CN105554693B - The matching method and device of bluetooth equipment - Google Patents

The matching method and device of bluetooth equipment Download PDF

Info

Publication number
CN105554693B
CN105554693B CN201610073995.3A CN201610073995A CN105554693B CN 105554693 B CN105554693 B CN 105554693B CN 201610073995 A CN201610073995 A CN 201610073995A CN 105554693 B CN105554693 B CN 105554693B
Authority
CN
China
Prior art keywords
bluetooth equipment
code
key
random number
bluetooth
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610073995.3A
Other languages
Chinese (zh)
Other versions
CN105554693A (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.)
Shenzhen Excelsecu Data Technology Co Ltd
Original Assignee
Shenzhen Excelsecu Data Technology 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 Shenzhen Excelsecu Data Technology Co Ltd filed Critical Shenzhen Excelsecu Data Technology Co Ltd
Priority to CN201610073995.3A priority Critical patent/CN105554693B/en
Publication of CN105554693A publication Critical patent/CN105554693A/en
Application granted granted Critical
Publication of CN105554693B publication Critical patent/CN105554693B/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

Abstract

The present invention provides a kind of matching methods of bluetooth equipment, comprising: the first bluetooth equipment and the second bluetooth equipment establish the preliminary connection based on justwork mode;Output compares code respectively on first bluetooth equipment and second bluetooth equipment;The comparison code for receiving user's input confirms instruction, carries out first bluetooth equipment and second bluetooth equipment using data interaction.The present invention is conducive to improve the safety of device pairing, reduces the risk of leaking data.

Description

