Summary of the invention
Technical problem to be solved by this invention is when adopting CSBK mode to carry out transfer of data, transmit leg can only send the short data of 8 bytes at every turn, correspondingly recipient receives only the short data of 8 bytes at every turn, effectively cannot transmit the long data that length is greater than 8 bytes.
In order to solve the problems of the technologies described above, the invention provides a kind of data transmission device and method.
According to an aspect of the present invention, provide a kind of data transmission device, it comprises:
Receiving element, be set to reception one and send information, described transmission information comprises subdata, for judging described subdata whether effective check information and order information corresponding to described subdata, described subdata is by a group in Data Placement to be sent many groups subdata out;
First judging unit, is set to according to described check information, judges that whether described subdata is effective; In the effective situation of described subdata, described subdata is saved in the memory module corresponding with the order information of this subdata; And
Second judging unit, whether the number being set to the subdata that cycle criterion is saved is less than default reference group number, until when the number of the subdata be saved equals reference group number, described reference group number is by the number of described Data Placement to be sent subdata out; When the number of the subdata be saved is less than described reference group number, notify that described receiving element continues to receive transmission information, notify that described first judging unit judges that whether the subdata in this transmission information is effective, and in the effective situation of described subdata, this subdata is saved in the memory module corresponding with the order information of this subdata.
Preferably, described subdata is by a group in Data Placement to be sent many groups subdata out according to the data length preset.
Preferably, identical by the check information that same Data Placement to be sent subdata is out corresponding.
Preferably, described check information comprises one or several in data encoding to be sent, enciphered message and group number, and wherein said group of number is by the number of described Data Placement to be sent subdata out.
Preferably, described check information comprises data encoding to be sent, enciphered message and group number;
Described first judging unit comprises:
3rd judging unit, is set to judge that whether described data encoding to be sent is consistent with the reference encoder preset;
4th judging unit, is set to, when described data encoding to be sent is consistent with described reference encoder, be decrypted described enciphered message according to treaty rule, and judges that whether the information after deciphering is consistent with the reference decryption information preset;
5th judging unit, be set to information after decryption with described consistent with reference to decryption information when, judge that whether described group of number consistent with described reference group number; And
6th judging unit, is set to, when described group of number is consistent with described reference group number, determine that described subdata is effective.
Preferably, data transmission device also comprises:
Division unit, is set to Data Placement to be sent as to organize subdata more;
Record cell, is set to record and often organizes the order information of subdata in described data to be sent; And
Transmitting element, is set to successively to often organizing subdata, by comprising described subdata, is used for judging that the transmission information of described subdata whether effective check information and order information corresponding to described subdata sends.
According to another aspect of the present invention, provide a kind of data transmission method, it comprises:
Receive one and send information, described transmission information comprises subdata, for judging described subdata whether effective check information and order information corresponding to described subdata, described subdata is by a group in Data Placement to be sent many groups subdata out;
According to described check information, judge that whether described subdata is effective;
If so, then described subdata is saved in the memory module corresponding with the order information of this subdata;
Circulation perform above-mentioned in steps, until when the number of the subdata be saved equals default reference group number, described reference group number is by the number of described Data Placement to be sent subdata out.
Preferably, described subdata is by a group in Data Placement to be sent many groups subdata out according to the data length preset.
Preferably, identical by the check information that same Data Placement to be sent subdata is out corresponding.
Preferably, described check information comprises one or several in data encoding to be sent, enciphered message and group number, and wherein said group of number is by the number of described Data Placement to be sent subdata out.
Preferably, described check information comprises data encoding to be sent, enciphered message and group number;
Described according to described check information, judge whether described subdata effectively comprises:
Judge that whether described data encoding to be sent is consistent with the reference encoder preset;
If so, then according to treaty rule, described enciphered message is decrypted, and judges that whether the information after deciphering is consistent with the reference decryption information preset;
If so, then judge that whether described group of number be consistent with described reference group number;
If so, then determine that described subdata is effective.
Preferably, described data transmission method also comprises:
By Data Placement to be sent for organize subdata more;
Record often organizes the order information of subdata in described data to be sent;
Successively to often organizing subdata, by comprising described subdata, be used for judging that the transmission information of described subdata whether effective check information and order information corresponding to described subdata sends.
Compared with prior art, the one or more embodiments in such scheme can have the following advantages or beneficial effect by tool:
Apply data transmission device of the present invention, first judge that whether the subdata corresponding with this transmission information be effective according to the check information in the transmission information received, then according to the order information in this transmission information, effective subdata is saved in corresponding memory module, and after receiving all subdatas, data to be sent can be reduced by the order information corresponding according to each subdata.Therefore described data transmission device is while remaining the little feature of real-time and channel confliction that short data sender mask has, achieve the accurate reception of data to be sent (long data), namely in the process receiving long data, avoiding data occurs chaotic, affect follow-up data process, improve the reliability of long data in transmitting procedure, and then the CSBK mode effectively overcoming prior art can only transmit the defect of short data.
Other features and advantages of the present invention will be set forth in the following description, and partly become apparent from specification, or understand by implementing the present invention.Object of the present invention and other advantages realize by structure specifically noted in specification, claims and accompanying drawing and obtain.
Embodiment
Describe embodiments of the present invention in detail below with reference to drawings and Examples, to the present invention, how application technology means solve technical problem whereby, and the implementation procedure reaching technique effect can fully understand and implement according to this.It should be noted that, only otherwise form conflict, each embodiment in the present invention and each feature in each embodiment can be combined with each other, and the technical scheme formed is all within protection scope of the present invention.
Technical problem to be solved by this invention is when adopting CSBK mode to carry out transfer of data, transmit leg can only send the short data of 8 bytes at every turn, correspondingly recipient receives only the short data of 8 bytes at every turn, effectively cannot transmit the long data that length is greater than 8 bytes.For solving the problems of the technologies described above, embodiments provide a kind of data transmission device.
As shown in Figure 1, it is the structural representation of data sending device in embodiment of the present invention data transmission device, this data sending device comprises division unit 101, record cell 102 and transmitting element 103, and wherein division unit 101, record cell 102 and transmitting element 103 are electrically connected between two.Wherein:
The first, division unit 101, is set to Data Placement to be sent as to organize subdata more.
Particularly, data to be sent are generally the long data that data length is greater than 8 bytes, first this long data are divided at least 2 group subdatas, and subdata is short data here.Especially, division unit 101 preferably according to the data length preset, divides data to be sent.Here, enumerate an example to assist the present invention is described.In this example, default data length is set to 6 bytes, the data length of data to be sent is 20 bytes, then due to n=20/6=3.33 ..., so be 4 groups of subdatas by Data Placement to be sent.Wherein the data length of first three groups subdata is 6 bytes, and the data length of last group subdata is 2 bytes.
The second, record cell 102, is set to record and often organizes the order information of subdata in data to be sent.
Particularly, order information represents subdata and to be in whole data to be sent in turn.Still with reference to above-mentioned example, order information corresponding to first group of subdata is 1, second group of order information that subdata is corresponding is 2, and the order information of other group subdata by that analogy.
3rd, transmitting element 103, is set to successively to often organizing subdata, by comprising described subdata, is used for judging that the transmission information of described subdata whether effective check information and order information corresponding to described subdata is sent to data sink.
Particularly, transmitting element 103 needs all to send to data sink by by Data Placement to be sent all subdatas out, for convenience of data sink after receiving all subdatas independent of each other, these group subdata reduction can be utilized to obtain original data to be sent, need to carry out data processing to each subdata: be each subdata configuration feature data, performance data is for judging whether effectively (such as judging whether each subdata is subordinated to same data to be sent etc.) each subdata, and for determining that this subdata is in (namely sorting) in turn in whole data to be sent.Therefore, performance data comprises check information and order information corresponding to subdata, and wherein check information is for judging that whether subdata is effective.
In the present invention one preferred embodiment, the check information corresponding by same Data Placement to be sent subdata is out identical.More particularly, check information preferably includes one or several in data encoding to be sent, enciphered message and group number, and wherein organizing number is by the number of Data Placement to be sent subdata out.
For clearly setting forth the course of work of data sending device, give the flow chart of the data transmission method for uplink in data sending device in one embodiment of the invention, with reference to Fig. 2, the method comprises the following steps:
Step 201: by Data Placement to be sent for organize subdata more;
Step 202: record often organizes the order information of subdata in data to be sent;
Step 203: successively to often organizing subdata, by comprising described subdata, is used for judging that the transmission information of described subdata whether effective check information and order information corresponding to described subdata is sent to data sink.
The course of work of transmitting element 103 is still described in conjunction with above-mentioned example below:
For pressing close to the CSBK data packing manner (to adapt to the conventional data transmission mode of motor digital radio station) mentioned in background technology, the transmission information of corresponding first group of subdata accounts for 8 bytes, wherein front 2 bytes are performance data, rear 6 bytes are subdata, certainly, before performance data also can be positioned at subdata.In performance data, the high 4 bit representation data encoding to be sent of the first byte, the low 4 bit representation enciphered messages of the first byte, and high 4 bit representations of the second byte are by the number of Data Placement to be sent subdata out, namely number is organized, the order information that low this subdata of 4 bit representations of the second byte is corresponding.Transmitting element 103 successively by the transmission information transmission of each for correspondence subdata to data sink, data sink utilizes the performance data in transmission information to reduce data to be sent.
To sum up, the data transmission device of application described in the present embodiment, first data sending device by Data Placement to be sent longer for data length for organize subdata more, then successively the subdata being configured with check information and order information is sent to data sink, so that data sink utilizes check information and order information that each subdata is reassembled into original data to be sent.Therefore data transmission device is while remaining the little feature of real-time and channel confliction that short data sender mask has, achieve the transmission of long data, and in the process of transmission long data, avoiding data occurs chaotic, affect follow-up data process, improve the reliability of long data in transmitting procedure, and then the CSBK mode effectively overcoming prior art can only transmit the defect of short data.
Accordingly, the embodiment of the present invention additionally provides the corresponding data sink of a kind of and above-mentioned data sending device, and the data sending device be electrically connected to each other and data sink together constitute data transmission device.As shown in Figure 3, be the structural representation of this data sink, this data sink comprises receiving element 301, first judging unit 302 and the second judging unit 303.Wherein receiving element 301, first judging unit 302 and the second judging unit 303 are electrically connected between two.Wherein:
First, receiving element 301, be set to the transmission information receiving data sending device transmission, transmission information comprises subdata, for judging described subdata whether effective check information and order information corresponding to described subdata, described subdata is by a group in Data Placement to be sent many groups subdata out.
Particularly, in the present invention one preferred embodiment, subdata is by a group in Data Placement to be sent many groups subdata out according to the data length preset.In other words, become to organize subdata by Data Placement to be sent according to the data length preset, above-mentioned subdata is wherein one group more.Further, identical by the check information that same Data Placement to be sent subdata is out corresponding.Further, check information comprises one or several in data encoding to be sent, enciphered message and group number, and wherein organizing number is by the number of Data Placement to be sent subdata out.
Second, first judging unit 302, is set to according to check information, judges that whether subdata is effective; In the effective situation of subdata, subdata is saved in the memory module corresponding with the order information of this subdata; When subdata is invalid, abandon transmission information.
Particularly, the concrete structure about the first judging unit 302 will be set forth by composition graphs 5 hereinafter in detail, therefore not carry out expansion explanation to the concrete structure of the first judging unit 302 at this.
Under determining the effective situation of the subdata of current reception, this subdata is saved in the memory module corresponding with the order information of this subdata by the first judging unit 302.Here it is to be noted, for by same Data Placement to be sent all subdatas out, these are defined as effective subdata and are all stored in same memory by data sink, this memory comprise respectively with order information multiple memory module one to one of each subdata.
When determining that the subdata of current reception is invalid, the first judging unit 302 abandons transmission information corresponding to this subdata, namely abandons the subdata that this is invalid, and not invalid to this subdata stores.
3rd, second judging unit 303, whether the number being set to the subdata that cycle criterion is saved is less than the reference group number of data sink storage, until when the number of the subdata be saved equals reference group number, reference group number is by the number of Data Placement to be sent subdata out; When the number of the subdata be saved is less than reference group number, notice receiving element 301 continues the transmission information that transmission and reception apparatus sends, notify that the first judging unit 302 judges that whether the subdata in this transmission information is effective, and in the effective situation of subdata, this subdata is saved in the memory module corresponding with the order information of this subdata.
Particularly, whether the second judging unit 303 gets all subdatas for reducing needed for original data to be sent for monitor data receiving system, namely for monitor data sink memory in whether preserve (collecting) all by Data Placement to be sent subdata out.
Second judging unit 303 judges whether the number of the subdata of being preserved by the first judging unit 302 is less than the reference group number (reference group number is by the number of Data Placement to be sent subdata out) be stored in advance in data sink, if, then mean and do not collect all required subdatas, now need to notify the action before receiving element 301 and the respective repetition of the first judging unit 302: notice receiving element 301 continues the transmission information that transmission and reception apparatus sends, notify that the first judging unit 302 judges that whether the subdata in this transmission information is effective, and in the effective situation of subdata, this subdata is saved in the memory module corresponding with the order information of this subdata.
Second judging unit 303 is before determining that the number of the subdata of being preserved by the first judging unit 302 equals to be stored in the reference group number in data sink in advance, all aforesaid operations will be repeated always, until when the number of the subdata be saved equals the reference group number be stored in advance in data sink, second judging unit 303 has determined the reception to data to be sent, couple together according to respective order information head and the tail by all subdatas, be original data to be sent.
For clearly setting forth the course of work of data sink, give the flow chart of the data receive method in data sink in one embodiment of the invention, with reference to Fig. 4, the method comprises the following steps:
Step 401: receive the transmission information that data sending device sends, transmission information comprises subdata, for judging subdata whether effective check information and order information corresponding to subdata, subdata is by a group in Data Placement to be sent many groups subdata out;
Step 402: according to check information, judges that whether subdata is effective;
Step 403: if then subdata is saved in the memory module corresponding with the order information of this subdata; Then step 405 is performed:
Step 404: otherwise abandon transmission information, and exit;
Step 405: judge whether the number of the subdata be saved is less than the reference group number of data sink storage, and reference group number is by the number of Data Placement to be sent subdata out; If so, then circulation performs step 401-406;
Step 406: otherwise exit, namely complete the reception determined data to be sent.
To sum up, the data transmission device of application described in the present embodiment, first according to the check information in the transmission information received, data sink judges that whether the subdata corresponding with this transmission information be effective, then according to the order information in this transmission information, effective subdata is saved in corresponding memory module, and after receiving all subdatas, data to be sent can be reduced by the order information corresponding according to each subdata.Therefore described data transmission device is while remaining the little feature of real-time and channel confliction that short data sender mask has, achieve the accurate reception of data to be sent (long data), namely in the process receiving long data, avoiding data occurs chaotic, affect follow-up data process, improve the reliability of long data in transmitting procedure, and then the CSBK mode effectively overcoming prior art can only transmit the defect of short data.
In the present invention one preferred embodiment, as shown in Figure 5, be in the embodiment of the present invention when check information comprises data encoding to be sent, enciphered message and group number, the structural representation of the first judging unit 302 shown in Fig. 3, this first judging unit 302 comprises the 3rd judging unit 501, the 4th judging unit 502, the 5th judging unit 503 and the 6th judging unit 504 that connect in turn each other.Wherein:
3rd judging unit 501, is set to judge that whether data encoding to be sent is consistent with the reference encoder that data sink stores.Especially, the 3rd judging unit 501 is preferably set to judge that whether data encoding to be sent is identical with the reference encoder that data sink stores.
4th judging unit 502, be set to when data encoding to be sent is consistent with the reference encoder that data sink stores, according to treaty rule (namely data sending device and data sink appoint in advance encryption and decryption rule) enciphered message is decrypted, and judge deciphering after information whether consistent with the reference decryption information that data sink stores.Especially, the 4th judging unit 502 is preferably set to judge that whether the information after deciphering is identical with the reference decryption information that data sink stores.
5th judging unit 503, be set to reference decryption information that information and date receiving system after decryption stores consistent when, judge that whether group number consistent with the reference group number that data sink stores.Especially, the 5th judging unit 503 is preferably set to judge that whether group number is identical with the reference group number that data sink stores.
6th judging unit 504, is set to, when organizing number and being consistent with the reference group number that data sink stores, determine that subdata is effective.
For clearly setting forth the course of work of above-mentioned first judging unit 302 of number, give the flow chart judging subdata whether effective method in the first judging unit 302 shown in Fig. 5 in a preferred embodiment of the invention, as shown in Figure 6, the method comprises the following steps:
Step 601: judge that whether data encoding to be sent is consistent with the reference encoder that data sink stores;
Step 602: if be then decrypted enciphered message according to treaty rule, then performs step 603; Otherwise, perform step 606;
Step 603: judge that whether the information after deciphering is consistent with the reference decryption information that data sink stores;
Step 604: if then judge that whether group number is consistent with the reference group number that data sink stores, then performs step 605; Otherwise perform step 606;
Step 605: if then determine that subdata is effective, exit; Otherwise perform step 606;
Step 606: determine that subdata is invalid.
Those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the present invention is not restricted to any specific hardware and software combination.
Although execution mode disclosed in this invention is as above, the execution mode that described content just adopts for the ease of understanding the present invention, and be not used to limit the present invention.Technical staff in any the technical field of the invention; under the prerequisite not departing from spirit and scope disclosed in this invention; any amendment and change can be done what implement in form and in details; but scope of patent protection of the present invention, the scope that still must define with appending claims is as the criterion.