Bluetooth equipment and communication means thereof
Technical field
The present invention relates to the communications field, particularly a kind of bluetooth equipment and communication means thereof.
Background technology
Blue-tooth communication method is the communication mode of variable bit rate, about the messaging parameter such as interval of broadcast data packet is all defined in the host-host protocol between two bluetooth equipments, this host-host protocol defines maximum and the minimum value at the interval of broadcast data packet, oneself workable parameter area can be stated from bluetooth equipment, main bluetooth equipment obtains corresponding informance from bluetooth equipment by the mode of (scan) of searching in the pre-connection under normal circumstances, then main bluetooth equipment sends connection request and (contains the information such as interFrameGap (hereinafter describing in detail) in this connection request, decided in its sole discretion by main bluetooth equipment), reply from bluetooth equipment, now, just establish bluetooth between the two to connect.At main bluetooth equipment with from after carrying out bluetooth connection between bluetooth equipment, when upgrading Connecting quantity from bluetooth equipment request, main bluetooth equipment response, then main bluetooth equipment sends the request of undated parameter, thus reaches the host-host protocol between the two realized by bluetooth.Main bluetooth equipment and between bluetooth equipment without during data communication by sending empty bag (NULL packet, wherein, empty bag does not have payload (payload, also can be described as load) and be only made up of channel access code (channel access code) and packet header, its total length is 126bit, and empty bag need not confirm) remain long and connect and (also can be called that dimension is lived, keep alive), there are settings in Bluetooth transmission protocol (setting the delivery plan about packet between two bluetooth equipments in this agreement) between two bluetooth equipments, the transmission interval that this value controls for maintaining the long sky bag connected (also can be described as interFrameGap (the Interframe Space between every two Frames maintaining connection, namely, the time interval between two continuous print bags in same channel indexes (channel index))), and during the long connection of maintenance, between two bluetooth equipments, the delivery plan of the empty bag of transmission adjusts in the following way: namely main bluetooth equipment sends about adjusting the notice of delivery plan extremely from bluetooth equipment, thus sent scheme is come into force between two bluetooth equipments.If there is data communication afterwards between main frame and equipment, then both sides can send data packets to each other to carry out data communication.And if there is no data communication between main frame and equipment, then main frame can send empty bag to equipment with fixed intervals (about 100ms), equipment can feed back one, main frame sky bag (usual equipment receive main frame be less than in 400 μ s times after the sky bag sent out feed back) indication equipment is online, wherein, in empty bag, there is link control message (link control information), in this way, long connection can be maintained under without the state of data communication between main frame and equipment.
Owing to sending empty bag with fixed intervals without data communication during keeping connecting between main frame and equipment in prior art, and the transmission interval of empty bag is less, therefore between two bluetooth equipments, the power consumption of bluetooth equipment is larger without data communication and when keeping connection.
Summary of the invention
To be solved by this invention be in prior art between bluetooth equipment without data communication time, the problem that too consumes energy of method of the maintenance link validity provided.
In order to solve the problem, the invention provides the communication means between a kind of bluetooth equipment, it comprises the following steps:
Between bluetooth equipment, keep the various durations that connects to send during keeping connecting between the different delivery plans that wrap of sky between bluetooth equipment preset corresponding relation without data communication without data communication;
During keeping stop data communication between bluetooth equipment after connecting, record is without the duration of data communication;
According to the recorded duration between bluetooth equipment without data communication and the delivery plan sending empty bag during keeping connecting adjust accordingly based on the corresponding relation preset.
As preferably, in corresponding relation: the difference that the different duration corresponds to empty bag sends interval, wherein, the sky bag transmission interval of duration longer correspondence is longer, sends to be spaced apart to send empty interval of unwrapping the beginning from once sending empty end-of-packet to next time.
As preferably, communication means comprises:
Setting Preset Time;
When the duration of recording is less than Preset Time, that consults time between bluetooth equipment to connect sends empty bag in the mode of the empty bag of fixed intervals transmission;
After the duration of record is greater than Preset Time,, according to the recorded duration, the delivery plan sending empty bag between bluetooth equipment to be adjusted accordingly based on the corresponding relation preset during keeping connecting without data communication between bluetooth equipment.
As preferably, above-mentioned communication means also comprises:
Setting dwell time,
Then after the recorded duration reaches dwell time, no longer keep between bluetooth equipment connecting.
As preferably, above-mentioned communication means also comprises:
When restarting data communication stop data communication between bluetooth equipment after, the mode of the transmission packet consulted during to connect transmits packet.
As preferably, bluetooth equipment comprises main bluetooth equipment and from bluetooth equipment, wherein, main bluetooth equipment and between bluetooth equipment without data communication and the delivery plan sending empty bag during keeping connecting adjust as follows:
Send the request of change delivery plan to main bluetooth equipment from bluetooth equipment, main bluetooth equipment response is from bluetooth equipment.
Present invention also offers a kind of bluetooth equipment, comprising:
Presetting module, it to be configured between bluetooth equipment without data communication and to keep the various durations that connects to send during keeping connecting between different delivery plans that sky wraps between bluetooth equipment preset corresponding relation without data communication;
Logging modle, it records the duration without data communication during keeping connecting after being configured to stop data communication between bluetooth equipment;
Adjusting module, its be configured to duration of recording according to logging modle between bluetooth equipment without data communication and the corresponding relation that the delivery plan sending empty bag during keeping connecting presets based on presetting module adjust accordingly.
As preferably, in corresponding relation: the difference that the different duration corresponds to empty bag sends interval, wherein, the sky bag transmission interval of duration longer correspondence is longer, sends to be spaced apart to send empty interval of unwrapping the beginning from once sending empty end-of-packet to next time.
As preferably, presetting module is also for setting Preset Time;
Bluetooth equipment also comprises:
Sending module, it is configured to when the duration of logging modle record is less than Preset Time, and that consults during to connect sends empty bag in the mode of the empty bag of fixed intervals transmission;
Also it is configured to after the duration of logging modle record is greater than Preset Time adjusting module,, according to the recorded duration, the delivery plan sending empty bag between bluetooth equipment to be adjusted accordingly based on the corresponding relation preset during keeping connecting without data communication between bluetooth equipment.
As preferably, presetting module is also configured to set dwell time,
Communicator also comprises:
Interrupt link block, its duration being configured to record in logging modle makes no longer to keep between bluetooth equipment connecting after reaching dwell time.
As preferably, when adjusting module restarts data communication after being also configured to stop data communication between bluetooth equipment, the mode of the transmission packet consulted during to connect transmits packet.
The present invention is relative to the beneficial effect of prior art:
1, can according between bluetooth equipment without data communication and keep connect various durations adjust based on the delivery plan of the corresponding relation preset to the sky bag between them, thus adapt to different situations and save the energy consumption of bluetooth equipment, send request raising frame period by equipment and reduce emitting times, reduce power consumption;
2, reach dwell time without the duration of data communication between bluetooth equipment after, then make no longer to keep between bluetooth equipment connecting, be conducive to further energy efficient, avoid unnecessary sky bag transmission.
Accompanying drawing explanation
Fig. 1 be according to the bluetooth equipment of the embodiment of the present invention between the flow chart of communication means;
Fig. 2 is the block diagram of the bluetooth equipment according to the embodiment of the present invention.
Embodiment
Be described in detail of the present invention below in conjunction with accompanying drawing.
It (also can be server that bluetooth equipment can comprise main bluetooth equipment, i.e. service) and (also can be from equipment from bluetooth equipment, i.e. slave), wherein, main bluetooth equipment and between bluetooth equipment without data communication and the delivery plan sending empty bag during keeping connecting adjust as follows: the request sending change delivery plan from bluetooth equipment to main bluetooth equipment, main bluetooth equipment response is from bluetooth equipment.Set up blue teeth wireless connection between two bluetooth equipments after, can carry out radio communication between bluetooth equipment, when normal data communication state, the modules of bluetooth equipment all normally works.And when there is no data communication and keep connecting between two bluetooth equipments, then according to embodiments of the invention, provide the communication means between a kind of bluetooth equipment, be in particular and between bluetooth equipment, do not carry out data communication and the communication means adjusting empty bag transmission means after keeping connecting, as shown in Figure 1, for the flow chart according to the communication means between the bluetooth equipment of the embodiment of the present invention, this communication means comprises the following steps:
Step S1, keeps the various durations that connects to send during keeping connecting between the different delivery plans that wrap of sky between bluetooth equipment preset corresponding relation without data communication without data communication between bluetooth equipment.According to an embodiment of the invention, delivery plan can and sky bag different transmission intervals be correlated with, preferably, in described corresponding relation: the difference that the different duration corresponds to empty bag sends interval, wherein, the transmission interval of the sky bag of duration longer correspondence is longer, wherein, sends and is spaced apart from once sending empty end-of-packet to the empty interval of unwrapping the beginning of transmission next time.Certainly this corresponding relation can be set according to different demand by user.
Step S2, the duration without data communication between bluetooth equipment is recorded during connecting without maintenance after data communication between bluetooth equipment, namely the time that this step records can be the empty delivery plan form the basis of wrapping of adjustment, such as when the recorded duration more than 10min/30min (or other user preset fixed duration) time, jump to step S3;
Step S3, according to the recorded duration between bluetooth equipment without data communication and the delivery plan sending empty bag during keeping connecting adjust accordingly based on the corresponding relation preset, that is, the transmission interval of the correspondingly empty bag of adjustment.After technical scheme of the present invention is mainly devoted to connect between bluetooth equipment, without data communication and keep connect during, from bluetooth equipment can according between bluetooth equipment without transfer of data and keep connect duration based on preset corresponding relation the empty bag delivery plan between them is adjusted, namely, send the request of the empty bag delivery plan of change can initiatively to main bluetooth equipment from bluetooth equipment, so that the transmission interval of sky bag is extended, after main bluetooth equipment response, just the empty bag delivery plan between bluetooth equipment can be changed, thus adapt to different situations and save the energy consumption of bluetooth equipment.
In a preferred embodiment, communication means according to the present invention comprises: first set a Preset Time by user; From there is no data communication between bluetooth equipment and main bluetooth equipment and duration of recording is less than Preset Time during keeping connecting time, the mode sending empty bag with fixed intervals of consulting time between bluetooth equipment to connect sends empty bag; After the duration of above-mentioned record is greater than Preset Time, between bluetooth equipment without data communication and keep connect during, the delivery plan sending empty bag between bluetooth equipment is adjusted accordingly based on the corresponding relation preset from bluetooth equipment according to the recorded duration, namely, initiatively can send the request of the delivery plan of the empty bag of adjustment from bluetooth equipment, only need main bluetooth equipment to reply after the requests have been received.Such as, the Preset Time of user's setting is 3 minutes, when recording without data communication stop data communication between bluetooth equipment after and keep the duration connected to be less than within 3 minutes, between bluetooth equipment, every 100ms sends an empty bag and carries out stability maintenance, if still there is no data communication after 3 minutes, then initiatively can send request the transmission interval extending empty bag from bluetooth equipment.
Certainly, when restarting data communication stop data communication between bluetooth equipment after, the mode of the transmission packet consulted during to connect transmits packet.In addition, in practice, also may there will be between bluetooth equipment and not need to carry out transfer of data, and user have forgotten bluetooth equipment is in the possibility that thus connection status does not close Bluetooth function in time, therefore, communication means according to another embodiment of the invention can also comprise: according to the requirements set dwell time of user, the duration of then recording during connecting without maintenance after data communication between bluetooth equipment no longer keeps between bluetooth equipment connecting after reaching this dwell time.Thus be conducive to further energy efficient, avoid unnecessary sky bag transmission.Such as, dwell time set by user is 40 minutes, when keeping duration of connecting more than 40 minutes without data communication, then make no longer to keep between bluetooth equipment to connect, then need link re-establishment between bluetooth equipment as data communication need be carried out again between bluetooth equipment.
According to a specific embodiment of the communication means between bluetooth equipment of the present invention, default several continued time value (such as, 10min, 30min, 50min) can be carried out to bluetooth equipment, set up the connection of normal bluetooth between bluetooth equipment after; Carry out determining step, when in 10min without data communication time, low-power consumption mode is automatically switched to from bluetooth equipment, send request the transmission interval extending empty bag to main bluetooth equipment simultaneously, when after a period of time (such as 20min, namely altogether 30min without data communication) also there is no the words of data communication, send request to main bluetooth equipment the transmission interval reducing empty bag more further again from bluetooth equipment, if there is data communication, then the mode of the transmission packet consulted time to connect transmits packet.If but long-time (such as 50min) is without data communication, then the bluetooth that can disconnect between bluetooth equipment connects.
According to embodiments of the invention, additionally providing a kind of bluetooth equipment, as shown in Figure 2, is the block diagram of the bluetooth equipment according to the embodiment of the present invention.This bluetooth equipment mainly comprises:
Presetting module 21, it to be configured between bluetooth equipment without data communication and to keep the various durations that connects to send during keeping connecting between different delivery plans that sky wraps between bluetooth equipment preset corresponding relation without data communication;
Logging modle 22, it records the duration without data communication during keeping connecting after being configured to stop data communication between bluetooth equipment;
Adjusting module 23, its be configured to duration of recording according to logging modle 22 between bluetooth equipment without data communication and the corresponding relation that the delivery plan sending empty bag during keeping connecting presets based on presetting module 21 adjust accordingly.
In a preferred embodiment, in described corresponding relation: the difference that the different duration corresponds to empty bag sends interval, wherein, the sky bag transmission interval of duration longer correspondence is longer, wherein, transmission is spaced apart and sends empty interval of unwrapping the beginning from once sending empty end-of-packet to next time.According to technical scheme of the present invention, presetting module 21 is also for setting Preset Time; And bluetooth equipment also comprises: sending module (not shown), when its duration being configured to record in logging modle 22 is less than Preset Time, that consults during to connect sends empty bag in the mode of the empty bag of fixed intervals transmission; After the duration that adjusting module 23 is also configured to record in logging modle 22 is greater than Preset Time,, according to the recorded duration, the delivery plan sending empty bag between bluetooth equipment to be adjusted accordingly based on the corresponding relation preset during keeping connecting without data communication between bluetooth equipment.
In addition, presetting module 21 can also set dwell time, then bluetooth equipment can also comprise:
Interrupt link block (not shown), its duration being configured to record in logging modle 22 makes no longer to keep between bluetooth equipment connecting after reaching described dwell time.
When adjusting module 23 restarts data communication after being also configured to stop data communication between bluetooth equipment, the mode of the transmission packet consulted during to connect transmits packet.
Above embodiment is only exemplary embodiment of the present invention, and be not used in restriction the present invention, protection scope of the present invention is defined by the claims.Those skilled in the art can in essence of the present invention and protection range, and make various amendment or equivalent replacement to the present invention, this amendment or equivalent replacement also should be considered as dropping in protection scope of the present invention.