Summary of the invention
The present invention provides a kind of communications protocol switching method, data transmission method, wireless sensor and system, can automatically intoThe switching of row communication protocol, carries out data transmission, and can avoid matching error occur, to cause loss of data.
Embodiment of the present invention discloses a kind of communications protocol switching method, applied to can support the first communication protocol and secondThe wireless sensor of communication protocol, the communications protocol switching method includes: can be from a wireless charging in the wireless sensorWhen seat gets electric energy, the communication protocol of the wireless sensor is switched to described second from first communication protocol automaticallyCommunication protocol;And when the wireless sensor and the wireless charging base are established and communicated to connect, the data of storage are passed throughSecond communication protocol is transmitted to the wireless charging base.
Wherein, the communications protocol switching method further include: when the wireless sensor meets switching condition, automatically by instituteThe communication protocol for stating wireless sensor switches back into first communication protocol from second communication protocol.
Wherein, the switching condition is the one of which in the following conditions: the wireless sensor completes data transmission, instituteState the broken communication connection of wireless sensor and the wireless charging base, the wireless sensor fails from the wireless charging baseGet electric energy.
A kind of wireless sensor, including power supply unit, central processing unit, multi-protocol communication is also disclosed in embodiment of the present inventionUnit and memory, the multi-protocol communication unit support the first communication protocol and the second communication protocol, the central processing unitWhen the wireless sensor can get electric energy from a wireless charging base, automatically controlling the multi-protocol communication unit will be communicatedAgreement switches to second communication protocol from first communication protocol, and in the wireless sensor and the wireless chargingWhen electric seat establishes communication connection, the data that the memory stores are transmitted to the wireless charging by second communication protocolElectric seat.
Wherein, the central processing unit is when the wireless sensor meets switching condition, by the wireless sensorCommunication protocol switches back into first communication protocol from second communication protocol.
Wherein, the switching condition is the one of which in the following conditions: the wireless sensor completes data transmission, instituteState the broken communication connection of wireless sensor and the wireless charging base, the wireless sensor fails from the wireless charging baseGet electric energy.
A kind of data transmission method is also disclosed in embodiment of the present invention, be applied to wireless sensor and wireless charging base itBetween, the wireless sensor supports the first communication protocol and the second communication protocol, and the wireless charging base supports that described second is logicalBelieve agreement and third communication agreement, the data transmission method includes: can be from the wireless charging base in the wireless sensorWhen getting electric energy, the communication protocol of the wireless sensor is switched to described second from first communication protocol automatically and is led toBelieve agreement;When the wireless sensor and the wireless charging base are established and communicated to connect, the data of storage are passed through described theTwo communication protocols are transmitted to the wireless charging base;The wireless charging base is received described wireless by second communication protocolThe data of sensor transmissions;And the wireless charging base is transmitted the data received by the third communication agreementTo external electronic.
A kind of system is also disclosed in embodiment of the present invention, comprising: wireless sensor supports the first communication protocol and second logicalLetter agreement automatically switches to communication protocol from first communication protocol when that can get electric energy from a wireless charging baseSecond communication protocol, and when establishing communication connection with the wireless charging base, the data of storage are passed through described secondCommunication protocol is transmitted to the wireless charging base;And the wireless charging base, support second communication protocol and third logicalBelieve agreement, after establishing communication connection by second communication protocol and the wireless sensor, receives the wireless sensingThe data of device transmission, and the data received are transmitted to external electronic by the third communication agreement.
Wherein, the wireless sensor cuts communication protocol from second communication protocol also when meeting switching conditionShift to first communication protocol.
Wherein, the switching condition is the one of which in the following conditions: the wireless sensor completes data transmission, instituteState the broken communication connection of wireless sensor and the wireless charging base, the wireless sensor fails from the wireless charging baseGet electric energy.
In the present invention, when charging to wireless sensor, the automatic switching for carrying out communication protocol, will can wirelessly passThe data of sensor storage are transmitted to wireless charging base.Compared to the prior art, the present invention can carry out the switching of communication protocol automatically,Carry out data transmission, can avoid matching error occur, to cause loss of data.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, completeSite preparation description, it is clear that the described embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on thisEmbodiment in invention, every other reality obtained by those of ordinary skill in the art without making creative effortsExample is applied, shall fall within the protection scope of the present invention.
Fig. 1 is the flow chart of communications protocol switching method in one embodiment of the present invention, and this method is applied to wireless passIn sensor.Wireless sensor is usually wearable wireless sensor, can be that can sense the physiological parameters such as EGC parameter, respiratory rateWireless sensor.Wireless sensor can support the first communication protocol and the second communication protocol.In present embodiment, the first communication protocolsView is low speed standard agreement, and the second communication protocol is high-speed nonstandard agreement, usually by factory settings.Low speed standard agreement can be withFor 4.0 low power consumption protocol of bluetooth, Zigbee protocol, ANT+ agreement etc..Low speed standard agreement is suitable for periodically, constantly countingAccording to transmission.Therefore, under normal circumstances, the communication pattern of wireless sensor is the communication pattern using low speed standard agreement, with energyNormal communication is carried out with smart machine, such as smart phone, tablet computer, personal digital assistant etc..High-speed nonstandard agreement letterIt is single, high-efficient, at low cost, but protocol compatibility is poor, can only be direct-connected with limited equipment, it is suitble to a large amount of numbers of transmission in a short timeAccording to.In present embodiment, wireless sensor can be established by high-speed nonstandard agreement and wireless charging base and be communicated to connect.
Communications protocol switching method in present embodiment may include following steps:
Step 100, when wireless sensor can get electric energy from wireless charging base, by the communication protocol of wireless sensorThe second communication protocol is switched to from the first communication protocol.
Specifically, user is usually and charges after wireless sensor use to wireless sensor.Therefore, existCommunication protocol is switched to the second communication protocol from the first communication protocol in charging process, that is, is switched to high-speed nonstandard agreement,It will not influence the use of user.
Specifically, using wireless charging, oxidation, corrosion, abrasion, skin tears, allergy of mechanical socket etc. can be avoided and askedTopic.Further, using wireless charging, it is also convenient for user's carrying.When being charged, wireless sensor and wireless charging can adjustThe relative position of seat, the receiving end of the transmitting terminal and wireless charging base that make wireless sensor as far as possible is close, therefore, carries out data biographyWhen defeated, it can be carried out data transmission with low transmitting power, to avoid crosstalk.
Step 101, when wireless sensor and wireless charging base are established and communicated to connect, the data of storage are led to by secondLetter agreement is transmitted to wireless charging base.
In present embodiment, when detecting wireless charging base and charging to wireless sensor, automatically by communication protocolThe second communication protocol is switched to from the first communication protocol, the data of storage can be transmitted to wireless charging by the second communication protocolElectric seat.Compared to the prior art, present embodiment can carry out the switching of communication protocol automatically, carry out data transmission, and can avoidExisting matching error, to cause loss of data.
Fig. 2 is the flow chart of communications protocol switching method in another embodiment of the present invention, it may include following steps:
Step 200, when wireless sensor can get electric energy from wireless charging base, by the communication protocol of wireless sensorThe second communication protocol is switched to from the first communication protocol.
Step 201, when wireless sensor and wireless charging base are established and communicated to connect, the data of storage are led to by secondLetter agreement is transmitted to wireless charging base.
Step 202, when wireless sensor meets switching condition, by the communication protocol of wireless sensor from the second communication protocolsView switches back into the first communication protocol.
Specifically, switching condition can be the one of which in the following conditions: wireless sensor completes data transmission, wireless biographyThe broken communication connection of sensor and wireless charging base, wireless sensor, which fail to get electric energy from wireless charging base, (no longer to be carried outCharging).
When meeting switching condition, indicates the data transfer ends or cannot carry out data transmission, at this point, mould will be communicated automaticallyFormula is switched to the low speed standard agreement used under normal condition, switches over manually without user, user can be facilitated to reuseWireless sensor.
Fig. 3 is the basic structure schematic diagram of wireless sensor in one embodiment of the present invention.Wireless sensor is usuallyWearable wireless sensor can be the wireless sensor that can sense the physiological parameters such as EGC parameter, respiratory rate.Present embodimentIn, wireless sensor may include power supply unit 11, central processing unit 12, multi-protocol communication unit 13 and memory 14.Power supply listMember 11 provides electric energy for entire wireless sensor.Power supply unit 11 and multi-protocol communication unit 13 can be it is physically separate,It can integrate.Central processing unit 12 is electrically connected to multi-protocol communication unit 13 and memory 14.Memory 14 can memory bankLevy parameter.
In present embodiment, multi-protocols, which lead to unit 13, can support the first communication protocol and the second communication protocol.This implementationIn mode, the first communication protocol is low speed standard agreement, and the second communication protocol is high-speed nonstandard agreement.Low speed standard agreement canThink 4.0 low power consumption protocol of bluetooth, Zigbee protocol, ANT+ agreement etc..Low speed standard agreement is suitable for periodically, constantlyData transmission.Therefore, under normal circumstances, the communication pattern of wireless sensor is the communication pattern using low speed standard agreement, withEnergy and smart machine, such as smart phone, tablet computer, personal digital assistant etc. carry out normal communication.High-speed nonstandard agreementSimply, high-efficient, at low cost, but protocol compatibility is poor, can only be direct-connected with limited equipment, it is suitble to transmission in a short time a large amount ofData.In present embodiment, wireless sensor can be established by high-speed nonstandard agreement and wireless charging base and be communicated to connect.
In present embodiment, central processing unit 12 is when wireless sensor can get electric energy from wireless charging base, automaticallyIt controls multi-protocol communication unit 13 and communication protocol is switched to the second communication protocol from the first communication protocol, and in wireless sensingWhen device and wireless charging base establish communication connection, the data of storage are transmitted to wireless charging base by the second communication protocol.
Specifically, user is usually and charges after wireless sensor use to wireless sensor.Therefore, existCommunication protocol is switched to the second communication protocol from the first communication protocol in charging process, that is, is switched to high-speed nonstandard agreement,It will not influence the use of user.
In present embodiment, detect charge to wireless sensor when, automatically by communication protocol from first communicationProtocol switching is to the second communication protocol, the data of storage can be transmitted to wireless charging base by the second communication protocol.It comparesIn the prior art, present embodiment can carry out the switching of communication protocol automatically, carry out data transmission, and can avoid matching mistake occurAccidentally, to cause loss of data.
Further, after the communication protocol of wireless sensor being switched to high-speed nonstandard agreement, wireless sensor and wirelessMay be due to some between cradle, such as interfere too greatly, communication connection can not be successfully established.Therefore, in further,When wireless sensor all fails to establish communication connection with wireless charging base within a preset period of time, central processing unit 12 restartsStarting communication connection.
Further, central processing unit 12 is also when wireless sensor meets switching condition, by the communication protocols of wireless sensorView switches back into the first communication protocol from the second communication protocol.
Specifically, switching condition can be the one of which in the following conditions: wireless sensor completes data transmission, wireless biographyThe broken communication connection of sensor and wireless charging base, wireless sensor, which fail to get electric energy from wireless charging base, (no longer to be carried outCharging).
When meeting switching condition, indicates the data transfer ends or cannot carry out data transmission, at this point, mould will be communicated automaticallyFormula is switched to the low speed standard agreement used under normal condition, switches over manually without user, user can be facilitated to reuseWireless sensor.
Fig. 4 is the flow chart of data transmission method in one embodiment of the present invention, and this method is applied to wireless sensorBetween wireless charging base.Wireless sensor is the wireless sensor of Fig. 3 description, and details are not described herein.Wireless charging base can beWireless sensor provides electric energy.Wireless charging base can support above-mentioned second communication protocol and third communication agreement.Present embodimentIn, third communication agreement is high speed modular agreement.Communication under high speed modular agreement can be WIFI communication, Bluetooth communication, USBCommunication, fiber optic communication, ethernet communication, 3G/4G communication etc., can be with smart machines, WIFI hot spot, the shifting such as smart phone, plateDynamic base station etc. is communicated.
The data transmission method may include following steps:
Step 400, when wireless sensor can get electric energy from wireless charging base, by the communication protocol of wireless sensorThe second communication protocol is switched to from the first communication protocol.
Step 401, when wireless sensor and wireless charging base are established and communicated to connect, the data of storage are led to by secondLetter agreement is transmitted to wireless charging base.
Step 402, wireless charging base receives the data of wireless sensor transmission by the second communication protocol.
Step 403, the data received are transmitted to external electronic by third communication agreement by wireless charging base.
External electronic can be Cloud Server, smart machine etc..Wireless charging base can first cache the data received,The data of caching are transferred out again after data end of transmission, can not also be data cached, data are passed immediately after receiving dataOutput is gone.
In present embodiment, after use, electricity generally can all be consumed much, need at this time to wireless sensor intoRow charging.And after use, a large amount of data of wireless sensor own cache.It, can be certainly in charging in present embodimentIt is dynamic to be transferred out the data of caching by wireless charging base, without any participation of user, greatly facilitates and passed to wirelessIt uses to sensor, further promotes the usage experience of user.
Fig. 5 be one embodiment of the present invention in system basic structure schematic diagram, the system include wireless sensor andWireless charging base.Wireless sensor is wireless sensor described in Fig. 3, it may include power supply unit 11, central processing unit 12, more associationsDiscuss communication unit 13 and memory 14.Power supply unit 11, central processing unit 12, multi-protocol communication unit 13 and memory 14 toolBody function is identical as the description in Fig. 3, and details are not described herein.
Specifically, using wireless charging, oxidation, corrosion, abrasion, skin tears, allergy of mechanical socket etc. can be avoided and askedTopic.Further, it using wireless charging, can also be carried convenient for user.When being charged, wireless sensor and wireless charging can adjustThe receiving end of the relative position of electric seat, the transmitting terminal and wireless charging base that make wireless sensor as far as possible is close, therefore, carries out dataWhen transmission, it can be carried out data transmission with low transmitting power, to avoid crosstalk.
In present embodiment, wireless charging base may include central processing unit 21, power supply unit 22, the first communication unit 23 andSecond communication unit 24.Power supply unit 22 is usually the module of charge and discharge together as one, can provide electricity for wireless sensorEnergy.First communication unit 23 can support the second communication protocol, i.e. high-speed nonstandard agreement.Wireless sensor and wireless charging base itBetween by high-speed nonstandard agreement establish communication connection.High-speed nonstandard agreement is usually by factory settings.Second communication unit 24It can support third communication agreement.In present embodiment, third communication agreement is high speed modular agreement.It is logical under high speed modular agreementLetter can for WIFI communication, Bluetooth communication, usb communication, fiber optic communication, ethernet communication, 3G/4G communicate etc., can be with intelligent handThe smart machines such as machine, plate, WIFI hot spot, mobile base station etc. are communicated.
Central processing unit 21 passes through the first communication unit 23 (i.e. high-speed nonstandard agreement) and wireless biography in wireless charging baseWhen sensor establishes communication connection, data are received from wireless sensor by the first communication unit 23, and pass through the second communication unitThe data received are transmitted to external electronic by 24 (i.e. high speed modular agreements), external electronic can for Cloud Server,Smart machine etc..Central processing unit 21 can first cache the data received, again pass the data of caching after data end of transmissionOutput is gone, can not also be data cached, immediately transfers out data after receiving data.
In present embodiment, after use, electricity generally can all be consumed much, need at this time to wireless sensor intoRow charging.And after use, a large amount of data of wireless sensor own cache.It, can be certainly in charging in present embodimentIt is dynamic to be transferred out the data of caching by wireless charging base, without any participation of user, greatly facilitates and passed to wirelessIt uses to sensor, further promotes the usage experience of user.
The above is a preferred embodiment of the present invention, it is noted that for those skilled in the artFor, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also considered asProtection scope of the present invention.