Summary of the invention
In order to solve the problems of the technologies described above, the first object of the present invention is to provide a kind of transmission method of structure based data.
Another object of the present invention is to provide a kind of transmitting device of structure based data.
First technical scheme of the present invention is: the transmission method of structure based data, and the method comprising the steps of:
Y1, obtains the XML document being used for transmission structure data;
Y2, carries out compression coding according to the data dictionary preset and data assembling rule to described document;
Data after compression coding are transmitted by Y3.
Further, described step Y2 its specifically comprise sub-step:
Y21, obtain the data dictionary and data assembling rule preset, wherein, described data dictionary comprises the data element of structural data and the mark key assignments corresponding with each data element, and described preset data assembling rule comprises data frame format;
Y22, carries out compression coding according to described data dictionary and data frame format by described document, obtains the data after compression coding.
Further, described data frame format comprises message header and message body; Described message header comprises the descriptor of message; The descriptor of described message comprises protocol type, version number, operational order mark; Described protocol type is for identifying protocol class between platform; Described operational order mark is used for identification field identification message type; Described message body be the data element of structural data in described document encoded after content, after described message body is located at message header.
Further, described mark key assignments is hexadecimal format, and described data frame format adopts the message header of hexadecimal format and the message body of hexadecimal format; According to described data dictionary and data frame format, described document is carried out compression coding, obtain this step of the data after compression coding, it is specially: according to described data dictionary and data frame format, the data element of the descriptor of message and the structural data of transmission in described document is converted to the data of corresponding hexadecimal format, and the data of described hexadecimal format are assembled according to described data frame format, obtain the data after compression coding.
Further, described message header also comprises number of retransmissions mark, frame number, information block length.
Second technical scheme of the present invention is:
This device comprises: data connection object module: for obtaining the XML document for transmission structure data; Compression coding module: for carrying out compression coding according to the data dictionary preset and data assembling rule to described document; Transport module: for the data after compression coding are transmitted.
Further, described compression coding module comprises pre-preparation module and structure coding module;
Described pre-preparation module: for obtaining default data dictionary and data assembling rule,
Wherein, described data dictionary comprises the data element of structural data and the mark key assignments corresponding with each data element, and described preset data assembling rule comprises data frame format;
Described structure coding module: for described document being carried out compression coding according to described data dictionary and data frame format, obtain the data after compression coding.
Further, described data frame format comprises message header and message body; Described message header comprises the descriptor of message; The descriptor of described message comprises protocol type, version number, operational order mark; Described protocol type is for identifying protocol class between platform; Described operational order mark is used for identification field identification message type; Described message body be the data element of structural data in described document encoded after content, after described message body is located at message header.
Further, described mark key assignments is hexadecimal format, the message header of described data frame format and the message body hexadecimal format of being; Described structure coding module is specifically for according to described data dictionary and data frame format, the data element of the descriptor of message and the structural data of transmission in described document is converted to the data of corresponding hexadecimal format, and the data of described hexadecimal format are assembled according to described data frame format, obtain the data after compression coding.
Further, described message header also comprises number of retransmissions mark, frame number, information block length.
First beneficial effect of the present invention is:
The transmission method that the present invention is based on structural data defines data dictionary and the rule to data assembling by the data area in advance according to transmission, according to data dictionary and data frame format, data to be transmitted object is carried out compression coding, after encoded compression, significantly can reduce the data volume of transmission, improve the validity of transmission.
In addition, due to the data acquisition hexadecimal format of the present invention's transmission, existing cryptographic algorithm can be used, promote the security of data transmission; Because the present invention marks in the message header definition information block length of Frame, allow the integrality of receiving end energy perception data, promote the correctness exchanging data; In the message header definition frame sequence number of Frame, make data content can batchwise transfer when bandwidth deficiency, be beneficial to the assembling of opposite end, improve the availability of Radio Resource; At the message header definition number of retransmissions mark of Frame, possesses retransmission capability.
Second beneficial effect of the present invention is:
The present invention is based on the transmitting device of structural data, by arranging compression coding module, realizing data to be transmitted object to carry out compression coding, significantly reducing the data volume of transmission, improve the validity of transmission.
Embodiment
Be described the principle of invention and feature below in conjunction with accompanying drawing, example, only for explaining invention, is not intended to limit scope of the present invention.
The system applying transmission method of the present invention needs define data dictionary according to the data area of transmission and define the rule of data assembling in advance, and this method is applied to the transmitting scene of structural data (can be defined by data dictionary).
Fig. 1 is the schematic flow sheet of the transmission method that the present invention is based on structural data, as shown in Figure 1, the transmission method of structure based data, the method comprising the steps of:
Y1, obtains the XML document being used for transmission structure data;
Y2, carries out compression coding according to the data dictionary preset and data assembling rule to described document;
Data after compression coding are transmitted by Y3.
Described step Y2 its specifically comprise sub-step:
Y21, obtain the data dictionary and data assembling rule preset, wherein, described data dictionary comprises the data element of structural data and the mark key assignments corresponding with each data element, and described preset data assembling rule comprises data frame format;
Y22, carries out compression coding according to described data dictionary and data frame format by described document, obtains the data after compression coding.
Data frame format comprises message header and message body; Message header comprises the descriptor of message; The descriptor of message comprises protocol type, version number, operational order mark; Protocol type is for identifying protocol class between platform; Operational order mark is used for identification field identification message type; Message header also comprises number of retransmissions mark, frame number, information block length; Marked by definition information block length, allow the integrality of receiving end energy perception data, promote the correctness exchanging data; By definition frame sequence number, make data content can batchwise transfer when bandwidth deficiency, be beneficial to the assembling of opposite end, improve the availability of Radio Resource; By definition number of retransmissions mark, retransmitting function can be realized.Message body be the data element of structural data in described document encoded after content, message body is immediately preceding after message header.
Below for the transmission requirement of " table 1 data element transmission demand signal table ", the specific implementation process of transmission method of the present invention is described.
In advance according to the data area definition data dictionary of transmission and the rule to data assembling.
Definition data dictionary is in table 2, table 2 is data dictionary definition standard, as shown in table 2, data dictionary comprises the data element of structural data and the mark key assignments corresponding with each data element, in the present embodiment, mark key assignments comprises type key assignments and data key values, all adopts hexadecimal format to be described; Wherein data key values is used for identification data item, and type key assignments is used for identification data item content.In data transmission procedure with type key assignments+data key values for transmission information, other information in form be management this data message maintenance information.As transmission information: " the equipment use state " of 00010101 expression " equipment 1 " is " taking " state.
The rule of preset data assembling, namely define data frame format, table 3 is data frame format, as shown in table 3, and data frame packet is containing message header and message body, and message body is immediately following after message header.Message header comprises the descriptor of message, and the descriptor of message comprises protocol type, version number, operational order mark, number of retransmissions, frame number, information block length.
Below, associative list 4 illustrates the process of " table 1 data element transmission demand signal table " data to be transmitted object being carried out to compressed encoding, and table 4 is the compressed encoding table of comparisons.
As shown in table 4, the message header of frame format and message body desired value all adopt hexadecimal format in the present embodiment, fill in message header information according to table 3 data frame format, will treat that in former XML document, transmission information is converted to type key assignments+data key values and inserts message body according to table 2; After encoded compression, the actual information sent is: 1E01000100060401000101010302.
From this example, data volume used for traditional X-ray ML method can be reduced to 28 bytes from 200 bytes by transmission method described in this patent, greatly improve the validity of transmission, and existing cryptographic algorithm can be used to promote the security of data transmission by the data that this patent transmits.In addition, the present invention, by increasing information block length mark, allows the integrality of receiving end energy perception data, promotes the correctness exchanging data; The present invention, by increasing frame number, makes data content can batchwise transfer when bandwidth deficiency, is beneficial to the assembling of opposite end, improves the availability of Radio Resource.
Fig. 2 is the structural representation of the transmitting device of a kind of structure based data of the present invention, and as shown in Figure 2, the invention also discloses the transmitting device of structure based data, this device comprises:
Data connection object module: for obtaining the XML document for transmission structure data;
Compression coding module: for carrying out compression coding according to the data dictionary preset and data assembling rule to described document;
Transport module: for the data after compression coding are transmitted.
Compression coding module comprises pre-preparation module and structure coding module.
Pre-preparation module: for obtaining default data dictionary and data assembling rule, wherein, data dictionary comprises the data element of structural data and the mark key assignments corresponding with each data element, and described mark key assignments is hexadecimal format; Preset data assembling rule comprises data frame format, the message header of data frame format and the message body hexadecimal format of being.
Structure coding module: for described document being carried out compression coding according to data dictionary and data frame format, obtain the data after compression coding.Structure coding module is specifically for according to data dictionary and data frame format, the data element of the descriptor of message and the structural data of transmission in described document is converted to the data of corresponding hexadecimal format, and the data of described hexadecimal format are assembled according to described data frame format, obtain the data after compression coding.
Fig. 3 is that the data transmit-receive of the system applying transmission method of the present invention runs schematic diagram; Below in conjunction with Fig. 3, the system data transmitting-receiving process of application transmission method of the present invention is introduced.
As shown in Figure 3, the transmitting terminal of system and receiving end need to define data dictionary and data frame format according to the data area of transmission in advance, then complete the transmitting procedure of data in the following way:
S1, data send; Conventionally send data connection object;
S2, coding: carry out compression coding to data connection object according to defined data dictionary and frame format, obtain the data after compressing;
S3, transmission data: conventionally the data after compression are sent to transmission equipment;
S4, wireless transmission: transmission equipment completes information transmission;
S5, reception data: conventionally receive the data after compression;
S6, decoding: according to data dictionary and frame format to the decoding data after compression, obtain the data after reducing;
S7, data send: the data after reduction are transferred to reception object.
Wherein the decode procedure of S6 is the inverse process of S2 coding.
Apply the system of transmission method of the present invention, wireless bandwidth utilization rate can be promoted, promote the validity of transmission, and encryption method can be used to promote the security of transmission.
More than that better enforcement of the present invention is illustrated, but the invention is not limited to described embodiment, those of ordinary skill in the art also can make all equivalent variations or replacement under the prerequisite without prejudice to spirit of the present invention, and these equivalent distortion or replacement are all included in the application's claim limited range.