Information transferring method and device based on low-power consumption bluetoothTechnical field
The present embodiments relate to internet of things field, more particularly to a kind of information transfer side based on low-power consumption bluetoothMethod and device.
Background technology
Bluetooth Low Energy wireless technology is exactly to reduce making for bluetooth equipment to greatest extent using many intellectual technology meansUse power consumption.As shown in figure 1, the system resource that existing Bluetooth Low Energy protocol stack is mainly used includes:Application layer, main frame and controlDevice processed.
Wherein, application configuration file is mainly included in application layer;Mainly include host controller interface (Host on main frameController Interface, HCI), logic link control and adapting protocol (Logical Link Control andAdaption Protocol, L2CAP) layer, safety management layer (Safety Management, SM), general-purpose accessing configuration file(Generic Access Profile, GAP) layer, attribute protocol layer (Attribute Protocol, ATT), general-purpose attribute are matched somebody with somebodyPut file (Generic Attribute profile, GATT);Mainly include physical layer (Physical on the controllerLayer, PHY), link layer (Link Layer, LL) and direct test module.
It can be seen that, in the prior art, to realize Bluetooth Low Energy protocol stack, it is still necessary to use higher system resource,Such as controller and larger internally stored program internal memory, not only increase the use cost of low-power consumption bluetooth, and are unfavorable for savingResource.
The content of the invention
The embodiment of the present invention provides a kind of information transferring method and device based on low-power consumption bluetooth, can save system moneySource.
In a first aspect, the embodiments of the invention provide a kind of information transferring method based on low-power consumption bluetooth, this method bagInclude:
Set up the low-power consumption bluetooth passage with equipment to be communicated;
Row data communication is entered by the low-power consumption bluetooth broadcast channel and the equipment to be communicated.
Second aspect, the embodiment of the present invention additionally provides a kind of information transferring method based on low-power consumption bluetooth, this methodIncluding:
Set up the low-power consumption bluetooth broadcast channel with broadcasting equipment;
Row data communication is entered by the low-power consumption bluetooth broadcast channel and the broadcasting equipment.)
The third aspect, the embodiment of the present invention additionally provides a kind of information carrying means based on low-power consumption bluetooth, the deviceIncluding:
First channel determination module, for setting up the low-power consumption bluetooth passage with equipment to be communicated;
First data transmission module, for entering line number by the low-power consumption bluetooth broadcast channel and the equipment to be communicatedAccording to communication.
Fourth aspect, the embodiment of the present invention additionally provides a kind of information carrying means based on low-power consumption bluetooth, the deviceIncluding:
Second channel sets up module, for setting up the low-power consumption bluetooth broadcast channel with broadcasting equipment;
Second data communication module, for carrying out data by the low-power consumption bluetooth broadcast channel and the broadcasting equipmentCommunication.
The embodiment of the present invention passes through the low-power consumption bluetooth by setting up the low-power consumption bluetooth passage with equipment to be communicatedBroadcast channel enters row data communication with the equipment to be communicated, and the embodiment of the present invention only needs the physical layer of system resource, partLink layer and application layer are it is achieved that and then saving system resource.
Brief description of the drawings
Fig. 1 is a kind of structure chart for system resource that prior art is provided;
Fig. 2 is a kind of flow chart for information transferring method based on low-power consumption bluetooth that the embodiment of the present invention one is provided;
Fig. 3 is a kind of flow chart for information transferring method based on low-power consumption bluetooth that the embodiment of the present invention two is provided;
Fig. 4 is a kind of flow chart for information transferring method based on low-power consumption bluetooth that the embodiment of the present invention three is provided;
Fig. 5 is a kind of flow chart for information transferring method based on low-power consumption bluetooth that the embodiment of the present invention four is provided;
Fig. 6 is a kind of structure chart for information carrying means based on low-power consumption bluetooth that the embodiment of the present invention five is provided;
Fig. 7 is a kind of structure chart for information carrying means based on low-power consumption bluetooth that the embodiment of the present invention six is provided.
Embodiment
In order that the object, technical solutions and advantages of the present invention are clearer, below in conjunction with the accompanying drawings to specific reality of the inventionExample is applied to be described in further detail.It is understood that specific embodiment described herein is used only for explaining the present invention,Rather than limitation of the invention.
It also should be noted that, for the ease of description, illustrate only in accompanying drawing part related to the present invention rather thanFull content.It should be mentioned that some exemplary embodiments are described before exemplary embodiment is discussed in greater detailInto the processing or method described as flow chart.Although operations (or step) are described as the processing of order by flow chart,It is that many of which operation can be by concurrently, concomitantly or while implement.In addition, the order of operations can be by againArrange.The processing can be terminated when its operations are completed, it is also possible to the additional step being not included in accompanying drawing.The processing can correspond to method, function, code, subroutine, subprogram etc..
Embodiment one
A kind of flow chart for information transferring method based on low-power consumption bluetooth that Fig. 2 embodiment of the present invention one is provided, this realityThe situation that example is applicable to carry out data transmission based on low-power consumption bluetooth is applied, this method can be by base provided in an embodiment of the present inventionPerformed in the information carrying means of low-power consumption bluetooth, the device can be realized by the way of software and hardware.As Fig. 2 is stated, thisThe method of embodiment is specifically included:
S101, foundation and the low-power consumption bluetooth passage of equipment to be communicated.
The executive agent of the present embodiment can be the information transfer dress provided in an embodiment of the present invention based on low-power consumption bluetoothPut, or the broadcasting equipment with Bluetooth broadcast function, for example, low-power consumption bluetooth equipment.The low-power consumption bluetooth equipment is included but notThe terminal device of low level development can be carried out by being limited to anti-loss device, intelligent light switch and remote control etc..
Accordingly, equipment to be communicated is the general communications set communicated with broadcasting equipment, for example, can be mobile wholeEnd (for example, smart mobile phone or tablet personal computer), fixed terminal (such as desktop computer) or wearable device are (for example, intelligent watch, intelligenceCan bracelet etc.) etc. had the terminal device of whole low-power consumption bluetooth protocol stack resource, can be used for as control terminalAnti-loss device, remote control and intelligent switch are controlled, so when making anti-loss device, remote control and intelligent switch, its tool is avoided the need forStandby whole low-power consumption bluetooth protocol stack resource, only possesses part low-power consumption bluetooth function, can so save anti-loss device,The hardware cost of remote control and intelligent switch.
Wherein, the equipment to be communicated, which is alternatively, possesses part low-power consumption bluetooth function and (need not possess whole low work(Consume bluetooth protocol repertory resource) terminal device, you can the equipment to carry out low level development.For example, can be opened for anti-loss device, intelligencePass, remote control etc..
A kind of optional embodiment of this step is broadcasted by the low-power consumption bluetooth broadcast channel;If it is determined thatThe device scan to be communicated is to the broadcast, it is determined that be created as with the low-power consumption bluetooth broadcast channel of the equipment to be communicatedWork(.
Specifically, broadcasting equipment by the low-power consumption bluetooth broadcast channel when being broadcasted, to ensure that data canIt is transmitted in low-power consumption bluetooth broadcast channel, the data format that broadcast message is supported using low-power consumption bluetooth is carried out at packingReason.For example, the data format that low-power consumption bluetooth is supported includes the combination of one or more of field:Lead code(Preamble), access address (access address), protocol Data Unit (Protocol Data Unit, PDU) and followRing redundancy check code (Cyclic Redundancy Check, CRC).For example shown in following table one:
Table one
Wherein, the bit of each field is represented using the hytes of octet eight, can be inserted according to Bluetooth protocol in PDU partsUseful information, such as application layer data.
Broadcasted especially by the low-power consumption bluetooth broadcast channel, the adoptable forms of broadcasting are directional broadcasting or non-Directional broadcasting.If using directional broadcasting, then carry the address of broadcasting equipment and the address of equipment to be communicated in broadcast message,Equipment to be communicated is received after the directional broadcasting message for issuing oneself, and connection request can be sent immediately as response.If adoptedBroadcasted with non-directional, then the address of a carrying broadcasting equipment in broadcast message, the address of equipment to be communicated is not carried, shows thisBroadcasting equipment can receive the connection request of other any equipment to be communicated.
S102, row data communication entered by the low-power consumption bluetooth broadcast channel and the equipment to be communicated.
A kind of optional embodiment of this step is to receive the equipment to be communicated and broadcast by the low-power consumption bluetooth to believeThe scan request message that road is sent;Wait to lead to described by the low-power consumption bluetooth broadcast channel according to the scan request messageBelieve that equipment sends scanning response message;Or, receive what the equipment to be communicated was sent by the low-power consumption bluetooth broadcast channelConnection request message;Corresponding operating is performed according to the connection request message and/or passes through the low-power consumption bluetooth broadcast channelResponse message is returned to the equipment to be communicated.
Wherein, application layer can be included in scan request message, scanning response message, connection request message, response messageData are the application layer information to be sent.The data format that above-mentioned message is supported using low-power consumption bluetooth carries out packing processing;Then the data after packing are sent to the equipment to be communicated by the low-power consumption bluetooth broadcast channel.
Specifically, broadcasting equipment is broadcasted by low-power consumption bluetooth broadcast channel at regular intervals, wherein, broadcast packetThe inside can include application layer data, and equipment to be communicated is scanned, such as successful scan to broadcast packet, then low-power consumption bluetooth broadcast letterRoad is successfully established, and equipment to be communicated sends scan request message to broadcasting equipment, and broadcasting equipment is received after scan request message, is sent outSend scanning return information to equipment to be communicated, the application layer information to be sent can be included in this scanning reply.
Or, equipment to be communicated can be by initiating connection request message to broadcasting equipment, in this connection request messageFace can include the application layer information to be sent, and after broadcasting equipment is received, according to protocol analysis connection request message, then completeCertain action.So broadcasting equipment is achieved that with equipment to be communicated only transmits information in low-power consumption bluetooth broadcast channel,In the case where not supporting whole Bluetooth Low Energy protocol stack, the transmission of control information is realized.
The present embodiment is broadcasted by setting up the low-power consumption bluetooth passage with equipment to be communicated by the low-power consumption bluetoothChannel enters row data communication with the equipment to be communicated, and the embodiment of the present invention only needs the physical layer of system resource, part of linksLayer and application layer are it is achieved that and then saving system resource.
Embodiment two
A kind of flow chart for information transferring method based on low-power consumption bluetooth that Fig. 3 embodiment of the present invention two is provided.This realityThe situation that example is applicable to carry out data transmission based on low-power consumption bluetooth is applied, this method can be by base provided in an embodiment of the present inventionPerformed in the information carrying means of low-power consumption bluetooth, the device can realize that the device can by the way of software and/or hardwareIt is integrated in a communications device or in the application end of communication equipment.Wherein, communication equipment can be but to be not limited to mobile terminal (flatPlate computer or smart mobile phone), fixed terminal (desktop computer or notebook) etc. had whole low-power consumption bluetooth protocol stack moneyThe terminal device in source, or (do not need whole low-power consumption bluetooth available for low level development part low-power consumption bluetooth functionProtocol stack resource) remote control, intelligent switch or anti-loss device in.
Wherein, application end can be the plug-in unit for some client being embedded in communication equipment, or be set for the communicationThe plug-in unit of standby operating system, with the client or logical for the information transfer based on low-power consumption bluetooth being embedded in communication equipmentBelieve that the information transfer application program based on low-power consumption bluetooth in the operating system of equipment is used cooperatively;Application end can also be instituteAn independent client that the information transfer based on low-power consumption bluetooth is provided in communication equipment is stated, the present embodiment does not enter to thisRow limitation.
As Fig. 3 is stated, the method for the present embodiment is specifically included:
S201, foundation and broadcasting equipment low-power consumption bluetooth broadcast channel.
The executive agent of the present embodiment can be the information transfer dress provided in an embodiment of the present invention based on low-power consumption bluetoothPut, or communication equipment, including but not limited to smart mobile phone, wearable device (such as intelligent watch, Intelligent bracelet, motion bracelet)Had the terminal device of whole low-power consumption bluetooth protocol stack resource, can as control terminal, for control anti-loss device,Remote control and intelligent switch, so when making anti-loss device, remote control and intelligent switch, avoid the need for it and possess whole low work(Bluetooth protocol repertory resource is consumed, only possesses part low-power consumption bluetooth function, can so save anti-loss device, remote control and intelligenceThe hardware cost of switch.
Can also be (not need whole low-power consumption bluetooth protocol stack available for low level development part low-power consumption bluetooth functionResource) remote control, intelligent switch or anti-loss device.
Wherein, broadcasting equipment possesses Bluetooth broadcast function, can be broadcasted by low-power consumption bluetooth broadcast channel.For example,Low-power consumption bluetooth equipment.For example, can be (not need whole low-power consumption available for low level development part low-power consumption bluetooth functionBluetooth protocol repertory resource) anti-loss device, intelligent switch, remote control etc..
A kind of optional embodiment of this step is that the broadcasting equipment is sent out by the low-power consumption bluetooth broadcast channelThe broadcast sent is scanned;If the broadcast is arrived in scanning, it is determined that built with the low-power consumption bluetooth broadcast channel of the broadcasting equipmentStand successfully.
Specifically, broadcasting equipment is broadcasted by the low-power consumption bluetooth broadcast channel, communication equipment is scanned,If the message of the broadcasting apparatus broadcasts is arrived in scanning, it is determined that set up with the low-power consumption bluetooth broadcast channel of the broadcasting equipmentSuccess.Wherein, the adoptable forms of broadcasting of broadcasting equipment are that directional broadcasting or non-directional are broadcasted.If using directional broadcasting, thatThe address of broadcasting equipment and/or the address of equipment to be communicated are carried in broadcast message, communication equipment, which is received, issues determining for oneselfTo after broadcasting packet, connection request can be sent immediately as response.If broadcasted using non-directional, then in broadcast messageThe address of carrying broadcasting equipment, the address of equipment to be communicated is not carried, shows that the broadcasting equipment can receive other and any treatThe connection request of communication equipment.
S202, row data communication entered by the low-power consumption bluetooth broadcast channel and the broadcasting equipment.
A kind of achievable embodiment of this step is, by the low-power consumption bluetooth broadcast channel to the broadcasting equipmentScan request message is sent, is believed so that the broadcasting equipment is broadcasted according to the scan request message by the low-power consumption bluetoothRoad returns to scanning response message;Or, disappeared by the low-power consumption bluetooth broadcast channel to broadcasting equipment transmission connection requestBreath, so that the broadcasting equipment performs corresponding operating and/or wide by the low-power consumption bluetooth according to the connection request messageBroadcast channel and return to response message.
In data transfer, the data format that can be supported using low-power consumption bluetooth is treated communication data and carries out packing processing;Data after packing are sent to the equipment to be communicated by the low-power consumption bluetooth broadcast channel.Wherein, the low-power consumptionThe data format that bluetooth is supported includes the combination of one or more of field:Lead code Preamble, access address accessAddress, protocol Data Unit PDU and CRC CRC.For example shown in upper table one.
Wherein, can be that application layer will comprising application layer data in scanning response message, connection request message, response messageThe information of transmission.The data format that above-mentioned message is supported using low-power consumption bluetooth carries out packing processing;Then by after packingData are sent to the equipment to be communicated by the low-power consumption bluetooth broadcast channel.
Specifically, broadcasting equipment is broadcasted by low-power consumption bluetooth broadcast channel at regular intervals, wherein, broadcast packetThe inside can include application layer data, and equipment to be communicated is scanned, such as successful scan to broadcast packet, then low-power consumption bluetooth broadcast letterRoad is successfully established, and equipment to be communicated sends scan request message to broadcasting equipment, and broadcasting equipment is received after scan request message, is sent outSend scanning return information to equipment to be communicated, the application layer information to be sent can be included in this scanning reply.
Or, equipment to be communicated can be by initiating connection request message to broadcasting equipment, in this connection request messageFace can include the application layer information to be sent, and after broadcasting equipment is received, according to protocol analysis connection request message, then completeCertain action.So broadcasting equipment is achieved that with equipment to be communicated only transmits information in low-power consumption bluetooth broadcast channel,In the case where not supporting whole Bluetooth Low Energy protocol stack, the transmission of control information is realized.
The present embodiment is broadcasted by setting up the low-power consumption bluetooth passage with equipment to be communicated by the low-power consumption bluetoothChannel enters row data communication with the equipment to be communicated, and the embodiment of the present invention only needs the physical layer of system resource, part of linksLayer and application layer are it is achieved that and then saving system resource.
Embodiment three
Fig. 4 is a kind of flow chart for information transferring method based on low-power consumption bluetooth that the embodiment of the present invention three is provided, thisEmbodiment is the interaction embodiment of broadcasting equipment and communication equipment, as shown in figure 4, specifically including:
S301, broadcasting equipment carry out non-directional broadcast every preset time by low-power consumption bluetooth broadcast channel.
Wherein, the application layer information to be sent can be included inside broadcast packet.
S302, communication equipment are scanned to broadcast, and are swept by low-power consumption bluetooth broadcast channel to broadcasting equipment transmissionRetouch request message.
S303, broadcasting equipment are received after scan request message, are sent out by low-power consumption bluetooth broadcast channel to communication equipmentSend scanning response message.
Wherein, the application layer information to be sent can be included in scanning response message.
So broadcasting equipment is achieved that with communication equipment only carries out transmission information inside low-power consumption bluetooth broadcast channel,In the case where not supporting whole Bluetooth Low Energy protocol stack, the transmission of information is realized.
Example IV
Fig. 5 is a kind of flow chart for information transferring method based on low-power consumption bluetooth that the embodiment of the present invention four is provided, thisEmbodiment is the another interactive embodiment of broadcasting equipment and communication equipment, as shown in figure 5, specifically including:
S401, broadcasting equipment are oriented broadcast by low-power consumption bluetooth broadcast channel, wherein, comprising wide inside broadcast packetBroadcast the address of equipment and the address of communication equipment.
S402, communication equipment are received after the directional broadcasting message for issuing oneself, pass through low-power consumption bluetooth broadcast channelConnection request message is sent to communication equipment.
Wherein, the application layer information to be sent can be included inside connection request.
S403, broadcasting equipment are received after connection request message, according to the information of protocol analysis communication equipment, complete certainAction.
So broadcasting equipment is achieved that with communication equipment only transmits information in low-power consumption bluetooth broadcast channel, is not propping upIn the case of holding whole Bluetooth Low Energy protocol stack, the transmission of control information is realized.
Embodiment five
Fig. 6 is a kind of structure chart for information carrying means based on low-power consumption bluetooth that the embodiment of the present invention five is provided, thisEmbodiment is applicable to situation about carrying out data transmission based on low-power consumption bluetooth, and the device can use the side of software and/or hardwareFormula is realized.
As shown in fig. 6, described device includes:First passage sets up the data communication module 52 of module 51 and first, wherein:
First passage set up module 51 be used for set up and equipment to be communicated low-power consumption bluetooth broadcast channel;
First data communication module 52 is used to carry out with the equipment to be communicated by the low-power consumption bluetooth broadcast channelData communication.
The information carrying means based on low-power consumption bluetooth of the present embodiment be used for perform the various embodiments described above based on low work(The information transferring method of bluetooth is consumed, its technical principle is similar with the technique effect produced, repeats no more here.
On the basis of the various embodiments described above, the first passage set up module 51 specifically for:
Broadcasted by the low-power consumption bluetooth broadcast channel;If it is determined that the device scan to be communicated is to described wideBroadcast, it is determined that be successfully established with the low-power consumption bluetooth broadcast channel of the equipment to be communicated.
On the basis of the various embodiments described above, first data communication module 52 specifically for:
Receive the scan request message that the equipment to be communicated is sent by the low-power consumption bluetooth broadcast channel;According to instituteState scan request message and scanning response message is sent to the equipment to be communicated by the low-power consumption bluetooth broadcast channel;Or,Receive the connection request message that the equipment to be communicated is sent by the low-power consumption bluetooth broadcast channel;Please according to the connectionAsk message to perform corresponding operating and/or return to response to the equipment to be communicated by the low-power consumption bluetooth broadcast channel to disappearBreath.
On the basis of the various embodiments described above, first data communication module 52 specifically for:
The data format supported using low-power consumption bluetooth is treated communication data and carries out packing processing;Data after packing are led toCross the low-power consumption bluetooth broadcast channel and be sent to the equipment to be communicated.
On the basis of the various embodiments described above, the data format that the low-power consumption bluetooth is supported includes one or more ofThe combination of field:Lead code Preamble, access address access address, protocol Data Unit PDU and cyclic redundancy schoolTest a yard CRC.
Any implementation of the executable present invention of the information carrying means based on low-power consumption bluetooth that the various embodiments described above are providedThe information transferring method based on low-power consumption bluetooth that example is provided, possesses information transferring method phase of the execution based on low-power consumption bluetoothThe functional module and beneficial effect answered.
Embodiment six
Fig. 7 is a kind of structure chart for information carrying means based on low-power consumption bluetooth that the embodiment of the present invention six is provided, thisEmbodiment is applicable to situation about carrying out data transmission based on low-power consumption bluetooth, and the device can use the side of software and/or hardwareFormula realizes that the device can be integrated in a communications device or in the application end of communication equipment.Wherein, communication equipment can be but not limitIn having had whole low work(for mobile terminal (tablet personal computer or smart mobile phone), fixed terminal (desktop computer or notebook) etc.Consume the terminal device of bluetooth protocol repertory resource, or (need not be whole available for low level development part low-power consumption bluetooth functionIndividual low-power consumption bluetooth protocol stack resource) remote control, intelligent switch or anti-loss device in.
Wherein, application end can be the plug-in unit for some client being embedded in communication equipment, or be set for the communicationThe plug-in unit of standby operating system, with the client or logical for the information transfer based on low-power consumption bluetooth being embedded in communication equipmentBelieve that the information transfer application program based on low-power consumption bluetooth in the operating system of equipment is used cooperatively;Application end can also be instituteAn independent client that the information transfer based on low-power consumption bluetooth is provided in communication equipment is stated, the present embodiment does not enter to thisRow limitation.
As shown in fig. 7, described device includes:Second channel sets up the data communication module 62 of module 61 and second, wherein:
Second channel set up module 61 be used for set up and broadcasting equipment low-power consumption bluetooth broadcast channel;
Second data communication module 62 is used to enter line number by the low-power consumption bluetooth broadcast channel and the broadcasting equipmentAccording to communication.
The information carrying means based on low-power consumption bluetooth of the present embodiment be used for perform the various embodiments described above based on low work(The information transferring method of bluetooth is consumed, its technical principle is similar with the technique effect produced, repeats no more here.
On the basis of the various embodiments described above, the second channel set up module 61 specifically for:
The broadcast that the broadcasting equipment is sent by the low-power consumption bluetooth broadcast channel is scanned;If institute is arrived in scanningState broadcast, it is determined that be successfully established with the low-power consumption bluetooth broadcast channel of the broadcasting equipment.
On the basis of the various embodiments described above, second data communication module 62 specifically for:
Scan request message is sent to the broadcasting equipment by the low-power consumption bluetooth broadcast channel, so that the broadcastEquipment returns to scanning response message according to the scan request message by the low-power consumption bluetooth broadcast channel;Or, by instituteState low-power consumption bluetooth broadcast channel and send connection request message to the broadcasting equipment, so that the broadcasting equipment is according to the companyRequest message is connect to perform corresponding operating and/or return to response message by the low-power consumption bluetooth broadcast channel.
On the basis of the various embodiments described above, second data communication module 62 specifically for:
The data format supported using low-power consumption bluetooth is treated communication data and carries out packing processing;Data after packing are led toCross the low-power consumption bluetooth broadcast channel and be sent to the equipment to be communicated.
On the basis of the various embodiments described above, the data format that the low-power consumption bluetooth is supported includes one or more ofThe combination of field:Lead code Preamble, access address access address, protocol Data Unit PDU and cyclic redundancy schoolTest a yard CRC.
Any implementation of the executable present invention of the information carrying means based on low-power consumption bluetooth that the various embodiments described above are providedThe information transferring method based on low-power consumption bluetooth that example is provided, possesses information transferring method phase of the execution based on low-power consumption bluetoothThe functional module and beneficial effect answered.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art thatThe invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art it is various it is obvious change,Readjust and substitute without departing from protection scope of the present invention.Therefore, although the present invention is carried out by above exampleIt is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, alsoOther more equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.