Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of Bluetooth communication method, the method can effectively reduce bluetooth equipment switch between multiple terminal equipment communication time handover delay.
In order to achieve the above object, the technical scheme that the present invention proposes is:
A kind of Bluetooth communication method, comprising:
Be stored on a key server by the session key of bluetooth equipment in advance, described key server is arranged in the addressable network of terminal equipment;
After described terminal equipment starts, if this terminal does not preserve the active session key of described bluetooth equipment, then from described key server, obtain described session key, and when with described bluetooth devices, utilize described session key to carry out communication encryption.
In sum, the Bluetooth communication method that the present invention proposes, utilize the session key be pre-stored on key server, the session key with bluetooth devices can be obtained from this server after terminal equipment is started, do not need when such bluetooth equipment switches between terminal equipment to perform session key agreement process again, thus can effectively reduce bluetooth equipment switch between multiple terminal equipment communication time handover delay.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, the present invention is described in further detail below in conjunction with the accompanying drawings and the specific embodiments.
Core concept of the present invention is: utilize terminal equipment a key server in a network preserve the session key of Bluetooth communication equipment, terminal equipment obtains this session key after starting from this server.So, the process of session key of all will holding consultation when not needing at every turn to switch, thus can reduce bluetooth equipment switch between multiple terminal equipment communication time handover delay.
Fig. 1 is the schematic flow sheet of the embodiment of the present invention one, and as shown in Figure 1, this embodiment mainly comprises:
Step 101, be stored on a key server by the session key of bluetooth equipment in advance, described key server is arranged in the addressable network of terminal equipment.
This step, for the session key of bluetooth equipment is stored in advance in a key server, obtains from server so that terminal equipment is direct after starting.Here, key server can be the arbitrary server in terminal equipment addressable network, that is, as long as the server that terminal equipment can be accessed.
In actual applications, described session key can adopt and arrange when bluetooth equipment dispatches from the factory in advance, or the mode by consulting with terminal after dispatching from the factory is arranged.Preferably, following method can be adopted to realize:
Method one, described terminal equipment adopt the mode of consulting with described bluetooth equipment in advance, determine described session key, and are kept on described key server by the relative index identification information of described session key and correspondence.
Here, described relative index identification information can comprise the identification information of the server log account information of described terminal equipment, user totem information and/or described bluetooth equipment, can think any combination of above-mentioned three.
Particularly, the identification information of bluetooth equipment can be device id, MAC Address, unique sequence numbers or other self-defining there is uniquely identified information.
Method two, configure corresponding session key at the described bluetooth equipment Shi Weiqi that dispatches from the factory, in advance the described session key of the identification information of described bluetooth equipment and correspondence thereof is kept in described key server.
Method three, configure corresponding session key and server login account at the described bluetooth equipment Shi Weiqi that dispatches from the factory, in advance the described session key of described server log account and correspondence thereof is kept in described key server.
In method three, be utilize server log account and Session key establishment corresponding relation, like this, with server log account for index entry, corresponding session key can be obtained later.That is, in subsequent step, when terminal equipment needs to obtain session key from key server, according to the server log account of terminal equipment, corresponding session key can be got.
Step 102, after described terminal equipment starts, if this terminal does not preserve the active session key of described bluetooth equipment, then from described key server, obtain described session key, and when with described bluetooth devices, utilize described session key to carry out communication encryption.
In this step, after terminal equipment starts, need to detect the current active session key whether saving bluetooth equipment, if do not had, then need to obtain from server, to use when being after this connected with bluetooth equipment.
Adopt said method, do not need all will carry out key agreement when bluetooth equipment switches communication between multiple terminal equipment at every turn, thus can handover delay be reduced.
Preferably, in order to increase fail safe, can be dynamic key by session cipher key configuration, namely the term of validity of session key is set, when the term of validity arrives, for it consults new key.Particularly, following method can be adopted to realize this purpose:
When the default term of validity of described session key expires, new session key determined through consultation by described bluetooth equipment and arbitrary described terminal equipment, and utilizes described new session key to upgrade the counterpart keys in described key server.
In said method, the term of validity length of session key can be arranged according to actual needs by those skilled in the art, does not repeat them here.
In sum, these are only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.