Summary of the invention
For above-mentioned Problems existing, the invention provides a kind of device pairing method and system, conveniently, accurately and reliably to realize the pairing connection between terminal equipment.
The invention provides a kind of device pairing method, comprising:
Described in first terminal equipment Inspection, whether the socket of first terminal equipment is inserted with the plug of the second terminal equipment;
If be inserted with the plug of described second terminal equipment, the then pairing transmission channel of described first terminal equipment by being formed between described socket and described plug, send unpaired message to described second terminal equipment, described unpaired message comprises the identification information of described first terminal equipment;
Described second terminal equipment is according to the identification information of described first terminal equipment, and adopt wireless transmission method to send pairing request to described first terminal equipment, described pairing request comprises the identification information of described second terminal equipment;
Described first terminal equipment adopts described wireless transmission method to send pairing response to described second terminal equipment, completes the pairing with described second terminal equipment.
The invention provides a kind of device pairing system, comprising: first terminal equipment and the second terminal equipment;
Described first terminal equipment comprises: first processor, and the socket, the first wireless transceiver and the first memory that are connected with described first processor respectively, and described socket comprises testing circuit;
Described second terminal equipment comprises: the second processor, and the plug be connected with described second processor respectively and the second wireless transceiver;
Whether described testing circuit, be inserted with described plug for detecting described socket, and detect be inserted with described plug time, send triggering signal to described first processor;
Described first processor, for after receiving described triggering signal, by the pairing transmission channel formed between described socket and described plug, send unpaired message to described second processor, described unpaired message comprises the identification information of described first terminal equipment;
Described second processor, for after receiving described unpaired message, according to the identification information of described first terminal equipment, control described second wireless transceiver and send pairing request to described first terminal equipment, described pairing request comprises the identification information of described second terminal equipment;
Described first wireless transceiver, for receiving described pairing request, and under the control of described first processor, sending pairing response to described second terminal equipment, completing the pairing with described second terminal equipment;
Described first memory, for storing described unpaired message.
Device pairing method and system provided by the invention, when first terminal equipment Inspection is inserted with the plug of the second terminal equipment to its socket, triggers the pairing handling process between first terminal equipment and the second terminal equipment.Specifically, first, first terminal equipment is connected formed pairing transmission channel by its socket with the plug of the second terminal equipment, sends the unpaired message comprising its device identification to the second terminal equipment; Secondly, the second terminal equipment, after receiving this unpaired message, sends pairing request by wireless transmission method to first terminal equipment; Finally, first terminal equipment sends pairing response to the second terminal equipment, connects with the pairing completed between the two.In this programme, based on above-mentioned insert action, what the second terminal equipment can be made to determine its needs pairing connection exactly is first terminal equipment, and pairing is between the two connected accurately and reliably, and user only needs to carry out above-mentioned update, simple to operation.
Embodiment
Fig. 1 is the flow chart of present device matching method embodiment one, and as shown in Figure 1, the method comprises the steps:
Described in step 101, first terminal equipment Inspection, whether the socket of first terminal equipment is inserted with the plug of the second terminal equipment, if be inserted with the plug of described second terminal equipment, then performs step 102, otherwise terminates.
In the present embodiment, for example, above-mentioned first terminal equipment is such as panel computer, and above-mentioned second terminal equipment is such as bluetooth keyboard.Certainly, above-mentioned first terminal equipment and the second terminal equipment are not limited to this citing, and such as first terminal equipment can also be mobile phone, PC, TV etc., and above-mentioned second terminal equipment can also be blue-tooth printer, bluetooth earphone etc.
What deserves to be explained is, above-mentioned first terminal equipment and the second terminal equipment both can be provided with plug, be provided with socket again, for first terminal equipment, when the plug of the second terminal equipment inserts the socket of first terminal equipment, triggering first terminal equipment performs the device pairing method in the present embodiment, contrary, if the plug of first terminal equipment inserts the socket of the second terminal equipment, then trigger the second terminal equipment and perform device pairing method in the present embodiment.
In the present embodiment, trigger the pairing processing procedure between first terminal equipment and the second terminal equipment based on above-mentioned insert action.
Concrete example, supposes above-mentioned bluetooth keyboard to be provided with a plug, is matched with the socket that panel computer is arranged.User is by inserting in the socket on panel computer the pairing connection procedure triggered between the two by the plug of this bluetooth keyboard.
Wherein, described socket can comprise any one socket in following socket:
Receiver J-Horner, USB, HDMI socket, MHL socket, lighting socket.
Accordingly, described plug comprises any one plug in the following plug coordinated with described socket:
Headset plug, USB plug, HDMI plug, MHL plug, lighting plug.
That is, the type matching of plug and socket.
Step 102, the first terminal equipment pairing transmission channel by being formed between described socket and described plug, send unpaired message to described second terminal equipment, described unpaired message comprises the identification information of described first terminal equipment.
In the present embodiment, when the plug of the second terminal equipment inserts the socket of first terminal equipment, first terminal equipment is connected based on this insertion with the second terminal equipment, and define electrical connection path between the two, this path is called pairing transmission channel.
The unpaired message carrying equipment of itself mark is sent to the second terminal equipment by this pairing transmission channel by first terminal equipment.With for example above-mentioned, the unpaired message carrying equipment of itself mark is sent to bluetooth keyboard by panel computer.
Wherein, the identification information of above-mentioned first terminal equipment is such as the MAC Address of first terminal equipment.
Optionally, key information, the service discovery information of such as first terminal equipment can also be comprised in this unpaired message.This service discovery information can be self-defining a kind of service discovery information, can be such as the Indication message that instruction second terminal equipment starts certain application.
Step 103, the second terminal equipment are according to the identification information of described first terminal equipment, and adopt wireless transmission method to send pairing request to described first terminal equipment, described pairing request comprises the identification information of described second terminal equipment.
Step 104, first terminal equipment adopt described wireless transmission method to send pairing response to described second terminal equipment, complete the pairing with described second terminal equipment.
After the second terminal equipment receives the unpaired message of first terminal equipment transmission, be different from the unpaired message above by wired pairing transmission channel transmission first terminal equipment, the second terminal equipment adopts the mode of wireless transmission to send pairing request to first terminal equipment.Described wireless transmission method comprises any one in following transmission means: bluetooth, infrared, ZigBee, WiFi.
Wherein, in above-mentioned pairing request except including the mark of the second terminal equipment, such as pairing request mark can also be comprised, this pairing request of first terminal equipment for announcement matches for request and its foundation the use be connected, and above-mentioned key information etc., carry out authentication for the second terminal equipment.
After first terminal equipment receives this pairing request, also send pairing response, to complete pairing connection establishment between the two by corresponding wireless transmission method to the second terminal equipment.
In the present embodiment, when first terminal equipment Inspection is inserted with the plug of the second terminal equipment to its socket, trigger the pairing handling process between first terminal equipment and the second terminal equipment.Specifically, first, first terminal equipment is connected formed pairing transmission channel by its socket with the plug of the second terminal equipment, sends the unpaired message comprising its device identification to the second terminal equipment; Secondly, the second terminal equipment, after receiving this unpaired message, sends pairing request by wireless transmission method to first terminal equipment; Finally, first terminal equipment sends pairing response to the second terminal equipment, connects with the pairing completed between the two.Pass through such scheme, based on above-mentioned insert action, what the second terminal equipment can be made to determine its needs pairing connection exactly is first terminal equipment, and pairing is between the two connected accurately and reliably, and user only needs to carry out above-mentioned update, simple to operation.
Fig. 2 is the flow chart of present device matching method embodiment two, as shown in Figure 2, before above-mentioned steps 103, can also comprise the steps:
Step 201, the second terminal equipment identification information to described first terminal equipment carries out format check, if verification is passed through, then performs step 202, otherwise feedback error prompting.
Optionally, can also comprise:
Step 202, the second terminal equipment store described unpaired message.
Optionally, after step 103, can also comprise:
The identification information of the second terminal equipment described in step 203, first terminal device storage.
In the present embodiment, the second terminal equipment receive that first terminal equipment sent by above-mentioned pairing transmission channel carry the unpaired message of the identification information of first terminal equipment after, also need to carry out format check to the identification information of this first terminal equipment.Such as, MAC Address is 48 bits, if the MAC Address of first terminal equipment that the second terminal equipment receives is not 48, then the second terminal equipment can think that this pairing transmission channel there occurs the problem such as packet loss, error of transmission, and verification is not passed through.If verification is not passed through, then the second terminal equipment can be conveyed through to the prompting of first terminal equipment feedback error by above-mentioned pairing, again can resend unpaired message to make first terminal equipment.
In the present embodiment, by the verification to unpaired message, ensure that the reliability that pairing connects, to match the carrying out smoothly of process.
Fig. 3 is the structural representation of present device pair system embodiment one, and as shown in Figure 3, this system comprises: first terminal equipment 1 and the second terminal equipment 2.
Wherein, first terminal equipment 1 comprises: first processor 11, and socket 12, first wireless transceiver 13 be connected with first processor 11 respectively and first memory 14, and socket 12 comprises testing circuit 121.
Second terminal equipment 2 comprises: the second processor 21, and the plug 22 be connected with the second processor 21 respectively and the second wireless transceiver 23;
Whether described testing circuit 121, be inserted with described plug 22 for detecting described socket 12, and detect be inserted with described plug 22 time, send triggering signal to described first processor 11.
Wherein, this testing circuit 121 can be such as be arranged in prior art in the socket such as receiver J-Horner, USB for detecting the testing circuit whether having external device (ED) to insert, concrete circuit forms and repeats no more.
Described first processor 11, for after receiving described triggering signal, by the pairing transmission channel formed between described socket 12 and described plug 22, send unpaired message to described second processor 21, described unpaired message comprises the identification information of described first terminal equipment 1.
Described second processor 21, for after receiving described unpaired message, according to the identification information of described first terminal equipment 1, control described second wireless transceiver 23 and send pairing request to described first terminal equipment 1, described pairing request comprises the identification information of described second terminal equipment 2.
Described first wireless transceiver 13, for receiving described pairing request, and under the control of described first processor 11, sending pairing response to described second terminal equipment 2, completing the pairing with described second terminal equipment 2.
Described first memory 14, for storing described unpaired message.
Wherein, described socket 12 comprises any one socket in following socket:
Receiver J-Horner, USB, HDMI socket, MHL socket, lighting socket;
Accordingly, described plug 22 comprises any one plug in the following plug coordinated with described socket 12:
Headset plug, USB plug, HDMI plug, MHL plug, lighting plug.
Wherein, the wireless transmission method that described first wireless transceiver 13, described second wireless transceiver 23 are supported comprise following any one:
Bluetooth, infrared, ZigBee, WiFi.
The present embodiment system may be used for the technical scheme performing embodiment of the method shown in Fig. 1, and it realizes principle and technique effect is similar, repeats no more herein.
Fig. 4 is the structural representation of present device pair system embodiment two, and as shown in Figure 4, on basis embodiment illustrated in fig. 3, described second processor 21 comprises checking circuit 211;
Described checking circuit 211, for carrying out format check to the identification information of described first terminal equipment 1.
Also comprise in described second terminal equipment 2: the second memory 24 be connected with described second processor 21, described second memory 24, for storing described unpaired message.
The present embodiment system may be used for the technical scheme performing embodiment of the method shown in Fig. 2, and it realizes principle and technique effect is similar, repeats no more herein.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that program command is relevant, aforesaid program can be stored in a computer read/write memory medium, this program, when performing, performs the step comprising said method embodiment; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.