A kind of Bluetooth pairing methods and device
Technical field
The present invention relates to electronic technology field, particularly relate to a kind of Bluetooth pairing methods and device.
Background technology
Along with the development of electronic technology, a lot of electric terminal all bluetooth enables, and realize short-range rapid data transmission with synchronous by Bluetooth function.Low-power consumption bluetooth just because the fast search had, connects fast, and super low-power consumption keeps the functions such as connection and transmission, is therefore commonly used to wearable device with the pairing of terminal with in being connected.Present stage, it is all that after user registers login, terminal directly gets wearable device Bluetooth address from backstage connects usually that wearable device and terminal carry out the mode that bluetooth is connected.
Carry out the mode that bluetooth is connected with wearable device after registering login for current user, can ensure that wearable device can not be connected by other people by mistake, if but user changes wearable device, user also must re-register login, processing mode is pretty troublesome, reduce property easy to use, user experience is poor.
Summary of the invention
Embodiment of the present invention technical problem to be solved is, a kind of Bluetooth pairing methods and device are provided, to realizing the wearable device that terminal is accurately determined to need to connect, and with between this wearable device more easily bluetooth be connected, and then the property easy to use of lifting means.
Embodiments provide a kind of Bluetooth pairing methods, the method comprises:
When receiving Bluetooth pairing instruction, detect the Bluetooth signal intensity of at least one wearable device searched;
According to the Bluetooth signal intensity of at least one wearable device described in detecting, determine the target wearable device that at least one wearable device described, Bluetooth signal intensity is the highest;
Obtain the Bluetooth address of described target wearable device;
According to described Bluetooth address, carry out pairing with described target wearable device and be connected.
Optionally, described method also comprises: detect at least one wearable device described whether in the distance range preset.
Optionally, described method also comprises: in the time threshold preset, and search can retrieve at least one wearable device of Bluetooth signal intensity.
Optionally, described according to described Bluetooth address, carry out pairing with described target wearable device and be connected and comprise:
Bluetooth pairing is carried out with described target wearable device;
If detect and described target wearable device Bluetooth pairing success, then set up bluetooth according to described Bluetooth address with described target wearable device and be connected.
Optionally, described and described target wearable device carries out Bluetooth pairing and comprises:
Generate Bluetooth pairing code;
Described Bluetooth pairing code is sent to described target wearable device;
Receive the pairing feedback information that described target wearable device returns, described pairing feedback information generates afterwards for whether the described target wearable device Bluetooth pairing code that the Bluetooth pairing code that receives and user input on described target wearable device described in checking is consistent.
Correspondingly, the embodiment of the present invention additionally provides a kind of Bluetooth pairing device, and this device comprises:
Detection module, for when receiving Bluetooth pairing instruction, detects the Bluetooth signal intensity of at least one wearable device searched;
Determination module, described in detecting for basis, the Bluetooth signal intensity of at least one wearable device, determines the target wearable device that at least one wearable device described, Bluetooth signal intensity is the highest;
Acquisition module, for obtaining the Bluetooth address of described target wearable device;
Link block, for according to described Bluetooth address, carries out pairing with described target wearable device and is connected.
Optionally, described device also comprises: spacing module, for detecting at least one wearable device described whether in the distance range preset.
Optionally, described device also comprises: time module, and in the time threshold preset, search can retrieve at least one wearable device of Bluetooth signal intensity.
Optionally, described link block comprises:
Pairing unit, for carrying out Bluetooth pairing with described target wearable device;
Linkage unit, if for detecting and described target wearable device Bluetooth pairing success, then set up bluetooth according to described Bluetooth address with described target wearable device and be connected.
Optionally, described pairing unit specifically for:
Generate Bluetooth pairing code;
Described Bluetooth pairing code is sent to described target wearable device;
Receive the pairing feedback information that described target wearable device returns, described pairing feedback information generates afterwards for whether the described target wearable device Bluetooth pairing code that the Bluetooth pairing code that receives and user input on described target wearable device described in checking is consistent.
The embodiment of the present invention is by detecting the Bluetooth signal intensity of at least one wearable device searched, determine the target wearable device that at least one wearable device described, Bluetooth signal intensity is the highest, obtain the Bluetooth address of described target wearable device, according to described Bluetooth address, carry out pairing with described target wearable device to be connected, achieve the wearable device that terminal is accurately determined to need to connect, and with between this wearable device more easily bluetooth be connected, and then the property easy to use of lifting means.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of a kind of Bluetooth pairing methods in the embodiment of the present invention;
Fig. 2 is the schematic flow sheet of Bluetooth pairing methods in another embodiment of the present invention;
Fig. 3 is the composition structure chart of a kind of Bluetooth pairing device in the embodiment of the present invention;
Fig. 4 is the composition structure chart of the link block of Fig. 3 in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 1 is the schematic flow sheet of a kind of Bluetooth pairing methods in the embodiment of the present invention, this method flow process can be implemented by Bluetooth pairing device, described Bluetooth pairing device can be user terminal or the software program operating in user terminal, described user terminal can comprise mobile phone, notebook computer, panel computer, vehicle-mounted computer, POS (PointOfSales, point of sale) machine etc.Described method at least comprises as shown in the figure:
Step S101, when receiving Bluetooth pairing instruction, detects the Bluetooth signal intensity of at least one wearable device searched.
Concrete, Bluetooth pairing instruction can be the order that user inputs in terminal, such as sliding trace, click, double-click or long by pairing icon, press default pairing button, rock operations such as terminal etc., also can be the Bluetooth pairing instruction that terminal is sent to terminal by other apparatus remotes, such as send infrared signal by Infrared remote controller to terminal, make terminal open Bluetooth pairing etc.
In the present embodiment, when terminal receives above-mentioned Bluetooth pairing instruction, the Bluetooth signal that the wearable device around searching for sends can be started, and the Bluetooth signal intensity of the multiple wearable devices searched is detected.In specific implementation process, wearable device is when bluetooth module is opened, periodically can send Bluetooth signal, terminal by receiving this Bluetooth signal to search for the wearable device of surrounding, and then can detect the Bluetooth signal intensity of at least one wearable device searched.Here, Bluetooth signal intensity can be weighed with Bluetooth signal intensity level (dBm) originally, also can divide Bluetooth signal strength grade in advance, the numerical value of the signal strength signal intensity detected be corresponded to corresponding grade and gets on.
Such as, terminal gets the Bluetooth signal intensity of the first wearable device for-50dBm, and the Bluetooth signal intensity of the second wearable device is-35dBm, and the Bluetooth signal intensity of the 3rd wearable device is-100dBm, then terminal can just with this records of values; Also Bluetooth signal intensity can be divided into five grades,-10dBm ~-30dBm is the first estate,-31dBm ~-50dBm is the second grade,-51dBm ~-70dBm is the tertiary gradient,-71dBm ~-90dBm is the fourth estate, more than-91dBm is the 5th grade, then the Bluetooth signal intensity of above-mentioned three wearable devices is just respectively the second grade, the second grade and the 5th grade.
Optionally, the method can also comprise: detect at least one wearable device described whether in the distance range preset.
Concrete, terminal can preset a distance range, terminal detects at least one wearable device of searching whether in the distance range preset, if in the distance range preset, then terminal can obtain its Bluetooth signal intensity further, if not preset distance range in, illustrate this wearable device from terminal excessively away from, terminal just can be got rid of in Bluetooth signal intensity screening scope.Such as, terminal predeterminable range scope is 0.5m, then terminal is after receiving the Bluetooth signal that wearable device sends, the distance of each wearable device and terminal just can be calculated according to Bluetooth signal, if detect, the distance of the first equipment and the second equipment and terminal is within 0.5m, and the distance of the 3rd equipment and terminal is beyond 0.5m, so just down to the Bluetooth signal intensity of acquisition first equipment and the second equipment, no longer the 3rd device signal can be gathered.
Further alternative, the method also comprises: in the time threshold preset, and search can retrieve at least one wearable device of Bluetooth signal intensity.
Concrete, terminal can arrange a time threshold, and in this time threshold, search can detect at least one wearable device of Bluetooth signal intensity, after exceeding this time threshold, just can stop search.Such as, terminal can arrange the time threshold of a 5s, terminal can open bluetooth discovery function in this 5s, namely the wearable device sending Bluetooth signal is only searched in this 5s, and be in the scope that terminal can retrieve, after the time threshold past of 5s, then automatically closed bluetooth discovery function, do not detect at the Bluetooth signal of the wearable device to surrounding.
Step S102, according to the Bluetooth signal intensity of at least one wearable device described in detecting, determines the target wearable device that at least one wearable device described, Bluetooth signal intensity is the highest.
Concrete, target wearable device can be the wearable device that user finally wishes to set up with terminal bluetooth and is connected, it can be only a wearable device, also can be multiple wearable device, specifically can be determined by the configuration of the quantity set of user or terminal, not do concrete restriction here.
In the present embodiment, can think from terminal more close to its Bluetooth signal intensity of wearable device higher, therefore, terminal has got the Bluetooth signal intensity of at least one wearable device in step S101, according to the Bluetooth signal intensity of these wearable devices, can therefrom filter out the highest wearable device of Bluetooth signal intensity as target wearable device.That is, to determine at least one wearable device from the nearest wearable device of terminal as target wearable device.In concrete enforcement, if terminal weighs Bluetooth signal intensity with the Bluetooth signal intensity level (dBm) of Bluetooth signal intensity itself, so terminal just can determine that Bluetooth signal intensity absolute value is minimum in the Bluetooth signal intensity level got wearable device is as target wearable device; If the Bluetooth signal intensity with grade classification, so terminal can determine that wearable device that grade middle grade corresponding to the Bluetooth signal intensity that gets is the highest is as target wearable device.
Such as, citing in step S101, terminal gets the Bluetooth signal intensity of the first wearable device for-50dBm, the Bluetooth signal intensity of the second wearable device is-35dBm, the Bluetooth signal intensity of the 3rd wearable device is-100dBm, then terminal can determine that the absolute value of Bluetooth signal intensity-35dBm is minimum, namely Bluetooth signal intensity is the highest, and therefore the second wearable device can be defined as target wearable device; If according to the method for five grade classification Bluetooth signal intensity, then above-mentioned three Bluetooth signal intensity are respectively in the wearable device of the second grade, the second grade and the 5th grade, terminal can determine the wearable device of two the second grades, and namely the first wearable device and the second wearable device are target wearable device.
Step S103, obtains the Bluetooth address of described target wearable device.
Concrete, terminal, after determining target wearable device, just can obtain its Bluetooth address.In concrete enforcement, Bluetooth address can be that the Bluetooth signal that wearable device sends carries, and terminal, after opening bluetooth discovery function, just can get the Bluetooth address of each wearable device by the Bluetooth signal receiving wearable device.Bluetooth address uniquely can identify the bluetooth equipment of its correspondence, therefore, after terminal gets the Bluetooth address of target wearable device, and identification target wearable device that just can be unique.
Further, terminal can also obtain the device id of target wearable device, for distinguishing further and confirming target wearable device.
Step S104, according to described Bluetooth address, carries out pairing with described target wearable device and is connected.
Concrete, after getting the Bluetooth address of target wearable device, terminal just can send pairing request to this Bluetooth address, can the Bluetooth pairing code of carried terminal oneself and Bluetooth address in pairing request, after target wearable device receives this pairing request, user can be pointed out to input pairing code verify, if the pairing code of user's input is consistent with the pairing code that terminal sends, then target wearable device just can return successful matching information to terminal, thus terminal and target wearable device just can be set up bluetooth and be connected, carry out Bluetooth communication.
The embodiment of the present invention is by detecting the Bluetooth signal intensity of at least one wearable device searched, determine the target wearable device that at least one wearable device described, Bluetooth signal intensity is the highest, obtain the Bluetooth address of described target wearable device, according to described Bluetooth address, carry out pairing with described target wearable device to be connected, achieve the wearable device that terminal is accurately determined to need to connect, and with between this wearable device more easily bluetooth be connected, and then the property easy to use of lifting means.
Fig. 2 is the schematic flow sheet of Bluetooth pairing methods in another embodiment of the present invention, and the method comprises:
Step S201, when receiving Bluetooth pairing instruction, detects the Bluetooth signal intensity of at least one wearable device searched.
Concrete grammar can refer step S101.
Step S202, according to the Bluetooth signal intensity of at least one wearable device described in detecting, determines the target wearable device that at least one wearable device described, Bluetooth signal intensity is the highest.
Concrete grammar can refer step S102.
Step S203, obtains the Bluetooth address of described target wearable device.
Concrete grammar can refer step S103.
Step S204, carries out Bluetooth pairing with described target wearable device.
Concrete, terminal and target wearable device, when First Contact Connections, first can carry out Bluetooth pairing.The effect of Bluetooth pairing is mainly used for setting up authentication relationship, and therefore, terminal and target wearable device, after Bluetooth pairing success, after namely setting up authentication relationship, just directly can carry out bluetooth connection without the need to what carry out matching again.
In concrete enforcement, the mode of Bluetooth pairing also can be various ways.Such as, default Bluetooth pairing fingerprint can be sent to target wearable device by terminal, after target wearable device receives Bluetooth pairing fingerprint, user can be pointed out to input match accordingly fingerprint, whether the pairing fingerprint of authentication of users input mates with the Bluetooth pairing fingerprint received, if coupling, return the information of successful matching to terminal, thus terminal can be carried out bluetooth further with target wearable device and is connected.Again such as, terminal also can send Bluetooth pairing request to target wearable device, after target wearable device receives Bluetooth pairing request, user can be pointed out to input match accordingly code, then this pairing code is sent to terminal, compare, if both are consistent with the Bluetooth pairing code preset after terminal receives this pairing code, then return the information of successful matching to wearable device, thus terminal can be carried out bluetooth further with target wearable device and is connected.Again such as, terminal can also send Bluetooth pairing request to target wearable device, after target wearable device receives Bluetooth pairing request, automatic generation Bluetooth pairing pattern sends to terminal, terminal can point out user to input to match accordingly pattern, then the pairing code that the Bluetooth pairing pattern received and user input is compared by terminal, if both are consistent, then return the information of successful matching to wearable device, thus terminal can be carried out bluetooth further with target wearable device and is connected.
As above-mentioned citing, in the present embodiment, the secret key of pairing during Bluetooth pairing can be finger print information, numerical ciphers, sliding trace, pattern etc. form, and can be that user or terminal are preset, also can be that terminal generates automatically, not do concrete restriction here.
Optionally, step S204 can comprise:
Generate Bluetooth pairing code.
Described Bluetooth pairing code is sent to described target wearable device.
Receive the pairing feedback information that described target wearable device returns, described pairing feedback information generates afterwards for whether the described target wearable device Bluetooth pairing code that the Bluetooth pairing code that receives and user input on described target wearable device described in checking is consistent.
Concrete, terminal can generate pairing code Bluetooth pairing code automatically, and concrete generation formula or rule can be user presets, also can be that terminal presets.Such as, terminal can preset 4 character strings that Bluetooth pairing code is random combine in the set of letter, numeral and punctuation mark, can user preset Bluetooth pairing code be also 6 bit digital of random combine in 0 ~ 9 numeral etc.
After terminal generates Bluetooth pairing code, just according to the Bluetooth address of the target wearable device got in step S203, this Bluetooth pairing code automatically generated can be sent to target wearable device, while can the Bluetooth address of carried terminal.
Target wearable device is after receiving this Bluetooth pairing code, user just can be pointed out on target wearable device to input Bluetooth pairing code, thus the Bluetooth pairing code that the user got can input by target wearable device is compared with the Bluetooth pairing code that the terminal received sends, and then generate pairing feedback information according to comparison result.In concrete enforcement, if two Bluetooth pairing codes are consistent, the Bluetooth pairing success of terminal and target wearable device are so described, then generate corresponding successful matching information; If two Bluetooth pairing codes are inconsistent, the Bluetooth pairing that terminal and target wearable device are so described unsuccessfully, then generates and matches failure information accordingly.Finally, the pairing feedback information of corresponding generation according to the Bluetooth address of the terminal received before, can be returned to terminal by target wearable device.
Step S205, if detect and described target wearable device Bluetooth pairing success, then sets up bluetooth according to described Bluetooth address with described target wearable device and is connected.
Concrete, after terminal and the success of target wearable device Bluetooth pairing, the Bluetooth address of terminal just can be corresponding with target wearable device Bluetooth address establish a connection, also namely terminal and target wearable device are bound by bluetooth, can carry out the wireless transmission of various data.
The embodiment of the present invention is by detecting the Bluetooth signal intensity of at least one wearable device searched, determine the target wearable device that at least one wearable device described, Bluetooth signal intensity is the highest, obtain the Bluetooth address of described target wearable device, according to described Bluetooth address, carry out pairing with described target wearable device to be connected, achieve the wearable device that terminal is accurately determined to need to connect, and with between this wearable device more easily bluetooth be connected, and then the property easy to use of lifting means.
Fig. 3 is the composition structure chart of a kind of Bluetooth pairing device in the embodiment of the present invention, and this device comprises:,
Detection module 310, for when receiving Bluetooth pairing instruction, detects the Bluetooth signal intensity of at least one wearable device searched.
Concrete, Bluetooth pairing instruction can be the order that user inputs in terminal, such as sliding trace, click, double-click or long by pairing icon, press default pairing button, rock operations such as terminal etc., also can be the Bluetooth pairing instruction that terminal is sent to terminal by other apparatus remotes, such as send infrared signal by Infrared remote controller to terminal, make terminal open Bluetooth pairing etc.
In the present embodiment, when detection module 310 receives above-mentioned Bluetooth pairing instruction, the Bluetooth signal that the wearable device around searching for sends can be started, and the Bluetooth signal intensity of the multiple wearable devices searched is detected.In specific implementation process, wearable device is when bluetooth module is opened, periodically can send Bluetooth signal, detection module 310 by accepting this Bluetooth signal to search for the wearable device of surrounding, and then can detect the Bluetooth signal intensity of at least one wearable device searched.Here, Bluetooth signal intensity can be weighed with Bluetooth signal intensity level (dBm) originally, also can divide Bluetooth signal strength grade in advance, the numerical value of the signal strength signal intensity detected be corresponded to corresponding grade and gets on.
Such as, detection module 310 gets the Bluetooth signal intensity of the first wearable device for-50dBm, the Bluetooth signal intensity of the second wearable device is-35dBm, and the Bluetooth signal intensity of the 3rd wearable device is-100dBm, then terminal can just with this records of values; Also Bluetooth signal intensity can be divided into five grades,-10dBm ~-30dBm is the first estate,-31dBm ~-50dBm is the second grade,-51dBm ~-70dBm is the tertiary gradient,-71dBm ~-90dBm is the fourth estate, more than-91dBm is the 5th grade, then the Bluetooth signal intensity of above-mentioned three wearable devices is just respectively the second grade, the second grade and the 5th grade.
Determination module 320, described in detecting for basis, the Bluetooth signal intensity of at least one wearable device, determines the target wearable device that at least one wearable device described, Bluetooth signal intensity is the highest.
Concrete, target wearable device can be the wearable device that user finally wishes to set up with terminal bluetooth and is connected, it can be only a wearable device, also can be multiple wearable device, specifically can be determined by the configuration of the quantity set of user or terminal, not do concrete restriction here.
In the present embodiment, can think from terminal more close to its Bluetooth signal intensity of wearable device higher, therefore, terminal has got the Bluetooth signal intensity of at least one wearable device in detection module 310, determination module 320 according to the Bluetooth signal intensity of these wearable devices, can therefrom filter out the highest wearable device of Bluetooth signal intensity as target wearable device.That is, to determine at least one wearable device from the nearest wearable device of terminal as target wearable device.In concrete enforcement, if weigh Bluetooth signal intensity with the Bluetooth signal intensity level (dBm) of Bluetooth signal intensity itself, so determination module 320 just can determine that Bluetooth signal intensity absolute value is minimum in the Bluetooth signal intensity level got wearable device is as target wearable device; If the Bluetooth signal intensity with grade classification, so determination module 320 can determine that wearable device that grade middle grade corresponding to the Bluetooth signal intensity that gets is the highest is as target wearable device.
Such as, citing in step S101, get the Bluetooth signal intensity of the first wearable device for-50dBm, the Bluetooth signal intensity of the second wearable device is-35dBm, the Bluetooth signal intensity of the 3rd wearable device is-100dBm, then determination module 320 can determine that the absolute value of Bluetooth signal intensity-35dBm is minimum, namely Bluetooth signal intensity is the highest, and therefore the second wearable device can be defined as target wearable device; If according to the method for five grade classification Bluetooth signal intensity, then above-mentioned three Bluetooth signal intensity are respectively in the wearable device of the second grade, the second grade and the 5th grade, determination module 320 can determine the wearable device of two the second grades, and namely the first wearable device and the second wearable device are target wearable device.
Acquisition module 330, for obtaining the Bluetooth address of described target wearable device.
Concrete, after determining target wearable device, acquisition module 330 just can obtain its Bluetooth address.In concrete enforcement, Bluetooth address can be that the Bluetooth signal that wearable device sends carries, and acquisition module 330, after opening bluetooth discovery function, just can get the Bluetooth address of each wearable device by the Bluetooth signal receiving wearable device.Bluetooth address uniquely can identify the bluetooth equipment of its correspondence, therefore, after terminal gets the Bluetooth address of target wearable device, and identification target wearable device that just can be unique.
Further, acquisition module 330 can also obtain the device id of target wearable device, for distinguishing further and confirming target wearable device.
Link block 340, for according to described Bluetooth address, carries out pairing with described target wearable device and is connected.
Concrete, after getting the Bluetooth address of target wearable device, link block 340 just can send pairing request to this Bluetooth address, can the Bluetooth pairing code of carried terminal oneself and Bluetooth address in pairing request, after target wearable device receives this pairing request, user can be pointed out to input pairing code verify, if the pairing code of user's input is consistent with the pairing code that terminal sends, then target wearable device just can return successful matching information to link block 340, thus link block 340 and target wearable device just can be set up bluetooth and be connected, carry out Bluetooth communication.
Further, described link block 340 can comprise: pairing unit 341 and linkage unit 342, as shown in Figure 4.
Pairing unit 341, for carrying out Bluetooth pairing with described target wearable device.
Concrete, with target wearable device when First Contact Connections, pairing unit 341 first can carry out Bluetooth pairing.The effect of Bluetooth pairing is mainly used for setting up authentication relationship, and therefore, terminal and target wearable device, after Bluetooth pairing success, after namely setting up authentication relationship, just directly can carry out bluetooth connection without the need to what carry out matching again.
In concrete enforcement, the mode of Bluetooth pairing also can be various ways.Such as, default Bluetooth pairing fingerprint can be sent to target wearable device by pairing unit 341, after target wearable device receives Bluetooth pairing fingerprint, user can be pointed out to input match accordingly fingerprint, whether the pairing fingerprint of authentication of users input mates with the Bluetooth pairing fingerprint received, if coupling, return the information of successful matching to terminal, thus terminal can be carried out bluetooth further with target wearable device and is connected.Again such as, pairing unit 341 also can send Bluetooth pairing request to target wearable device, after target wearable device receives Bluetooth pairing request, user can be pointed out to input match accordingly code, then this pairing code is sent to pairing unit 341, compare with the Bluetooth pairing code preset after pairing unit 341 receives this pairing code, if both are consistent, then return the information of successful matching to wearable device, thus terminal can be carried out bluetooth further with target wearable device and is connected.Again such as, pairing unit 341 can also send Bluetooth pairing request to target wearable device, after target wearable device receives Bluetooth pairing request, automatic generation Bluetooth pairing pattern sends to terminal, pairing unit 341 can point out user to input to match accordingly pattern, then the pairing code that the Bluetooth pairing pattern received and user input is compared by pairing unit 341, if both are consistent, then return the information of successful matching to wearable device, thus terminal can be carried out bluetooth further with target wearable device and is connected.
As above-mentioned citing, in the present embodiment, the secret key of pairing during Bluetooth pairing can be finger print information, numerical ciphers, sliding trace, pattern etc. form, and can be that user or pairing unit 341 are preset, also can be that pairing unit 341 generates automatically, not do concrete restriction here.
Further, described pairing unit 341 specifically for:
Generate Bluetooth pairing code;
Described Bluetooth pairing code is sent to described target wearable device;
Receive the pairing feedback information that described target wearable device returns, described pairing feedback information generates afterwards for whether the described target wearable device Bluetooth pairing code that the Bluetooth pairing code that receives and user input on described target wearable device described in checking is consistent.
Concrete, pairing unit 341 can generate pairing code Bluetooth pairing code automatically, and concrete generation formula or rule can be user presets, also can be that pairing unit 341 presets.Such as, pairing unit 341 can preset 4 character strings that Bluetooth pairing code is random combine in the set of letter, numeral and punctuation mark, can user preset Bluetooth pairing code be also 6 bit digital of random combine in 0 ~ 9 numeral etc.
After pairing unit 341 generates Bluetooth pairing code, just can according to the Bluetooth address of the target wearable device got, send this Bluetooth pairing code automatically generated to target wearable device, simultaneously can the Bluetooth address of carried terminal.
Target wearable device is after receiving this Bluetooth pairing code, user just can be pointed out on target wearable device to input Bluetooth pairing code, thus the Bluetooth pairing code that the user got can input by target wearable device is compared with the Bluetooth pairing code that the pairing unit 341 received sends, and then generate pairing feedback information according to comparison result.In concrete enforcement, if two Bluetooth pairing codes are consistent, the Bluetooth pairing success of terminal and target wearable device are so described, then generate corresponding successful matching information; If two Bluetooth pairing codes are inconsistent, the Bluetooth pairing that terminal and target wearable device are so described unsuccessfully, then generates and matches failure information accordingly.Finally, the pairing feedback information of corresponding generation according to the Bluetooth address of the terminal received before, can be returned to pairing unit 341 by target wearable device.
Linkage unit 342, if for detecting and described target wearable device Bluetooth pairing success, then set up bluetooth according to described Bluetooth address with described target wearable device and be connected.
Concrete, after successful with target wearable device Bluetooth pairing, the Bluetooth address of terminal just can be corresponding with target wearable device Bluetooth address establish a connection, also namely linkage unit 342 and target wearable device are bound by bluetooth, can carry out the wireless transmission of various data.
Spacing module 350, for detecting at least one wearable device described whether in the distance range preset.
Concrete, spacing module 350 can preset a distance range, spacing module 350 detects at least one wearable device of searching whether in the distance range preset, if in the distance range preset, then terminal can obtain its Bluetooth signal intensity further, if not preset distance range in, illustrate this wearable device from terminal excessively away from, spacing module 350 just can be got rid of in Bluetooth signal intensity screening scope.Such as, spacing module 350 predeterminable range scope is 0.5m, then spacing module 350 is after receiving the Bluetooth signal that wearable device sends, the distance of each wearable device and terminal just can be calculated according to Bluetooth signal, if detect, the distance of the first equipment and the second equipment and terminal is within 0.5m, and the distance of the 3rd equipment and terminal is beyond 0.5m, so just down to the Bluetooth signal intensity of acquisition first equipment and the second equipment, no longer the 3rd device signal can be gathered.
Time module 360, in the time threshold preset, search can retrieve at least one wearable device of Bluetooth signal intensity.
Concrete, time module 360 can arrange a time threshold, and in this time threshold, search can detect at least one wearable device of Bluetooth signal intensity, after exceeding this time threshold, just can stop search.Such as, the time threshold of a 5s can be set, time module 360 can open bluetooth discovery function in this 5s, namely the wearable device sending Bluetooth signal is only searched in this 5s, and be in the scope that terminal can retrieve, after the time threshold past of 5s, then automatically closed bluetooth discovery function, do not detect at the Bluetooth signal of the wearable device to surrounding.
The embodiment of the present invention is by detecting the Bluetooth signal intensity of at least one wearable device searched, determine the target wearable device that at least one wearable device described, Bluetooth signal intensity is the highest, obtain the Bluetooth address of described target wearable device, according to described Bluetooth address, carry out pairing with described target wearable device to be connected, achieve the wearable device that terminal is accurately determined to need to connect, and with between this wearable device more easily bluetooth be connected, and then the property easy to use of lifting means.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-OnlyMemory, ROM) or random store-memory body (RandomAccessMemory, RAM) etc.
Above disclosedly be only present pre-ferred embodiments, certainly can not limit the interest field of the present invention with this, therefore according to the equivalent variations that the claims in the present invention are done, still belong to the scope that the present invention is contained.