Invention content
The application can improve data point mainly solving the technical problems that provide a kind of data analysing method and deviceThe efficiency of analysis.
The present invention provides a kind of data analysing methods, including:Receive the data that the wearable device is sent, whereinThe data that the wearable device is sent include mode field, time started field and Duration field, wherein the shapeState field is used to indicate the motion state of user, and the time started field is for indicating that the user starts the movementThe time of state, the Duration field are used to indicate the duration of motion state described in the user;To it is described canThe data that wearable device is sent carry out the bit arithmetic of "or", are parsed with the data sent to the wearable device.
Optionally, the data length instruction that wearable device is sent is received, wherein the data length instruction includes transmissionThe length of data;Judge whether the length for the data that the wearable device received is sent is equal to the length of transmission data;If equal to the length of transmission data, is sent to the wearable device and delete data command, wherein the deletion data commandFor instructing the wearable device to delete the data sent;If not equal to the length of transmission data, worn to describedIt wears equipment and sends repeating transmission order.
Optionally, after receiving the data length instruction that wearable device is sent, judge to receive described wearable setsThe length for the data that preparation is sent whether be equal to transmission data length before include:Judge the frame head of the data length instructionWhether data value is default value, wherein the default value is the group of one or more of character, letter and numerical valueIt closes;If data value is default value, the data length instruction is decapsulated to obtain the length of the transmission data, ifData value is not default value, then sends the repeating transmission order to the wearable device.
Optionally, the wearable device is any one in Intelligent bracelet, smartwatch and intelligent glasses.
Optionally, the data for receiving the wearable device transmission are specially:Institute is received by Bluetooth transmission protocolState the data of wearable device transmission.
The present invention also provides a kind of data analysis set-ups, including:Receiving module, for receiving the wearable device hairThe data sent, wherein the data that the wearable device is sent include mode field, time started field and duration wordSection, wherein the mode field is used to indicate the motion state of user, and the time started field is for indicating the usePerson starts the time of the motion state, and the Duration field is for indicating continuing for motion state described in the userTime;Computing module, the bit arithmetic of the data progress "or" for sending to the wearable device, wearable to be set to describedThe data that preparation is sent are parsed.
Optionally, described device further includes the first judgment module and sending module, and the receiving module can for receivingThe data length instruction that wearable device is sent, wherein the data length instruction includes the length of transmission data;Described first sentencesWhether the length for the data that the wearable device that disconnected module is used to judge to receive is sent is equal to the length of transmission data;InstituteSending module is stated for when equal to the length of transmission data, being sent to the wearable device and deleting data command, wherein instituteIt states and deletes data command for instructing the wearable device to delete the data sent;In the length not equal to transmission dataWhen, it is sent to the wearable device and retransmits order.
Optionally, described device further includes the second judgment module and decapsulation module, and second judgment module is used forJudge whether the data value of the frame head of the data length instruction is default value, wherein the default value is character, letterAnd the combination of one or more of numerical value;The decapsulation module is used for when data value is default value, decapsulationThe data length instruction is to obtain the length of the transmission data;The sending module is used in data value not be default valueWhen, send the repeating transmission order to the wearable device.
Optionally, the wearable device is any one in Intelligent bracelet, smartwatch and intelligent glasses.
Optionally, the receiving module is used to receive the data that the wearable device is sent by Bluetooth transmission protocol.
Data are taken out from memory with the prior art, are then calculated, the mode for being restored again into memory after the completion is compared, this hairThe data that bright middle terminal-pair wearable device is sent carry out this bit arithmetic of "or", directly can internally deposit into capable operation, significantlyImprove the efficiency of operation.
Specific implementation mode
In being described below, for illustration and not for limitation, it is proposed that such as specific system structure, interface, technology itThe detail of class understands the application to cut thoroughly.However, it will be clear to one skilled in the art that there is no these specificThe application can also be realized in the other embodiment of details.In other situations, omit to well-known device, circuit withAnd the detailed description of method, so as not to obscure the description of the present application with unnecessary details.
Refering to fig. 1, Fig. 1 is a kind of flow chart of data analysing method provided by the invention.The data analysis side of the present inventionMethod includes:
Step 110:Terminal receives the data length instruction and receive what wearable device was sent that wearable device is sentData.
Terminal can be smart mobile phone (smart phone), desktop computer, tablet computer (PAD), laptop(NoteBook Computer), server (server) etc..Wearable device is Intelligent bracelet, smartwatch, intelligent glassesEtc..Data length instruction is the message sent between terminal and wearable device, and data length instruction includes transmissionThe length of data.The data that wearable device is sent include mode field, time started field and Duration field,In, mode field is used to indicate the motion state of user, and time started field is for indicating user's setting in motion stateTime, Duration field are used to indicate the duration of user's motion state.For example, the data that wearable device is sentA kind of structure is as shown in table 1,
A kind of structure for data that 1 wearable device of table is sent
Wherein, when the value of mode field is 0x01, the state of user is to walk, and when being 0x02, the state of user is to runStep ... ....Value in time started field then indicates the time started, for example, first eight bits indicate year, then four expression moons, connectFive expression days, then when four expressions, then six indicate to divide, last six expression seconds.Duration field is used for tableShow duration, for example, when preceding four expressions, then six indicate to divide, last six expression seconds.
In addition, the structure for the data that wearable device is sent can also include total step number field and calorie field, whereinTotal step number field is for indicating the total step number of user in this state, and calorie field is for indicating that user consumes in this stateCalorie.For example, as shown in table 2,
The structure for another data that 2 wearable device of table is sent
Wearable device is to terminal transmission data length instruction.Terminal judges data after receiving data length instructionWhether the data value of the frame head of length instruction is default value, wherein default value is one kind in character, letter and numerical valueOr a variety of combination.Such as:Default value is 33xx etc..If data value is default value, data length is decapsulatedInstruction is to obtain the length of transmission data, and according further to communications protocol to terminal transmission data, terminal then accordingly connects wearable deviceReceive the data that wearable device is sent.If data value is not default value, is sent to wearable device and retransmit order.
It is understood that when data value is default value, wearable device can be long to terminal transmission data simultaneouslyDegree instruction and data, can also be first to terminal transmission data length instruction, then to terminal transmission data, even, first to terminalTransmission data, then to terminal transmission data length instruction.
Step 120:Terminal judges whether the length for the data that the wearable device received is sent is equal to transmission dataLength.
The length for the data that terminal is sent according to wearable device judge wearable device send data length whetherEqual to the length of transmission data.If equal to the length of transmission data, it is meant that the data one that wearable device is sent to terminalIt is a to be received by terminal with not leaking, 130 can be entered step, if not equal to the length of transmission data, it is meant that wearable deviceThe data sent to terminal are lost, and enter step 150.
Step 130:Terminal sends to wearable device and deletes data command.
After determining that data one that wearable device is sent to terminal are not received with not leaking by terminal, terminal can pass through terminalBluetooth transmission protocol sends to wearable device and deletes data command, wherein deletes data command for instructing wearable deviceThe data sent are deleted.Wearable device is after receiving deletion data command, by warp-wise is whole in wearable deviceThe data that end is sent are deleted, to save the memory space of wearable device.
Step 140:The data that terminal-pair wearable device is sent are analyzed.
Terminal can also carry out the data that wearable device is sent the bit arithmetic of "or", with what is sent to wearable deviceData are parsed, for example, it is desired to the meaning that represents of value for the mode field that terminal is sent as sound sleep total duration intoWhen row statistics, the bit arithmetic of "or" can be directly carried out according to numerical value, and the time is calculated to save.For example, first time deep sleepDuration is 11 minutes, and the time of second of sound sleep is 22 minutes, and it is logical with " 00100010 " can be changed into " 00010001 "The bit arithmetic for crossing "or", to obtain result " 00110011 ".
Step 150:Terminal sends to wearable device and retransmits order.
Terminal, can be by Bluetooth transmission protocol to can after determining that data that wearable device is sent to terminal are lostWearable device, which is sent, retransmits order.After wearable device receives repeating transmission order, data before are retransmitted one time, with trueThe data that wearable device is sent to terminal are protected can accurately to be received.
Data are taken out from memory with the prior art, are then calculated, the mode for being restored again into memory after the completion is compared, this hairThe data that bright middle terminal-pair wearable device is sent carry out this bit arithmetic of "or", directly can internally deposit into capable operation, significantlyImprove the efficiency of operation.
Moreover, in the present invention wearable device by terminal transmission data length instruction, and judge wearable device toWhether the length for the data that terminal is sent is equal to the length of transmission data, if equal to the length of transmission data, it is known thatThere is no a transmission data loss, transmission success, so, sent to wearable device and delete data command, by wearable deviceThe data that warp-wise terminal is sent are deleted, to save the memory space of wearable device, if not equal to the length of transmission data,It is known that loss of data has occurred, terminal sends to wearable device and retransmits order, to ensure that data can completely be sentTo terminal, loss of data is prevented.
Referring to Fig.2, Fig. 2 is a kind of structural schematic diagram of data analysis set-up provided by the invention.The number of present embodimentInclude according to transmitting device:Receiving module 302, the second judgment module 304, decapsulation module 305, is sent first judgment module 303Module 306 and computing module 307.
Receiving module 302 is used to receive the data that the wearable device is sent, wherein what the wearable device was sentData include mode field, time started field and Duration field, wherein the mode field is for indicating userMotion state, the time started field is described lasting for indicating that the user starts the time of the motion stateTime field is used to indicate the duration of motion state described in the user;Computing module 307 is used for described wearableThe data that equipment is sent carry out the bit arithmetic of "or", are parsed with the data sent to the wearable device.
Optionally, the receiving module 302 is used to receive the data length instruction of wearable device transmission, wherein describedData length instruction includes the length of transmission data;First judgment module 303 is described wearable for judging to receiveWhether the length for the data that equipment is sent is equal to the length of transmission data;The sending module 306 is used for equal to transmission dataLength when, sent to the wearable device and delete data command, wherein the deletions data command is for can described in instructingWearable device deletes the data sent;When not equal to the length of transmission data, sends and retransmit to the wearable deviceOrder.
Optionally, whether the data value for the frame head that second judgment module 304 is used to judge that the data length instructsIt is default value, wherein the default value is the combination of one or more of character, letter and numerical value;The solutionPackage module 305 is used for when data value is default value, decapsulates the data length instruction to obtain the transmission dataLength;The sending module 306 is used for when data value is not default value, and the repeating transmission is sent to the wearable deviceOrder.
Optionally, the wearable device is any one in Intelligent bracelet, smartwatch and intelligent glasses.
Optionally, the receiving module 302 is used to receive the number that the wearable device is sent by Bluetooth transmission protocolAccording to.
The present invention data analysis set-up can be corresponded with data analysing method shown in FIG. 1, referring specifically to Fig. 1 withAnd associated description, not reinflated description herein.
Data are taken out from memory with the prior art, are then calculated, the mode for being restored again into memory after the completion is compared, this hairThe data that bright middle terminal-pair wearable device is sent carry out this bit arithmetic of "or", directly can internally deposit into capable operation, significantlyImprove the efficiency of operation.
Moreover, in the present invention wearable device by terminal transmission data length instruction, and judge wearable device toWhether the length for the data that terminal is sent is equal to the length of transmission data, if equal to the length of transmission data, it is known thatThere is no a transmission data loss, transmission success, so, sent to wearable device and delete data command, by wearable deviceThe data that warp-wise terminal is sent are deleted, to save the memory space of wearable device, if not equal to the length of transmission data,It is known that loss of data has occurred, terminal sends to wearable device and retransmits order, to ensure that data can completely be sentTo terminal, loss of data is prevented.
In several embodiments provided herein, it should be understood that disclosed system, device and method canTo realize by another way.For example, device embodiments described above are only schematical, for example, the mouldThe division of block or unit, only a kind of division of logic function, formula that in actual implementation, there may be another division manner, for example (,) it is multipleUnit or component can be combined or can be integrated into another system, or some features can be ignored or not executed.It is anotherPoint, shown or discussed mutual coupling, direct-coupling or communication connection can be by some interfaces, device orThe INDIRECT COUPLING of unit or communication connection can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unitThe component shown may or may not be physical unit, you can be located at a place, or may be distributed over multipleIn network element.Some or all of unit therein can be selected according to the actual needs to realize present embodiment schemePurpose.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, also may be usedIt, can also be during two or more units be integrated in one unit to be that each unit physically exists alone.It is above-mentioned integratedThe form that hardware had both may be used in unit is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent productWhen, it can be stored in a computer read/write memory medium.Based on this understanding, the technical solution of the application is substantiallyThe all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other wordsIt embodies, which is stored in a storage medium, including some instructions are used so that a computerEquipment (can be personal computer, terminal or the network equipment etc.) or processor (processor) execute each reality of the applicationApply all or part of step of mode the method.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory(ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CDEtc. the various media that can store program code.