The matching method and device of bluetooth equipment
Technical field
The invention belongs to the communications field more particularly to the matching methods and device of bluetooth equipment.
Background technique
Data communication is carried out between bluetooth equipment in use, between the bluetooth equipment communicated required for needing first to establish Pairing connection.In establishing connection procedure, the certification of safety is carried out to the equipment for establishing connection, or obtain being permitted for connection both sides Can after, the transmission of further progress data or instruction.
Matching method between bluetooth equipment at present, the pairing that the main matching method including PIN code input, number compare Method and the matching method for running (justwork) at once, in which:
The matching method of the PIN code input refers to and inputs PIN code in needing two equipment connected, and compares The PIN code of two inputs allows to establish connection if the PIN code of two bluetooth equipments input is identical.
Match clock synchronization carrying out bluetooth equipment by input PIN code, if third party's illegal user's disguise as connects equipment, and When inputting corresponding PIN code, illegal connection may be established, or even causes the leakage of significant data.
Summary of the invention
The purpose of the present invention is to provide a kind of matching methods of bluetooth equipment, are matched with solving the prior art in bluetooth equipment Clock synchronization, if third party's illegal user's disguise as connects equipment, and when inputting corresponding PIN code, may establish illegal connection, The problem of even causing the leakage of significant data.
In a first aspect, the embodiment of the invention provides a kind of matching methods of bluetooth equipment, which comprises
First bluetooth equipment and the second bluetooth equipment establish the preliminary connection based on justwork mode;
Output compares code respectively on first bluetooth equipment and second bluetooth equipment;
The comparison code for receiving user's input confirms instruction, carries out to first bluetooth equipment and second bluetooth equipment Using data interaction.
With reference to first aspect, in the first possible implementation of first aspect, in first bluetooth equipment and institute It states on the second bluetooth equipment before output compares code step respectively, the method also includes first bluetooth equipments to described the Two bluetooth equipments are sent than information on the code, or are previously stored in first bluetooth equipment and the second bluetooth equipment described Compare code, wherein first bluetooth equipment sends comparison code information Step to second bluetooth equipment and includes:
The comparison code being pre-stored in the first bluetooth equipment is sent to the second bluetooth equipment;
Alternatively, generating the comparison code at random by the first bluetooth equipment, and the comparison code generated at random is sent to second Bluetooth equipment;
Alternatively, the first bluetooth equipment, which generates, compares the code factor, the comparison code factor is sent to the second bluetooth equipment, root Handle to obtain according to calculation preset in the first bluetooth equipment and the second bluetooth equipment and compare code, wherein the comparison code because Son is pre-set data, the data perhaps generated at random or pre-set data and the data generated at random.
The possible implementation of with reference to first aspect the first, in second of possible implementation of first aspect, institute It states the first bluetooth equipment and generates the comparison code factor, the comparison code factor is sent to the second bluetooth equipment, according to the first bluetooth Preset calculation, which handles to obtain, in equipment and the second bluetooth equipment compares code step and includes:
First random number of generation and the first key prestored are sent to the second bluetooth equipment by the first bluetooth equipment, and Receive the second random number that second bluetooth equipment generates and the second key that second bluetooth equipment prestores;
First bluetooth equipment is according to the first random number and the first key prestored and received described second of generation Random number, the second key carry out cryptographic calculation, and it is random according to the second of generation to obtain the first comparison code and the second bluetooth equipment Number and the second key and received first random number and first key prestored, obtain the second comparison code.
The possible implementation of second with reference to first aspect, in the third possible implementation of first aspect, First bluetooth equipment is according to the first random number of generation and the first key prestored and received described second random Number, the second key carry out cryptographic calculation, before obtaining the first comparison code step, the method also includes:
First bluetooth equipment carries out second random number, first key, the second key according to preset Encryption Algorithm Cryptographic calculation generates the first secret value;
First secret value is compared with the second secret value of the second bluetooth equipment, second secret value is by Two bluetooth equipments carry out computations generation to the second random number, first key, the second key according to preset Encryption Algorithm;
If the first secret value is different from the second secret value, the preliminary connection is disconnected, if the first secret value and Two secret values are identical, then cryptographic calculation generates first and compares code.
The possible implementation of second with reference to first aspect, in the 4th kind of possible implementation of first aspect, The comparison code for receiving user's input confirms instruction, applies to first bluetooth equipment and second bluetooth equipment After data interaction step, the method also includes:
If the first bluetooth equipment and the second bluetooth equipment are completed to match, the first bluetooth equipment compares code and second to first Key is encrypted, and is obtained third and is compared code, and stores and be sent to second bluetooth equipment third comparison code and deposit Storage;
When the first bluetooth equipment carries out again with the second bluetooth equipment using data interaction, directly output storage is described Third compares code.
Second aspect, the embodiment of the invention provides a kind of contrast means of bluetooth equipment, described device includes:
Preliminary connection establishment unit is based on justwork mode for establishing the first bluetooth equipment and the second bluetooth equipment Preliminary connection;
Data outputting unit, for output to compare respectively on first bluetooth equipment and second bluetooth equipment Code;
Comparing unit, for receiving the comparison code confirmation instruction of user's input, to first bluetooth equipment and described the Two bluetooth equipments are carried out using data interaction.
In conjunction with second aspect, in the first possible implementation of second aspect, described device further includes data exchange Unit or pre-storing unit, the data exchange unit from first bluetooth equipment to second bluetooth equipment for being sent Than information on the code, the pre-storing unit is described for being previously stored in first bluetooth equipment and the second bluetooth equipment Code is compared, wherein the data exchange unit includes:
First transmission sub-unit, the comparison code for will be pre-stored in the first bluetooth equipment are sent to the second bluetooth equipment;
Alternatively, the second transmission sub-unit, for generating the comparison code at random by the first bluetooth equipment, and will generate at random Comparison code be sent to the second bluetooth equipment;
Alternatively, third transmission sub-unit, compares the code factor for being generated by the first bluetooth equipment, by the comparison code factor It is sent to the second bluetooth equipment, is handled and is compared according to calculation preset in the first bluetooth equipment and the second bluetooth equipment Code, wherein described includes comparing the code factor for pre-set data, the data perhaps generated at random or pre-set Data and the data generated at random.
In conjunction with the first possible implementation of second aspect, in second of possible implementation of second aspect, institute Stating third comparing subunit includes:
Data exchange module, for being sent out the first random number of generation and the first key prestored by the first bluetooth equipment It send to the second bluetooth equipment, and receives the second random number that second bluetooth equipment generates and second bluetooth equipment is pre- The second key deposited;
Computing module, for by the first bluetooth equipment according to the first random number of generation and the first key prestored, with And received second random number, the second key carry out cryptographic calculation, obtain the first comparison code and the second bluetooth equipment root The second random number according to generation and the second key and received first random number and first key that prestore, obtain second Compare code.
In conjunction with second of possible implementation of second aspect, in the third possible implementation of second aspect, institute State device further include:
Encrypting module, for by the first bluetooth equipment according to preset Encryption Algorithm, to second random number, first close Key, the second key carry out cryptographic calculation, generate the first secret value;
Comparison module, it is described for first secret value to be compared with the second secret value of the second bluetooth equipment Second secret value carries out the second random number, first key, the second key according to preset Encryption Algorithm by the second bluetooth equipment Computations generate;
If judgment module disconnects the preliminary connection different from the second secret value for the first secret value, if the One secret value is identical as the second secret value, then cryptographic calculation generates first and compares code.
In conjunction with second of possible implementation of second aspect, in the 4th kind of possible implementation of second aspect, institute State device further include:
Transmission unit is encrypted, if completing to match for the first bluetooth equipment and the second bluetooth equipment, is set by the first bluetooth It is standby that first comparison code and the second key are encrypted, it obtains third and compares code, and third comparison code is stored and sent It is stored to second bluetooth equipment;
Display unit, for when the first bluetooth equipment carries out again with the second bluetooth equipment using data interaction, directly The third of output storage compares code.
In the present invention, by the way that two equipment to be paired are established the preliminary connection based on justwork mode, lead to The preliminary connection is crossed, the comparison code is shown respectively on the first bluetooth equipment and the second bluetooth equipment, holds the first bluetooth The user of equipment when the comparison code of display is identical compared with by the user for holding the second bluetooth equipment, then may be used by input validation information It is effective to complete to the data interaction between the first bluetooth equipment and the second bluetooth equipment.Due to going back after establishing preliminary connection Further progress compares the display verification of code, on the basis of directly pairing in the prior art, both can be used It is convenient, it also can effectively improve the safety of data interaction.
Detailed description of the invention
Fig. 1 is the implementation flow chart of the matching method for the bluetooth equipment that first embodiment of the invention provides;
Fig. 2 is the implementation flow chart of the matching method for the bluetooth equipment that second embodiment of the invention provides;
Fig. 3 is the implementation flow chart of the matching method for the bluetooth equipment that third embodiment of the invention provides;
Fig. 4 is the implementation flow chart of the matching method for the bluetooth equipment that fourth embodiment of the invention provides;
Fig. 5 is the structural schematic diagram of the contrast means for the bluetooth equipment that fifth embodiment of the invention provides.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
When the purpose of the embodiment of the present invention is to solve in the prior art to carry out using data interaction to bluetooth equipment, use The lower problem of cumbersome or data interaction safety, is specifically illustrated with reference to the accompanying drawing.
Embodiment one:
Fig. 1 shows the implementation process of the matching method of the bluetooth equipment of first embodiment of the invention offer, and details are as follows:
In step s101, the first bluetooth equipment establishes tentatively connecting based on justwork mode with the second bluetooth equipment It connects.
Specifically, the first bluetooth equipment described in the embodiment of the present invention and the second bluetooth equipment, it can be for bluetooth Smart machine of communication function, such as smart phone, tablet computer, laptop etc., or may be logical with bluetooth Believe the Input/Output Device of module, such as Bluetooth audio device, bluetooth mouse, bluetooth keyboard, bluetooth headset, bluetooth digital certificate end End device etc..
The preliminary connection, in inventive embodiments, for the transmission key between bluetooth equipment and by bluetooth equipment The random number of generation, to be different from pairing described in the embodiment of the present invention, after completing pairing, can transmit between bluetooth equipment is needed It sends or received data, and tentatively connects the random number for being only used for generating in sending device and key.
The key of the bluetooth equipment can be due to safety concerns the public key in bluetooth equipment.The bluetooth equipment is raw At random number, can automatically generated with bluetooth equipment with clock synchronization, so as to improve compare code calculate safety.
As in preferred embodiment a kind of in the embodiment of the present invention, the preliminary connection can pass through existing bluetooth The connection type for connecting justwork at once between equipment is completed.
At once the connection type for connecting justwork, it is only necessary to be sent by any appliance between two bluetooth equipments Request, can establish the connection communication between two bluetooth equipments, in embodiments of the present invention by connecting justwork at once Mode exchanges random number and key.
It can be by the start button of matching method described in the setting embodiment of the present invention, in the enabled instruction for receiving pairing Afterwards, the equipment for needing to connect is searched, the preliminary connection based on justwork mode can be established automatically.
In step s 102, output compares code respectively on first bluetooth equipment and second bluetooth equipment.
Specifically, the comparison code in the embodiment of the present invention, can tentatively be connected by the justwork, by the first bluetooth Equipment is sent to the second bluetooth equipment, can also be stored in advance in the first bluetooth equipment and the second bluetooth equipment.
Wherein, for first way, the first bluetooth equipment described in the embodiment of the present invention, to second bluetooth equipment It sends than information on the code, can specifically use following sending method:
1) the comparison code being pre-stored in the first bluetooth equipment, is sent to the second bluetooth equipment.
The comparison code is stored in advance in the first bluetooth equipment, matches clock synchronization needing to establish, will by the first bluetooth equipment Pre-stored comparison code is transmitted directly to the second bluetooth equipment by tentatively connection.
The code that compares can be number, the combination of letter or symbol.Certainly, the comparison code can be stored in advance more It is a, it is different according to the object of pairing, and select the comparison code being adapted with pairing user.
2), the comparison code is generated by the first bluetooth equipment at random, and the comparison code generated at random is sent to the second indigo plant Tooth equipment.
The comparison code is generated at random by the first bluetooth equipment, in this way can be to avoid after once connecting, causing to compare The leakage of code, and comparison code data can be obtained by making illegal user also, be likely to result in illegal pairing connection.Such as Fixed comparison code, if the first bluetooth equipment needs to match with the second bluetooth equipment, if illegal user learns after comparing code, Establish the preliminary connection based on justwork mode by bluetooth equipment C and the first bluetooth equipment, and by bluetooth equipment D to Second bluetooth equipment, which is sent, compares code, to cause the first bluetooth equipment and illegal bluetooth equipment C is mismatched pair, by it is described with Machine generates the mode for comparing code, can be to avoid this defect.
Certainly, the code that compares can also be random number and the fixed combination for comparing code.
3), the first bluetooth equipment, which generates, compares the code factor, and the comparison code factor is sent to the second bluetooth equipment, according to Preset calculation, which handles to obtain, in first bluetooth equipment and the second bluetooth equipment compares code, wherein described includes comparing code The factor is pre-set data, the data perhaps generated at random or pre-set data and the data generated at random.
In this fashion, it is previously provided with Processing Algorithm in the first bluetooth equipment and the second bluetooth equipment, received After the comparison factor sent to the first bluetooth equipment, by preset Processing Algorithm, comparison code can be generated.This processing Mode, so that also can effectively ensure that the safety of pairing even if illegality equipment has stolen the comparison factor.
Wherein, output compares mode of code, including sound output, display output etc..
In step s 103, the comparison code for receiving user's input confirms instruction, to first bluetooth equipment and described the Two bluetooth equipments are carried out using data interaction.
Specifically, described different according to the difference of concrete application scene using data.For example, being in the first bluetooth equipment Bluetooth digital certificate terminal installation, when the second bluetooth equipment is smart phone, the application data can be transaction data, signature Data etc..
The second bluetooth equipment receive it is described than information on the code after, by display match code, user can be facilitated to pairing Code is compared.
In addition, as a kind of currently preferred embodiment, when first bluetooth equipment and the second bluetooth equipment, Whens for smart machine with function of Bluetooth communication, such as smart phone, tablet computer, laptop etc., the comparison code Display interface the application journey of display interface can be sent from the first bluetooth equipment to the second bluetooth equipment by the preliminary connection Sequence, make with the first bluetooth equipment connect the comparison code display interface of the second bluetooth equipment it is consistent, user can further pass through Display interface is confirmed, to further increase the safety and ease for use of pairing.Certainly, the comparison code display interface is also The application program of display interface can be installed in the second bluetooth equipment, so that improving user makes by preassembled mode Safety and ease for use.
The present invention is by establishing the preliminary connection based on justwork mode for two equipment to be paired, by described Preliminary connection, shows the comparison code respectively on the first bluetooth equipment and the second bluetooth equipment, holds the first bluetooth equipment For user when the comparison code of display is identical compared with by the user for holding the second bluetooth equipment, input validation information then can be effective It completes to the data interaction between the first bluetooth equipment and the second bluetooth equipment.Due to going back further after establishing preliminary connection The display verification of code is compared, on the basis of directly pairing in the prior art, both can be used conveniently, The safety of data interaction can effectively be improved.
Embodiment two:
Fig. 2 shows the implementation processes of the matching method of the bluetooth equipment of first embodiment of the invention offer, and details are as follows:
In step s 201, the first bluetooth equipment establishes tentatively connecting based on justwork mode with the second bluetooth equipment It connects.
This step and step S101 in embodiment one are essentially identical.
In step S202, the first random number of generation and the first key prestored are sent to by the first bluetooth equipment Two bluetooth equipments, and receive the second random number that second bluetooth equipment generates and second bluetooth equipment prestores the Two keys.
It in embodiments of the present invention, can be by the first key in the first bluetooth equipment of user by the preliminary connection And it is sent to the second bluetooth equipment for matching the first random number generated, equally, it can also be connect by the first bluetooth equipment It receives by the second random number and the second key of the transmission of the second bluetooth equipment.
The first key and the second key for equipment it is intrinsic, the first key and the second key can for pair Claim key, the first bluetooth equipment and the second bluetooth equipment that random number and the intrinsic key of equipment are sent to counterpart device, in life After comparing code, the identification information of equipment not only may include, but also enabled to compare code with the other user's attribute, improve and compare Safety.
In step S203, the first bluetooth equipment according to the first random number of generation and the first key prestored, and Received second random number, the second key carry out cryptographic calculation, obtain the first comparison code and the second bluetooth equipment according to The second random number generated and the second key and received first random number and first key that prestore, obtain the second ratio To code, the comparison code is exported respectively on first bluetooth equipment and second bluetooth equipment.
Specifically, it is described compare code according to receive the second random number, the second key, and the first of bonding apparatus itself Random number, first key operation obtain, so that the first comparison code has the identification information of first bluetooth equipment itself, second simultaneously The identification information of bluetooth equipment and the random code information of both sides.
The cryptographic calculation can be logarithm according to the algorithm verified, such as redundancy check algorithm etc., it is possible to understand that It is that should not be construed as limited to this, can also includes the algorithm that other pairs of data carry out cryptographic calculation.
Equally, same to carry out the second calculating for comparing code in the second bluetooth equipment to be paired, described second compares code Calculating according to the first random number, the first key that receive, the second random number and the second key of the second bluetooth equipment, root It is calculated according to preset Encryption Algorithm.The Encryption Algorithm used in two bluetooth equipments is identical.
In step S204, the comparison code for receiving user's input confirms instruction, to first bluetooth equipment and described the Two bluetooth equipments are carried out using data interaction.
Since the first comparison code is the generated according to second random number, the second key and the equipment that receive First key that one random number and equipment prestore, which encrypts, to be generated, and the second comparison code be according to described first received with The second key encryption that the second random number and equipment that machine number, first key and equipment generate prestore generates, and makes Encryption Algorithm is identical.Therefore, when data exchange does not malfunction, then the first comparison code generated is compared with the second of generation Code is identical.
When judgement first compare code and second than code difference when, then illustrate that the equipment currently connected is not received by correctly Data, possible current data communication error, or connected for illegal user, therefore the preliminary connection that automatic disconnection is current, reduce number According to the risk of leakage.
When the first comparison code with second compare code it is identical when, by the output comparison code, for example show the comparison code, Or play compare code voice signal, with the second bluetooth equipment output second compare code it is identical when, input validation instruction, then It can complete the pairing to second bluetooth equipment.
The embodiment of the present invention on the basis of example 1, has been further specifically introduced through the preliminary connection exchange two The key of a equipment and the random number of generation are added received key, random number and the key of itself and random number Close operation obtains comparing code, and the comparison code by comparing two equipment is identical to complete the pairing to bluetooth equipment, due to The equipment of pairing automatically generates comparison code by encrypting the data of exchange after exchange data, and third party's illegality equipment cannot generate Corresponding comparison code, thus be conducive to improve the safety of device pairing, reduce the risk of leaking data.
Embodiment three:
Fig. 2 shows the implementation processes of the matching method of the bluetooth equipment of second embodiment of the invention offer, and details are as follows:
In step S301, the first bluetooth equipment establishes tentatively connecting based on justwork mode with the second bluetooth equipment It connects.
In step s 302, the first random number of generation and the first key prestored are sent to by the first bluetooth equipment Two bluetooth equipments, and receive the second random number that second bluetooth equipment generates and second bluetooth equipment prestores the Two keys.
In step S303, the first bluetooth equipment is according to preset Encryption Algorithm, to second random number, first close Key, the second key carry out cryptographic calculation, generate the first secret value.
Specifically, first secret value, according to receive the second random number, the second key, bonding apparatus itself First key is calculated.
In step s 304, the first bluetooth equipment by the second secret value of first secret value and the second bluetooth equipment into Row compares, and second secret value encrypts the second random number, first key, the second key according to preset Encryption Algorithm It calculates and generates.
According to the calculation of the first secret value, the second secret value is calculated in the second bluetooth equipment.
In step S305, if the first secret value is different from the second secret value, the preliminary connection is disconnected.
By by the first secret value compared with the second secret value, it can be determined that whether the data currently transmitted correct, i.e., Judge whether equipment has received correct key data, and the correctly value of random number.
If the first secret value and the second secret value are different, then it represents that received key or random number data error, then Preliminary connection can be directly disconnected, terminates this time to match, avoids establishing connection with illegality equipment.
In step S306, if the first secret value is identical as the second secret value, according to the first random number of generation with And the first key prestored and received second random number, the second key carry out cryptographic calculation, obtain the first comparison Code, output compares code respectively on first bluetooth equipment and second bluetooth equipment.
In step S307, the comparison code for receiving user's input confirms instruction, to first bluetooth equipment and described the Two bluetooth equipments are carried out using data interaction.
The embodiment of the present invention and embodiment one the difference is that, the embodiment of the present invention be compared code compare compared with Before, it further include the judgment step to transmission data, by comparing the first secret value and the second secret value, it can be determined that data transmission It is whether accurate, to provide safety guarantee for the judgement of subsequent comparison code.
Example IV:
Fig. 4 shows the implementation process of the matching method of the bluetooth equipment of third embodiment of the invention offer, and details are as follows:
In step S401, the first bluetooth equipment establishes tentatively connecting based on justwork mode with the second bluetooth equipment It connects.
In step S402, the first random number of generation and the first key prestored are sent to by the first bluetooth equipment Two bluetooth equipments, and receive the second random number that second bluetooth equipment generates and second bluetooth equipment prestores the Two keys.
In step S403, the first bluetooth equipment according to the first random number of generation and the first key prestored, and Received second random number, the second key carry out cryptographic calculation, obtain the first comparison code.
In step s 404, it is compared according to the first comparison code and the second bluetooth equipment is calculated second being calculated Code compares, and completes pairing according to comparison result or disconnects.
Step S401-S404 and step S201-S204 in embodiment one are essentially identical, so here is no more repetition.
In step S405, if the first bluetooth equipment and the second bluetooth equipment are completed to match, the first bluetooth equipment pair First comparison code and the second key are encrypted, and are obtained third and are compared code, and third comparison code is stored and is sent to institute State the storage of the second bluetooth equipment.
In embodiments of the present invention, further including the first bluetooth equipment compares the further computations of code to first, by the One compares code and the second key progress cryptographic calculation, obtains third and compares code.The method of the cryptographic calculation can previous existence therewith The Encryption Algorithm for comparing code at the first comparison code and second is identical, can also be different.
The third, which compares code, to be generated after the completion of two bluetooth equipments match, and therefore, can pass through the number after pairing According to interface channel, third comparison code is sent to equipment to be paired.
Certainly, the third compares code and can also be generated by calculating in second bluetooth equipment.
In step S406, when the first bluetooth equipment carries out again with the second bluetooth equipment using data interaction, compare Whether the third comparison code of storage is identical, if identical, completes to match.
Code is compared storing third, the connection for having built up pairing before the two equipment is indicated, therefore, when two The equipment that third having the same compares code is needed again with clock synchronization, it is only necessary to which whether searching third, to compare code identical, if phase Together, then pairing can be done directly.
It can store one or more third in the bluetooth equipment and compare code.So as to highly efficient completion Matching efficiency between the bluetooth equipment of pairing.
Embodiment five:
Fig. 5 shows the structural schematic diagram of the contrast means of the bluetooth equipment of fourth embodiment of the invention offer, is described in detail such as Under:
The contrast means of bluetooth equipment described in the embodiment of the present invention, comprising:
Preliminary connection establishment unit 501 is based on justwork for establishing the first bluetooth equipment and the second bluetooth equipment The preliminary connection of mode;
Data outputting unit 502, for exporting ratio respectively on first bluetooth equipment and second bluetooth equipment To code;
Comparing unit 503, for receiving the comparison code confirmation instruction of user's input, to first bluetooth equipment and described Second bluetooth equipment is carried out using data interaction.
Preferably, described device further includes data exchange unit or pre-storing unit, the data exchange unit be used for by First bluetooth equipment is sent to second bluetooth equipment than information on the code, and the pre-storing unit is used for described first The comparison code is previously stored in bluetooth equipment and the second bluetooth equipment, wherein the data exchange unit includes:
First transmission sub-unit, the comparison code for will be pre-stored in the first bluetooth equipment are sent to the second bluetooth equipment;
Alternatively, the second transmission sub-unit, for generating the comparison code at random by the first bluetooth equipment, and will generate at random Comparison code be sent to the second bluetooth equipment;
Alternatively, third transmission sub-unit, compares the code factor for being generated by the first bluetooth equipment, by the comparison code factor It is sent to the second bluetooth equipment, is handled and is compared according to calculation preset in the first bluetooth equipment and the second bluetooth equipment Code, wherein described includes comparing the code factor for pre-set data, the data perhaps generated at random or pre-set Data and the data generated at random.
Preferably, the third comparing subunit includes:
Data exchange module, for being sent out the first random number of generation and the first key prestored by the first bluetooth equipment It send to the second bluetooth equipment, and receives the second random number that second bluetooth equipment generates and second bluetooth equipment is pre- The second key deposited;
Computing module, for by the first bluetooth equipment according to the first random number of generation and the first key prestored, with And received second random number, the second key carry out cryptographic calculation, obtain the first comparison code and the second bluetooth equipment root The second random number according to generation and the second key and received first random number and first key that prestore, obtain second Compare code.
Preferably, described device further include:
Encrypting module, for by the first bluetooth equipment according to preset Encryption Algorithm, to second random number, first close Key, the second key carry out cryptographic calculation, generate the first secret value;
Comparison module, it is described for first secret value to be compared with the second secret value of the second bluetooth equipment Second secret value carries out the second random number, first key, the second key according to preset Encryption Algorithm by the second bluetooth equipment Computations generate;
If judgment module disconnects the preliminary connection different from the second secret value for the first secret value, if the One secret value is identical as the second secret value, then cryptographic calculation generates first and compares code.
Preferably, described device further include:
Transmission unit is encrypted, if completing to match for the first bluetooth equipment and the second bluetooth equipment, is set by the first bluetooth It is standby that first comparison code and the second key are encrypted, it obtains third and compares code, and third comparison code is stored and sent It is stored to second bluetooth equipment;
Display unit, for when the first bluetooth equipment carries out again with the second bluetooth equipment using data interaction, directly The third of output storage compares code.
The contrast means of bluetooth equipment described in the embodiment of the present invention, the pairing with bluetooth equipment described in embodiment one to three Method is corresponding, so here is no more repetition.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only Only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can be tied Another system is closed or is desirably integrated into, or some features can be ignored or not executed.Another point, it is shown or discussed Mutual coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or logical of device or unit Letter connection can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the present invention Portion or part.And storage medium above-mentioned include: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), Random access memory (RAM, Random Access Memory), magnetic or disk etc. be various to can store program code Medium.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.

