CN107181813A - The processing method and system of a kind of data message - Google Patents
The processing method and system of a kind of data message Download PDFInfo
- Publication number
- CN107181813A CN107181813A CN201710429584.8A CN201710429584A CN107181813A CN 107181813 A CN107181813 A CN 107181813A CN 201710429584 A CN201710429584 A CN 201710429584A CN 107181813 A CN107181813 A CN 107181813A
- Authority
- CN
- China
- Prior art keywords
- data
- message
- equipment
- target
- preset value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Computer Security & Cryptography (AREA)
- Communication Control (AREA)
Abstract
The invention discloses a kind of processing method of data message and system, methods described is applied in Internet of Things, methods described includes, equipment transmitting terminal determines target data waiting for transmission, and generate a data message and send to equipment receiving terminal, the data message includes the data definition word of the target data and the byte for the data attribute that indicates the target data;Equipment receiving terminal obtains the data message, and the data attribute of the target data is judged according to the data definition word, and parses the data message according to the data attribute, reduces the expense of data message, improves the utilization rate of the network bandwidth.
Description
Technical field
The present invention relates to Internet of Things field, the processing method and system of more particularly to a kind of data message.
Background technology
The data type of facility information has many kinds described in Internet of Things application, such as describes the data type of equipment state
Have:The data type of facility switching state is described, is generally represented with 1 bit;The data type of equipment humiture is described, is led to
It is often the floating number of 1 decimal place;Data type for representing equipment color, generally with the RGB or 4 bytes of 3 bytes
RGBW represent;One section of image or a section audio, byte length reach K bytes up to a hundred.The data class of specification of equipment is described
Type has:Input and output, the flow direction for representing data;Accuracy of measurement is simulated, the accuracy value for describing AD samplings.
The equipment of current Internet of Things typically does arithmetic logic processing using MCU, with modes such as ZigBee/ radio frequencies or serial ports
Realize data transfer.These data types are generally described using TLV (type, length, value) forms.In general,
Type is expressed as the corresponding data types of Value, and length is 1 byte;Length represents the corresponding data lengths of Value, its
Length is 4 bytes;Value is the data message of transmission, and its data length is corresponding length values.Due to radio frequency and serial ports
The bandwidth very little of agreement, MCU RAM resources are also very nervous, and TLV data are preserved in system database and expense also can
Very weight is, it is necessary to which multiple bytes could represent TLV data message, so the processing of TLV data in the prior art scheme
The MCU that disposal ability is stronger is needed, simultaneously as data information is limited.
Therefore, how to solve the problems of the prior art, reduce the expense of data message, be asking for common concern
Topic.
The content of the invention
In consideration of it, it is an object of the invention to provide a kind of processing method of data message and system, reducing data message
Expense, improve the network bandwidth utilization rate.
According to foregoing invention purpose, the invention provides a kind of processing method of data message, methods described is applied to thing
In networking, methods described includes:
S1, equipment transmitting terminal determines target data waiting for transmission, and one data message of generation is sent to equipment equipment receiving terminal, institute
State the data definition of a byte of the data message including the target data and for the data attribute that indicates the target data
Word;
S2, equipment receiving terminal obtains the data message, and the data for judging the target data according to the data definition word belong to
Property, and the data message is parsed according to the data attribute.
Preferably, the data attribute includes data direction, switching value data type, analog data type, floating number
Data type, array data type and multimedia data type.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the first preset value in the first predetermined bit section of the data definition word, and first preset value refers to
Show the data direction of the target data;
Step S2 further comprises:
Equipment receiving terminal confirms the data direction of the target data according to first preset value, and according to the data side
To the parsing data message.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the second preset value in the second predetermined bit section of the data definition word, and second preset value is used
To indicate the data attribute of the target data as switching value data type;
Step S2 further comprises:
Equipment receiving terminal confirms the data length of the target data according to second preset value and switching value data type, and
According to the switching value data type and data length, the data message is parsed.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the 3rd preset value in the 3rd predetermined bit section of the data definition word, and the 3rd preset value refers to
The data attribute for showing the target data is analog data type;
Step S2 further comprises:
Equipment receiving terminal determines the data length of target data according to the 3rd preset value, and according to the analog data class
Type and data length, parse the data message.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the 4th preset value in the 4th predetermined bit section of the data definition word, and the 4th preset value refers to
The data attribute for showing the target data is array data type;
Step S2 further comprises:
Equipment receiving terminal determines the data length of target data according to the 4th preset value, and according to the array data type
And data length, parse the data message.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the 5th preset value in the 5th predetermined bit section of the data definition word, and the 5th preset value refers to
The data attribute for showing the target data is floating number data type;
The step S2 further comprises:
Equipment receiving terminal determines the floating number precision of target data according to the 5th preset value, and according to the floating number data
Type and floating number precision, parse the data message.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the 6th preset value in the 6th predetermined bit section of the data definition word, and the 6th preset value refers to
The data attribute for showing the target data is multimedia data type;
The step S2 further comprises:
Equipment receiving terminal determines the data length of target data according to the 6th preset value and a preset algorithm, and according to described
Multimedia data type and data length, parse the data message.
Preferably, the data message also includes device id, and by the device id in the data message, data definition word
It is stored in target data in database, and the device id, data definition word and target data are corresponded.
Present invention also offers a kind of data message processing system, the system includes equipment transmitting terminal and equipment is received
End, wherein,
Equipment transmitting terminal includes:
Determining module, for determining target data waiting for transmission;
Generation module, for generating a data message, the data message includes the target data and for indicating the mesh
Mark the data definition word of a byte of the data attribute of data;
Sending module, for sending the data message to equipment receiving terminal;
Equipment receiving terminal includes:
Receiving module, for receiving the data message from equipment transmitting terminal;
Parsing module, for obtaining the data definition word in the data message, the mesh is judged according to the data definition word
The data attribute of data is marked, and the target data is parsed according to the data attribute.
Compared with prior art, the processing method and system of a kind of data message of the invention, have the advantages that:Number
The data definition word of one byte is set according to message, and the data definition word can just represent the number of the target data in data message
According to attribute, such as, I/O mode, switching value information and analog quantity information of target data etc., relative to prior art
Middle use TLV forms generate the scheme of data message, and the technical scheme data message length is reduced, and reduces accessing cost for data, together
When reduce the time of data transfer, improve the utilization rate of bandwidth, also improve the efficiency being wirelessly transferred, support can be allowed more
Wireless device;The logical process of data message is simple, and the disposal ability to equipment MCU is less demanding, reduces equipment cost;Should
Scheme more simple and flexible;For the data storage of non-long data block, database can be carried out with the numerical value of single row storage and
Analysis.
Brief description of the drawings
Fig. 1 is a kind of flow chart of data message processing method of one embodiment of the invention;
Fig. 2 is a kind of composition structure chart of data message processing system of one embodiment of the invention.
Embodiment
Below by clearly understandable mode, preferred embodiment is described with reference to the drawings, to a kind of processing of data message
Above-mentioned characteristic, technical characteristic, advantage and its implementation of method and system are further described.
Fig. 1 is a kind of flow chart of the processing method of data message of one embodiment of the invention.As shown in figure 1, described
Method is applied in Internet of Things, including:
S1, equipment transmitting terminal determines target data waiting for transmission, and one data message of generation is sent to equipment equipment receiving terminal, institute
State the data definition of a byte of the data message including the target data and for the data attribute that indicates the target data
Word;
S2, equipment receiving terminal obtains the data message, and the data for judging the target data according to the data definition word belong to
Property, and the data message is parsed according to the data attribute.
The method of the present invention is applied in Internet of Things, is sent datagram between the equipment in Internet of Things, is reported by sending
Text completes the data information transfer of equipment room, such as, and control centre's equipment in Internet of Things sends control information into network
Smart machine;The smart machine transmission status information of itself is to control centre's equipment, so that control centre's equipment obtains network
In smart machine status information.In Internet of Things, equipment transmitting terminal sends message, it is determined that the target data to be sent, if
Preparation sending end sets the data definition word of a byte, and the data definition word is used for the data attribute for indicating the target data, and
A data message is generated, the data message includes the data definition word and target data of a byte.Equipment receiving terminal is received
The data message, parses the data message, obtains the data definition word in data message, and judge according to the defined word
The data attribute of the target data, then according to the data attribute of the target data, obtains the mesh in the data message
Data are marked, and the target data is correspondingly handled.Such as, in Internet of Things, the Internet of Things is included in a control
Heart equipment and intelligent bulbs, if control centre equipment controls the color of bulb, send the data message of control bulb color to intelligence
Energy bulb, the message format is as follows:
Heading+data definition word(One byte)+ target data(Bulb color data is set),
Wherein, the data definition word of a byte be for setting the corresponding data attribute of this target data of bulb color, it is described
Data definition word includes setting the data type of bulb color and the data length of target data, such as, represent bulb color
Data type, it is conventional to be represented using RGB data type or RGBW data type.Equipment receiving terminal receives the data
After message, data message is parsed, the data definition word in the data message is obtained, and according to the data definition word,
Obtain the data attribute and data length in the data message, the i.e. data attribute of target data for RGB data type or
RGBW data type, and according to the length of data definition word acquisition target data, data are obtained according to target data length
The data message of the setting bulb color of message, so as to judge the data message to set bulb color, intelligent bulbs are set
Bulb color.
In the technical scheme, data definition word of the data message that equipment room is sent in Internet of Things comprising byte and
Target data, a variety of data attributes of target data can be just represented by the data definition word of a byte, such as, data category
Property includes I/O mode, the data type of switching value, the data type of analog quantity and the corresponding target data of data
Data length;Relative to TLV forms in the prior art, the technical scheme data message length is reduced, and reduces accessing cost for data,
The time of data transfer is reduced simultaneously, the utilization rate of bandwidth is improved, also improves the efficiency being wirelessly transferred, and can allow support more
Multiradio device;The program more simple and flexible;The logical process of data message is simple, the disposal ability requirement to the MCU of equipment
It is not high, so as to reduce equipment cost.
Technical scheme is described in detail with the specific embodiment of the present invention below.Equipment transmitting terminal
The data message form of transmission is as follows:
Heading | Message length | Command word | Equipment 1 | Type1 | Data1 | Equipment 2 | Type2 |
Data2 | …… |
Wherein, heading includes the version information and message length of message;Command word represents the type of the message, such as, the report
Text is control message or state message;Equipment represents the object performed by target data data, accordingly in Internet of Things
The unique ID number of smart machine;Type represents the corresponding data definition words of target data data;Data represents that equipment transmitting terminal is sent out
The target data sent.
Wherein, data definition word Type is defined as follows shown in table 1:
bit7 | Input and output are described |
bit6-bit1 | Referring specifically to table 2 |
bit0 | On off state is described |
Wherein, bit6-bit1 definition description, as shown in table 2 below:
Bit6-bit1 | Description |
000000 | The data type of switching value |
1XXXXX | The data type of analog quantity, XXXXX represents the precision of analog data |
01XXXX | The data type of array |
0001XX | The data type of 16 floating numbers, XX represents precision |
000010 | Multimedia data type |
Above-mentioned Tables 1 and 2 is described in detail with specific embodiment below.
Preferably, the data attribute includes data direction, switching value data type, analog data type, floating number
Data type, array data type and multimedia data type.
Specifically, the data definition word is used to refer to the data attribute of target data.It is common in Internet of Things application to retouch
The data attribute for stating data is a variety of, such as, describes the data attribute of device data control direction, generally using input and output come
Represent;The data type of presentation data is described the data type of facility switching amount, for example, representing that the on off state of equipment is usual
Using switching value data type;For representing that the data type of equipment color generally uses analog data type;Equipment is described
The data type of humiture generally uses the data type of floating number;Serial communication generally uses the data type of array;One section
The data type of image or a section audio uses multimedia data type.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the first preset value in the first predetermined bit section of the data definition word, and first preset value refers to
Show the data direction of the target data;
Step S2 further comprises:
Equipment receiving terminal confirms the data direction of the target data according to first preset value, and according to the data side
To the parsing data message.
Bit7 is set to represent data direction in the specific embodiment of the present invention, data definition word, to represent data
Input and output, such as it is 1 expression data input direction to set bit7, and bit7 is 0 expression data output direction.Such as, Internet of Things
Include control centre's equipment and intelligent bulbs, control centre's equipment, which is sent, opens the data messages of intelligent bulbs to intelligent bulbs
When, it is 10000001b to set data definition word, and the form that sends datagram is as follows:
Heading+message length+command word+{ intelligent bulbs ID }+{ 10000001b };
When intelligent bulbs send data to control centre's equipment, the bit7 for setting data definition word is 0.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the second preset value in the second predetermined bit section of the data definition word, and second preset value is used
To indicate the data attribute of the target data as switching value data type;
Step S2 further comprises:
Equipment receiving terminal confirms the data length of the target data according to second preset value and switching value data type, and
According to the switching value data type and data length, the data message is parsed.
Set bit0 to represent the on off state of smart machine in the specific embodiment of the present invention, data definition word, be used for
The on off state of the smart machine in Internet of Things is represented, bit0 is that 1 expression is opened, and bit0 represents to close for 0, in data definition word
Setting bit1-bit6 is 000000b, is expressed as switching value data type, the value is to represent the target data in data message
Data attribute be switching value data type, and according to the value of data definition word confirm target data data length, to switch
Measure for data type, the data length of the target data is 0 byte, i.e., the state of switch is represented with bit0, passes through bit0
Value come set smart machine open either close or according to bit0 value obtain smart machine on off state.Such as, exist
In Internet of Things, the Internet of Things includes control centre's equipment and intelligent switch, and control centre's equipment is to open intelligent switch, control
Central apparatus send the data message for opening intelligent switch to intelligent switch, and the data message includes data definition word and target
Data, wherein, it is 1 for 1, bit0 to set the bit7 of data definition word, and settings bit1-bit6 is 000000b, thus data definition
The target data that word is set in 10000001b, data message is 0 byte, thus the form that sends datagram is as follows:
Heading+message length+command word+{ intelligent switch ID }+{ 10000001b };
Intelligent switch receives the data message, and the data message is parsed, and the value of data definition word is obtained, according to data
Bit1-bit6 in defined word is 000000b, judges target data for switching value data type, and the data of target data
Length is 0 byte, and then the bit0 in data definition word is 1, judges to open intelligent switch, bit7 is represented to switch for 1
It is configured, therefore is that 1, bit7 is 1 and bit1-bit6 is 000000b according to bit0, it is to open intelligence to judge the data message
Switch, the operation for opening switch is performed to intelligent switch.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the 3rd preset value in the 3rd predetermined bit section of the data definition word, and the 3rd preset value refers to
The data attribute for showing the target data is analog data type;
Step S2 further comprises:
Equipment receiving terminal determines the data length of target data according to the 3rd preset value, and according to the analog data class
Type and data length, parse the data message.
Bit1-bit6 is set to be 1XXXXXb in the specific embodiment of the present invention, data definition word, the value is expressed as mould
Analog quantity data type, the value to represent the target data in data message be analog data type, wherein, XXXXX value
Data length to represent the target data.Such as, in Internet of Things, the Internet of Things includes control centre's equipment and intelligence
Bulb, control centre's equipment is to set the color of intelligent bulbs and opening intelligent bulbs, and control centre's equipment, which is sent, sets lamp
The data message of color and opening intelligent bulbs is steeped to intelligent bulbs, and the data message includes data definition word and number of targets
According to, wherein, it is 1 for 1, bit0 to set the bit7 of data definition word, and settings bit1-bit6 is 110111b, thus data definition word
The data length for the target data being set in 11101111b, data message is(23+1)Bit, target data 0xff0000 is set
Intelligent bulbs color is put for red, the form sent datagram is as follows:
Heading+message length+command word+{ intelligent bulbs ID }+{ 11101111b }+0xff0000;
Intelligent bulbs receive the data message, parse the data message, the value of data definition word are obtained, according to data definition word
In bit7 be 1 be that intelligent bulbs are configured, it 1 is to open intelligent bulbs that bit0, which is,.It is according to bit1-bit6 values
110111, target data is judged for analog data type, and judges that the data of target data are long according to described 10111 value
Degree, i.e., data length is(23+1)Bit, obtains the target data in data message, therefore according to bit0, bit7 and bit1-
Bit6 value, it is to set bulb color and open intelligent bulbs to judge the data message, is then judged as setting according to target data
It is red to put bulb color, and intelligent bulbs perform corresponding operation.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the 4th preset value in the 4th predetermined bit section of the data definition word, and the 4th preset value refers to
The data attribute for showing the target data is array data type;
Step S2 further comprises:
Equipment receiving terminal determines the data length of target data according to the 4th preset value, and according to the array data type
And data length, parse the data message.
It is 01XXXXb that bit1-bit6 is set in the specific embodiment of the present invention, data definition word, and the value is expressed as number
Group data type, the value to represent the target data in data message be array data type, wherein, XXXXX value is represented
The data length of target data in the data message.Such as, in Internet of Things, the Internet of Things include control centre's equipment and
Terminal device is acted on behalf of, an external third party device under the agent equipment, is communicated between the two by serial communication,
Agent equipment is responsible for Serial Port Information passing through control centre's equipment, now can with using array mode by the number of Serial Port Information
According to transmission, it is 0 for 1, bit0 to set the bit7 of data definition word, and setting bit1-bit6 is 010010b, wherein, 0010 value multiplies
Represent that the data length of target data is 8 bytes with 4, { 0x12345678+0x90abcdef } represents the target in data message
Data, data definition word is set to 10100100b, thus the data message form sent is as follows:
Heading+message length+command word+{ proxy terminal ID }+{ 10100100b }+{ 0x12345678+
0x90abcdef };
Agent equipment receives the data message, and the data message is parsed, and obtains the data definition word in data message
Value, according to the bit1-bit6 of data definition word be 010010b, judge the target data in data message for data group data
Type, then 0010 value in data definition word, the data length for judging target data is 8 bytes, obtains data
Target data in message, it is { 0x12345678+0x90abcdef } that agent equipment obtains target data according to data length, from
And corresponding operation is performed according to target data.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the 5th preset value in the 5th predetermined bit section of the data definition word, and the 5th preset value refers to
The data attribute for showing the target data is floating number data type;
The step S2 further comprises:
Equipment receiving terminal determines the floating number precision of target data according to the 5th preset value, and according to the floating number data
Type and floating number precision, parse the data message.
Set bit1-bit6 to be 0001XXb in the specific embodiment of the present invention, data definition word, be expressed as 16 and float
Points data type, the value is to represent that the target data in data message is 16 floating number data types, 16 floating numbers
Data type indicate target data length be fixed as 2 bytes, wherein, XX value represents the floating number precision of target data
Or decimal place number.Such as, in Internet of Things, the Internet of Things includes control centre's equipment and temperature sensor, control centre
If obtaining the temperature data of temperature sensor, temperature sensor reports temperature data to control centre's equipment, sets data definition
The bit7 of word is that 0, bit0 is 0, and setting bit1-bit6 is 000110b, wherein 10 represent the decimal place of temperature data for 2,
Data definition word is set to 00001100b, and { 0x09c4 } is the target data sent, represents 25.00 degree of temperature, temperature sensor
The data message form of transmission is as follows:
Heading+message length+command word+{ control centre's device id }+{ 00001100b }+{ 0x09c4 };
Control centre's equipment receives the data message, parses the data message, obtains the value of data definition word, fixed according to data
Bit1-bit6 in adopted word is 000110b, target data is judged for 16 floating number data types, then according to data definition
10 values in word, the decimal place for being judged as target data { 0x09c4 } is 2, according to the decimal of target data and target data
Position, therefore the temperature data of control centre's equipment acquisition temperature sensor is 25.00 degree.
Preferably, the step S1 further comprises:
Equipment transmitting terminal sets the 6th preset value in the 6th predetermined bit section of the data definition word, and the 6th preset value refers to
The data attribute for showing the target data is multimedia data type;
The step S2 further comprises:
Equipment receiving terminal determines the data length of target data according to the 6th preset value and a preset algorithm, and according to described
Multimedia data type and data length, parse the data message.
Set bit1-bit6 to be 000010 in the specific embodiment of the present invention, data definition word, be expressed as multimedia number
According to type, the value is to represent that the target data in data message is multimedia data type.Such as, in Internet of Things, the thing
Networking includes control centre's equipment and intelligent sound playback equipment, and control centre's equipment sends voice to voice playing equipment and believed
Breath.It is 0 for 1, bit0 to set the bit7 of data definition word, and it is 000010 to set bit1-bit6, and data definition word is set to
10000100b, the data message form that control centre's equipment is sent is as follows:
Heading+message length+command word+{ intelligent sound playback equipment ID }+{ 10000100b }+{ multi-medium data
Head+speech data };
Intelligent sound playback equipment receives the data message, parses the data message, the value of data definition word is obtained, according to number
It is 000010b according to the bit1-bit6 in defined word, judges target data for multimedia data type, then according to a pre- imputation
Method determines the data length of the target data in data message, such as, and the number of target data is obtained according to multi-medium data head
According to length.Intelligent sound equipment obtains the target data in data message according to data length, and then sets the voice number played
According to.
According to above-mentioned specific embodiment, a variety of numbers of target data can just be represented by the data definition word of a byte
According to attribute, relative to TLV forms in the prior art, the technical scheme reduces accessing cost for data, improves the utilization rate of bandwidth, such as,
Control device sends datagram to bulb, it is desirable to set bulb color to be red and open bulb, according to TLV forms, then
The data message form of transmission is:
Heading+message length+setting color commands word+{ intelligent bulbs ID }+0x01 (type)+0x03 (len)+
0xff0000 (val)+setting switch command word+{ intelligent bulbs ID }+0x01 (type)+0x01(length)+0x01
(val);
According to technical scheme, then the data message form sent is:
Heading+message length+command word+{ intelligent bulbs ID }+{ 11101111b }+0xff0000;
It can be seen that from the specific embodiment and use technical scheme, data message length is reduced, and is reduced data and is opened
Pin, while reducing the time of data transfer, improves the utilization rate of bandwidth;The program more simple and flexible;The logic of data message
Processing is simple, and the disposal ability to the MCU of equipment is less demanding, so as to reduce equipment cost.
A specific embodiment of the invention, is illustrated to the date storage method of the data message in the present invention.In cloud
In the database of service end, device id, data definition word and target data in data message are stored, and described
Device id, data definition word and target data carry out storage one-to-one corresponding.Such as, database table can be designed as such as the institute of table 3
Show, smart machine ID is unique equipment Serial Number for identifying smart machine, data definition word is stored in a row, corresponding target
Data are stored in a row, the smart machine ID, data definition word and target data is corresponding is stored in database.By this
Technical scheme, you can preserved all data, reaches that data unitize, optimizes storage efficiency, reduce development amount
And maintenance workload, do not needing to design different table structures for different device types.
Table 3:
Device id | Data definition word | Target data |
Fig. 2 is a kind of composition structure chart of data message processing system of one embodiment of the invention.As shown in Fig. 2 the system
System includes equipment transmitting terminal and equipment receiving terminal, wherein,
Equipment transmitting terminal includes:
Determining module 20, for determining target data waiting for transmission;
Generation module 21, for generating a data message, the data message includes the target data and described for indicating
The data definition word of one byte of the data attribute of target data;
Sending module 22, for sending the data message to equipment receiving terminal;
Equipment receiving terminal includes:
Receiving module 23, for receiving the data message from equipment transmitting terminal;
Parsing module 24, for obtaining the data definition word in the data message, according to judging the data definition word
The data attribute of target data, and the target data is parsed according to the data attribute.
In specific implementation process, sent datagram between the equipment in Internet of Things, complete to set by sending message
Data information transfer between standby, such as, control centre's equipment in Internet of Things send smart machine of the control information into network;
The smart machine transmission status information of itself is to control centre's equipment, so that control centre's equipment obtains the smart machine in network
Status information.
In Internet of Things, equipment transmitting terminal determines the target data to be sent in determining module 20, and the target data is used
The data message that equipment is transmitted in Internet of Things, such as transmission set the data message of bulb color, or obtain TEMP
The temperature data information of device.The data definition word of one byte is set in generation module 21, and the data definition word is described for indicating
The data attribute of target data in data message, and a data message is generated, the data message includes the data of a byte
Defined word and target data.The data attribute includes data direction, switching value data type, analog data type, floating-point
Number data type, array data type and multimedia data type, such as, describe the data attribute of device data control direction,
Generally represented using input and output;The data type of presentation data is described the data type of facility switching amount;For representing
The data type of equipment color generally uses analog data type;The data type for describing equipment humiture generally uses floating-point
Several data types;Serial communication generally uses the data type of array;The data type of one section of image or a section audio is adopted
Use multimedia data type.Then the data message is sent to equipment receiving terminal by sending module 22.
Equipment receiving terminal receives data message by receiving module 23.In parsing module 24, to the data message
Parsed, obtain the data definition word in the data message, the data of the target data are judged according to the defined word
Attribute, then according to the data attribute of the target data, obtains the target data in the data message, and to the target
Data are correspondingly handled.
By the technical scheme, relative to TLV forms in the prior art, the technical scheme data message length is reduced, together
When reduce the time of data transfer, improve the utilization rate of bandwidth, also improve the efficiency being wirelessly transferred, support can be allowed more
Wireless device;The program more simple and flexible;The logical process of data message is simple, and the disposal ability to the MCU of equipment is required not
Height, so as to reduce equipment cost.
In summary, the processing method and system of a kind of data message of the invention, in data message one byte of setting
Data definition word, the data definition word can just represent the data attribute of the target data in data message, such as, target data
I/O mode, switching value information and analog quantity information etc., relative in the prior art using TLV forms generation data
The scheme of message, the technical scheme reduces accessing cost for data, improves the utilization rate of bandwidth;The program more simple and flexible.
Any those skilled in the art can repair under the spirit and scope without prejudice to the present invention to above-described embodiment
Decorations are with changing.Therefore, the scope of the present invention, should be as listed by claims.
Claims (10)
1. a kind of processing method of data message, methods described is applied in Internet of Things, it is characterised in that methods described includes:
S1, equipment transmitting terminal determines target data waiting for transmission, and one data message of generation is sent to equipment receiving terminal, the number
Include the data definition word of the target data and a byte for the data attribute that indicates the target data according to message;
S2, equipment receiving terminal obtains the data message, and the data for judging the target data according to the data definition word belong to
Property, and the data message is parsed according to the data attribute.
2. the processing method of data message as claimed in claim 1, it is characterised in that the data attribute includes data side
To, switching value data type, analog data type, floating number data type, array data type and multimedia data type.
3. the processing method of data message as claimed in claim 2, it is characterised in that
The step S1 further comprises:
Equipment transmitting terminal sets the first preset value in the first predetermined bit section of the data definition word, and first preset value refers to
Show the data direction of the target data;
Step S2 further comprises:
Equipment receiving terminal confirms the data direction of the target data according to first preset value, and according to the data side
To the parsing data message.
4. the processing method of data message as claimed in claim 3, it is characterised in that
The step S1 further comprises:
Equipment transmitting terminal sets the second preset value in the second predetermined bit section of the data definition word, and second preset value is used
To indicate the data attribute of the target data as switching value data type;
Step S2 further comprises:
Equipment receiving terminal confirms the data length of the target data according to second preset value and switching value data type, and
According to the switching value data type and data length, the data message is parsed.
5. the processing method of data message as claimed in claim 3, it is characterised in that
The step S1 further comprises:
Equipment transmitting terminal sets the 3rd preset value in the 3rd predetermined bit section of the data definition word, and the 3rd preset value refers to
The data attribute for showing the target data is analog data type;
Step S2 further comprises:
Equipment receiving terminal determines the data length of target data according to the 3rd preset value, and according to the analog data class
Type and data length, parse the data message.
6. the processing method of described data message as claimed in claim 3, it is characterised in that
The step S1 further comprises:
Equipment transmitting terminal sets the 4th preset value in the 4th predetermined bit section of the data definition word, and the 4th preset value refers to
The data attribute for showing the target data is array data type;
Step S2 further comprises:
Equipment receiving terminal determines the data length of target data according to the 4th preset value, and according to the array data type
And data length, parse the data message.
7. the processing method of data message as claimed in claim 3, it is characterised in that
The step S1 further comprises:
Equipment transmitting terminal sets the 5th preset value in the 5th predetermined bit section of the data definition word, and the 5th preset value refers to
The data attribute for showing the target data is floating number data type;
The step S2 further comprises:
Equipment receiving terminal determines the floating number precision of target data according to the 5th preset value, and according to the floating number data
Type and floating number precision, parse the data message.
8. the processing method of data message as claimed in claim 3, it is characterised in that
The step S1 further comprises:
Equipment transmitting terminal sets the 6th preset value in the 6th predetermined bit section of the data definition word, and the 6th preset value refers to
The data attribute for showing the target data is multimedia data type;
The step S2 further comprises:
Equipment receiving terminal determines the data length of target data according to the 6th preset value and a preset algorithm, and according to described
Multimedia data type and data length, parse the data message.
9. the processing method of data message as claimed in claim 1, it is characterised in that the data message also includes equipment
ID, and the device id in the data message, data definition word and target data are stored in database, and the equipment
ID, data definition word and target data are corresponded.
10. a kind of data message processing system, it is characterised in that the system includes equipment transmitting terminal and equipment receiving terminal, its
In,
Equipment transmitting terminal includes:
Determining module, for determining target data waiting for transmission;
Generation module, for generating a data message, the data message includes the target data and for indicating the mesh
Mark the data definition word of a byte of the data attribute of data;
Sending module, for sending the data message to equipment receiving terminal;
Equipment receiving terminal includes:
Receiving module, for receiving the data message from equipment transmitting terminal;
Parsing module, for obtaining the data definition word in the data message, the mesh is judged according to the data definition word
The data attribute of data is marked, and the target data is parsed according to the data attribute.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710429584.8A CN107181813A (en) | 2017-06-09 | 2017-06-09 | The processing method and system of a kind of data message |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710429584.8A CN107181813A (en) | 2017-06-09 | 2017-06-09 | The processing method and system of a kind of data message |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107181813A true CN107181813A (en) | 2017-09-19 |
Family
ID=59836443
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710429584.8A Pending CN107181813A (en) | 2017-06-09 | 2017-06-09 | The processing method and system of a kind of data message |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107181813A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107864199A (en) * | 2017-11-07 | 2018-03-30 | 山东网智物联网科技有限公司 | The realization device of Internet of Things communication means, device and Internet of Things Network Communication |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101799682A (en) * | 2010-03-01 | 2010-08-11 | 胡虹 | Intelligent control system for household equipment and method for controlling same |
CN103175566A (en) * | 2011-12-22 | 2013-06-26 | ***通信集团公司 | System, device and method for calibrating sensor |
CN106559300A (en) * | 2016-11-27 | 2017-04-05 | 杭州柏年智能光电子股份有限公司 | One kind is applied to intelligent lamp box CAN communication means |
-
2017
- 2017-06-09 CN CN201710429584.8A patent/CN107181813A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101799682A (en) * | 2010-03-01 | 2010-08-11 | 胡虹 | Intelligent control system for household equipment and method for controlling same |
CN103175566A (en) * | 2011-12-22 | 2013-06-26 | ***通信集团公司 | System, device and method for calibrating sensor |
CN106559300A (en) * | 2016-11-27 | 2017-04-05 | 杭州柏年智能光电子股份有限公司 | One kind is applied to intelligent lamp box CAN communication means |
Non-Patent Citations (1)
Title |
---|
郭毅: "基于WSN的智能航标***研究与设计", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107864199A (en) * | 2017-11-07 | 2018-03-30 | 山东网智物联网科技有限公司 | The realization device of Internet of Things communication means, device and Internet of Things Network Communication |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105577736B (en) | A kind of electric line carrier communication terminal control mechanism, system and method | |
CN101312386B (en) | Packet generation method in radio HDMI CEC | |
WO2020231783A9 (en) | Multi-link aggregation link management | |
WO2022068506A1 (en) | Data transmission method and apparatus | |
EP2571224B1 (en) | Method for processing messages on m2m platform and m2m platform system | |
KR20140049068A (en) | Audio transfer using the bluetooth low energy standard | |
CN106773767A (en) | Intelligent robot house system and its sound control method based on Voice command | |
CN105245521B (en) | Protocol format conversion method, device and interface platform | |
CN112152884B (en) | Equipment control method and device and household appliance | |
CN101247276B (en) | large traffic simulation test tool and method for WiMAX system | |
CN106793135A (en) | Communication resource dispatching method, terminal device and base station equipment | |
CN108965293A (en) | Message parsing method and device, electronic equipment | |
CN107181813A (en) | The processing method and system of a kind of data message | |
WO2022227392A1 (en) | Handheld transceiver and communication method therefor, electronic device, and storage medium | |
CN205563123U (en) | Control panel and control system | |
CN107276901A (en) | The system and method and wireless router and terminal of integration application | |
US20230283668A1 (en) | Sensor data interpreter/converter methods and apparatus for use in low power wide area networks (lpwans) | |
CN108966168A (en) | Internet of Things gauge table, communication board and the Internet of Things gauge table means of communication based on NB-IoT | |
CN107172573B (en) | zigbee terminal communication data processing method | |
CN101754475A (en) | Data transmission method, system and device | |
CN103686863B (en) | Realize the method and system of control signaling transmission | |
CN106302056B (en) | Household Internet of things communication connection system and communication connection method | |
CN108389574A (en) | A kind of devices, systems, and methods for supporting IOT device intelligences to interconnect | |
CN111065084A (en) | Method for improving low-power-consumption Bluetooth transmission speed | |
CN110896554B (en) | Communication method, communication equipment and equipment with storage function |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170919 |