CN106454713A - Method and device for pairing and synchronizing mobile equipment and Bluetooth equipment - Google Patents

Method and device for pairing and synchronizing mobile equipment and Bluetooth equipment Download PDF

Info

Publication number
CN106454713A
CN106454713A CN201611115029.XA CN201611115029A CN106454713A CN 106454713 A CN106454713 A CN 106454713A CN 201611115029 A CN201611115029 A CN 201611115029A CN 106454713 A CN106454713 A CN 106454713A
Authority
CN
China
Prior art keywords
target bluetooth
pairing
bluetooth devices
mobile device
mark
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.)
Granted
Application number
CN201611115029.XA
Other languages
Chinese (zh)
Other versions
CN106454713B (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.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies 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 Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201611115029.XA priority Critical patent/CN106454713B/en
Publication of CN106454713A publication Critical patent/CN106454713A/en
Application granted granted Critical
Publication of CN106454713B publication Critical patent/CN106454713B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

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 provides a method and device for pairing and synchronizing mobile equipment and Bluetooth equipment, and relates to the communication field. The method comprises the following steps: judging whether a second pairing identifier corresponding to target Bluetooth equipment exists in the mobile equipment when judging that the mobile equipment is bound with the target Bluetooth equipment, if the second pairing identifier corresponding to target Bluetooth equipment exists in the mobile equipment, reading the second pairing identifier, and judging whether the second pairing identifier exits in the target Bluetooth equipment according to a first pairing identifier in broadcast data of the target Bluetooth equipment, if the second pairing identifier exits in the target Bluetooth equipment, communicating with the target Bluetooth equipment, and ending the pairing; otherwise, unbinding the mobile equipment and the target Bluetooth equipment, and then rebinding the same, pairing the mobile equipment with the target Bluetooth equipment, receiving the pairing identifier returned by the target Bluetooth equipment, and saving the pairing identifier in the mobile equipment as the second pairing identifier to communicate with the target Bluetooth equipment, and ending the pairing. Through the adoption of the method provided by the invention, the problem that the communication is failed since the pairing of two parties is asynchronous when establishing the communication between the mobile equipment and the Bluetooth equipment is avoided, and the usability of the Bluetooth equipment is improved.

Description

A kind of mobile device method and device synchronous with bluetooth equipment pairing
Technical field
The present invention relates to the communications field, more particularly, to a kind of mobile device method synchronous with bluetooth equipment pairing and dress Put.
Background technology
BLE (Bluetooth Low Energy, Bluetooth Low Energy) Bluetooth technology, has shortening wireless opening time, fast The advantages of connect, lower transmitting-receiving peak power is stood in run-up;Be widely used in the mobile devices such as mobile phone, notebook computer, PAD with Data transfer between bluetooth equipment.
In prior art, when mobile device and BLE bluetooth equipment are set up and communicated, such as mobile device is set with this BLE bluetooth Standby previously successfully matched, then due to still preserving the unpaired message previous with this BLE bluetooth equipment in mobile device, thus not Can again match;Now, if also there being previous unpaired message in BLE bluetooth equipment, mobile device and BLE bluetooth equipment Pairing is synchronous, thus being successfully established communication;But if now previous unpaired message is deleted by BLE bluetooth equipment, then by because Mobile device is asynchronous with the pairing of BLE bluetooth equipment, leads to communication failure, so that reducing Consumer's Experience.
Content of the invention
For solving the deficiencies in the prior art, the present invention provide a kind of synchronous method of mobile device and bluetooth equipment pairing and Device.
On the one hand, the invention provides a kind of mobile device matches synchronous method with bluetooth equipment, including:
Step S1:Judge whether mobile device is bound with target Bluetooth devices, be then execution step S2;Otherwise will be described Mobile device and described target Bluetooth devices binding, execution step S4;
Step S2:Judge in described mobile device, whether there be second pairing mark corresponding with described target Bluetooth devices Know, be, read described second pairing mark, execution step S3;Otherwise by described mobile device and described target Bluetooth devices solution After binding again binding, execution step S4;
Step S3:The first pairing mark in broadcast data according to described target Bluetooth devices judges described target Bluetooth Whether there is described second pairing mark in equipment, is then to communicate with described target Bluetooth devices, terminates;Otherwise by described movement Equipment and described target Bluetooth devices are unbinding and after again binding, execution step S4;
Step S4:With the pairing of described target Bluetooth devices, receive the pairing mark that described target Bluetooth devices return, will connect The pairing mark receiving preserves to described mobile device as the second pairing mark, communicates with described target Bluetooth devices, knot Bundle.
Alternatively, before described step S1, also include:
Step A:Bluetooth equipment around scanning mobile device, judges whether to scan target Bluetooth devices, is, obtain The broadcast data of described target Bluetooth devices, execution step S1;Otherwise continue executing with step A.
Before described step S3, also include:The broadcast data parsing described target Bluetooth devices obtains the first pairing mark.
Alternatively, in described step S1, described judge whether mobile device is bound with target Bluetooth devices, specially: Judge in the binding information that mobile device preserves, whether to contain the binding information with target Bluetooth devices, be then to judge mobile device Bind with target Bluetooth devices;Otherwise, it is determined that mobile device is unbound with target Bluetooth devices;
In described step S2 and described step S3, described released described mobile device with described target Bluetooth devices is tied up Fixed, specially:In the binding information that described mobile device preserves, delete the described binding information with target Bluetooth devices.
Alternatively, described judge whether to contain in the binding information that described mobile device preserves and the tying up of target Bluetooth devices Determine information, specially:Obtain the binding information that described mobile device preserves, judge whether contain mesh in the binding information getting The device name of mark bluetooth equipment, is to judge to contain and target Bluetooth devices in the binding information that described mobile device preserves Binding information, otherwise judges not containing the binding information with target Bluetooth devices in the binding information that described mobile device preserves.
Alternatively, before described step S1, also include:
Step B:Obtain the MAC Address of target Bluetooth devices;
In described step S2, described judge that whether having corresponding with described target Bluetooth devices second in mobile device joins To mark, specially:Obtain the unpaired message that described mobile device preserves, whether judge in the unpaired message getting containing State the MAC Address of target Bluetooth devices, be, judge in described mobile device, have corresponding with described target Bluetooth devices Two pairing marks;Otherwise, it is determined that there not being second pairing mark corresponding with described target Bluetooth devices in described mobile device;
In described step S2, described reading described second matches mark, specially:MAC from described target Bluetooth devices Described second pairing mark is read in the corresponding unpaired message in address;
In described step S4, described identify the pairing receiving mark as the described second pairing preserves to described movement In equipment, specially:The pairing receiving mark is identified the MAC Address pair with described target Bluetooth devices as the second pairing Should preserve to described mobile device.
Alternatively, the first pairing mark in described step S3, in the described broadcast data according to described target Bluetooth devices Know and judge in described target Bluetooth devices, whether there is described second pairing mark, specially:
The first pairing mark in broadcast data according to described target Bluetooth devices determines that described target Bluetooth devices are protected The pairing mark deposited, judges whether contain described second pairing mark in the pairing mark that described target Bluetooth devices preserve.
Wherein, the first pairing mark in the described broadcast data according to described target Bluetooth devices determines that described target is blue The pairing mark that tooth equipment preserves, specially:
According to the second predetermined way, the described first pairing mark is converted to what described target Bluetooth devices preserved successively Pairing mark.
Alternatively, the first pairing mark in described step S3, in the described broadcast data according to described target Bluetooth devices Know and judge in described target Bluetooth devices, whether there is described second pairing mark, specially:
Step N1:Described first pairing mark is updated according to predetermined manner;
Step N2:The first pairing mark after judging to update and described second pairing identify whether to meet pre-conditioned, are Then judge in described target Bluetooth devices, there is described second pairing mark;Otherwise judge do not have in described target Bluetooth devices Described second pairing mark.
Wherein, described step N1, specially:
As the described first pairing is designated binary data, then the described first pairing mark is moved right default position, by institute State the first pairing mark and be updated to the data after shifting;
As the described first pairing is designated non-binary data, then the described first pairing mark is converted into binary representation Afterwards, move right default position, and the described first pairing mark is updated to the data after shifting.
In described step N2, described judge to update after the first pairing mark and described second pairing identify whether to meet pre- If condition, specially:
The first pairing mark after updating carries out step-by-step with described second pairing mark or computing obtains operation result, sentences Described second pairing of described operation result and positional representation of breaking identifies whether identical, is that the first pairing after then judging to update is marked Know and described second pairing mark meet pre-conditioned, otherwise judge update after first pairing mark and described second pairing mark Knowledge does not meet pre-conditioned.
Alternatively, in described step S4, after described the second pairing receiving described target Bluetooth devices return identifies, also Including:
Step C:Judge whether described mobile device is to match with described target Bluetooth devices for the first time, be to receive Pairing mark preserve in described mobile device as the second pairing mark;Otherwise update institute using the pairing mark receiving State the second pairing mark of mobile device preservation.
Alternatively, before described mobile device being bound with described target Bluetooth devices, also include:Connect described target blue Tooth equipment, and judge whether successful connection, it is then by described mobile device and described target Bluetooth devices binding, otherwise terminate.
On the other hand, the present invention provides a kind of mobile device the device synchronous with bluetooth equipment pairing, including:
First judge module, for judging whether mobile device is bound with target Bluetooth devices;
Binding module, for when described first judge module judges that mobile device and target Bluetooth devices are unbound, By described mobile device and described target Bluetooth devices binding;
When described first judge module, second judge module, for judging that mobile device is bound with target Bluetooth devices When, judge in described mobile device, whether there be second pairing mark corresponding with described target Bluetooth devices;
Read module, for judging have in described mobile device and described target Bluetooth when described second judge module During the corresponding second pairing mark of equipment, read described second pairing mark;
Release module, for judging do not have in described mobile device and described target indigo plant when described second judge module During the corresponding second pairing mark of tooth equipment, will be unbinding with described target Bluetooth devices for described mobile device;
3rd judge module, after reading described second pairing mark for described read module, blue according to described target The first pairing mark in the broadcast data of tooth equipment judges whether there is described second pairing mark in described target Bluetooth devices Know;
Described releasing module, is additionally operable to judge not having institute in described target Bluetooth devices when described 3rd judge module When stating the second pairing mark, will be unbinding with described target Bluetooth devices for described mobile device;
Described binding module, is additionally operable to described releasing module and is tied up described mobile device with the releasing of described target Bluetooth devices After fixed, described mobile device is bound again with described target Bluetooth devices;
Matching module, after described mobile device being bound with described target Bluetooth devices when described binding module, With the pairing of described target Bluetooth devices;
Receiver module, for receiving the pairing mark that described target Bluetooth devices return;
Preserving module, the pairing mark for receiving described receiver module preserves extremely described as the second pairing mark In mobile device;
Communication module, judges there is described second pairing in described target Bluetooth devices for described 3rd judge module During mark, communicate with described target Bluetooth devices;It is additionally operable to the pairing mark that described receiver module is received by described preserving module Know after preserving to described mobile device as the second pairing mark, communicate with described target Bluetooth devices.
Alternatively, the device in the present invention, also includes:Scan module, the 4th judge module and the first acquisition module;
Described scan module, for scanning the bluetooth equipment around described mobile device;
Described 4th judge module, for judging whether described scan module scans target Bluetooth devices;
When described 4th judge module, described first acquisition module, for judging that described scan module scans target indigo plant During tooth equipment, obtain the broadcast data of described target Bluetooth devices;
Described first judge module, specifically for:When described first acquisition module gets described target Bluetooth devices After broadcast data, judge whether mobile device is bound with target Bluetooth devices;
Described scan module, is additionally operable to judge that described scan module does not scan target indigo plant when described 4th judge module During tooth equipment, continue to scan on the bluetooth equipment around described mobile device.
Alternatively, the device in the present invention, also includes:Parsing module;
Described parsing module, for described 3rd judge module according in the broadcast data of described target Bluetooth devices Before one pairing mark judges whether to have described second pairing mark in described target Bluetooth devices, parse described target Bluetooth The broadcast data of equipment obtains the first pairing mark.
Alternatively, described first judge module, specifically for:Judge whether contain in the binding information that mobile device preserves With the binding information of target Bluetooth devices, it is to judge that mobile device is bound with target Bluetooth devices;Otherwise, it is determined that movement sets Standby unbound with target Bluetooth devices;
Described releasing module, specifically for:In the binding information that described mobile device preserves, delete described blue with target The binding information of tooth equipment.
Alternatively, described first judge module, specifically for:Obtain the binding information that described mobile device preserves, judge The whether device name containing target Bluetooth devices in the binding information getting, is to judge that what described mobile device preserved ties up Determine in information, to contain the binding information with target Bluetooth devices, otherwise judge not containing in the binding information that described mobile device preserves There is the binding information with target Bluetooth devices.
Alternatively, the device in the present invention, also includes:Second acquisition module;
With target Bluetooth devices whether described second acquisition module, judge mobile device for described first judge module Before binding, obtain the MAC Address of target Bluetooth devices;
Described second judge module, specifically for:Obtain the unpaired message that described mobile device preserves, judgement gets Whether contain the MAC Address of described target Bluetooth devices in unpaired message, be, judge to have in described mobile device with described The corresponding second pairing mark of target Bluetooth devices;Otherwise, it is determined that do not have in described mobile device setting with described target Bluetooth Standby corresponding second pairing mark;
Described read module, specifically for:Read from the corresponding unpaired message of the MAC Address of described target Bluetooth devices Described second pairing mark;
Described preserving module, specifically for:The pairing mark that described receiver module is received is as the second pairing mark Preservation corresponding with the MAC Address of described target Bluetooth devices is to described mobile device.
Alternatively, described 3rd judge module, including:Determining unit and judging unit;
Described determining unit, determines institute for the first pairing mark in the broadcast data according to described target Bluetooth devices State the pairing mark of target Bluetooth devices preservation;
Described judging unit, for judging the pairing mark that the described target Bluetooth devices that described determining unit determines preserve In whether contain described second pairing mark.
Alternatively, described determining unit, specifically for:
According to the second predetermined way, the described first pairing mark is converted to what described target Bluetooth devices preserved successively Pairing mark.
Alternatively, described 3rd judge module, including:Updating block and judging unit;
Described updating block, for updating described first pairing mark according to predetermined manner;
Described judging unit, marks for judging that the first pairing mark and described second after described updating block renewal is matched It is pre-conditioned whether knowledge meets, and is, judges there is described second pairing mark in described target Bluetooth devices;Otherwise judge institute State and in target Bluetooth devices, do not have described second pairing mark.
Alternatively, as the described first pairing is designated binary data, then described updating block, specifically for:Will be described First pairing mark moves right default position, and the described first pairing mark is updated to the data after shifting;
As the described first pairing is designated non-binary data, then described updating block, specifically for:Described first is joined Mark is converted into after binary representation, move right default position, the described first pairing mark is updated to the data after shifting.
Described judging unit, specifically for:
The first pairing mark after described updating block is updated carries out step-by-step with the described second pairing mark or computing obtains To operation result, judge that described operation result and described second pairing of positional representation identify whether identical, be then to judge to update Afterwards first pairing mark and described second pairing mark meet pre-conditioned, otherwise judge update after first pairing mark and Described second pairing mark does not meet pre-conditioned.
Alternatively, the device in the present invention, also includes:5th judge module and update module;
Described 5th judge module, receives, for described receiver module, the second pairing mark that described target Bluetooth devices return After knowledge, judge whether described mobile device is to match with described target Bluetooth devices for the first time;
Described preserving module, specifically for:When described 5th judge module judge described mobile device be for the first time with During described target Bluetooth devices pairing, the pairing mark that described receiver module is received preserves as the described second pairing mark To described mobile device;
Described update module, for when described 5th judge module judge described mobile device be not for the first time with described During target Bluetooth devices pairing, the pairing mark being received using described receiver module updates the of the preservation of described mobile device Two pairing marks.
Alternatively, the device in the present invention, also includes:Link block and the 6th judge module;
Described mobile device and described target Bluetooth devices are bound it for described binding module by described link block Before, connect described target Bluetooth devices;
Described 6th judge module, for judging the whether successful connection of described link block;
Described binding module, specifically for:When described 6th judge module judges described link block successful connection, By described mobile device and described target Bluetooth devices binding.
The beneficial effects of the present invention is:
When mobile device and BLE bluetooth equipment are set up and communicates, it is to avoid because both sides match communication that is asynchronous and leading to The problem of failure, improves the ease for use of BLE bluetooth equipment, improves Consumer's Experience.
Brief description
Fig. 1 matches synchronous method flow diagram for a kind of mobile device that embodiment one provides with bluetooth equipment;
Fig. 2 matches synchronous method flow diagram for a kind of mobile device that embodiment two provides with bluetooth equipment;
Fig. 3 forms frame for a kind of mobile device that embodiment three provides with the module of the device of bluetooth equipment pairing synchronization Figure.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation description is it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, the every other enforcement that those skilled in the art are obtained under the premise of not making creative work Example, broadly falls into the scope of protection of the invention.
Embodiment one
The embodiment of the present invention one provides a kind of mobile device the method synchronous with bluetooth equipment pairing, as shown in figure 1, bag Include:
Step 101:Judge whether mobile device is bound with target Bluetooth devices, be then execution step 102;Otherwise will move Dynamic equipment is bound with target Bluetooth devices, execution step 104;
Step 102:Judge in mobile device, whether there be second pairing mark corresponding with target Bluetooth devices, be to read Take the second pairing mark, execution step 103;Otherwise will be unbinding to mobile device and target Bluetooth devices and after again binding, Execution step 104;
Step 103:Judged in target Bluetooth devices according to the first pairing mark in the broadcast data of target Bluetooth devices Whether there is the second pairing mark, is then to communicate with target Bluetooth devices, terminates;Otherwise by mobile device and target Bluetooth devices Unbinding and again bind after, execution step 104;
Step 104:With target Bluetooth devices pairing, receive the pairing mark that target Bluetooth devices return, by receive Pairing mark preserves to mobile device as the second pairing mark, communicates with target Bluetooth devices, terminates.
In the present embodiment, before step 101, also include:
Step A:Bluetooth equipment around scanning mobile device, judges whether to scan target Bluetooth devices, is, obtain The broadcast data of target Bluetooth devices, execution step 101;Otherwise continue executing with step A.
Accordingly, before step 103, also include:The broadcast data of parsing target Bluetooth devices obtains the first pairing mark.
In the present embodiment, in step 101, judge whether mobile device is bound with target Bluetooth devices, specially:Sentence Whether contain the binding information with target Bluetooth devices in the binding information that disconnected mobile device preserves, be then judge mobile device and Target Bluetooth devices are bound;Otherwise judge that mobile device is unbound with target Bluetooth devices;
Wherein, judge in the binding information that mobile device preserves, whether to contain the binding information with target Bluetooth devices, tool Body is:Obtain the binding information that mobile device preserves, whether judge in the binding information getting containing target Bluetooth devices Device name, is then to judge in the binding information that mobile device preserves containing the binding information with target Bluetooth devices, otherwise sentences The binding information with target Bluetooth devices is not contained in the binding information determining mobile device preservation.
Accordingly, in step 102 and step 103, mobile device is unbinding with target Bluetooth devices, specially:? In the binding information that mobile device preserves, delete the binding information with target Bluetooth devices.
In the present embodiment, before step 101, also include:
Step B:Obtain the MAC Address of target Bluetooth devices;
Accordingly, in step 102, judge in mobile device, whether there be second pairing mark corresponding with target Bluetooth devices Know, specially:Obtain the unpaired message that mobile device preserves, judge that whether containing target Bluetooth in the unpaired message getting sets Standby MAC Address, is to judge there be second pairing mark corresponding with target Bluetooth devices in mobile device;Otherwise, it is determined that There is not second pairing mark corresponding with target Bluetooth devices in mobile device;
In step 102, read the second pairing mark, specially:From the MAC Address of target Bluetooth devices corresponding pairing letter The second pairing mark is read in breath;
In step 104, the pairing receiving mark is preserved to mobile device as the second pairing mark, specially: The pairing receiving mark is preserved to mobile device as the second pairing mark is corresponding with the MAC Address of target Bluetooth devices In.
Alternatively, in step 103, judge that target is blue according to the first pairing mark in the broadcast data of target Bluetooth devices Whether there is the second pairing mark, specially in tooth equipment:
The pairing that target Bluetooth devices preserve is determined according to the first pairing mark in the broadcast data of target Bluetooth devices Mark, judges whether to contain the second pairing mark in the pairing mark that target Bluetooth devices preserve.
Wherein, determine what target Bluetooth devices preserved according to the first pairing mark in the broadcast data of target Bluetooth devices Pairing mark, specially:
According to the second predetermined way, the first pairing mark is converted to successively the pairing mark of target Bluetooth devices preservation.
Alternatively, in step 103, judge that target is blue according to the first pairing mark in the broadcast data of target Bluetooth devices Whether there is the second pairing mark, specially in tooth equipment:
Step N1:Described first pairing mark is updated according to predetermined manner;
Step N2:The first pairing mark after judging to update and the second pairing identify whether to meet pre-conditioned, are to sentence Set the goal and have the second pairing mark in bluetooth equipment;Otherwise judge in target Bluetooth devices, there is not the second pairing mark.
Wherein, step N1, specially:
As the first pairing is designated binary data, then the first pairing mark is moved right default position, by the first pairing mark Know and be updated to the data after shifting;
As the first pairing is designated non-binary data, then the first pairing mark is converted into after binary representation, to the right Move default position, the first pairing mark is updated to the data after shifting.
In step N2, the first pairing mark after judging to update and the second pairing identify whether to meet pre-conditioned, specifically For:
The first pairing mark after updating carries out step-by-step with the second pairing mark or computing obtains operation result, judges fortune The second pairing calculating result and positional representation identifies whether identical, is that the first pairing mark and second after then judging to update is matched Mark meet pre-conditioned, otherwise judge update after first pairing mark and second pairing mark do not meet pre-conditioned.
Further, in the present embodiment, in step 104, receive the second pairing mark that target Bluetooth devices return Afterwards, also include:
Step C:Judge whether mobile device is to match with target Bluetooth devices for the first time, be, by the pairing receiving mark Know and preserve to mobile device as the second pairing mark;Otherwise update mobile device using the pairing mark receiving to preserve Second pairing mark.
Further, in the present embodiment, before mobile device being bound with target Bluetooth devices, also include:Connect Target Bluetooth devices, and judge whether successful connection, it is then mobile device to be bound with target Bluetooth devices, otherwise terminate.
Embodiment two
The embodiment of the present invention two provides a kind of mobile device the method synchronous with bluetooth equipment pairing, as shown in Fig. 2 bag Include:
Step 201:Judge whether mobile device supports BLE, be then execution step 202;Otherwise point out not supporting BLE, knot Bundle;
In the present embodiment, step 201 specifically includes:
Step 201-1:Judge whether the hardware of mobile device supports BLE, be then execution step 201-2, otherwise point out not Support BLE, terminate;
In the present embodiment, judge whether the hardware of mobile device supports BLE, specially:Call first function interface simultaneously Judge the type of return value, such as return value is true, then confirm hardware supported BLE of mobile device, otherwise confirm mobile device Hardware do not support BLE;
In the present embodiment, first function interface is specially:
context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_ BLU ETOOTH_LE).
Step 201-2:Judge whether the system of mobile device supports BLE, be then execution step 202, otherwise point out not prop up Hold BLE, terminate;
In the present embodiment, judge whether the system of mobile device supports BLE, specially:Second function interface is called to obtain Take the SDK version number of mobile device, and judge that the SDK version number getting, whether more than default version number, is then to confirm to move The system of equipment supports BLE, otherwise confirms that the system of mobile device does not support BLE;
In the present embodiment, second function interface is specially:
Build.VERSION.SDK_INT>=Build.VERSION_CODES.JELLY_BEAN_MR2;
Preferably, default version number is 17.
Step 202:Judge whether mobile device opens bluetooth, be then execution step 204, bluetooth is opened in otherwise prompting, holds Row step 203;
In the present embodiment, judge whether mobile device opens bluetooth, specially:Call the 3rd function interface and judge to return Return the type of value, such as return value is true, then confirm that the Bluetooth function of mobile device is opened, such as return value is false, then confirm The Bluetooth function of mobile device is not opened;
In the present embodiment, the 3rd function interface is specially:
BluetoothAdapter.getDefaultAdapter().isEnabled().
Step 203:Whether the bluetooth durations to be opened such as judgement exceed preset duration, are to terminate, otherwise return to step 202;
Step 204:Bluetooth equipment around scanning, and judges whether to scan target Bluetooth devices, is then execution step 205, otherwise continue executing with step 204;
Specifically, the bluetooth equipment around scanning, obtains the broadcast data of the bluetooth equipment scanning, is analyzed and acquired by Broadcast data obtains the device name of corresponding bluetooth equipment, judges the implementor name of the device name and target Bluetooth devices obtaining Whether identical claim, be, confirm to scan target Bluetooth devices, otherwise confirm not scanning target Bluetooth devices.
Step 205:The broadcast data of target Bluetooth devices is preserved;
Step 206:Obtain the MAC Address of target Bluetooth devices;
Specifically, the 4th function interface is called to obtain the MAC Address of target Bluetooth devices;
In the present embodiment, the 4th function interface is specially:BluetoothDevice.getAddress();
For example, the MAC Address of the target Bluetooth devices getting is 65:A2:00:B7:E6:39.
In the present embodiment, the order of step 205 and step 206 can be exchanged.
Step 207:Judge whether mobile device is bound with target Bluetooth devices, be then execution step 208, otherwise execute Step 214;
Specifically, call the 5th function interface, and judge the type of return value receiving, the return value such as receiving is BluetoothDevice.BOND_BONDED, then judge that mobile device is bound with target Bluetooth devices;As the return receiving It is worth for BluetoothDevice.BOND_NONE, then judge that mobile device is unbound with target Bluetooth devices;
More specifically, call the 5th function interface to obtain the binding information preserving in mobile device, and judge to get Binding information in the whether device name containing target Bluetooth devices, be to judge that mobile device is tied up with target Bluetooth devices Fixed;Otherwise, it is determined that mobile device is unbound with target Bluetooth devices;
In the present embodiment, the 5th function interface is specially:BluetoothDevice.getBondState().
Step 208:Judge that whether contain the first pairing in the broadcast data preserving identifies, be then execution step 209, otherwise Terminate;
Preferably, in the present embodiment, the broadcast data of bluetooth equipment is made up of the data element of multiple TV structures;
Step 208 specifically includes:
Step A1:Judge the particular data elements being the first preset data with the presence or absence of T structure in the broadcast data preserving, be Then execution step A2, otherwise confirms not containing the first pairing mark in the broadcast data preserving, terminates;
Preferably, the first preset data is FF.
Step A2:Judge whether the data in preset byte in particular data elements is the second preset data, be then to execute step Rapid A3, otherwise confirms not containing the first pairing mark in the broadcast data preserving, terminates;
Preferably, judge that the data in the second to the 3rd byte in particular data elements is the second preset data;Wherein second Preset data is specially bluetooth equipment production firm mark, and for example, the second preset data is 056A.
Step A3:Judge whether the length of the data after preset byte in particular data elements is not less than preset length, be Then confirm in the broadcast data preserving containing the first pairing mark, execution step 208;Otherwise confirm in the broadcast data preserving not Containing the first pairing mark, terminate.
Preferably, preset length is 2 bytes.
In the present embodiment, position in broadcast data for the first pairing mark is not limited to above-mentioned position, can be according to need Seek sets itself;For example, set the first pairing and be designated the data in last 2 bytes in broadcast data.
Step 209:The the first pairing mark containing in the broadcast data of reading and saving;
Specifically, read the data after the 3rd byte in the particular data elements of broadcast data, and by the data reading Be converted to decimal representation and obtain the first pairing mark.
For example, in the present embodiment, data 0x001F reading is converted to decimal representation and obtains the first pairing mark Know for 31.
In the present embodiment, after bluetooth equipment and mobile device successful matching, bluetooth equipment according to the first predetermined way according to Secondary identify pairing corresponding with mobile device preserves as unpaired message, and pairing mark corresponding with mobile device is sent To mobile device;The the first pairing mark containing in the broadcast data of bluetooth equipment is specially the pairing mark that bluetooth equipment preserves In last;
Preferably, in the present embodiment, bluetooth equipment is according to the sequencing matching with mobile device, will preserve successively Pairing mark starts to sequentially increase with 1 step-length from 0;
In the present embodiment, bluetooth equipment can also be according to the sequencing with mobile device pairing, the pairing that will preserve Mark presetting step-length decreasing order, or with preset multiple sequentially etc..
Step 210:MAC Address according to getting judges whether there be second with target Bluetooth devices in mobile device Unpaired message, is to read the second pairing mark in the second unpaired message, execution step 211, otherwise execution step 213;
In the present embodiment, the unpaired message preserving in mobile device is specially " MAC Address:The form of pairing mark "; Wherein, MAC Address is the MAC Address of bluetooth equipment, and after pairing is designated mobile device and bluetooth equipment successful matching, bluetooth sets The standby pairing mark corresponding with mobile device returning to mobile device;
In step 210, the MAC Address according to getting judges whether there be with target Bluetooth devices in mobile device Two unpaired messages, specially:Obtain the unpaired message that mobile device preserves, judge whether to contain in the unpaired message getting and obtain The MAC Address of the target Bluetooth devices got, is to judge the second pairing letter having with target Bluetooth devices in mobile device Breath, otherwise judges the second unpaired message not having with target Bluetooth devices in mobile device.
For example, in the present embodiment, there is the second unpaired message with target Bluetooth devices in mobile device:65:A2: 00:B7:E6:39:5, then the second pairing reading is designated 5.
Step 211:Judge whether to have in target Bluetooth devices according to the first pairing mark and the second pairing mark and move First unpaired message of dynamic equipment, is then execution step 212, otherwise execution step 213;
In the present embodiment, bluetooth equipment preserves the pairing mark less than predetermined number;When joining that bluetooth equipment preserves When described predetermined number is reached to the quantity of mark, such as bluetooth equipment again with other mobile device successful matchings, then bluetooth set Standby identify the pairing preserving at first removes, and pairing mark corresponding with the mobile device of successful matching is preserved;
Preferably, in the present embodiment, predetermined number is 4;
For example, bluetooth equipment preserve pairing be designated 1,2,3,4 four, when bluetooth equipment again with other mobile devices During successful matching, then the pairing that bluetooth equipment renewal preserves is designated 2,3,4,5.
In the present embodiment, step 211 is specially:The pairing that target Bluetooth devices preserve is determined according to the first pairing mark Identify, and judge whether contain the second pairing mark in the pairing mark that target Bluetooth devices preserve, be then to judge target Bluetooth Contain the first unpaired message with mobile device in equipment, otherwise judge not containing in bluetooth equipment and join with the first of mobile device To information.
Further, in the present embodiment, the pairing mark that target Bluetooth devices preserve is determined according to the first pairing mark, It is specially:According to the second predetermined way by the first pairing mark be converted to successively target Bluetooth devices preservation less than default The pairing mark of quantity;
Preferably, in the present embodiment, the first pairing is identified 1 step-length of successively decreasing successively and obtain target Bluetooth devices preservation First pairing mark, and be less than 4;
For example, in the present embodiment, according to above-mentioned second predetermined way, the first pairing mark 31 is successively decreased 1 successively and walks Long, the first pairing obtaining target Bluetooth devices preservation is designated 28,29,30,31, does not wherein contain the second pairing mark 5, sentences Set the goal the first unpaired message not contained in bluetooth equipment with mobile device.
Step 212:Linking objective bluetooth equipment, and judge whether successful connection, is then execution step 220, otherwise terminates;
Specifically, call the 6th function interface linking objective bluetooth equipment, and judge the 7th of mobile device system readjustment the In function interface, whether the value of second parameter and the 3rd parameter is preset value, is, judges that target Bluetooth devices connect into Work(;Otherwise, it is determined that target Bluetooth devices connection failure;
In the present embodiment, the 6th function interface is specially:
BluetoothDevice.connectGatt(Context context,boolean autoConnect, BluetoothGattCallback callback);
Wherein, parameter callback is specially the 7th function interface;
7th function interface is specially:
public void onConnectionStateChange(final BluetoothGatt gatt,int status,int newState);
As in the 7th function interface, second parameter status is BluetoothGatt.GATT_SUCCESS, and the 3rd When parameter newState is BluetoothProfile.STATE_CONNECTED, then judge target Bluetooth devices successful connection; Otherwise judge target Bluetooth devices connection failure.
Step 213:Mobile device is unbinding with target Bluetooth devices, and judge unbinding whether successful, it is then Execution step 214, otherwise prompting user is unbinding with target Bluetooth devices by mobile device manually, return to step 201.
Specifically, delete the binding information with target Bluetooth devices in the binding information that mobile device preserves, and judge Whether delete successfully, be then execution step 214, otherwise prompting user deletes the binding information with target Bluetooth devices manually, returns Return step 201.
Step 214:Linking objective bluetooth equipment, and judge whether successful connection, is then execution step 215, otherwise terminates;
The implementation method of this step, the implementation method with step 212 is identical, will not be described here.
Step 215:With target Bluetooth devices binding, and judge whether binding success, be then execution step 216, otherwise tie Bundle;
Specifically, call the 8th function interface to bind with target Bluetooth devices, and judge the type of return value, such as return value For BluetoothDevice.BOND_BONDED, then confirm binding success, otherwise confirm Bind Failed.
In the present embodiment, the 8th function interface is specially:BluetoothDevice.createBond().
Step 216:With target Bluetooth devices pairing, the reply data that parsing target Bluetooth devices return obtains matching to be marked Know;
Specifically, match with target Bluetooth devices, and read last in the reply data of target Bluetooth devices return Data in byte obtains pairing mark;
For example, in the present embodiment, the reply data that parsing target Bluetooth devices return obtains pairing and is designated 32.
Step 217:Judge that whether mobile device is for the first time and target Bluetooth devices pairing, be then execution step 218, no Then execution step 219;
Specifically, obtain the unpaired message preserving in mobile device, be successively read the MAC ground in the unpaired message getting Location, and judge the MAC Address and target Bluetooth devices reading MAC Address whether identical, be, judge mobile device be not For the first time with target Bluetooth devices pairing, otherwise judge that mobile device is to match with target Bluetooth devices for the first time.
Step 218:According to obtain pairing mark and target Bluetooth devices MAC Address, by with target Bluetooth devices Second unpaired message preserves to mobile device, execution step 220;
Specifically, corresponding with the MAC Address of target Bluetooth devices for the pairing obtaining mark preservation is made to mobile device It is the second unpaired message with target Bluetooth devices.
Step 219:Joined with the second of target Bluetooth devices according to have in the pairing mark renewal mobile device obtaining To information, execution step 220;
Specifically, the MAC Address according to target Bluetooth devices finds and mesh in the unpaired message that mobile device preserves Second unpaired message of mark bluetooth equipment, and the second pairing mark in the second unpaired message is updated to the pairing mark obtaining Know.
For example, in the present embodiment, by above-mentioned second unpaired message 65:A2:00:B7:E6:39:5 are updated to 65:A2: 00:B7:E6:39:32.
Step 220:Communicate with target Bluetooth devices, terminate.
Further, in the present embodiment, pairing mark corresponding with mobile device can also be saved as by bluetooth equipment The data of 16 systems as unpaired message, when bluetooth equipment and other mobile device successful matchings, will finally protect by bluetooth equipment Deposit pairing mark carry out positional representation, and right-to-left be gradually increased one 1 after be reconverted into 16 binary data obtain with should The mobile device corresponding pairing mark of successful matching, the pairing obtaining mark is preserved as unpaired message;
Number as the pairing that current Bluetooth equipment preserves identifies has reached maximum, then identify the pairing obtaining and preserve Before, also include:The pairing preserving at first mark is removed;
For example, current last pairing preserving of bluetooth equipment is designated 0x0007, when bluetooth equipment is moved with other Equipment again successful matching when, bluetooth equipment preserve unpaired message process be specially:0x0007 is carried out positional representation is 0000 0,000 0,000 0111, and successful matching information will be expressed as 0,000 0,000 0,000 1111 again, by 0,000 0000 0000 1111 are converted to 16 systems is expressed as 0x000F, then remove the unpaired message preserving at first, and 0x000F is preserved.
Correspondingly, step 211 specifically includes:
Step N1:First pairing mark is updated according to predetermined manner;
Specifically, as the first pairing is designated binary data, then the first pairing mark is moved right default position, by first Pairing mark is updated to the data after shifting;
As the first pairing is designated non-binary data, then the first pairing mark is converted into after binary representation, to the right Move default position, the first pairing mark is updated to the data after shifting;
Preferably, in the present embodiment, the predetermined number that bluetooth equipment can be preserved the first pairing mark subtracts 1 to be preset Position;I.e., in the present embodiment, 3 are moved to right;
For example, in the present embodiment, the first pairing is designated 0x001F, and being converted to positional representation is 0,000 0,000 0001 1111, obtain 0,000 0,000 0,000 0011 after moving to right three, then the first pairing mark is updated to 0000 by 0x001F 0000 0000 0011.
Step N2:The first pairing mark after judging to update and the second pairing identify whether to meet pre-conditioned, are to sentence Determine in bluetooth equipment, to contain the unpaired message with mobile device, execution step 212;Otherwise judge not containing in bluetooth equipment and move The unpaired message of dynamic equipment, execution step 213.
In the present embodiment, the first pairing mark after judging to update and the second pairing identify whether to meet the second default bar Part, specially:The first pairing mark after updating carries out step-by-step with the second pairing mark or computing obtains the second operation result, Judge that the second pairing of the second operation result and positional representation identifies whether identical, be the first pairing mark after then judging to update With second pairing mark meet pre-conditioned, otherwise judge update after first pairing mark and second pairing mark do not meet pre- If condition;
For example, in the present embodiment, the second pairing is designated 0x0001, and being converted to positional representation is 0,000 0,000 0000 0001;After above-mentioned renewal first is designated 0,000 0,000 0,000 0011;By 0,000 0,000 0,000 0001 and 0000 0000 0,000 0011 carry out step-by-step or the second operation result that computing obtains is 0,000 0,000 0,000 0011, not with step-by-step Represent second pairing mark identical, confirm update after first pairing mark and second pairing mark do not meet pre-conditioned, Judge in bluetooth equipment, not containing the unpaired message with mobile device.
Embodiment three
The embodiment of the present invention three provides a kind of mobile device the device synchronous with bluetooth equipment pairing, as shown in figure 3, bag Include:
First judge module 301, for judging whether mobile device is bound with target Bluetooth devices;
When the first judge module 301, binding module 302, for judging that mobile device is unbound with target Bluetooth devices When, mobile device is bound with target Bluetooth devices;
When the first judge module 301, second judge module 303, for judging that mobile device is tied up with target Bluetooth devices Regularly, judge in mobile device, whether there be second pairing mark corresponding with target Bluetooth devices;
Read module 304, for judging have in mobile device and target Bluetooth devices pair when the second judge module 303 During the second pairing mark answered, read the second pairing mark;
Release module 305, for judging do not have and target Bluetooth devices in mobile device when the second judge module 303 During corresponding second pairing mark, mobile device is unbinding with target Bluetooth devices;
3rd judge module 306, after reading the second pairing mark for read module 304, according to target Bluetooth devices Broadcast data in the first pairing mark judge whether to have the second pairing in target Bluetooth devices and identify;
Release module 305, be additionally operable to judge not having the second pairing in target Bluetooth devices when the 3rd judge module 306 During mark, mobile device is unbinding with target Bluetooth devices;
Binding module 302, be additionally operable to release module 305 will be unbinding to mobile device and target Bluetooth devices after, will Mobile device is bound again with target Bluetooth devices;
Matching module 307, after binding mobile device with target Bluetooth devices when binding module 302, with target Bluetooth equipment matches;
Receiver module 308, after being matched with target Bluetooth devices for matching module 307, is received target Bluetooth devices and returns The pairing mark returned;
Preserving module 309, the pairing mark for receiving receiver module 308 preserves as the second pairing mark extremely moves In dynamic equipment;
Communication module 310, for judging there is the second pairing mark in target Bluetooth devices when the 3rd judge module 306 When, communicate with target Bluetooth devices;It is additionally operable to pairing mark that receiver module 308 receives by preserving module 309 as second After pairing mark preserves to mobile device, communicate with target Bluetooth devices.
Device in the present embodiment, also includes:Scan module, the 4th judge module and the first acquisition module;
Wherein, scan module, for scanning the bluetooth equipment around mobile device;
4th judge module, for judging whether scan module scans target Bluetooth devices;
First acquisition module, for when the 4th judge module judges that scan module scans target Bluetooth devices, obtaining Take the broadcast data of target Bluetooth devices;
First judge module 301, specifically for:When the first acquisition module get target Bluetooth devices broadcast data it Afterwards, judge whether mobile device is bound with target Bluetooth devices;
Scan module, is additionally operable to, when the 4th judge module judges that scan module does not scan target Bluetooth devices, continue Bluetooth equipment around continuous scanning mobile device.
Device in the present embodiment, also includes:Parsing module;
Described parsing module, joins according to first in the broadcast data of target Bluetooth devices for the 3rd judge module 306 Before mark being judged whether have the second pairing mark in target Bluetooth devices, the broadcast data of parsing target Bluetooth devices obtains To the first pairing mark.
In the present embodiment, the first judge module 301, specifically for:In the binding information judging mobile device preservation it is No containing the binding information with target Bluetooth devices, be, judge mobile device bind with target Bluetooth devices;Otherwise, it is determined that Mobile device is unbound with target Bluetooth devices;
Accordingly, release module 305, specifically for:In the binding information that mobile device preserves, delete and target Bluetooth The binding information of equipment.
More specifically, the first judge module 301, specifically for:Obtain the binding information that mobile device preserves, judge to obtain The whether device name containing target Bluetooth devices in the binding information got, is then to judge the binding information that mobile device preserves In containing binding information with target Bluetooth devices, otherwise judge not containing in the binding information that mobile device preserves and target be blue The binding information of tooth equipment.
Device in the present embodiment, also includes:Second acquisition module;
In the first judge module 301, described second acquisition module, for judging whether are mobile device and target Bluetooth devices Before binding, obtain the MAC Address of target Bluetooth devices;
Accordingly, the second judge module 303, specifically for:Obtain the unpaired message that mobile device preserves, judge to get Unpaired message in the whether MAC Address containing target Bluetooth devices, be to judge to have in mobile device and set with target Bluetooth Standby corresponding second pairing mark;Otherwise, it is determined that there not being second pairing mark corresponding with target Bluetooth devices in mobile device Know;
Read module 304, specifically for:Second is read from the corresponding unpaired message of the MAC Address of target Bluetooth devices Pairing mark;
Preserving module 309, specifically for:Receiver module 308 is received pairing mark as second pairing mark with The MAC Address of target Bluetooth devices is corresponding to be preserved to mobile device.
In the present embodiment, the 3rd judge module 303, specifically includes:Determining unit and judging unit;
Wherein it is determined that unit, determine target for the first pairing mark in the broadcast data according to target Bluetooth devices The pairing mark that bluetooth equipment preserves;
Judging unit, for judging whether contain the in the pairing mark that the target Bluetooth devices that determining unit determines preserve Two pairing marks.
Further, described determining unit, specifically for:
According to the second predetermined way, the first pairing mark is converted to successively the pairing mark of target Bluetooth devices preservation.
In the present embodiment, the 3rd judge module 306, can also specifically include:Updating block and judging unit;
Wherein, updating block, for updating the first pairing mark according to predetermined manner;
Judging unit, for judge updating block update after the first pairing mark and the second pairing identify whether to meet pre- If condition, it is to judge in target Bluetooth devices, there is the second pairing mark;Otherwise judge not having the in target Bluetooth devices Two pairing marks.
Further, as the first pairing is designated binary data, then described updating block, specifically for:First is joined Move right default position to mark, and the first pairing mark is updated to the data after shifting;
As the first pairing is designated non-binary data, then described updating block, specifically for:First pairing mark is turned After changing binary representation into, move right default position, and the first pairing mark is updated to the data after shifting.
In the present embodiment, described judging unit, specifically for:
The first pairing mark after updating block is updated carries out step-by-step with the second pairing mark or computing obtains computing knot Really, judge that the second pairing of operation result and positional representation identifies whether identical, be the first pairing mark after then judging to update With second pairing mark meet pre-conditioned, otherwise judge update after first pairing mark and second pairing mark do not meet pre- If condition.
Device in the present embodiment, also includes:5th judge module and update module;
Wherein, the 5th judge module, receives, for receiver module 308, the second pairing mark that target Bluetooth devices return Afterwards, judge whether mobile device is to match with target Bluetooth devices for the first time;
Preserving module 309, specifically for:When the 5th judge module judges that mobile device is to set with target Bluetooth for the first time During standby pairing, the pairing mark that receiver module 308 is received preserves to mobile device as the second pairing mark;
When the 5th judge module, update module, for judging that mobile device is not to match with target Bluetooth devices for the first time When, the pairing mark being received using receiver module 308 updates the second pairing mark of mobile device preservation.
Device in the present embodiment, also includes:Link block and the 6th judge module;
Wherein, link block, before binding mobile device with target Bluetooth devices for binding module 302, connects mesh Mark bluetooth equipment;
6th judge module, for judging link block whether successful connection;
Binding module 302, specifically for:When 6th judge module judges link block successful connection, by mobile device With target Bluetooth devices binding.
In the present invention, when mobile device and BLE bluetooth equipment are set up and communicated, by setting to mobile device and BLE bluetooth The comparison of the standby respective unpaired message preserving, it is to avoid the problem of the communication failure leading to because both sides' pairing is asynchronous, improves The ease for use of BLE bluetooth equipment, improve Consumer's Experience.
The above, the only present invention preferably specific embodiment, but protection scope of the present invention is not limited thereto, Any those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, all Should be included within the scope of the present invention.Therefore, protection scope of the present invention should be defined by scope of the claims.

Claims (26)

1. a kind of mobile device method synchronous with bluetooth equipment pairing is it is characterised in that include:
Step S1:Judge whether mobile device is bound with target Bluetooth devices, be then execution step S2;Otherwise by described movement Equipment and described target Bluetooth devices binding, execution step S4;
Step S2:Judge in described mobile device, whether there be second pairing mark corresponding with described target Bluetooth devices, be Then read described second pairing mark, execution step S3;Otherwise described mobile device is released with described target Bluetooth devices and tie up After determining and again binding, execution step S4;
Step S3:The first pairing mark in broadcast data according to described target Bluetooth devices judges described target Bluetooth devices In whether have described second pairing mark, be then communicate with described target Bluetooth devices, end;Otherwise by described mobile device Unbinding with described target Bluetooth devices and again bind after, execution step S4;
Step S4:With the pairing of described target Bluetooth devices, receive the pairing mark that described target Bluetooth devices return, will receive Pairing mark preserve in described mobile device as the second pairing mark, communicate with described target Bluetooth devices, end.
2. method according to claim 1 is it is characterised in that before described step S1, also include:
Step A:Bluetooth equipment around scanning mobile device, judges whether to scan target Bluetooth devices, is that then acquisition is described The broadcast data of target Bluetooth devices, execution step S1;Otherwise continue executing with step A.
3. method according to claim 2 is it is characterised in that before described step S3, also include:Parse described target blue The broadcast data of tooth equipment obtains the first pairing mark.
4. method according to claim 1 is it is characterised in that in described step S1, described judgement mobile device and target Whether bluetooth equipment is bound, specially:Judge whether contain and target Bluetooth devices in the binding information that mobile device preserves Binding information, be, judge mobile device bind with target Bluetooth devices;Otherwise, it is determined that mobile device is set with target Bluetooth Standby unbound;
In described step S2 and described step S3, described will be unbinding with described target Bluetooth devices for described mobile device, tool Body is:In the binding information that described mobile device preserves, delete the described binding information with target Bluetooth devices.
5. method according to claim 4 is it is characterised in that whether described judge in the binding information that mobile device preserves Contain the binding information with target Bluetooth devices, specially:Obtain the binding information that described mobile device preserves, judge to get Binding information in the whether device name containing target Bluetooth devices, be to judge the binding information that described mobile device preserves In containing binding information with target Bluetooth devices, otherwise judge not containing and mesh in the binding information that described mobile device preserves The binding information of mark bluetooth equipment.
6. method according to claim 1 is it is characterised in that before described step S1, also include:
Step B:Obtain the MAC Address of target Bluetooth devices;
In described step S2, described judge that whether having corresponding with described target Bluetooth devices second in described mobile device joins To mark, specially:Obtain the unpaired message that described mobile device preserves, whether judge in the unpaired message getting containing State the MAC Address of target Bluetooth devices, be, judge in described mobile device, have corresponding with described target Bluetooth devices Two pairing marks;Otherwise, it is determined that there not being second pairing mark corresponding with described target Bluetooth devices in described mobile device;
In described step S2, described reading described second matches mark, specially:MAC Address from described target Bluetooth devices Described second pairing mark is read in corresponding unpaired message;
In described step S4, described identify the pairing receiving mark as the described second pairing preserves to described mobile device In, specially:The pairing receiving mark is protected as the second pairing mark is corresponding with the MAC Address of described target Bluetooth devices Deposit to described mobile device.
7. method according to claim 1 is it is characterised in that in described step S3, described is set according to described target Bluetooth The first pairing mark in standby broadcast data judges whether have described second pairing mark, tool in described target Bluetooth devices Body is:
The first pairing mark in broadcast data according to described target Bluetooth devices determines what described target Bluetooth devices preserved Pairing mark, judges whether contain described second pairing mark in the pairing mark that described target Bluetooth devices preserve.
8. method according to claim 7 is it is characterised in that in the described broadcast data according to described target Bluetooth devices The first pairing mark determine the pairing mark that described target Bluetooth devices preserve, specially:
Described first pairing mark is converted to successively by the pairing that described target Bluetooth devices preserve according to the second predetermined way Mark.
9. method according to claim 1 is it is characterised in that in described step S3, described is set according to described target Bluetooth The first pairing mark in standby broadcast data judges whether have described second pairing mark, tool in described target Bluetooth devices Body is:
Step N1:Described first pairing mark is updated according to predetermined manner;
Step N2:The first pairing mark after judging to update and described second pairing identify whether to meet pre-conditioned, are to sentence There is described second pairing mark in fixed described target Bluetooth devices;Otherwise judge not have in described target Bluetooth devices described Second pairing mark.
10. method according to claim 9 is it is characterised in that described step N1, specially:
As the described first pairing is designated binary data, then the described first pairing mark is moved right default position, by described the One pairing mark is updated to the data after shifting;
As the described first pairing is designated non-binary data, then the described first pairing mark is converted into after binary representation, Move right default position, and the described first pairing mark is updated to the data after shifting.
11. methods according to claim 10 it is characterised in that in described step N2, described judge after updating first Pairing mark and described second pairing identify whether to meet pre-conditioned, specially:
The first pairing mark after updating carries out step-by-step with described second pairing mark or computing obtains operation result, judges institute State operation result and positional representation described second pairing identify whether identical, be the first pairing mark after then judging to update and Described second pairing mark meet pre-conditioned, otherwise judge update after first pairing mark and described second pairing mark not Meet pre-conditioned.
12. methods according to claim 1 are it is characterised in that in described step S4, the described target Bluetooth of described reception sets After standby the second pairing mark returning, also include:
Step C:Judge whether described mobile device is to match with described target Bluetooth devices for the first time, be, by joining of receiving Mark is preserved to described mobile device as the second pairing mark;Otherwise update described shifting using the pairing mark receiving Second pairing mark of dynamic equipment preservation.
13. methods according to claim 1 it is characterised in that tie up described mobile device with described target Bluetooth devices Before fixed, also include:Connect described target Bluetooth devices, and judge whether successful connection, be then by described mobile device and institute State target Bluetooth devices binding, otherwise terminate.
A kind of 14. mobile devices device synchronous with bluetooth equipment pairing is it is characterised in that include:
First judge module, for judging whether mobile device is bound with target Bluetooth devices;
Binding module, for when described first judge module judges that mobile device and target Bluetooth devices are unbound, by institute State mobile device and described target Bluetooth devices binding;
Second judge module, for when described first judge module judges that mobile device and target Bluetooth devices are bound, Judge in described mobile device, whether there be second pairing mark corresponding with described target Bluetooth devices;
Read module, for judging have in described mobile device and described target Bluetooth devices when described second judge module During corresponding second pairing mark, read described second pairing mark;
Release module, set with described target Bluetooth for judging not having in described mobile device when described second judge module During standby corresponding second pairing mark, will be unbinding with described target Bluetooth devices for described mobile device;
3rd judge module, after reading described second pairing mark for described read module, sets according to described target Bluetooth The first pairing mark in standby broadcast data judges whether there is described second pairing mark in described target Bluetooth devices;
Described releasing module, is additionally operable to judge do not have described in described target Bluetooth devices when described 3rd judge module During two pairing marks, will be unbinding with described target Bluetooth devices for described mobile device;
Described binding module, be additionally operable to described releasing module by unbinding to described mobile device and described target Bluetooth devices it Afterwards, described mobile device is bound again with described target Bluetooth devices;
Matching module, after binding described mobile device with described target Bluetooth devices when described binding module, with institute State target Bluetooth devices pairing;
Receiver module, for receiving the pairing mark that described target Bluetooth devices return;
Preserving module, the pairing mark for receiving described receiver module preserves to described movement as the second pairing mark In equipment;
Communication module, judges there is described second pairing mark in described target Bluetooth devices for described 3rd judge module When, communicate with described target Bluetooth devices;It is additionally operable to described preserving module to make the pairing mark that described receiver module receives After preserving to described mobile device for the second pairing mark, communicate with described target Bluetooth devices.
15. devices according to claim 14 are it is characterised in that also include:Scan module, the 4th judge module and first Acquisition module;
Described scan module, for scanning the bluetooth equipment around mobile device;
Described 4th judge module, for judging whether described scan module scans target Bluetooth devices;
When described 4th judge module, described first acquisition module, for judging that described scan module scans target Bluetooth and sets When standby, obtain the broadcast data of described target Bluetooth devices;
Described first judge module, specifically for:When described first acquisition module gets the broadcast of described target Bluetooth devices After data, judge whether mobile device is bound with target Bluetooth devices;
Described scan module, is additionally operable to judge that described scan module does not scan target Bluetooth and sets when described 4th judge module When standby, continue to scan on the bluetooth equipment around described mobile device.
16. devices according to claim 15 are it is characterised in that also include:Parsing module;
Described parsing module, joins according to first in the broadcast data of described target Bluetooth devices for described 3rd judge module Before mark being judged whether have described second pairing mark in described target Bluetooth devices, parse described target Bluetooth devices Broadcast data obtain first pairing mark.
17. devices according to claim 14 it is characterised in that described first judge module, specifically for:Judge to move Whether contain the binding information with target Bluetooth devices in the binding information that equipment preserves, be then to judge that mobile device is blue with target Tooth equipment is bound;Otherwise, it is determined that mobile device is unbound with target Bluetooth devices;
Described releasing module, specifically for:In the binding information that described mobile device preserves, set with target Bluetooth described in deletion Standby binding information.
18. devices according to claim 17 it is characterised in that described first judge module, specifically for:Obtain described The binding information that mobile device preserves, judges in the binding information that gets the whether device name containing target Bluetooth devices, It is to judge in the binding information that described mobile device preserves containing the binding information with target Bluetooth devices, otherwise judge described The binding information with target Bluetooth devices is not contained in the binding information that mobile device preserves.
19. devices according to claim 14 are it is characterised in that also include:Second acquisition module;
For described first judge module, described second acquisition module, judges whether mobile device is bound with target Bluetooth devices Before, obtain the MAC Address of target Bluetooth devices;
Described second judge module, specifically for:Obtain the unpaired message that described mobile device preserves, judge the pairing getting Whether contain the MAC Address of described target Bluetooth devices in information, be, judge have in described mobile device and described target The corresponding second pairing mark of bluetooth equipment;Otherwise, it is determined that not having in described mobile device and described target Bluetooth devices pair The the second pairing mark answered;
Described read module, specifically for:Read described from the corresponding unpaired message of the MAC Address of described target Bluetooth devices Second pairing mark;
Described preserving module, specifically for:The pairing mark that described receiver module is received is as the second pairing mark and institute The corresponding preservation of MAC Address stating target Bluetooth devices is to described mobile device.
20. devices according to claim 14 it is characterised in that described 3rd judge module, including:Determining unit and sentencing Disconnected unit;
Described determining unit, determines described mesh for the first pairing mark in the broadcast data according to described target Bluetooth devices The pairing mark that mark bluetooth equipment preserves;
Described judging unit, for judging in the pairing mark that the described target Bluetooth devices that described determining unit determines preserve to be No pairing containing described second identifies.
21. devices according to claim 20 it is characterised in that described determining unit, specifically for:
Described first pairing mark is converted to successively by the pairing that described target Bluetooth devices preserve according to the second predetermined way Mark.
22. devices according to claim 14 it is characterised in that described 3rd judge module, including:Updating block and sentencing Disconnected unit;
Described updating block, for updating described first pairing mark according to predetermined manner;
Described judging unit, for judging that the first pairing mark and described second after described updating block renewal matches mark be No meet pre-conditioned, be to judge in described target Bluetooth devices, there is described second pairing mark;Otherwise judge described mesh There is not described second pairing mark in mark bluetooth equipment.
23. devices according to claim 22 it is characterised in that
As the described first pairing is designated binary data, then described updating block, specifically for:By the described first pairing mark Move right default position, and the described first pairing mark is updated to the data after shifting;
As the described first pairing is designated non-binary data, then described updating block, specifically for:By the described first pairing mark Know after being converted into binary representation, move right default position, the described first pairing mark is updated to the data after shifting.
24. devices according to claim 23 it is characterised in that described judging unit, specifically for:
The first pairing mark after described updating block is updated carries out step-by-step with the described second pairing mark or computing is transported Calculate result, judge that described second pairing of described operation result and positional representation identifies whether identical, after being then judgement renewal First pairing mark and described second pairing mark meet pre-conditioned, otherwise judge update after first pairing mark and described Second pairing mark does not meet pre-conditioned.
25. devices according to claim 14 are it is characterised in that also include:5th judge module and update module;
Described 5th judge module, receives, for described receiver module, the second pairing mark that described target Bluetooth devices return Afterwards, judge whether described mobile device is to match with described target Bluetooth devices for the first time;
Described preserving module, specifically for:When described 5th judge module judge described mobile device be for the first time with described During target Bluetooth devices pairing, the pairing mark that described receiver module is received preserves to institute as the described second pairing mark State in mobile device;
When described 5th judge module, described update module, for judging that described mobile device is not first time and described target During bluetooth equipment pairing, the pairing mark being received using described receiver module is updated the second of the preservation of described mobile device and joins To mark.
26. equipment according to claim 14 are it is characterised in that also include:Link block and the 6th judge module;
Described link block, before described mobile device being bound with described target Bluetooth devices for described binding module, even Connect described target Bluetooth devices;
Described 6th judge module, for judging the whether successful connection of described link block;
Described binding module, specifically for:When described 6th judge module judges described link block successful connection, by institute State mobile device and described target Bluetooth devices binding.
CN201611115029.XA 2016-12-07 2016-12-07 A kind of method and device that mobile device is synchronous with bluetooth equipment pairing Active CN106454713B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611115029.XA CN106454713B (en) 2016-12-07 2016-12-07 A kind of method and device that mobile device is synchronous with bluetooth equipment pairing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611115029.XA CN106454713B (en) 2016-12-07 2016-12-07 A kind of method and device that mobile device is synchronous with bluetooth equipment pairing

Publications (2)

Publication Number Publication Date
CN106454713A true CN106454713A (en) 2017-02-22
CN106454713B CN106454713B (en) 2019-08-30

Family

ID=58216195

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611115029.XA Active CN106454713B (en) 2016-12-07 2016-12-07 A kind of method and device that mobile device is synchronous with bluetooth equipment pairing

Country Status (1)

Country Link
CN (1) CN106454713B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018223892A1 (en) * 2017-06-06 2018-12-13 苏州欧普照明有限公司 Bluetooth connection method, bluetooth apparatus, and bluetooth connection system
CN109151788A (en) * 2018-09-28 2019-01-04 咪付(广西)网络技术有限公司 A kind of data in mobile phone transmission method and system based on bluetooth low energy device
CN109951829A (en) * 2017-12-20 2019-06-28 深圳光峰科技股份有限公司 Bluetooth connecting method, intelligent terminal and bluetooth equipment
CN111726667A (en) * 2020-05-25 2020-09-29 福建新大陆通信科技股份有限公司 Method and system for interconnecting intelligent sound box and set top box
WO2021093725A1 (en) * 2019-11-12 2021-05-20 飞天诚信科技股份有限公司 Bluetooth finder and quick pairing method therefor
CN115245271A (en) * 2022-07-27 2022-10-28 珠海优特智厨科技有限公司 Kitchen device and pairing method thereof
CN117060949A (en) * 2022-05-07 2023-11-14 Oppo广东移动通信有限公司 Signal sending method and device, combination identification method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104967971A (en) * 2015-06-26 2015-10-07 飞天诚信科技股份有限公司 Method achieving bluetooth automatic return connection in Android system
CN105516902A (en) * 2015-12-22 2016-04-20 惠州Tcl移动通信有限公司 Method and system for Bluetooth connection and Bluetooth device
CN105681846A (en) * 2016-01-29 2016-06-15 深圳创维数字技术有限公司 Method for carrying out Bluetooth matching for set top box and set top box
CN106028294A (en) * 2016-05-31 2016-10-12 北京疯景科技有限公司 Equipment connection method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104967971A (en) * 2015-06-26 2015-10-07 飞天诚信科技股份有限公司 Method achieving bluetooth automatic return connection in Android system
CN105516902A (en) * 2015-12-22 2016-04-20 惠州Tcl移动通信有限公司 Method and system for Bluetooth connection and Bluetooth device
CN105681846A (en) * 2016-01-29 2016-06-15 深圳创维数字技术有限公司 Method for carrying out Bluetooth matching for set top box and set top box
CN106028294A (en) * 2016-05-31 2016-10-12 北京疯景科技有限公司 Equipment connection method and device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018223892A1 (en) * 2017-06-06 2018-12-13 苏州欧普照明有限公司 Bluetooth connection method, bluetooth apparatus, and bluetooth connection system
CN109951829A (en) * 2017-12-20 2019-06-28 深圳光峰科技股份有限公司 Bluetooth connecting method, intelligent terminal and bluetooth equipment
CN109951829B (en) * 2017-12-20 2021-07-20 深圳光峰科技股份有限公司 Bluetooth connection method, intelligent terminal and Bluetooth device
CN109151788A (en) * 2018-09-28 2019-01-04 咪付(广西)网络技术有限公司 A kind of data in mobile phone transmission method and system based on bluetooth low energy device
WO2021093725A1 (en) * 2019-11-12 2021-05-20 飞天诚信科技股份有限公司 Bluetooth finder and quick pairing method therefor
CN111726667A (en) * 2020-05-25 2020-09-29 福建新大陆通信科技股份有限公司 Method and system for interconnecting intelligent sound box and set top box
CN117060949A (en) * 2022-05-07 2023-11-14 Oppo广东移动通信有限公司 Signal sending method and device, combination identification method and device and electronic equipment
CN115245271A (en) * 2022-07-27 2022-10-28 珠海优特智厨科技有限公司 Kitchen device and pairing method thereof
CN115245271B (en) * 2022-07-27 2024-07-02 珠海优特智厨科技有限公司 Kitchen equipment and kitchen equipment pairing method

Also Published As

Publication number Publication date
CN106454713B (en) 2019-08-30

Similar Documents

Publication Publication Date Title
CN106454713A (en) Method and device for pairing and synchronizing mobile equipment and Bluetooth equipment
CN103139857B (en) Communication system, network handover process method and device
CN104581652B (en) Message treatment method, the method and apparatus for selecting MME
KR102357070B1 (en) Communication method, device and system
CN100527738C (en) Method for handling discarding of a sequence of service data units and communication apparatus
CN102761988B (en) The short-distance movement terminal and repeater that can coordinate
CN104221449A (en) Method and device to synchronize bluetooth and LTE/WIMAX transmissions for achieving coexistence
CN107071709A (en) A kind of matching method and device with bluetooth equipment
CN106341516A (en) Multipoint connection control method and apparatus, terminal and multipoint bluetooth earphone
JP2003515296A5 (en)
CN102970125A (en) Method and device for synchronizing time in close distance
CN104365174A (en) Portable terminal auxiliary device having satellite communication function
CN103813365A (en) WDS support system, device and method based on Android system
WO2005004414A8 (en) Method for updating and managing synchronization identifier by using release messages or status request and response
CN110191389A (en) Mulit-point Connection method, apparatus, bluetooth headset and the TWS earphone of wireless headset
CN102870490A (en) Data transmission method, network element equipment and communication system
CN105959968A (en) Wifi configuration method and device
US20140120917A1 (en) Communication system, communication method, base station , and management device
CN1838666B (en) Byte sequence switching method for crossing operating system platform
CN105376814B (en) Calling when switching saves
WO2001076177A3 (en) Method and apparatus for a mobile station application to identify specified events
CN108632855A (en) A kind of method and device for establishing interface between base station
CN101483695A (en) Terminal and method for implementing short message forwarding
CN103108050B (en) Method and system capable of achieving synchronization of mobile terminal phone directories of tablet computer
CN103391589B (en) Home base station gateway user equipment context method for releasing and system

Legal Events

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