Claims (9)

1. a kind of method that bluetooth equipment matches safely, which is characterized in that the described method includes:
First bluetooth equipment and the second bluetooth equipment establish the preliminary connection based on justwork mode;
Output compares code respectively on first bluetooth equipment and second bluetooth equipment;
The comparison code for receiving user's input confirms instruction, applies to first bluetooth equipment and second bluetooth equipment Data interaction;
Before output compares code step respectively on first bluetooth equipment and second bluetooth equipment, the method is also wrapped It includes first bluetooth equipment to send to second bluetooth equipment than information on the code, or in first bluetooth equipment and the The comparison code is previously stored in two bluetooth equipments, wherein first bluetooth equipment is sent to second bluetooth equipment Comparing code information Step includes:
The comparison code being pre-stored in the first bluetooth equipment is sent to the second bluetooth equipment;
Alternatively, generating the comparison code at random by the first bluetooth equipment, and the comparison code generated at random is sent to the second bluetooth Equipment;
Alternatively, the first bluetooth equipment, which generates, compares the code factor, the comparison code factor is sent to the second bluetooth equipment, according to the Preset calculation, which handles to obtain, in one bluetooth equipment and the second bluetooth equipment compares code, wherein the comparison code factor is Pre-set data, the data perhaps generated at random or pre-set data and the data generated at random.
2. method according to claim 1, which is characterized in that first bluetooth equipment, which generates, compares the code factor, will be described It compares the code factor and is sent to the second bluetooth equipment, at calculation preset in the first bluetooth equipment and the second bluetooth equipment Reason obtains comparing code step
First random number of generation and the first key prestored are sent to the second bluetooth equipment by the first bluetooth equipment, and are received The second key that the second random number and second bluetooth equipment that second bluetooth equipment generates prestore;
First bluetooth equipment is according to the first random number of generation and the first key prestored and received described second random Number, the second key carry out cryptographic calculation, obtain the first comparison code and the second bluetooth equipment according to the second random number of generation with And the second key and received first random number and first key prestored, obtain the second comparison code.
3. method according to claim 2, which is characterized in that in first bluetooth equipment according to the first random number of generation And the first key prestored and received second random number, the second key carry out cryptographic calculation, obtain the first comparison Before code step, the method also includes:
First bluetooth equipment encrypts second random number, first key, the second key according to preset Encryption Algorithm Operation generates the first secret value;
First secret value is compared with the second secret value of the second bluetooth equipment, second secret value is by the second indigo plant Tooth equipment carries out computations generation to the second random number, first key, the second key according to preset Encryption Algorithm;
If the first secret value is different from the second secret value, the preliminary connection is disconnected, if the first secret value and second adds Close value is identical, then cryptographic calculation generates first and compares code.
4. method according to claim 2, which is characterized in that instruction is confirmed in the comparison code of the reception user input, it is right First bluetooth equipment and second bluetooth equipment carry out after applying data interaction step, the method also includes:
If the first bluetooth equipment and the second bluetooth equipment are completed to match, the first bluetooth equipment compares code and the second key to first It is encrypted, obtains third and compare code, and third comparison code is stored and is sent to second bluetooth equipment and is stored;
When the first bluetooth equipment carries out again with the second bluetooth equipment using data interaction, the third of storage is directly exported Compare code.
5. a kind of device that bluetooth equipment matches safely, which is characterized in that described device includes:
Preliminary connection establishment unit, for establishing the first bluetooth equipment and the second bluetooth equipment based on justwork mode Preliminary connection;
Data outputting unit, for output to compare code respectively on first bluetooth equipment and second bluetooth equipment;
Comparing unit, for receiving the comparison code confirmation instruction of user's input, to first bluetooth equipment and second indigo plant Tooth equipment is carried out using data interaction;
Described device further includes data exchange unit or pre-storing unit, and the data exchange unit is used for by first bluetooth Equipment is sent to second bluetooth equipment than information on the code, and the pre-storing unit is used in first bluetooth equipment and the The comparison code is previously stored in two bluetooth equipments, wherein the data exchange unit includes:
First transmission sub-unit, the comparison code for will be pre-stored in the first bluetooth equipment are sent to the second bluetooth equipment;
Alternatively, the second transmission sub-unit, for generating the comparison code, and the ratio that will be generated at random at random by the first bluetooth equipment Second bluetooth equipment is sent to code;
Alternatively, third transmission sub-unit, compares the code factor for being generated by the first bluetooth equipment, the comparison code factor is sent To the second bluetooth equipment, handled to obtain comparison code according to calculation preset in the first bluetooth equipment and the second bluetooth equipment, Wherein, described includes comparing the code factor as pre-set data, the data perhaps generated at random or pre-set data The data generated at random.
6. device according to claim 5, which is characterized in that the third transmission sub-unit includes:
Data exchange module, for being sent to the first random number of generation and the first key prestored by the first bluetooth equipment Second bluetooth equipment, and receive the second random number that second bluetooth equipment generates and second bluetooth equipment prestores Second key;
Computing module, for by the first bluetooth equipment according to the first random number of generation and the first key prestored, Yi Jijie Second random number of receipts, the second key carry out cryptographic calculation, obtain the first comparison code and the second bluetooth equipment according to life At the second random number and the second key and received first random number and first key that prestore, obtain the second comparison Code.
7. device according to claim 6, which is characterized in that described device further include:
Encrypting module, for by the first bluetooth equipment according to preset Encryption Algorithm, to second random number, first key, Second key carries out cryptographic calculation, generates the first secret value;
Comparison module, for first secret value to be compared with the second secret value of the second bluetooth equipment, described second Secret value encrypts the second random number, first key, the second key according to preset Encryption Algorithm by the second bluetooth equipment It calculates and generates;
If judgment module disconnects the preliminary connection different from the second secret value for the first secret value, if first adds Close value is identical as the second secret value, then cryptographic calculation generates first and compares code.
8. device according to claim 6, which is characterized in that described device further include:
Transmission unit is encrypted, if completing to match for the first bluetooth equipment and the second bluetooth equipment, by the first bluetooth equipment pair First comparison code and the second key are encrypted, and are obtained third and are compared code, and third comparison code is stored and is sent to institute State the storage of the second bluetooth equipment;
Display unit, for directly exporting when the first bluetooth equipment carries out again with the second bluetooth equipment using data interaction The third of storage compares code.
9. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as Claims 1-4 of realization the method.
CN201610073995.3A 2016-02-02 2016-02-02 The matching method and device of bluetooth equipment Active CN105554693B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610073995.3A CN105554693B (en) 2016-02-02 2016-02-02 The matching method and device of bluetooth equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610073995.3A CN105554693B (en) 2016-02-02 2016-02-02 The matching method and device of bluetooth equipment

