Wireless device and its broadcasting method
Technical field
The present invention relates to the communications field more particularly to a kind of wireless devices and its broadcasting method.
Background technique
Power problems are that the portable radio machine (such as bluetooth Key) of the limited formula of charging is all the time to be solved,
Wireless device in operational mode or standby mode can constantly overseas broadcast data packet, in order to allow other wireless devices
It searches, for example is divided into 100 milliseconds (i.e. 100 milliseconds of broadcast intervals) between broadcast, power consumption is larger.Although wireless device also has switch
Mode, but user needs to be manually operated between opening mode and close pattern every time, it is more troublesome, and be also easy to forget,
Thus wireless device can be constantly in operational mode or standby mode, thus cause unnecessary power wastage.
Wireless device, which is maintained at operational mode (also referred to as working condition), larger power consumption, and in a practical situation, user
It not uses wireless device for a long time daily, but only concentrates in certain periods using wireless device.Conventional is wireless
Equipment can keep normal frequency broadcast data packet after booting, and user may not need wireless devices the most of the time
In working condition, thus this measure virtually can also have unnecessary power wastage.Although existing wireless device also has standby
Function, for example standby function is entered without using (or when transmitting for a long time without data between other wireless devices) for a long time
Can, and energy consumption can be also reduced in a manner of reducing broadcasting frequency (in the way of so-called reduction broadcasting frequency, it can be understood as extend
The broadcast interval of wireless device, that is, wireless device is not to continuously transmit data packet, and be spaced between movement of giving out a contract for a project twice identical
Time, and every time only send out a data packet), but this there are also problems, for example, reduce broadcasting frequency, every time default hair one
Data packet, recipient's (wireless device of received data packet) are easy to search in search less than (such as end of just giving out a contract for a project), can also
Can be very little due to data packet and parse or carry out packet loss processing, thus can there is a situation where without responding, this is undesirable
, it is inflexible although certain time can reduce power consumption without using entering standby this to a certain extent.
Summary of the invention
To be solved by this invention is that the prior art does not solve the wireless device of standby mode not perfectly and consumes energy high ask
Topic.
To solve the above-mentioned problems, the present invention provides a kind of broadcasting methods of wireless device, comprising the following steps:
Corresponding relationship is preset between different broadcasting schemes and different periods of the wireless device to data packet, it is variant
Period determines the use demand of wireless device based on user;
Judge the period being presently in;
Wireless device according to the period being presently in, based on preset corresponding relationship to the broadcasting scheme of data packet into
The corresponding adjustment of row.
Preferably, in corresponding relationship:
Different periods correspond to the different broadcast intervals of data packet, wherein user is smaller to wireless device use demand
Broadcast interval corresponding to period is longer, and the data packet that primary broadcast predetermined quantity is divided between broadcast broadcasts predetermined quantity to next time
Data packet between interval.
Preferably, in corresponding relationship:
Different periods quantity of giving out a contract for a project different during corresponding to the different broadcast intervals of data packet and broadcasting, wherein user
Give out a contract for a project during broadcast interval corresponding to the period smaller to wireless device use demand is longer and corresponding primary broadcast quantity
It is more.
Preferably, different periods include the first time period and the second time period, user is to wireless device in the first period
Use demand was greater than for the second period, and corresponding relationship is divided into the first corresponding relationship for being related to for the first period and was related to for the second period
The second corresponding relationship,
In the first corresponding relationship, wireless device is not received after beginning broadcast data packet from another wireless device
The duration of connection request is longer, then the broadcast interval of data packet is longer, and the number of primary broadcast predetermined quantity is divided between broadcast
According to the interval between the data packet of packet to broadcast next time predetermined quantity;
In the second corresponding relationship, wireless device is in the standby mode or closed state of not broadcast data packet.
Preferably, wireless device does not receive connection request after beginning broadcast data packet in the first corresponding relationship
Duration it is longer, then the broadcast interval of data packet is longer and quantity of giving out a contract for a project is more during once broadcasting.
Preferably, during the first period,
Before the duration is not up to preset time, with conventional rules broadcast data packet;
After the duration reaches preset time, according to the duration and based on the first corresponding relationship to the wide of data packet
The scheme of broadcasting is adjusted.
Preferably, wireless device is bluetooth Key.
The present invention also provides a kind of wireless devices, including broadcast module, are used for broadcast data packet, and wireless device also wraps
It includes:
Presetting module is configured between different broadcasting schemes and different periods of the wireless device to data packet in advance
Corresponding relationship is set, the variant period determines the use demand of wireless device based on user;
Clock lock is configured to the period that judgement is presently in;
Adjust module, be configured to according to be presently in period, based on preset corresponding relationship to data packet
Broadcasting scheme is adjusted correspondingly.
Preferably, in corresponding relationship:
Different periods correspond to the different broadcast intervals of data packet, wherein user is smaller to wireless device use demand
Broadcast interval corresponding to period is longer, and the data packet that primary broadcast predetermined quantity is divided between broadcast broadcasts predetermined quantity to next time
Data packet between interval.
Preferably, in corresponding relationship:
Different periods quantity of giving out a contract for a project different during corresponding to the different broadcast intervals of data packet and broadcasting, wherein user
Give out a contract for a project during broadcast interval corresponding to the period smaller to wireless device use demand is longer and corresponding primary broadcast quantity
It is more.
Preferably, different periods include the first time period and the second time period, user is to wireless device in the first period
Use demand was greater than for the second period, and corresponding relationship is divided into the first corresponding relationship for being related to for the first period and was related to for the second period
The second corresponding relationship,
In the first corresponding relationship, wireless device is not received after beginning broadcast data packet from another wireless device
The duration of connection request is longer, then the broadcast interval of data packet is longer, and the number of primary broadcast predetermined quantity is divided between broadcast
According to the interval between the data packet of packet to broadcast next time predetermined quantity;
In the second corresponding relationship, wireless device is in the standby mode or closed state of not broadcast data packet.
Preferably, wireless device does not receive connection request after beginning broadcast data packet in the first corresponding relationship
Duration it is longer, then the broadcast interval of data packet is longer and quantity of giving out a contract for a project is more during once broadcasting.
Preferably, during the first period,
Before the duration is not up to preset time, broadcast module is with conventional rules broadcast data packet;
After the duration reaches preset time, according to the duration and based on the first corresponding relationship to the wide of data packet
The scheme of broadcasting is adjusted.
Preferably, wireless device is bluetooth Key.
The beneficial effect of the present invention compared with the existing technology is:
1, can demand according to user to wireless device be based on preset corresponding relationship to broadcast by wireless devices data
The scheme of packet is adjusted, to adapt to different situations and save the energy consumption of wireless device;
2, during wireless device targetedly adjusts its broadcast interval according to the locating period and/or broadcasts every time
The quantity of broadcast of data packet is enabled in user to during the wireless device demand biggish period, and other wireless devices can use up
Fast discovery the machine, and in user to then enough having the function that power saving to reduce power consumption during the wireless device demand lesser period;
4, wireless device is after powering with conventional rules broadcast data packet, can make other wireless devices of surrounding to its into
Row, which is concentrated, to be searched;
5, to the wireless device demand lesser period make wireless device be in standby mode or close can not need
Manual operation just carries out further energy saving.
Detailed description of the invention
Fig. 1 is the flow chart according to the broadcasting method of the wireless device of the embodiment of the present invention;
Fig. 2 is the block diagram according to the wireless device of the embodiment of the present invention.
Specific embodiment
Of the invention is described in detail below in conjunction with attached drawing.
It, can be to surrounding broadcast data packet (also referred to as wireless signal), if deposited in ambient enviroment after wireless device booting
In other wireless devices, then data packet can be received, then data packet is parsed, to identify that this is broadcasted wireless
Equipment, and then judge whether to establish connection to carry out data transmission equal subsequent steps.
According to an embodiment of the invention, a kind of broadcasting method of wireless device is provided, as shown in Figure 1, for according to this hair
The flow chart of the broadcasting method of bright wireless device, the broadcasting method the following steps are included:
Step S1 presets corresponding pass between different broadcasting schemes and different periods of the wireless device to data packet
System, variant period can determine the use demand of wireless device based on user, wherein can be based on user to the nothing
The use demand of line equipment by one day different periods definition (or even can in one week not on the same day or middle of the month
Different weeks etc. carry out period definition) it is multiple periods defined in ladder, for example, it is defined as interval I, interval I I, interval I II,
Wherein, interval I is the early 9-11 point (assuming that period user is larger to the use demand of wireless device) of Mon-Fri, and when
Section II is the 13-18 point (assuming that period user is inferior to interval I to the use demand of wireless device) of Mon-Fri, and the period
III is other periods in addition to interval I, interval I I (assuming that when these periods user is inferior to wireless device complete with demand
Section II), corresponding to broadcasting scheme can also in ladder setting (it is main include data packet quantity of broadcast and broadcasting frequency root
Increase according to the increase of use demand, hereinafter will specifically introduce);
Step S2 judges the period being presently in, can be by being judged using the encryption lock with time clock feature, should
Encryption lock can be set in wireless device;
Step S3, wireless device according to the period being presently in, based on preset corresponding relationship to the wide of data packet
The scheme of broadcasting is adjusted correspondingly, for example, when wireless device becomes interval I II by interval I then needing that interval I will be corresponded to
Broadcasting scheme be adjusted to the broadcasting scheme corresponding to interval I II.
Different broadcasting methods is specifically introduced below based on different corresponding relationships:
Broadcasting method 1, in corresponding relationship: different periods correspond to the different broadcast intervals of data packet, wherein user couple
Broadcast interval corresponding to the wireless device use demand smaller period is longer, and the number of primary broadcast predetermined quantity is divided between broadcast
According to the interval between the data packet of packet to broadcast next time predetermined quantity.Specifically, by taking above-mentioned interval I, II, III as an example, in the period
The broadcast that the broadcast interval of data packet is less than data packet in interval I I in I is spaced and is sequentially less than data packet in interval I II
Broadcast interval.Broadcast interval is bigger, then broadcasting frequency is smaller.
Broadcasting method 2, in corresponding relationship: different periods correspond to data packet different broadcast intervals and broadcast during not
Same quantity of giving out a contract for a project, wherein broadcast interval corresponding to user's period smaller to wireless device use demand is longer and corresponding
Primary broadcast during quantity of giving out a contract for a project it is more.Specifically, by taking above-mentioned interval I, II, III as an example, data packet is wide in interval I
Give out a contract for a project broadcast interval of the quantity less than data packet in interval I I and the hair during primary broadcast during broadcasting interval and once broadcast
Packet quantity and the broadcast interval for being sequentially less than data packet in interval I II and the quantity of giving out a contract for a project during primary broadcast.
Broadcasting method 3, above-mentioned period may include the first time period and the second time period, and user is to wirelessly setting in the first period
Standby use demand was greater than for the second period, and corresponding relationship is divided into the first corresponding relationship for being related to for the first period and is related to second
The second corresponding relationship of period can set for the first period to workaday 9-17 point, other times and weekend are all set
It was set to for the second period,
In the first corresponding relationship, wireless device is not received after beginning broadcast data packet from another wireless device
The duration of connection request is longer, then the broadcast interval of data packet is longer, and the number of primary broadcast predetermined quantity is divided between broadcast
According to the interval between the data packet of packet to broadcast next time predetermined quantity;Although that is, the first period generally can busy work, but if
Occur not receiving the long-term situation of connection request, broadcast interval can also be extended, increases institute during broadcast every time
The data packet of broadcast, to save energy.
In the second corresponding relationship, wireless device is in the standby mode or closed state of not broadcast data packet.That is,
Demand in second period due to user to wireless device is smaller, thus when to period II, wireless device is adjusted to standby mode
Or closed state.It is just carried out so as to automatically close by wireless device or be placed in standby mode without manual operation
Further energy saving.
Also, in the first corresponding relationship, it can be set to wireless device and do not receive institute after beginning broadcast data packet
The duration for stating connection request is longer, then the broadcast interval of data packet is longer and quantity of giving out a contract for a project is more during once broadcasting.
In an alternative embodiment of the invention, preset time can also be set, during the first period, when the duration not
Before reaching preset time, with conventional rules broadcast data packet;After the duration reaches preset time, according to described
Duration is simultaneously adjusted based on broadcasting scheme of first corresponding relationship to the data packet.For example, it is assumed that when above-mentioned default
Between be 3 minutes, during the first period, can carry out conventional each broadcasting one within 3 minutes after wireless device booting
The form of data packet carrys out broadcast data packet, if not receiving response after 3 minutes, can start to reduce broadcast interval, and
And the data packet number broadcasted every time can be increased simultaneously.It certainly, can be with sending after wireless device receives connection request
The wireless device of the connection request is attached, to carry out required data communication.
In the above-described embodiment, wireless device is preferably bluetooth Key.
According to an embodiment of the invention, a kind of wireless device is additionally provided, as shown in Fig. 2, for according to the embodiment of the present invention
Wireless device block diagram, which includes broadcast module 21, be used for broadcast data packet, in addition, its further include:
Presetting module 22 is configured between different broadcasting schemes and different periods of the wireless device to data packet pre-
Corresponding relationship is first set, the variant period determines the use demand of wireless device based on user;
Clock lock 23 is configured to the period that judgement is presently in;
Module 24 is adjusted, is configured to according to the period being presently in, is based on preset corresponding relationship to data packet
Broadcasting scheme be adjusted correspondingly.
In one embodiment of wireless device according to the present invention, in corresponding relationship:
Different periods correspond to the different broadcast intervals of data packet, wherein user is smaller to wireless device use demand
Broadcast interval corresponding to period is longer, and the data packet that primary broadcast predetermined quantity is divided between broadcast broadcasts predetermined quantity to next time
Data packet between interval.
In one embodiment of wireless device according to the present invention, in corresponding relationship:
Different periods quantity of giving out a contract for a project different during corresponding to the different broadcast intervals of data packet and broadcasting, wherein user
Give out a contract for a project during broadcast interval corresponding to the period smaller to wireless device use demand is longer and corresponding primary broadcast quantity
It is more.
In one embodiment of wireless device according to the present invention, different periods include the first time period and the second time period,
User was greater than for the second period to the use demand of wireless device in the first period, and corresponding relationship is divided into and was related to for the first period
The first corresponding relationship and be related to the second corresponding relationship of the second period,
In the first corresponding relationship, wireless device is not received after beginning broadcast data packet from another wireless device
The duration of connection request is longer, then the broadcast interval of data packet is longer, and the number of primary broadcast predetermined quantity is divided between broadcast
According to the interval between the data packet of packet to broadcast next time predetermined quantity;
In the second corresponding relationship, wireless device may be at the standby mode or closed state of not broadcast data packet.
In one embodiment of wireless device according to the present invention, in the first corresponding relationship, wireless device is from the beginning of
The duration for not receiving connection request after broadcast data packet is longer, then the broadcast interval of data packet is longer and once broadcasts
Period quantity of giving out a contract for a project is more.
In one embodiment of wireless device according to the present invention, a preset time can be set, in the first period
Period, before the duration is not up to preset time, broadcast module is with conventional rules broadcast data packet;Reach in the duration
After preset time, it is adjusted according to the duration and based on broadcasting scheme of first corresponding relationship to data packet.
In one embodiment of wireless device according to the present invention, wireless device is bluetooth Key.
Above embodiments are only exemplary embodiment of the present invention, are not used in the limitation present invention, protection scope of the present invention
It is defined by the claims.Those skilled in the art can within the spirit and scope of the present invention make respectively the present invention
Kind modification or equivalent replacement, this modification or equivalent replacement also should be regarded as being within the scope of the present invention.