Summary of the invention
The embodiment of the present invention provides a kind of method of attachment and device of low-power consumption bluetooth, without the need to the master slave relation of artificial extra selection equipment, connects convenient, simplifies the complexity of user operation, improve Consumer's Experience.
The embodiment of the present invention is by the following technical solutions:
First aspect, the technical program provides a kind of method of attachment of low-power consumption bluetooth, comprises main equipment and the conversion from equipment;
Main equipment and comprising from the conversion of equipment:
A. obtain the major time slice of random-length, use the scanning of low-power consumption Bluetooth protocol from equipment as main equipment; Determine not connect with from equipment in the major time slice of random-length; Obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol; Determine not connecting with main equipment in timeslice in random-length, return step a; Or,
C. obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol; Determine not connecting with main equipment in timeslice in random-length; Obtain the major time slice of random-length, use the scanning of low-power consumption Bluetooth protocol from equipment as main equipment; Determine not connect with from equipment in the major time slice of random-length, return step c.
Its further technical scheme is, the major time slice of described acquisition random-length, uses the scanning of low-power consumption Bluetooth protocol from after equipment, also comprise as main equipment:
Determine as main equipment with connect from equipment after and interrupt, then obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol; Or,
Determine as main equipment with connect from equipment after and interrupt, then obtain the major time slice of random-length, use the scanning of low-power consumption Bluetooth protocol from equipment as main equipment.
Its further technical scheme is, described acquisition random-length from timeslice, after sending Bluetooth broadcast signal from equipment use low-power consumption Bluetooth protocol, also comprise:
Determine as interrupting after connecting from equipment and main equipment, then to obtain the major time slice of random-length, use the scanning of low-power consumption Bluetooth protocol from equipment as main equipment; Or,
Determine as interrupting after connecting from equipment and main equipment, then to obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.
Its further technical scheme is, the major time slice of described acquisition random-length, uses the scanning of low-power consumption Bluetooth protocol from after equipment, also comprise as main equipment:
If detect, at least two from equipment, the Bluetooth signal intensity from equipment is sorted, by Bluetooth signal intensity from connecting successively to weak by force.
Its further technical scheme is, the major time slice of described random-length and random-length from timeslice are all the random time sheets obtained by formula T2=((Rand () %N)+1) * T1, wherein, T1 be low-power consumption bluetooth equipment switch minimum time unit, N be greater than 1 and be less than 20 integer.
Second aspect, the technical program provides a kind of jockey of low-power consumption bluetooth, comprising:
Major time slice acquiring unit, for obtaining the major time slice of random-length, uses the scanning of low-power consumption Bluetooth protocol from equipment as main equipment;
First connects determining unit, does not connect with from equipment in the major time slice of random-length for determining;
First trigger element, for when not having with when connecting from equipment in the major time slice of random-length, triggers from timeslice acquiring unit;
From timeslice acquiring unit, for obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol;
Second connects confirmation unit, for determining not connecting with main equipment in timeslice in random-length;
Second trigger element, for when when not the connecting with main equipment in timeslice of random-length, triggers described major time slice acquiring unit.
Its further technical scheme is also comprise:
First disconnecting unit, for determine as main equipment with connect from equipment after and interrupt, then obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol; Or, for determine as main equipment with connect from equipment after and interrupt, then obtain the major time slice of random-length, use the scanning of low-power consumption Bluetooth protocol from equipment as main equipment.
Its further technical scheme is also comprise:
Second disconnecting unit, as interrupting after connecting from equipment and main equipment for determining, then obtains the major time slice of random-length, uses the scanning of low-power consumption Bluetooth protocol from equipment as main equipment; Or, for determining as interrupting after connecting from equipment and main equipment, then to obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.
Its further technical scheme is also comprise:
Signal strength signal intensity linkage unit, if for detecting that at least two from equipment, the Bluetooth signal intensity from equipment sorted, by Bluetooth signal intensity from connecting successively to weak by force.
Its further technical scheme is, random time acquiring unit, for obtained by formula T2=((Rand () %N)+1) * T1 the major time slice of described random-length and random-length from timeslice, wherein, T1 be low-power consumption bluetooth equipment switch minimum time unit, N be greater than 1 and be less than 20 integer.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought:
In the technical program, by the mode of automated randomized timeslice, equipment is taken turns as main equipment and from equipment, avoid multiple equipment simultaneously for main equipment or simultaneously for finding that the other side connects from equipment, timeslice length produces at random, then connect when equipment is recycled to and is in different master slave modes, connect convenient, simplify the complexity of user operation, improve Consumer's Experience.
Embodiment
The technical problem solved for making the present invention, the technical scheme of employing and the technique effect that reaches are clearly, be described in further detail below in conjunction with the technical scheme of accompanying drawing to the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those skilled in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Please refer to Fig. 1, it is the method flow diagram of method of attachment first embodiment of the low-power consumption bluetooth that the embodiment of the present invention provides.This low-power consumption Bluetooth connecting method comprises:
The major time slice of S100, acquisition random-length, uses the scanning of low-power consumption Bluetooth protocol from equipment as main equipment.
The major time slice of random-length is obtained by formula T2=((Rand () %N)+1) * T1, wherein, T1 be low-power consumption bluetooth equipment switch minimum time unit, N be greater than 1 and be less than 20 integer.In the present embodiment, N is preferably 10.
The major time slice of random-length is relatively short, but time span is at least and allows to be received time needed for connectivity request message by other main equipments from equipment, main equipment can search other from the time required for equipment, usually at this moment between basis extends certain hour, ensure both sides continue several times at random rear one for main equipment one for connect from the state of equipment.
S101, to determine in the major time slice of random-length to connect with from equipment.
In the major time slice of random-length, do not scan the Bluetooth signal from equipment, or the Bluetooth signal scanned lower than set point, does not then connect.
S102, obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.
Random-length the same with the major time slice acquisition methods of random-length from timeslice, repeats no more.Is random within the specific limits due to random-length from the major time slice of timeslice and random-length, so the length of timeslice is not fixed value, equipment is converted to from equipment state from master status.
S103, determine not connecting with main equipment in timeslice in random-length, return step S100.
Equipment is in does not have main equipment to connect with it from equipment state, then again scan as main equipment, so circulate in master status and between equipment state, until be main equipment or simultaneously for can connect from equipment when multiple equipment is different.Usually can automatically connect through 1-3 circulation.
To sum up, in the present embodiment, after opened bluetooth function, equipment is in master status, by the mode of automated randomized timeslice, equipment is taken turns as main equipment and from equipment, avoid multiple equipment simultaneously for main equipment or simultaneously for scanning from equipment, timeslice length produces at random, then connects when equipment is recycled to and is in different master slave modes, connects convenient, simplify the complexity of user operation, improve Consumer's Experience.
Please refer to Fig. 2, it is the method flow diagram of method of attachment second embodiment of the low-power consumption bluetooth that the embodiment of the present invention provides.Shown in the method for attachment of this low-power consumption bluetooth and Fig. 1, the difference of method is, be first in from equipment state when the method for attachment of the present embodiment low-power consumption bluetooth starts, the method for attachment of low-power consumption bluetooth comprises:
S200, obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.
S201, determine not connecting with main equipment in timeslice in random-length.
The major time slice of S202, acquisition random-length, uses the scanning of low-power consumption Bluetooth protocol from equipment as main equipment.
S203, to determine in the major time slice of random-length to connect with from equipment, return step S200.
Equipment is in master status and does not scan from equipment, or, the Bluetooth signal scanned does not connect lower than set point, then again as scanning from equipment, so circulate in master status and between equipment state, until be main equipment or simultaneously for can connect from equipment when multiple equipment is different.Usually can automatically connect through 1-3 circulation.
The major time slice acquisition methods from timeslice and random-length of random-length, with reference to method related content shown in figure 1, repeats no more herein.
To sum up, in the present embodiment, after opened bluetooth function, equipment is in from equipment state, by the mode of automated randomized timeslice, equipment is taken turns as main equipment and from equipment, avoid multiple equipment simultaneously for main equipment or simultaneously for scanning from equipment, timeslice length produces at random, then connects when equipment is recycled to and is in different master slave modes, connects convenient, simplify the complexity of user operation, improve Consumer's Experience.
Please refer to Fig. 3, it is the method flow diagram of method of attachment the 3rd embodiment of the low-power consumption bluetooth that the embodiment of the present invention provides.Be with the difference of method shown in Fig. 1 in the present embodiment, the present embodiment finds it is not need the target device connected then to handle it upon connection.
The method of attachment of this low-power consumption bluetooth comprises:
The major time slice of S300, acquisition random-length, uses the scanning of low-power consumption Bluetooth protocol from equipment as main equipment.
S301, determine as main equipment with connect from equipment after and interrupt, then obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.
When equipment is in master status, scans from equipment and connect with it, now, random time sheet stops, and really being admitted a fault by identity information after connection needs the target device of connection, and this equipment then enters from equipment state.
When carrying out identity validation after connecting, user can be clicked by touch-screen and confirm, also can be use deliberate action to carry out body sense confirmation.
S302, determine not connecting with main equipment in timeslice in random-length, return step S300.
To sum up, in the present embodiment, after opened bluetooth function, equipment is in master status, by the mode of automated randomized timeslice, equipment is taken turns as main equipment and from equipment, until multiple equipment is in different states and connects, judge that the equipment connected is not target device, then continue the circulation of random time sheet, connect convenient, simplify the complexity of user operation, improve Consumer's Experience, ensure the accuracy connected.
In the present embodiment, preferably, equipment is when being in master status, if detect, at least two from equipment, the Bluetooth signal intensity from equipment is sorted, by Bluetooth signal intensity from connecting successively to weak by force.When connect be not target device from equipment time, then disconnect and give up this Bluetooth signal from equipment, according to Bluetooth signal intensity from connecting successively to weak by force.Can a successful connection when guaranteeing aspectant user's exchange message.
Please refer to Fig. 4, it is the method flow diagram of method of attachment the 4th embodiment of the low-power consumption bluetooth that the embodiment of the present invention provides.Be with the difference of method shown in Fig. 3 in the present embodiment, the present embodiment finds it is not the target device needing to connect upon connection, then enter master status.
The method of attachment of this low-power consumption bluetooth comprises:
The major time slice of S400, acquisition random-length, uses the scanning of low-power consumption Bluetooth protocol from equipment as main equipment.
S401, determine as main equipment with connect from equipment after and interrupt, then obtain the major time slice of random-length, use the scanning of low-power consumption Bluetooth protocol from equipment as main equipment.
When equipment is in master status, scans from equipment and connect with it, now, random time sheet stops, and really being admitted a fault by identity information after connection needs the target device of connection, and this equipment then enters master status.
When carrying out identity validation after connecting, user can be clicked by touch-screen and confirm, also can be use deliberate action to carry out body sense confirmation.
S402, to determine in the major time slice of random-length to connect with from equipment.
S403, obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.
S404, determine not connecting with main equipment in timeslice in random-length, return step S400.
To sum up, in the present embodiment, after opened bluetooth function, equipment is in master status, by the mode of automated randomized timeslice, equipment is taken turns as main equipment and from equipment, until multiple equipment is in different states and connects, judge that the equipment connected is not target device, then continue the circulation of random time sheet, connect convenient, simplify the complexity of user operation, improve Consumer's Experience, ensure the accuracy connected.
Please refer to Fig. 5, it is the method flow diagram of method of attachment the 5th embodiment of the low-power consumption bluetooth that the embodiment of the present invention provides.The difference of method shown in the present embodiment and Fig. 2 is, the present embodiment finds it is not need the target device connected then to handle it upon connection.
S500, obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.
S501, determine as interrupting after connecting from equipment and main equipment, then to obtain the major time slice of random-length, use the scanning of low-power consumption Bluetooth protocol from equipment as main equipment.
When equipment be in from during equipment state and main equipment connect, now, random time sheet stop, after connection by identity information really admit a fault need connect target device, this equipment then enters master status.
When carrying out identity validation after connecting, user can be clicked by touch-screen and confirm, also can be use deliberate action to carry out body sense confirmation.
S502, to determine in the major time slice of random-length to connect with from equipment, return step S500.
To sum up, in the present embodiment, after opened bluetooth function, equipment is in from equipment state, by the mode of automated randomized timeslice, equipment is taken turns as main equipment and from equipment, until multiple equipment is in different states and connects, judge that the equipment connected is not target device, then continue the circulation of random time sheet, connect convenient, simplify the complexity of user operation, improve Consumer's Experience, ensure the accuracy connected.
Please refer to Fig. 6, it is the method flow diagram of method of attachment the 6th embodiment of the low-power consumption bluetooth that the embodiment of the present invention provides.Be with the difference of method shown in Fig. 5 in the present embodiment, the present embodiment finds it is not the target device needing to connect upon connection, then enter from equipment state.
S600, obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.
S601, determine as interrupting after connecting from equipment and main equipment, then to obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.
When equipment be in from during equipment state and main equipment connect, now, random time sheet stop, after connection by identity information really admit a fault need connect target device, this equipment then enters from equipment state.
When carrying out identity validation after connecting, user can be clicked by touch-screen and confirm, also can be use deliberate action to carry out body sense confirmation.
S602, determine not connecting with main equipment in timeslice in random-length.
The major time slice of S603, acquisition random-length, uses the scanning of low-power consumption Bluetooth protocol from equipment as main equipment.
S604, to determine in the major time slice of random-length to connect with from equipment, return step S600.
To sum up, in the present embodiment, after opened bluetooth function, equipment is in from equipment state, by the mode of automated randomized timeslice, equipment is taken turns as main equipment and from equipment, until multiple equipment is in different states and connects, judge that the equipment connected is not target device, then continue the circulation of random time sheet, connect convenient, simplify the complexity of user operation, improve Consumer's Experience, ensure the accuracy connected.
Please refer to Fig. 7, it is the method flow diagram of jockey first embodiment of the low-power consumption bluetooth that the embodiment of the present invention provides.The jockey of this low-power consumption bluetooth comprises:
Major time slice acquiring unit 10, for obtaining the major time slice of random-length, uses the scanning of low-power consumption Bluetooth protocol from equipment as main equipment;
First connects determining unit 20, does not connect with from equipment in the major time slice of random-length for determining;
First trigger element 30, for when not having with when connecting from equipment in the major time slice of random-length, triggers from timeslice acquiring unit;
From timeslice acquiring unit 40, for obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol;
Second connects confirmation unit 50, for determining not connecting with main equipment in timeslice in random-length;
Second trigger element 60, for when when not the connecting with main equipment in timeslice of random-length, triggers described major time slice acquiring unit.
The detailed content of device please refer to method described in Fig. 1 and Fig. 2, repeats no more herein.
To sum up, by the mode of automated randomized timeslice, equipment is taken turns as main equipment and from equipment after opened bluetooth function in the present embodiment, avoid multiple equipment simultaneously for main equipment or simultaneously for scanning from equipment, timeslice length produces at random, then connect when equipment is recycled to and is in different master slave modes, connect convenient, simplify the complexity of user operation, improve Consumer's Experience.
In some other embodiment, also comprise:
First disconnecting unit, for determine as main equipment with connect from equipment after and interrupt, then obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol; Or, for determine as main equipment with connect from equipment after and interrupt, then obtain the major time slice of random-length, use the scanning of low-power consumption Bluetooth protocol from equipment as main equipment.
Particularly, when using method shown in Fig. 3, the first disconnecting unit be used for determining as main equipment with connect from equipment after and interrupt, then obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.
When using method shown in Fig. 4, the first disconnecting unit be used for determining as main equipment with connect from equipment after and interrupt, then obtain the major time slice of random-length, use the scanning of low-power consumption Bluetooth protocol from equipment as main equipment.Whether the equipment connected by checking is target device, improves the accuracy of connection.
In some other embodiment, also comprise:
Second disconnecting unit, as interrupting after connecting from equipment and main equipment for determining, then obtains the major time slice of random-length, uses the scanning of low-power consumption Bluetooth protocol from equipment as main equipment; Or, for determining as interrupting after connecting from equipment and main equipment, then to obtain random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.
Particularly, when using method shown in Fig. 5, the second disconnecting unit is used for determining as interrupting after connecting from equipment and main equipment, then obtaining the major time slice of random-length, using low-power consumption Bluetooth protocol to scan from equipment as main equipment.
When using method shown in Fig. 6, the second disconnecting unit is used for determining as interrupting after connecting from equipment and main equipment, then acquisition random-length from timeslice, send Bluetooth broadcast signal as from equipment use low-power consumption Bluetooth protocol.Whether the equipment connected by checking is target device, improves the accuracy of connection.
Preferably, also comprise:
Signal strength signal intensity linkage unit, if for detecting that at least two from equipment, the Bluetooth signal intensity from equipment sorted, by Bluetooth signal intensity from connecting successively to weak by force.By by Bluetooth signal intensity from being connected successively with from equipment to weak by force, ensure once to realize when carrying out information interaction face-to-face connecting, improve joint efficiency.
Random time acquiring unit, for obtained by formula T2=((Rand () %N)+1) * T1 the major time slice of described random-length and random-length from timeslice, wherein, T1 be low-power consumption bluetooth equipment switch minimum time unit, N be greater than 1 and be less than 20 integer.The major time slice of random-length and random-length be random time sheet from timeslice.
Above content is only preferred embodiment of the present invention, and for those of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, this description should not be construed as limitation of the present invention.