Publications (2)

Publication Number Publication Date
CN105554693A CN105554693A (en) 2016-05-04
CN105554693B true CN105554693B (en) 2019-02-01

Family

ID=55833583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610073995.3A Active CN105554693B (en) 2016-02-02 2016-02-02 The matching method and device of bluetooth equipment

Country Status (1)

Country Link
CN (1) CN105554693B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106851540B (en) * 2017-02-08 2019-11-15 飞天诚信科技股份有限公司 A kind of implementation method and device of Bluetooth pairing
CN107071709B (en) * 2017-04-06 2021-06-08 飞天诚信科技股份有限公司 Pairing method and device with Bluetooth equipment
CN108174370B (en) * 2017-12-14 2021-10-22 北京明华联盟科技有限公司 Bluetooth secure connection method, device, terminal and computer readable storage medium
CN114403819A (en) * 2021-12-09 2022-04-29 重庆医药高等专科学校 Children's prevention exogenous warning machine

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127538A (en) * 2007-09-19 2008-02-20 中兴通讯股份有限公司 Self-adapted match method between different Bluetooth devices
CN102983892A (en) * 2012-11-19 2013-03-20 深圳市文鼎创数据科技有限公司 Method and system for bluetooth pairing
CN103067055A (en) * 2012-12-26 2013-04-24 深圳天珑无线科技有限公司 Bluetooth connecting method and mobile terminal
CN103209007A (en) * 2012-01-11 2013-07-17 中兴通讯股份有限公司 Bluetooth device quick pairing method and Bluetooth device
CN103826221A (en) * 2013-12-31 2014-05-28 广东岭南通股份有限公司 Bluetooth based encryption communication method, and correlation systems and methods
CN104158653A (en) * 2014-08-14 2014-11-19 华北电力大学句容研究中心 Method of secure communication based on commercial cipher algorithm

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127538A (en) * 2007-09-19 2008-02-20 中兴通讯股份有限公司 Self-adapted match method between different Bluetooth devices
CN103209007A (en) * 2012-01-11 2013-07-17 中兴通讯股份有限公司 Bluetooth device quick pairing method and Bluetooth device
CN102983892A (en) * 2012-11-19 2013-03-20 深圳市文鼎创数据科技有限公司 Method and system for bluetooth pairing
CN103067055A (en) * 2012-12-26 2013-04-24 深圳天珑无线科技有限公司 Bluetooth connecting method and mobile terminal
CN103826221A (en) * 2013-12-31 2014-05-28 广东岭南通股份有限公司 Bluetooth based encryption communication method, and correlation systems and methods
CN104158653A (en) * 2014-08-14 2014-11-19 华北电力大学句容研究中心 Method of secure communication based on commercial cipher algorithm

Also Published As

Publication number Publication date
CN105554693A (en) 2016-05-04

Similar Documents

Publication Publication Date Title
CN106789047B (en) A kind of block chain identification system
CN103595718B (en) A kind of POS terminal Activiation method, system, service platform and POS terminal
CN101291224B (en) Method and system for processing data in communication system
CN105790938B (en) Safe unit key generation system and method based on credible performing environment
WO2020072551A1 (en) Contactless card emulation system and method
CN105554693B (en) The matching method and device of bluetooth equipment
TW201812630A (en) Block chain identity system
CN110784322B (en) Method, system, equipment and medium for connecting gateway equipment and cloud platform
CN103338215A (en) Method for establishing TLS (Transport Layer Security) channel based on state secret algorithm
CN105722013A (en) Bluetooth pairing method and device
CN112055019B (en) Method for establishing communication channel and user terminal
CN103747012A (en) Security verification method, device and system of network transaction
US10504109B2 (en) Method for the mutual authentication of entities having previously initiated an online transaction
CN108141458B (en) Method and system for securing first contact establishment of a mobile device with a device
CN108418845A (en) Bluetooth pairing code matches Preparation Method, system, terminal, server and mobile unit
CN112769574B (en) Key injection method and system, key management system, device and machine readable medium
CN102868531A (en) Networked transaction certification system and method
CN110278083A (en) ID authentication request treating method and apparatus, equipment replacement method and apparatus
TW201601083A (en) One-time password generation method and device, authentication method and authentication system
TWI786039B (en) Offline payment method, terminal equipment, backstage payment device and offline payment system
CN114389860B (en) Voice communication method, client, server, electronic device and storage medium
CN108718237A (en) A kind of modified AKA identity authorization systems and method based on pool of symmetric keys
CN101478547A (en) Apparatus for trustable digital signature to intelligent cipher key and working method thereof
WO2019178760A1 (en) Method for transmitting key and pos terminal
CN105184558B (en) Transaction Information sending method, device and mobile terminal

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