WO2015062503A1 - Data packet encapsulation method and check method - Google Patents

Data packet encapsulation method and check method Download PDF

Info

Publication number
WO2015062503A1
WO2015062503A1 PCT/CN2014/089784 CN2014089784W WO2015062503A1 WO 2015062503 A1 WO2015062503 A1 WO 2015062503A1 CN 2014089784 W CN2014089784 W CN 2014089784W WO 2015062503 A1 WO2015062503 A1 WO 2015062503A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
data
field
baseband frame
packet
Prior art date
Application number
PCT/CN2014/089784
Other languages
French (fr)
Chinese (zh)
Inventor
张文军
张娅
张震宁
应小青
项立任
史梦蕾
Original Assignee
上海数字电视国家工程研究中心有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 上海数字电视国家工程研究中心有限公司 filed Critical 上海数字电视国家工程研究中心有限公司
Publication of WO2015062503A1 publication Critical patent/WO2015062503A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0078Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
    • H04L1/0083Formatting with frames or packets; Protocol or part of protocol for error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L2001/0092Error control systems characterised by the topology of the transmission link

Definitions

  • the present invention relates to the field of digital television broadcasting, and in particular, to a data packet encapsulation method and a verification method.
  • the new generation digital TV broadcasting system can support various types of data transmission including audio and video.
  • the specific method is to fill the data packets to be transmitted into the baseband frame data field in turn, and the composition can be performed on the broadcast channel through the digital television broadcasting system.
  • the baseband frame structure of the transmission is
  • the data packet when the length of a data packet is large and exceeds the available space of the current data domain, the data packet may be divided into several segments, and each segment is transmitted using a baseband frame. After receiving all the fragments belonging to the data packet, the receiving end re-splices the fragments to obtain the original data packet.
  • the baseband frame may be distorted and error generated during transmission from the transmitting end to the receiving end, so that the data packet obtained by the receiving end after receiving the baseband frame and decoding it will not be original. Packet.
  • the receiving end may lose the entire baseband frame or even continuously lose multiple baseband frames.
  • the invention solves the problem that when the data packet is divided into several data blocks and the data blocks are carried in different baseband frames for transmission, the receiving end may miss the data block.
  • an embodiment of the present invention provides a method for encapsulating a data packet, which includes: recording, in a process of sequentially filling a data packet to be currently transmitted into one or more baseband frame data domains, recording the data packet. Data information of the number of blocks; based on the information code of the data packet and the data information of the number of times the data packet is divided to generate a check field of the data packet; the check field is spliced to the end of the information code of the data packet to Complete the encapsulation of the packet.
  • the data to be currently transmitted is sequentially padded to one or more baseband frame data fields, and the data information for recording the number of times the data packet is blocked includes:
  • Step 1) determining whether the available space of the current baseband frame data field is sufficient to carry the current data packet to be transmitted, where the data packet includes the information code and the length of the reserved check field;
  • Step 2) If the result of the determination is no, the data packet is segmented to form a first half data block and a second half data block, wherein the first half data block is adapted to fill the available space, the second half Part of the data block will be padded to the next baseband frame data field;
  • the data information of the number of times the data packet to be transmitted is currently blocked is determined based on the number of loop executions of the above steps 1) and 2).
  • the step of generating the check field of the data packet based on the information code of the data packet and the data information of the data packet by the number of times of the block includes: appending the data information of the data packet to the number of times of the block to End of the information code of the data packet to form a data packet to be verified; processing the data packet to be verified by using a first preset check field generation manner to generate a first check field as the data packet
  • the check field, wherein the first preset check field generation manner is jointly determined by the sending end and the receiving end.
  • the step of generating the check field of the data packet based on the information code of the data packet and the data information of the data packet to be the number of times of the data packet comprises: adopting a first preset check field generation manner to the data
  • the packet is processed to generate intermediate data; the data information of the data packet is added to the end of the intermediate data, and the foregoing data is processed by using a first preset check field generation manner to generate a second check field.
  • the check field of the data packet is sent by the sending end and the receiving end.
  • the step of generating the check field of the data packet based on the information code of the data packet and the data information of the data packet to be the number of times of the data packet comprises: adopting a first preset check field generation manner to the data Processing the packet to generate intermediate data; processing the intermediate data and the data information of the number of times the packet is blocked by using a second preset check field generation manner to generate a third check field as the data packet a check field; wherein the first preset check field generation manner and the second preset check field generation manner are jointly determined by the sending end and the receiving end.
  • the first preset check field is generated in a cyclic redundancy check manner.
  • the second preset check field generation manner includes any one of an exclusive OR operation, an addition operation, a subtraction operation, and a multiplication operation.
  • the embodiment of the present invention further provides a data packet verification method, where the data packet is encapsulated according to the encapsulation method of the foregoing data packet, and then padded to a baseband frame and transmitted in a channel, and then recovered at the receiving end, the verification method is obtained.
  • the check field is intercepted from the end of the data packet, and the remaining content of the data packet is used as the information code;
  • the obtaining the complete data packet from the one or more baseband frame data domains includes the following steps:
  • the data packet is not completely carried in the current baseband frame data, all data starting from the start position of the current baseband frame to the end of the data field is used as the first block of the data packet, and continues from several subsequent baseband frame data.
  • the remaining blocks of the data packet are read in the domain and spliced in sequence with the first block of the data packet to obtain an information code and a check field of the data packet, wherein the remaining partition of the data packet is based on a baseband frame frame.
  • the relationship between the start position field and the data field length field in the header is determined;
  • the information code and the check field of the data packet are obtained from the start position of the current baseband frame data field and according to the packet length of the data packet header;
  • the remaining partition of the data packet is determined according to a relationship between a start location field and a data domain length field in a baseband frame header, and includes the following situations:
  • the embodiment of the present invention further provides a data packet transmission method, including: sequentially filling a data packet to be currently transmitted into one or more baseband frame data fields; generating a verification field of the data packet, where the verification The field is determined according to the information code of the data packet and the data information of the number of times of the data packet being filled in the baseband frame data field; the check field is spliced to the end of the information code of the data packet to complete the Encapsulation of the data packet; transmitting one or more baseband frames carried in the data packet to the receiving end via the channel.
  • the data packet encapsulation method when generating the check field of the data packet, the data information of the number of times of blocking the data packet into the baseband frame data domain is considered, so that the receiving end receives the data information.
  • the data packet of the number of times the data packet is blocked is also used to check whether the data packet is correctly received, thereby improving the data packet (especially the data packet is divided into several data blocks and carried in different In the case of a baseband frame) reliability in the transmission of a broadcast communication channel.
  • the receiving end determines whether the data packet is complete by the packet length field located in the packet header.
  • the data is carried in the current baseband frame data field, and the complete data packet and the check field are obtained in different manners for different situations, and when the received data packet is verified, the data packet is considered to be blocked.
  • FIG. 1 is a schematic flow chart of a specific implementation manner of a method for packaging a data packet according to the present invention
  • FIG. 2 is a schematic diagram showing the basic structure of a baseband frame formed by encapsulating a data packet
  • 3A is a schematic diagram of a baseband frame structure in which a data packet is not divided and packaged
  • FIG. 3B is a schematic diagram of a baseband frame structure encapsulated in a case where each data block is respectively carried in a different baseband frame after the data packet is divided;
  • FIG. 4 is a schematic flow chart of a specific implementation manner of a method for verifying a data packet according to the present invention.
  • the inventors have found that in the prior art, when the data packet is divided into several data blocks and the data blocks are carried in different baseband frames for transmission, if the receiving end loses one of the baseband frames, the data block receiving error will be caused. .
  • the inventors have provided a data packet encapsulation method and a verification method by improving the data packet by considering the data information of the number of times the data packet is blocked in the process of encapsulating the data packet. It is the reliability of the data packet being divided into several data blocks carried in different baseband frames during transmission of the broadcast communication channel.
  • FIG. 1 is a schematic flow chart of a specific implementation manner of a method for packaging a data packet according to the present invention.
  • the method for packaging a data packet includes the following steps:
  • Step S11 in the process of sequentially filling the data packet to be transmitted into one or more baseband frame data fields, recording data information of the number of times the data packet is blocked;
  • Step S12 generating an check field of the data packet based on the information code of the data packet and the data information of the data packet being blocked.
  • Step S13 splicing the check field to the end of the information code of the data packet to complete the encapsulation of the data packet.
  • the data information of the number of times the data packet is blocked in the process of filling into one or more baseband frame data fields is further considered.
  • the data information of the number of times of blocking is twice.
  • step S11 in the process of sequentially filling the data packet to be transmitted into one or more baseband frame data fields, the data information of the number of times the data packet is blocked is recorded, which specifically includes the following. step:
  • Step 1) determining whether the available space of the current baseband frame data field is sufficient to carry the current data packet to be transmitted, where the data packet includes the information code and the length of the reserved check field;
  • Step 2) If the result of the determination is no, the data packet is segmented to form a first half data block and a second half data block, wherein the first half data block is adapted to fill the available space, the second half Part of the data block will be padded to the next baseband frame data field.
  • step 1) it is determined whether the available space is sufficient to carry the data packet by comparing the size relationship between the data field length occupied by the available space of the current baseband frame data field and the length of the current data packet to be transmitted. It should be noted that, in this step, the location of the check field needs to be reserved after the information code of the data packet, for example, a length of 2 bytes is reserved, and the reserved position is filled with zeros, so the length of the data packet includes Information code and reserved check field length.
  • step 2 if the packet length of the data packet is greater than the data domain length occupied by the available space of the current baseband frame data field, it is determined that the current baseband frame data field is insufficient to carry the entire data packet, and the data packet needs to be Split.
  • the divided data packet is divided into a first half data block and a second half data block, wherein the first half data block can fill the available space, and the remaining second half data block is filled into the next baseband frame data field.
  • the second half of the data block it will continue to judge according to the above step 1), that is, continue to determine whether the second half of the data block is sufficient to be carried in the current baseband frame data field (relative to the next baseband frame of the previous baseband frame) ).
  • the second half of the data block is further divided into two partial data blocks according to the above step 2), and the first half of the data blocks in the two partial data blocks can fill the baseband frame data.
  • the available space of the domain, the second half of the data block will be filled into the next baseband frame data field.
  • steps 1) and 2) are performed cyclically until the available space of the current baseband frame data field is sufficient to carry the last remaining data block.
  • data information of the number of times the data packet to be transmitted is currently blocked may be determined according to the number of loop executions in the entire process. For example, if step 1) and step 2) are performed twice in a loop, it can be determined that the current data packet to be transmitted is split twice, and the data packet is divided into three data blocks respectively carried in three consecutive basebands. In the frame data field.
  • step 1) If the result of the foregoing step 1) is yes, that is, the available space of the current baseband frame data field is sufficient to carry the data packet to be currently transmitted, the data packet does not need to be divided (that is, the data information of the number of times of blocking is 0) ), the packet will be completely carried in the current baseband frame data field.
  • step S12 the information code of the data packet and the data information of the number of times the data packet is divided are used to generate a check field of the data packet.
  • step S13 the check field is spliced to the end of the information code of the data packet to complete the encapsulation of the data packet.
  • step S12 includes the following steps:
  • the data packet to be checked is processed to generate a check field by using a first preset check field generation manner, where the first preset check field generation manner is jointly determined by the sending end and the receiving end.
  • the step S13 comprises the step of splicing the first check field to the end of the information code of the data packet to complete the encapsulation of the data packet.
  • step S12 includes the following steps:
  • the manner of generating the first preset check field is jointly determined by the sending end and the receiving end.
  • the step S13 comprises the step of splicing the second check field to the end of the information code of the data packet to complete the encapsulation of the data packet.
  • step S12 includes the following steps:
  • the manner of generating the first preset check field and the generating manner of the second preset check field are jointly determined by the sending end and the receiving end.
  • G(x, y) is the second preset check field generation mode.
  • the step S13 comprises the step of splicing the third check field to the end of the information code of the data packet to complete the encapsulation of the data packet.
  • the first preset check field is generated in a cyclic redundancy check, that is, a CRC check.
  • FIG. 2 is a schematic diagram showing the basic structure of a baseband frame formed by encapsulating a data packet.
  • the baseband frame includes a baseband frame header, a data field, and an area for zero-fill and in-band signaling.
  • the baseband frame header includes a MATYPE (MediaType) field (2 bytes), a DFL (DataFieldLength) field (2 bytes), a SYNCD (Synchronization Data) field (2 bytes), an INDICATORS field (1 byte), and a CRC-8 field (1 byte).
  • the INDICATORS field also includes a CRCI (CRC-Indicator) field (2 bits) and other fields (6 bits).
  • the data field is used to fill each data packet, and the data packet may be an IP data packet or a TS data stream packet.
  • the baseband frame includes a baseband frame header and a data field.
  • a plurality of data packets (such as a data packet N and a data packet N+1) are carried in the data domain, and the data packet is encapsulated in the data packet of each data packet according to the encapsulation method of the data packet provided by the technical solution (not The respective check fields are spliced at the end, for example, packet N and check field N, packet N+1, and check field N+1.
  • These data packets are carried in a baseband frame data field.
  • FIG. 3B is a schematic diagram of a baseband frame structure encapsulated in a case where data packets are respectively divided into different baseband frames after the data packet is divided.
  • the data packet N is divided into three data blocks, namely, a data block 1, a data block 2, and a data block 3, which are respectively carried in consecutive three baseband frame data fields.
  • Each baseband frame includes a baseband frame header and a data field.
  • the check field N of the data packet i.e., packet N
  • the transmitting end will encapsulate the data packet into a baseband frame by using the data packet encapsulation method provided by the technical solution, and then transmit each baseband frame to the receiving end via the broadcast communication channel, and the receiving end parses the data from the received baseband frame. Packet, and check whether the reception of each packet is correct.
  • FIG. 4 is a schematic flowchart diagram of a specific implementation manner of a method for verifying a data packet according to the present invention.
  • the verification method of the data packet includes the following steps:
  • Step S21 sequentially reading a data packet from a starting position of a current baseband frame data field, where the starting position is determined by a starting position field in a baseband frame header;
  • Step S22 determining whether the data packet is completely carried in the current baseband frame data field by whether the packet length field located at the packet header is zero.
  • Step S23 If the data packet is not completely carried in the current baseband frame data, all the data starting from the start position of the current baseband frame to the end of the data field is used as the first block of the data packet, and continues from the subsequent several. Reading the remaining blocks of the packet in the baseband frame data field and sequentially entering the first block of the packet Row stitching to obtain an information code and a check field of the data packet, wherein the remaining partition of the data packet is determined according to a relationship between a start position field and a data field length field in a baseband frame header;
  • Step S24 If the data packet is completely carried in the current baseband frame data, start from the starting position of the current baseband frame data field and obtain the information code and check field of the data packet according to the packet length of the data packet header. ;
  • Step S25 recording the number of baseband frames of the information code and the check field of the assembled data packet to determine the data information of the number of times the data packet is blocked;
  • Step S26 According to the preset check field generation manner and the check field length of the flag in the check algorithm flag bit in the baseband frame header, the check field is intercepted from the end of the data packet, and the remaining content of the data packet is used as the information code. ;
  • Step S27 performing a check calculation on the received data packet information code and the data information of the number of times the data packet is blocked to obtain a check field to be compared;
  • Step S28 Comparing whether the check field to be compared is consistent with the obtained check field
  • Step S29 If the two are consistent, it is determined that the data packet is received correctly.
  • step S21 the data packet is sequentially read from the start position of the current baseband frame data field.
  • the receiving end After receiving a series of consecutive baseband frames, the receiving end reads the first complete data packet from the beginning of the first baseband frame data field according to the received sequence.
  • the starting position is determined by a starting position field in the baseband frame header (such as the SYNCD field in FIG. 2), and the receiving end can determine the starting position of the data packet stored in the data field according to the information recorded in the SYNCD field. .
  • step S22 it is determined whether the data packet is completely carried in the current baseband frame data field by whether the packet length field located at the packet header is zero.
  • a packet length field is set in the header of the data packet for recording the packet length of the data packet.
  • the packet length field records the packet length of the entire data packet; and when the data packet is not completely carried in a baseband frame data field, the packet The long field is set to zero by default. Therefore, the receiving end can determine whether the data packet is completely carried in the current baseband frame data field by reading the packet length field located at the head of the data packet according to whether the value recorded by the receiver is zero.
  • step S23 if the data packet is not completely carried in the current baseband frame data, all data starting from the start position of the current baseband frame to the end of the data field is used as the first block of the data packet, and continues from the subsequent block.
  • the plurality of baseband frame data fields read the remaining blocks of the data packet and sequentially spliced with the first block of the data packet to obtain an information code and a check field of the data packet.
  • the receiving end needs to extract each data block belonging to the data packet from several baseband frames, and each data block belonging to the same data packet will be It is carried in several consecutive baseband frames. Therefore, after receiving the first data block of the data packet from the current baseband frame start position to the end of the data field, the receiving end will continue to read the remaining partition of the data packet from the subsequent baseband frame data field.
  • the remaining partition of the data packet is determined according to a relationship between a start position field and a data field length field in a baseband frame header. Specifically, the receiving end determines the total of the data fields recorded by the start position of the baseband frame data field and the data field length field (ie, the DFL field in FIG. 2) recorded in the start position field in the baseband frame header. The size relationship between the lengths to determine if the last data block of the packet has been acquired.
  • the start position field in a baseband frame header is larger than the data field length field, it is determined that the baseband frame data field is all used to carry one data block in the remaining block of the data packet, and the data packet is transmitted. undone. The receiving end will continue to retrieve the remaining data blocks from the subsequent baseband frame data field.
  • step S24 if the data packet is completely carried in the current baseband frame data, the information code of the data packet is obtained from the start position of the current baseband frame data field and according to the packet length of the packet header. Check the field.
  • the length information of the information code of the data packet can be obtained by directly or indirectly through the length field of the data packet header, and the length of the check field is obtained according to the agreement between the sending end and the receiving end for the check field calculation algorithm.
  • step S25 the number of baseband frames in which the information code of the data packet and the check field are assembled is recorded to determine the data information of the number of times the data packet is blocked.
  • the receiving end when the receiving end subsequently checks the received data packet, it needs to consider the data information of the number of times the data packet is blocked. Therefore, after obtaining the complete data packet, the receiving end also needs to record the number of baseband frames in which the information code of the data packet and the check field are assembled.
  • the receiving end can record a total of several baseband frames in the process of acquiring the entire data packet, so that it can be determined that the data packet is divided into several data blocks. And thereby determining the data information of the number of times the packet is blocked. For the case where the data packet is completely carried in the current baseband frame data field, the data information of the number of times of blocking is zero.
  • step S26 the preset check field generation mode and the check field length of the flag in the check algorithm flag bit (ie, the CRCI field in FIG. 2) in the baseband frame header are intercepted from the end of the data packet.
  • the check field the remaining content of the data packet as the information code.
  • the entire data packet obtained by the receiving end includes an information code and a check field, and the two are combined. Therefore, the receiving end needs to separately obtain the information code and the check field from it.
  • the length of the check field may be determined according to a preset check field generation manner and a check field length of the flag in the check algorithm flag bit in the baseband frame header.
  • the information code of the data packet is after the check field is intercepted. The rest of the content.
  • step S27 the received data packet information code and the data information of the number of times the data packet is blocked are subjected to check calculation to obtain a check field to be compared.
  • the receiving end performs a check operation on the information code of the received data packet in combination with the data information of the number of times the data packet is blocked according to the foregoing step S25, to obtain a check field to be compared.
  • the specific implementation process of the check operation is determined according to a preset check field generation manner of a flag in a check algorithm flag bit in a baseband frame header.
  • the sender and the receiver use the same preset check field generation manner to process the information code of the data packet to obtain the check field respectively.
  • step S12 for the different preset check field generation manners, refer to the embodiment of step S12 in the embodiment described in FIG. 1 for the manner of processing the information code of the data packet, and details are not described herein again.
  • step S28 it is compared whether the check field to be compared and the obtained check field are consistent.
  • step S29 if the two are consistent, it is determined that the data packet is received correctly. On the other hand, if the two are inconsistent, it is determined that the packet is received incorrectly.
  • the embodiment of the invention further provides a method for transmitting a data packet, which specifically includes the following steps:
  • Step S31 sequentially filling the data packet to be currently transmitted into one or more baseband frame data fields
  • Step S32 Generate a check field of the data packet, where the check field is determined according to the information code of the data packet and the data information of the number of times of blocking of the data packet in the process of filling the data field into the baseband frame;
  • Step S33 splicing the check field to the end of the information code of the data packet to complete the encapsulation of the data packet;
  • Step S34 The data packet is carried in one or more baseband frames and transmitted to the receiving end via a channel.
  • the transmitting end when the sending end generates the check field of the data packet, the transmitting end considers the data of the number of times of blocking in the process of filling the data packet into the baseband frame data domain. Information, so that in the process of parsing the received data packet at the receiving end, the data packet of the number of times the data packet is blocked is also used to check whether the data packet is correctly received, thereby improving the data packet (especially the data packet).
  • the reliability when transmitting a communication channel is divided into several data blocks that are carried in different baseband frames.

Abstract

A data packet encapsulation method and check method. The data packet encapsulation method comprises: inserting a data packet into one or a plurality of baseband frame data fields, and recording data information regarding the number of times the current data packet to be transmitted has been segmented into blocks; generating a check field for said packet on the basis of an information code of the data packet and the data information regarding the number of times said packet has been segmented into blocks; and, adding the check field onto the end of said information code to complete data packet encapsulation. The present technical solution improves the reliability of data packet transmission over a broadcast communication channel, particularly when a data packet has been segmented into several data blocks carried in different baseband frames.

Description

数据包的封装方法及校验方法Data packet encapsulation method and verification method 技术领域Technical field
本发明涉及数字电视广播领域,特别涉及数据包的封装方法及校验方法。The present invention relates to the field of digital television broadcasting, and in particular, to a data packet encapsulation method and a verification method.
背景技术Background technique
新一代数字电视广播系统能够支持包括音频、视频在内的各类数据传输,其具体方法是将待传输的数据包依次填入基带帧数据域中,组成可以通过数字电视广播系统在广播信道进行传输的基带帧结构。The new generation digital TV broadcasting system can support various types of data transmission including audio and video. The specific method is to fill the data packets to be transmitted into the baseband frame data field in turn, and the composition can be performed on the broadcast channel through the digital television broadcasting system. The baseband frame structure of the transmission.
在对数据包进行封装过程中,当一个数据包的长度较大且超过当前数据域的可用空间时,可以将数据包分割成若干个片段,每一个片段使用一个基带帧进行传输。接收端在接收到属于该数据包的所有片段后,再重新将这些片段进行拼接以获得原始的数据包。In the process of encapsulating a data packet, when the length of a data packet is large and exceeds the available space of the current data domain, the data packet may be divided into several segments, and each segment is transmitted using a baseband frame. After receiving all the fragments belonging to the data packet, the receiving end re-splices the fragments to obtain the original data packet.
但是,由于信道干扰等原因,基带帧在从发送端到接收端的传输过程中,可能会造成畸变并产生误码,这样接收端在接收到基带帧并对其解码后得到的数据包将不是原始的数据包。而在信道干扰严重的情况下,接收端可能会丢失整个基带帧甚至连续丢失多个基带帧。However, due to channel interference and other reasons, the baseband frame may be distorted and error generated during transmission from the transmitting end to the receiving end, so that the data packet obtained by the receiving end after receiving the baseband frame and decoding it will not be original. Packet. In the case of severe channel interference, the receiving end may lose the entire baseband frame or even continuously lose multiple baseband frames.
对于一个基带帧内出现误码,通过在数据包后附加校验字段可以很大程度上解决这一问题。但是,在一个数据包被分块成几个数据块并且这些数据块承载于不同的基带帧的情况下,若接收端丢失了其中一个基带帧而造成数据块漏收,仅通过在数据包后附加校验字段的方式将不能很好地解决这一问题。For errors in a baseband frame, this problem can be largely solved by appending a check field after the packet. However, in the case where a data packet is divided into several data blocks and the data blocks are carried in different baseband frames, if the receiving end loses one of the baseband frames and the data block is missed, only after the data packet The way the checksum field is attached will not solve this problem well.
发明内容Summary of the invention
本发明解决的是当该数据包被分块成几个数据块并且这些数据块承载于不同的基带帧进行传输过程中,接收端可能会漏收数据块的问题。The invention solves the problem that when the data packet is divided into several data blocks and the data blocks are carried in different baseband frames for transmission, the receiving end may miss the data block.
为解决上述问题,本发明实施例提供了一种数据包的封装方法,包括:在将当前待传输的数据包依次填充至一个或多个基带帧数据域的过程中,记录该数据包被分块次数的数据信息;基于该数据包的信息码和该数据包被分块次数的数据信息以生成该数据包的校验字段;将该校验字段拼接至该数据包的信息码的末尾以完成该数据包的封装。To solve the above problem, an embodiment of the present invention provides a method for encapsulating a data packet, which includes: recording, in a process of sequentially filling a data packet to be currently transmitted into one or more baseband frame data domains, recording the data packet. Data information of the number of blocks; based on the information code of the data packet and the data information of the number of times the data packet is divided to generate a check field of the data packet; the check field is spliced to the end of the information code of the data packet to Complete the encapsulation of the packet.
可选的,所述将当前待传输的数据依次填充至一个或多个基带帧数据域,记录该数据包被分块次数的数据信息包括:Optionally, the data to be currently transmitted is sequentially padded to one or more baseband frame data fields, and the data information for recording the number of times the data packet is blocked includes:
步骤1):判断当前的基带帧数据域的可用空间是否足以承载当前待传输的数据包,该数据包包括信息码和预留校验字段长度;Step 1): determining whether the available space of the current baseband frame data field is sufficient to carry the current data packet to be transmitted, where the data packet includes the information code and the length of the reserved check field;
步骤2):若该判断结果为否,则将该数据包进行分割以形成前半部分数据块和后半部分数据块,其中所述前半部分数据块适于填满该可用空间,所述后半 部分数据块将填充至下一个基带帧数据域;Step 2): If the result of the determination is no, the data packet is segmented to form a first half data block and a second half data block, wherein the first half data block is adapted to fill the available space, the second half Part of the data block will be padded to the next baseband frame data field;
循环执行上述步骤1)和步骤2),直至当前的基带帧数据域的可用空间足以承载当前待传输的数据包;Cycling the above steps 1) and 2) until the available space of the current baseband frame data field is sufficient to carry the data packet to be currently transmitted;
基于上述步骤1)和步骤2)的循环执行次数确定当前待传输的数据包被分块次数的数据信息。The data information of the number of times the data packet to be transmitted is currently blocked is determined based on the number of loop executions of the above steps 1) and 2).
可选的,所述基于该数据包的信息码和该数据包被分块次数的数据信息以生成该数据包的校验字段的步骤包括:将该数据包被分块次数的数据信息附加至该数据包的信息码的末尾以形成待校验数据包;采用第一预设校验字段生成方式对所述待校验数据包进行处理以生成第一校验字段来作为所述数据包的所述校验字段,其中该第一预设校验字段生成方式由发送端和接收端来共同确定。Optionally, the step of generating the check field of the data packet based on the information code of the data packet and the data information of the data packet by the number of times of the block includes: appending the data information of the data packet to the number of times of the block to End of the information code of the data packet to form a data packet to be verified; processing the data packet to be verified by using a first preset check field generation manner to generate a first check field as the data packet The check field, wherein the first preset check field generation manner is jointly determined by the sending end and the receiving end.
可选的,所述基于该数据包的信息码和该数据包被分块次数的数据信息以生成该数据包的校验字段的步骤包括:采用第一预设校验字段生成方式对该数据包进行处理以生成中间数据;将该数据包被分块次数的数据信息附加至该中间数据的末尾,再采用第一预设校验字段生成方式对前述数据进行处理以生成第二校验字段来作为所述数据包的所述校验字段;其中,该第一预设校验字段生成方式由发送端和接收端来共同确定。Optionally, the step of generating the check field of the data packet based on the information code of the data packet and the data information of the data packet to be the number of times of the data packet comprises: adopting a first preset check field generation manner to the data The packet is processed to generate intermediate data; the data information of the data packet is added to the end of the intermediate data, and the foregoing data is processed by using a first preset check field generation manner to generate a second check field. And the check field of the data packet is sent by the sending end and the receiving end.
可选的,所述基于该数据包的信息码和该数据包被分块次数的数据信息以生成该数据包的校验字段的步骤包括:采用第一预设校验字段生成方式对该数据包进行处理以生成中间数据;采用第二预设校验字段生成方式对该中间数据和该数据包被分块次数的数据信息进行处理以生成第三校验字段来作为所述数据包的所述校验字段;其中,该第一预设校验字段生成方式和第二预设校验字段生成方式由发送端和接收端来共同确定。Optionally, the step of generating the check field of the data packet based on the information code of the data packet and the data information of the data packet to be the number of times of the data packet comprises: adopting a first preset check field generation manner to the data Processing the packet to generate intermediate data; processing the intermediate data and the data information of the number of times the packet is blocked by using a second preset check field generation manner to generate a third check field as the data packet a check field; wherein the first preset check field generation manner and the second preset check field generation manner are jointly determined by the sending end and the receiving end.
可选的,所述第一预设校验字段生成方式为循环冗余校验。Optionally, the first preset check field is generated in a cyclic redundancy check manner.
可选的,所述第二预设校验字段生成方式包括异或运算、加法运算、减法运算和乘法运算中的任一种运算方式。Optionally, the second preset check field generation manner includes any one of an exclusive OR operation, an addition operation, a subtraction operation, and a multiplication operation.
本发明实施例还提供了一种数据包的校验方法,其中该数据包是根据上述数据包的封装方法封装后填充至基带帧在信道中传输后于接收端恢复得到,所述校验方法包括:The embodiment of the present invention further provides a data packet verification method, where the data packet is encapsulated according to the encapsulation method of the foregoing data packet, and then padded to a baseband frame and transmitted in a channel, and then recovered at the receiving end, the verification method is obtained. include:
从一个或多个基带帧数据域中获取完整的数据包,该完整的数据包包括信息码和校验字段;Acquiring a complete data packet from one or more baseband frame data fields, the complete data packet including an information code and a check field;
根据基带帧帧头中的校验算法标志位中标志的预设校验字段生成方式与校验字段长度,从该数据包的末尾截取校验字段,数据包的剩余内容作为信息码;And according to the preset check field generation manner and the check field length of the flag in the check algorithm flag bit in the baseband frame header, the check field is intercepted from the end of the data packet, and the remaining content of the data packet is used as the information code;
对接收到的数据包的信息码以及数据包被分块次数的数据信息进行校验计算以得到待比较校验字段;Performing a check calculation on the information code of the received data packet and the data information of the number of times the data packet is blocked to obtain a check field to be compared;
比较该待比较校验字段与获取到的校验字段是否一致;Comparing whether the check field to be compared is consistent with the obtained check field;
若两者一致,则确定该数据包接收正确。 If the two are consistent, it is determined that the data packet is received correctly.
可选的,所述从一个或多个基带帧数据域中获取完整的数据包包括如下步骤:Optionally, the obtaining the complete data packet from the one or more baseband frame data domains includes the following steps:
从当前的基带帧数据域的起始位置开始依次读取数据包,其中所述起始位置由基带帧帧头中的起始位置字段来确定;Reading a data packet sequentially from a starting position of a current baseband frame data field, wherein the starting position is determined by a starting position field in a baseband frame header;
通过位于数据包头部的包长字段是否为零来判断该数据包是否完整地承载于当前的基带帧数据域;Whether the data packet is completely carried in the current baseband frame data field by whether the packet length field at the packet header is zero or not;
若该数据包未完整地承载于当前的基带帧数据,则将当前基带帧起始位置开始至数据域末尾的所有数据作为该数据包的第一块,并继续从后续的若干个基带帧数据域中读取该数据包的剩余分块并依顺序与该数据包的第一块进行拼接以得到该数据包的信息码及校验字段,其中该数据包的剩余分块是根据基带帧帧头中的起始位置字段和数据域长度字段之间的关系来确定的;If the data packet is not completely carried in the current baseband frame data, all data starting from the start position of the current baseband frame to the end of the data field is used as the first block of the data packet, and continues from several subsequent baseband frame data. The remaining blocks of the data packet are read in the domain and spliced in sequence with the first block of the data packet to obtain an information code and a check field of the data packet, wherein the remaining partition of the data packet is based on a baseband frame frame. The relationship between the start position field and the data field length field in the header is determined;
若该数据包完整地承载于当前的基带帧数据,则从当前的基带帧数据域的起始位置开始并根据该数据包头部的包长获取该数据包的信息码及校验字段;If the data packet is completely carried in the current baseband frame data, the information code and the check field of the data packet are obtained from the start position of the current baseband frame data field and according to the packet length of the data packet header;
记录组装该数据包的信息码及校验字段的基带帧的个数以确定该数据包被分块次数的数据信息;Recording the information code of the data packet and the number of baseband frames of the check field to determine data information of the number of times the data packet is blocked;
可选的,所述该数据包的剩余分块根据基带帧帧头中的起始位置字段和数据域长度字段之间的关系来确定包括如下情形:Optionally, the remaining partition of the data packet is determined according to a relationship between a start location field and a data domain length field in a baseband frame header, and includes the following situations:
1)若某个基带帧帧头中的起始位置字段大于数据域长度字段,则确定该基带帧数据域全部用于承载数据包的剩余分块中的一个数据块,且该数据包的传输未完成;1) If the start position field in a baseband frame header is larger than the data field length field, it is determined that the baseband frame data field is all used to carry one data block in the remaining block of the data packet, and the data packet is transmitted. undone;
2)若某个基带帧帧头中的起始位置字段等于数据域长度字段,则确定该基带帧数据域全部用于承载该数据包,且该数据包的传输已经完成;2) If the start position field in a baseband frame header is equal to the data field length field, it is determined that the baseband frame data field is all used to carry the data packet, and the transmission of the data packet has been completed;
3)若某个基带帧帧头中的起始位置字段小于数据域长度字段,则该基带基数据域头部至起始位置之间的数据为该数据包的剩余分块中的最后一个数据块。3) If the start position field in a baseband frame header is smaller than the data field length field, the data between the baseband base data field header and the start position is the last data in the remaining partition of the data packet. Piece.
本发明实施例还提供了一种数据包的传输方法,包括:将当前待传输的数据包依次填充至一个或多个基带帧数据域;生成该数据包的校验字段,其中所述校验字段根据该数据包的信息码和该数据包在填充至基带帧数据域的过程中被分块次数的数据信息来确定;将该校验字段拼接至该数据包的信息码的末尾以完成该数据包的封装;将承载于该数据包的一个或多个基带帧经由信道传输至接收端。The embodiment of the present invention further provides a data packet transmission method, including: sequentially filling a data packet to be currently transmitted into one or more baseband frame data fields; generating a verification field of the data packet, where the verification The field is determined according to the information code of the data packet and the data information of the number of times of the data packet being filled in the baseband frame data field; the check field is spliced to the end of the information code of the data packet to complete the Encapsulation of the data packet; transmitting one or more baseband frames carried in the data packet to the receiving end via the channel.
与现有技术相比,本发明技术方案具有以下有益效果:Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
根据本发明实施例提供的数据包的封装方法,在生成数据包的校验字段时,考虑了数据包填充至基带帧数据域过程中被分块次数的数据信息,这样在接收端对接收到的数据包进行解析过程中,也将结合数据包被分块次数的数据信息来对数据包是否正确接收进行校验,从而提高了数据包(尤其是数据包被分成几个数据块承载于不同的基带帧中的情况下)在广播通信信道传输时的可靠性。 According to the data packet encapsulation method provided by the embodiment of the present invention, when generating the check field of the data packet, the data information of the number of times of blocking the data packet into the baseband frame data domain is considered, so that the receiving end receives the data information. During the parsing process of the data packet, the data packet of the number of times the data packet is blocked is also used to check whether the data packet is correctly received, thereby improving the data packet (especially the data packet is divided into several data blocks and carried in different In the case of a baseband frame) reliability in the transmission of a broadcast communication channel.
根据本发明实施例提供的数据包的校验方法,接收端在从接收到的基带帧数据域中读取数据包的过程中,通过位于数据包头部的包长字段来判断该数据包是否完整地承载于当前的基带帧数据域,并针对不同的情形采用不同的方式获取完整的数据包及校验字段,并且在对接收到的数据包进行校验时,考虑了该数据包被分块次数的数据信息,从而提高了数据包在广播通信信道传输时的可靠性。According to the verification method of the data packet provided by the embodiment of the present invention, in the process of reading the data packet from the received baseband frame data field, the receiving end determines whether the data packet is complete by the packet length field located in the packet header. The data is carried in the current baseband frame data field, and the complete data packet and the check field are obtained in different manners for different situations, and when the received data packet is verified, the data packet is considered to be blocked. The data information of the number of times, thereby improving the reliability of the data packet when transmitted on the broadcast communication channel.
附图说明DRAWINGS
图1是本发明的一种数据包的封装方法的具体实施方式的流程示意图;1 is a schematic flow chart of a specific implementation manner of a method for packaging a data packet according to the present invention;
图2是将数据包封装后形成的基带帧的基本结构示意图;2 is a schematic diagram showing the basic structure of a baseband frame formed by encapsulating a data packet;
图3A是数据包未经分割封装成的基带帧结构示意图;3A is a schematic diagram of a baseband frame structure in which a data packet is not divided and packaged;
图3B是数据包经分割后各个数据块分别承载于不同基带帧的情况下封装成的基带帧结构示意图;FIG. 3B is a schematic diagram of a baseband frame structure encapsulated in a case where each data block is respectively carried in a different baseband frame after the data packet is divided; FIG.
图4是本发明的一种数据包的校验方法的具体实施方式的流程示意图。4 is a schematic flow chart of a specific implementation manner of a method for verifying a data packet according to the present invention.
具体实施方式detailed description
发明人发现现有技术中,当该数据包被分成几个数据块并且这些数据块承载于不同的基带帧进行传输过程中,若接收端丢失了其中一个基带帧将造成数据块接收错误的问题。The inventors have found that in the prior art, when the data packet is divided into several data blocks and the data blocks are carried in different baseband frames for transmission, if the receiving end loses one of the baseband frames, the data block receiving error will be caused. .
针对上述问题,发明人经过研究,提供了一种数据包的封装方法和校验方法,通过在对数据包进行封装过程中考虑数据包被分块次数的数据信息,从而提高了数据包(尤其是数据包被分成几个数据块承载于不同的基带帧中)在广播通信信道传输时的可靠性。In view of the above problems, the inventors have provided a data packet encapsulation method and a verification method by improving the data packet by considering the data information of the number of times the data packet is blocked in the process of encapsulating the data packet. It is the reliability of the data packet being divided into several data blocks carried in different baseband frames during transmission of the broadcast communication channel.
为使本发明的上述目的、特征和优点能够更为明显易懂,下面结合附图对本发明的具体实施方式做详细的说明。The above described objects, features and advantages of the present invention will become more apparent from the aspects of the invention.
如图1所示的是本发明的一种数据包的封装方法的具体实施方式的流程示意图。参考图1,所述数据包的封装方法包括如下步骤:FIG. 1 is a schematic flow chart of a specific implementation manner of a method for packaging a data packet according to the present invention. Referring to FIG. 1, the method for packaging a data packet includes the following steps:
步骤S11:在将当前待传输的数据包依次填充至一个或多个基带帧数据域的过程中,记录该数据包被分块次数的数据信息;Step S11: in the process of sequentially filling the data packet to be transmitted into one or more baseband frame data fields, recording data information of the number of times the data packet is blocked;
步骤S12:基于该数据包的信息码和该数据包被分块次数的数据信息以生成该数据包的校验字段;Step S12: generating an check field of the data packet based on the information code of the data packet and the data information of the data packet being blocked.
步骤S13:将该校验字段拼接至该数据包的信息码的末尾以完成该数据包的封装。Step S13: splicing the check field to the end of the information code of the data packet to complete the encapsulation of the data packet.
与现有技术不同,在生成数据包的校验字段时,不仅针对数据包的信息码本身,进一步考虑了数据包在填充至一个或多个基带帧数据域过程中被分块次数的数据信息。例如,一个数据包在填充至基带帧数据域过程中被分块次数成了三个数据块,那么被分块次数的数据信息为两次。 Different from the prior art, when generating the check field of the data packet, not only the information code itself of the data packet, but also the data information of the number of times the data packet is blocked in the process of filling into one or more baseband frame data fields is further considered. . For example, when a data packet is divided into three data blocks in the process of filling into the baseband frame data field, the data information of the number of times of blocking is twice.
在具体实施例中,如步骤S11所述,在将当前待传输的数据包依次填充至一个或多个基带帧数据域的过程中,记录该数据包被分块次数的数据信息,具体包括如下步骤:In a specific embodiment, as described in step S11, in the process of sequentially filling the data packet to be transmitted into one or more baseband frame data fields, the data information of the number of times the data packet is blocked is recorded, which specifically includes the following. step:
步骤1):判断当前的基带帧数据域的可用空间是否足以承载当前待传输的数据包,该数据包包括信息码和预留校验字段长度;Step 1): determining whether the available space of the current baseband frame data field is sufficient to carry the current data packet to be transmitted, where the data packet includes the information code and the length of the reserved check field;
步骤2):若该判断结果为否,则将该数据包进行分割以形成前半部分数据块和后半部分数据块,其中所述前半部分数据块适于填满该可用空间,所述后半部分数据块将填充至下一个基带帧数据域。Step 2): If the result of the determination is no, the data packet is segmented to form a first half data block and a second half data block, wherein the first half data block is adapted to fill the available space, the second half Part of the data block will be padded to the next baseband frame data field.
在上述步骤1)中,通过比较当前的基带帧数据域的可用空间所占的数据域长度与当前待传输的数据包的长度之间的大小关系可以确定该可用空间是否足以承载该数据包。需要说明的是,在本步骤中,需要在数据包的信息码之后预留校验字段的位置,例如预留2个字节长度,用零填充该预留位置,因此该数据包的长度包括信息码和预留校验字段长度。In the above step 1), it is determined whether the available space is sufficient to carry the data packet by comparing the size relationship between the data field length occupied by the available space of the current baseband frame data field and the length of the current data packet to be transmitted. It should be noted that, in this step, the location of the check field needs to be reserved after the information code of the data packet, for example, a length of 2 bytes is reserved, and the reserved position is filled with zeros, so the length of the data packet includes Information code and reserved check field length.
如步骤2)所述,若该数据包的包长大于当前的基带帧数据域的可用空间所占的数据域长度,则确定当前的基带帧数据域不足以承载整个数据包,需要对数据包进行分割。分割后的数据包分为前半部分数据块和后半部分数据块,其中前半部分数据块能够填满该可用空间,剩余的后半部分数据块将填充至下一个基带帧数据域中。As described in step 2), if the packet length of the data packet is greater than the data domain length occupied by the available space of the current baseband frame data field, it is determined that the current baseband frame data field is insufficient to carry the entire data packet, and the data packet needs to be Split. The divided data packet is divided into a first half data block and a second half data block, wherein the first half data block can fill the available space, and the remaining second half data block is filled into the next baseband frame data field.
对于该后半部分数据块,将继续依照上述步骤1)进行判断,即继续判断该后半部分数据块是否足以承载于当前的基带帧数据域(相对于之前那一个基带帧的下一个基带帧)。而当判断结果为否时,则依照上述步骤2)所述,继续将该后半部分数据块再次分割成两部分数据块,这两部分数据块中的前半部分数据块能够填满基带帧数据域的可用空间,后半部分数据块将填充至下一个基带帧数据域中。For the second half of the data block, it will continue to judge according to the above step 1), that is, continue to determine whether the second half of the data block is sufficient to be carried in the current baseband frame data field (relative to the next baseband frame of the previous baseband frame) ). When the result of the determination is no, the second half of the data block is further divided into two partial data blocks according to the above step 2), and the first half of the data blocks in the two partial data blocks can fill the baseband frame data. The available space of the domain, the second half of the data block will be filled into the next baseband frame data field.
如此循环执行上述步骤1)和步骤2),直至当前的基带帧数据域的可用空间足以承载最后剩余的数据块。The above steps 1) and 2) are performed cyclically until the available space of the current baseband frame data field is sufficient to carry the last remaining data block.
进一步地,根据整个过程中的循环执行次数可以确定当前待传输的数据包被分块次数的数据信息。例如,若上述步骤1)和步骤2)循环执行了两次,则可以确定当前待传输的数据包被切分了两次,该数据包分成了三个数据块分别承载于连续的三个基带帧数据域中。Further, data information of the number of times the data packet to be transmitted is currently blocked may be determined according to the number of loop executions in the entire process. For example, if step 1) and step 2) are performed twice in a loop, it can be determined that the current data packet to be transmitted is split twice, and the data packet is divided into three data blocks respectively carried in three consecutive basebands. In the frame data field.
若上述步骤1)的判断结果为是,即当前的基带帧数据域的可用空间足以承载当前待传输的数据包,则不需要对该数据包进行分割(即被分块次数的数据信息为0),该数据包将完整地承载于当前的基带帧数据域中。If the result of the foregoing step 1) is yes, that is, the available space of the current baseband frame data field is sufficient to carry the data packet to be currently transmitted, the data packet does not need to be divided (that is, the data information of the number of times of blocking is 0) ), the packet will be completely carried in the current baseband frame data field.
然后,如步骤S12所述,基于该数据包的信息码和该数据包被分块次数的数据信息以生成该数据包的校验字段。如步骤S13所述,将该校验字段拼接至该数据包的信息码的末尾以完成该数据包的封装。 Then, as described in step S12, the information code of the data packet and the data information of the number of times the data packet is divided are used to generate a check field of the data packet. As described in step S13, the check field is spliced to the end of the information code of the data packet to complete the encapsulation of the data packet.
现有技术中,生成一个数据包的校验字段时,只将数据包的信息码参与到生成校验字段的运算中,而在本实施例中,则进一步考虑了数据包被分块次数的数据信息。具体来说,本实施例包括如下三个具体实例:In the prior art, when generating a check field of a data packet, only the information code of the data packet is involved in the operation of generating the check field, and in this embodiment, the number of times the data packet is blocked is further considered. Data information. Specifically, the embodiment includes the following three specific examples:
1)在一个具体实施方式中,所述步骤S12包括如下步骤:1) In a specific embodiment, the step S12 includes the following steps:
将该数据包被分块次数的数据信息附加至该数据包的信息码的末尾以形成待校验数据包;And appending the data information of the data packet to the end of the information code of the data packet to form a data packet to be verified;
采用第一预设校验字段生成方式对所述待校验数据包进行处理以生成校验字段,其中该第一预设校验字段生成方式由发送端和接收端来共同确定。The data packet to be checked is processed to generate a check field by using a first preset check field generation manner, where the first preset check field generation manner is jointly determined by the sending end and the receiving end.
例如,CHK=F(DATA,SEG)=H([DATA,SEG]),其中CHK为计算得到的校验字段;DATA为数据包的信息码;SEG为数据包被分块次数的数据信息,H(x)为所述第一预设校验字段生成方式。For example, CHK=F(DATA,SEG)=H([DATA,SEG]), where CHK is the calculated check field; DATA is the information code of the data packet; SEG is the data information of the number of times the data packet is blocked, H(x) is the first preset check field generation manner.
相应地,所述步骤S13包括如下步骤:将所述第一校验字段拼接至该数据包的信息码的末尾以完成该数据包的封装。Correspondingly, the step S13 comprises the step of splicing the first check field to the end of the information code of the data packet to complete the encapsulation of the data packet.
2)在本步骤的另一个具体实施方式中,所述步骤S12包括如下步骤:2) In another specific implementation of this step, the step S12 includes the following steps:
采用第一预设校验字段生成方式对该数据包进行处理以生成中间数据;Processing the data packet by using a first preset check field generation manner to generate intermediate data;
将该数据包被分块次数的数据信息附加至该中间数据的末尾,再采用第一预设校验字段生成方式对前述数据进行处理以生成第二校验字段;Adding the data information of the data packet to the end of the intermediate data, and processing the foregoing data by using a first preset check field generation manner to generate a second check field;
其中,该第一预设校验字段生成方式由发送端和接收端来共同确定。The manner of generating the first preset check field is jointly determined by the sending end and the receiving end.
例如,CHK=F(DATA,SEG)=H([H(DATA),SEG]),其中CHK为计算得到的校验字段;DATA为数据包的信息码,H(DATA)为中间数据;SEG为数据包被分块次数的数据信息,H(x)为所述第一预设校验字段生成方式。For example, CHK=F(DATA,SEG)=H([H(DATA),SEG]), where CHK is the calculated check field; DATA is the information code of the data packet, H(DATA) is the intermediate data; SEG For the data information of the number of times the data packet is blocked, H(x) is the first preset check field generation manner.
相应地,所述步骤S13包括如下步骤:将所述第二校验字段拼接至该数据包的信息码的末尾以完成该数据包的封装。Correspondingly, the step S13 comprises the step of splicing the second check field to the end of the information code of the data packet to complete the encapsulation of the data packet.
3)在本步骤的另一个具体实施方式中,所述步骤S12包括如下步骤:3) In another specific implementation of this step, the step S12 includes the following steps:
采用第一预设校验字段生成方式对所述数据包的信息码进行处理以生成中间数据;Processing, by using a first preset check field generation manner, an information code of the data packet to generate intermediate data;
采用第二预设校验字段生成方式对该中间数据和该数据包被分块次数的数据信息进行处理以生成第三校验字段;And processing, by using a second preset check field generation manner, the intermediate data and the data information of the number of times the data packet is blocked to generate a third check field;
其中,该第一预设校验字段生成方式和第二预设校验字段生成方式由发送端和接收端来共同确定。The manner of generating the first preset check field and the generating manner of the second preset check field are jointly determined by the sending end and the receiving end.
例如,CHK=F(DATA,SEG)=G(H(DATA),SEG),其中CHK为计算得到的校验字段;DATA为数据包的信息码;SEG为数据包被分块次数的数据信息,H(x)为所述第一预设校验字段生成方式。For example, CHK=F(DATA,SEG)=G(H(DATA), SEG), where CHK is the calculated check field; DATA is the information code of the data packet; SEG is the data information of the number of times the data packet is blocked. H(x) is the first preset check field generation manner.
G(x,y)为第二预设校验字段生成方式,在实际应用中,G(x,y)可以是常用的可以接收两个输入数据的函数,例如异或运算的函数G(x,y)=x XOR y、加法运算的函数G(x,y)=x+y、减法运算的函数G(x,y)=x–y或者是乘法运算的函数G(x,y)=x*y。 G(x, y) is the second preset check field generation mode. In practical applications, G(x, y) can be a commonly used function that can receive two input data, such as the function G of the exclusive OR operation (x). , y) = x XOR y, the function of the addition operation G(x, y) = x + y, the function of the subtraction function G (x, y) = x - y or the function of the multiplication operation G (x, y) = x*y.
相应地,所述步骤S13包括如下步骤:将所述第三校验字段拼接至该数据包的信息码的末尾以完成该数据包的封装。Correspondingly, the step S13 comprises the step of splicing the third check field to the end of the information code of the data packet to complete the encapsulation of the data packet.
在上述三个具体实施方式中,所述第一预设校验字段生成方式为循环冗余校验,即CRC校验。In the above three specific implementation manners, the first preset check field is generated in a cyclic redundancy check, that is, a CRC check.
如图2所示的是将数据包封装后形成的基带帧的基本结构示意图。参考图2,基带帧包括基带帧帧头、数据域以及用于填零和带内信令的区域。FIG. 2 is a schematic diagram showing the basic structure of a baseband frame formed by encapsulating a data packet. Referring to FIG. 2, the baseband frame includes a baseband frame header, a data field, and an area for zero-fill and in-band signaling.
其中,基带帧帧头具体包括MATYPE(MediaType)字段(2bytes)、DFL(DataFieldLength)字段(2bytes)、SYNCD(SynchronizationData)字段(2bytes)、INDICATORS字段(1byte)以及CRC-8字段(1byte)。INDICATORS字段还包括CRCI(CRC-Indicator)字段(2bits)和others字段(6bits)。数据域用于填充各个数据包,数据包可以是IP数据包或者是TS数据流包等。The baseband frame header includes a MATYPE (MediaType) field (2 bytes), a DFL (DataFieldLength) field (2 bytes), a SYNCD (Synchronization Data) field (2 bytes), an INDICATORS field (1 byte), and a CRC-8 field (1 byte). The INDICATORS field also includes a CRCI (CRC-Indicator) field (2 bits) and other fields (6 bits). The data field is used to fill each data packet, and the data packet may be an IP data packet or a TS data stream packet.
如图3A所示的是数据包未经分割封装成的基带帧结构示意图。参考图3A,基带帧包括基带帧帧头和数据域。在数据域中承载有多个数据包(例如数据包N、数据包N+1),依照本技术方案提供的数据包的封装方法对数据包经过封装后,在各个数据包的信息码(未示出)的末尾拼接了各自的校验字段,例如,数据包N和校验字段N、数据包N+1和校验字段N+1。这些数据包承载于一个基带帧数据域中。As shown in FIG. 3A, a schematic diagram of a baseband frame structure in which a data packet is not divided and packaged is shown. Referring to FIG. 3A, the baseband frame includes a baseband frame header and a data field. A plurality of data packets (such as a data packet N and a data packet N+1) are carried in the data domain, and the data packet is encapsulated in the data packet of each data packet according to the encapsulation method of the data packet provided by the technical solution (not The respective check fields are spliced at the end, for example, packet N and check field N, packet N+1, and check field N+1. These data packets are carried in a baseband frame data field.
如图3B所示的是数据包经分割后各个数据块分别承载于不同基带帧的情况下封装成的基带帧结构示意图。参考图3B,数据包N被分成3个数据块,即数据块1、数据块2以及数据块3,这三个数据块分别承载于连续的三个基带帧数据域中。每个基带帧包括基带帧帧头和数据域。在数据块3的信息码的末尾拼接了该数据包(即数据包N)的校验字段N。FIG. 3B is a schematic diagram of a baseband frame structure encapsulated in a case where data packets are respectively divided into different baseband frames after the data packet is divided. Referring to FIG. 3B, the data packet N is divided into three data blocks, namely, a data block 1, a data block 2, and a data block 3, which are respectively carried in consecutive three baseband frame data fields. Each baseband frame includes a baseband frame header and a data field. The check field N of the data packet (i.e., packet N) is spliced at the end of the information code of the data block 3.
发送端将采用本技术方案提供的数据包的封装方法将数据包封装成基带帧后,将各个基带帧经由广播通信信道传输至接收端,接收端将从接收到的基带帧中解析出各个数据包,并对各个数据包的接收是否正确进行校验。The transmitting end will encapsulate the data packet into a baseband frame by using the data packet encapsulation method provided by the technical solution, and then transmit each baseband frame to the receiving end via the broadcast communication channel, and the receiving end parses the data from the received baseband frame. Packet, and check whether the reception of each packet is correct.
本发明实施例提供的一种数据包的校验方法,该数据包是由上述实施例提供的数据包封装方法封装后填充至基带帧在信道中传输后于接收端恢复得到。如图4所述的是本发明的一种数据包的校验方法的具体实施方式的流程示意图。The method for verifying a data packet is provided by the data packet encapsulation method provided by the foregoing embodiment, and is encapsulated into a baseband frame and transmitted in a channel, and then recovered at the receiving end. FIG. 4 is a schematic flowchart diagram of a specific implementation manner of a method for verifying a data packet according to the present invention.
参考图4,数据包的校验方法包括如下步骤:Referring to FIG. 4, the verification method of the data packet includes the following steps:
步骤S21:从当前的基带帧数据域的起始位置开始依次读取数据包,其中所述起始位置由基带帧帧头中的起始位置字段来确定;Step S21: sequentially reading a data packet from a starting position of a current baseband frame data field, where the starting position is determined by a starting position field in a baseband frame header;
步骤S22:通过位于数据包头部的包长字段是否为零来判断该数据包是否完整地承载于当前的基带帧数据域;Step S22: determining whether the data packet is completely carried in the current baseband frame data field by whether the packet length field located at the packet header is zero.
步骤S23:若该数据包未完整地承载于当前的基带帧数据,则将当前基带帧起始位置开始至数据域末尾的所有数据作为该数据包的第一块,并继续从后续的若干个基带帧数据域中读取该数据包的剩余分块并依顺序与该数据包的第一块进 行拼接以得到该数据包的信息码及校验字段,其中该数据包的剩余分块是根据基带帧帧头中的起始位置字段和数据域长度字段之间的关系来确定的;Step S23: If the data packet is not completely carried in the current baseband frame data, all the data starting from the start position of the current baseband frame to the end of the data field is used as the first block of the data packet, and continues from the subsequent several. Reading the remaining blocks of the packet in the baseband frame data field and sequentially entering the first block of the packet Row stitching to obtain an information code and a check field of the data packet, wherein the remaining partition of the data packet is determined according to a relationship between a start position field and a data field length field in a baseband frame header;
步骤S24:若该数据包完整地承载于当前的基带帧数据,则从当前的基带帧数据域的起始位置开始并根据该数据包头部的包长获取该数据包的信息码及校验字段;Step S24: If the data packet is completely carried in the current baseband frame data, start from the starting position of the current baseband frame data field and obtain the information code and check field of the data packet according to the packet length of the data packet header. ;
步骤S25:记录组装该数据包的信息码及校验字段的基带帧的个数以确定该数据包被分块次数的数据信息;Step S25: recording the number of baseband frames of the information code and the check field of the assembled data packet to determine the data information of the number of times the data packet is blocked;
步骤S26:根据基带帧帧头中的校验算法标志位中标志的预设校验字段生成方式与校验字段长度,从该数据包的末尾截取校验字段,数据包的剩余内容作为信息码;Step S26: According to the preset check field generation manner and the check field length of the flag in the check algorithm flag bit in the baseband frame header, the check field is intercepted from the end of the data packet, and the remaining content of the data packet is used as the information code. ;
步骤S27:对接收到的数据包信息码以及数据包被分块次数的数据信息进行校验计算以得到待比较校验字段;Step S27: performing a check calculation on the received data packet information code and the data information of the number of times the data packet is blocked to obtain a check field to be compared;
步骤S28:比较该待比较校验字段与获取到的校验字段是否一致Step S28: Comparing whether the check field to be compared is consistent with the obtained check field
步骤S29:若两者一致,则确定该数据包接收正确。Step S29: If the two are consistent, it is determined that the data packet is received correctly.
在本实施例中,如步骤S21所述,从当前的基带帧数据域的起始位置开始依次读取数据包。In this embodiment, as described in step S21, the data packet is sequentially read from the start position of the current baseband frame data field.
在实际应用中,接收端接收到一系列连续的基带帧后,将依照接收的先后顺序从第一个基带帧数据域的起始位置开始读取第一个完整的数据包。所述起始位置由基带帧帧头中的起始位置字段(如图2中的SYNCD字段)来确定,接收端根据SYNCD字段中记录的信息可以确定数据域中存储该数据包的起始位置。In practical applications, after receiving a series of consecutive baseband frames, the receiving end reads the first complete data packet from the beginning of the first baseband frame data field according to the received sequence. The starting position is determined by a starting position field in the baseband frame header (such as the SYNCD field in FIG. 2), and the receiving end can determine the starting position of the data packet stored in the data field according to the information recorded in the SYNCD field. .
如步骤S22所述,通过位于数据包头部的包长字段是否为零来判断该数据包是否完整地承载于当前的基带帧数据域。As described in step S22, it is determined whether the data packet is completely carried in the current baseband frame data field by whether the packet length field located at the packet header is zero.
在本实施例中,在数据包包头部设置有包长字段,用于记录该数据包的包长。在该数据包完整地承载于一个基带帧数据域的情况下,该包长字段记录整个数据包的包长;而当该数据包未完整地承载于一个基带帧数据域的情况下,该包长字段默认设置为零。因此,接收端可以通过读取位于数据包头部的包长字段,根据其记录的数值是否为零来判断该数据包是否完整地承载于当前的基带帧数据域。In this embodiment, a packet length field is set in the header of the data packet for recording the packet length of the data packet. In the case where the data packet is completely carried in a baseband frame data field, the packet length field records the packet length of the entire data packet; and when the data packet is not completely carried in a baseband frame data field, the packet The long field is set to zero by default. Therefore, the receiving end can determine whether the data packet is completely carried in the current baseband frame data field by reading the packet length field located at the head of the data packet according to whether the value recorded by the receiver is zero.
如步骤S23所述,若该数据包未完整地承载于当前的基带帧数据,则将当前基带帧起始位置开始至数据域末尾的所有数据作为该数据包的第一块,并继续从后续的若干个基带帧数据域中读取该数据包的剩余分块并依顺序与该数据包的第一块进行拼接以得到该数据包的信息码及校验字段。As described in step S23, if the data packet is not completely carried in the current baseband frame data, all data starting from the start position of the current baseband frame to the end of the data field is used as the first block of the data packet, and continues from the subsequent block. The plurality of baseband frame data fields read the remaining blocks of the data packet and sequentially spliced with the first block of the data packet to obtain an information code and a check field of the data packet.
在数据包较长,未完整地承载于一个基带帧数据域的情况下,接收端需要从若干个基带帧中提取属于该数据包的各个数据块,而属于同一个数据包的各个数据块将承载于连续的若干个基带帧中。因此,接收端在从当前的基带帧起始位置至数据域末尾获取了该数据包的第一个数据块后,将继续从后续的基带帧数据域中读取该数据包的剩余分块。 In the case that the data packet is long and is not completely carried in a baseband frame data field, the receiving end needs to extract each data block belonging to the data packet from several baseband frames, and each data block belonging to the same data packet will be It is carried in several consecutive baseband frames. Therefore, after receiving the first data block of the data packet from the current baseband frame start position to the end of the data field, the receiving end will continue to read the remaining partition of the data packet from the subsequent baseband frame data field.
进一步地,该数据包的剩余分块是根据基带帧帧头中的起始位置字段和数据域长度字段之间的关系来确定的。具体来说,接收端通过判断基带帧帧头中的起始位置字段中记录的基带帧数据域的起始位置和数据域长度字段(即如图2中的DFL字段)记录的数据域的总长度之间的大小关系来确定是否已获取到该数据包的最后一个数据块。Further, the remaining partition of the data packet is determined according to a relationship between a start position field and a data field length field in a baseband frame header. Specifically, the receiving end determines the total of the data fields recorded by the start position of the baseband frame data field and the data field length field (ie, the DFL field in FIG. 2) recorded in the start position field in the baseband frame header. The size relationship between the lengths to determine if the last data block of the packet has been acquired.
具体包括如下情形:Specifically, the following situations are included:
1)若某个基带帧帧头中的起始位置字段大于数据域长度字段,则确定该基带帧数据域全部用于承载数据包的剩余分块中的一个数据块,且该数据包的传输未完成。接收端将继续从后续的基带帧数据域中获取剩余的数据块。1) If the start position field in a baseband frame header is larger than the data field length field, it is determined that the baseband frame data field is all used to carry one data block in the remaining block of the data packet, and the data packet is transmitted. undone. The receiving end will continue to retrieve the remaining data blocks from the subsequent baseband frame data field.
2)若某个基带帧帧头中的起始位置字段等于数据域长度字段,则确定该基带帧数据域全部用于承载该数据包,且该数据包的传输已经完成。2) If the start position field in a baseband frame header is equal to the data field length field, it is determined that the baseband frame data field is all used to carry the data packet, and the transmission of the data packet has been completed.
3)若某个基带帧帧头中的起始位置字段小于数据域长度字段,则该基带基数据域头部至起始位置之间的数据为该数据包的剩余分块中的最后一个数据块。3) If the start position field in a baseband frame header is smaller than the data field length field, the data between the baseband base data field header and the start position is the last data in the remaining partition of the data packet. Piece.
如步骤S24所述,若该数据包完整地承载于当前的基带帧数据,则从当前的基带帧数据域的起始位置开始并根据该数据包头部的包长获取该数据包的信息码及校验字段。As described in step S24, if the data packet is completely carried in the current baseband frame data, the information code of the data packet is obtained from the start position of the current baseband frame data field and according to the packet length of the packet header. Check the field.
其中,数据包的信息码的长度信息可以通过位于数据包头部长度字段直接或通过简单计算间接得到,而校验字段的长度则是根据发送端和接收端对校验字段计算算法的约定得到。The length information of the information code of the data packet can be obtained by directly or indirectly through the length field of the data packet header, and the length of the check field is obtained according to the agreement between the sending end and the receiving end for the check field calculation algorithm.
如步骤S25所述,记录组装该数据包的信息码及校验字段的基带帧的个数以确定该数据包被分块次数的数据信息。As described in step S25, the number of baseband frames in which the information code of the data packet and the check field are assembled is recorded to determine the data information of the number of times the data packet is blocked.
在本实施例中,接收端后续对接收到的数据包进行校验时,需要考虑数据包被分块次数的数据信息。因此,在获取到完整的数据包之后,接收端还需要记录下组装该数据包的信息码及校验字段的基带帧的个数。In this embodiment, when the receiving end subsequently checks the received data packet, it needs to consider the data information of the number of times the data packet is blocked. Therefore, after obtaining the complete data packet, the receiving end also needs to record the number of baseband frames in which the information code of the data packet and the check field are assembled.
对于数据包未完整地承载于当前的基带帧数据域的情形,接收端可以记录下获取整个数据包的过程中共跨度了几个基带帧,从而可以确定该数据包被分成了几个数据块,并由此确定该数据包被分块次数的数据信息。而对于数据包完整地承载于当前的基带帧数据域的情形,所述被分块次数的数据信息即为被分块次数为零。In the case that the data packet is not completely carried in the current baseband frame data field, the receiving end can record a total of several baseband frames in the process of acquiring the entire data packet, so that it can be determined that the data packet is divided into several data blocks. And thereby determining the data information of the number of times the packet is blocked. For the case where the data packet is completely carried in the current baseband frame data field, the data information of the number of times of blocking is zero.
如步骤S26所述,根据基带帧帧头中的校验算法标志位(即图2中的CRCI字段)中标志的预设校验字段生成方式与校验字段长度,从该数据包的末尾截取校验字段,数据包的剩余内容作为信息码。As described in step S26, the preset check field generation mode and the check field length of the flag in the check algorithm flag bit (ie, the CRCI field in FIG. 2) in the baseband frame header are intercepted from the end of the data packet. The check field, the remaining content of the data packet as the information code.
具体地,接收端在获取到的整个数据包包括信息码和校验字段,两者是合并在一起的。因此,接收端需要从中分别获取信息码和校验字段。其中,校验字段的长度可以根据基带帧帧头中的校验算法标志位中标志的预设校验字段生成方式与校验字段长度来确定。而数据包的信息码则是在截取了校验字段之后数据包的 剩余内容。Specifically, the entire data packet obtained by the receiving end includes an information code and a check field, and the two are combined. Therefore, the receiving end needs to separately obtain the information code and the check field from it. The length of the check field may be determined according to a preset check field generation manner and a check field length of the flag in the check algorithm flag bit in the baseband frame header. The information code of the data packet is after the check field is intercepted. The rest of the content.
如步骤S27所述,对接收到的数据包信息码以及数据包被分块次数的数据信息进行校验计算以得到待比较校验字段。As described in step S27, the received data packet information code and the data information of the number of times the data packet is blocked are subjected to check calculation to obtain a check field to be compared.
具体地,接收端将结合接收到的数据包的信息码与根据上述步骤S25所确定的该数据包被分块次数的数据信息进行校验运算,以得到待比较校验字段。其中,所述校验运算的具体实施过程是根据基带帧帧头中的校验算法标志位中标志的预设校验字段生成方式来确定。并且对于同一个数据包,发送端和接收端采用的是相同的预设校验字段生成方式对该数据包的信息码进行处理以分别获取校验字段。Specifically, the receiving end performs a check operation on the information code of the received data packet in combination with the data information of the number of times the data packet is blocked according to the foregoing step S25, to obtain a check field to be compared. The specific implementation process of the check operation is determined according to a preset check field generation manner of a flag in a check algorithm flag bit in a baseband frame header. And for the same data packet, the sender and the receiver use the same preset check field generation manner to process the information code of the data packet to obtain the check field respectively.
针对不同的预设校验字段生成方式,对数据包的信息码的处理方式可以参照上文图1描述的实施例中所述步骤S12的实施例,在此不再赘述。For the different preset check field generation manners, refer to the embodiment of step S12 in the embodiment described in FIG. 1 for the manner of processing the information code of the data packet, and details are not described herein again.
如步骤S28所述,比较该待比较校验字段与获取到的校验字段是否一致。As described in step S28, it is compared whether the check field to be compared and the obtained check field are consistent.
如步骤S29所述,若两者一致,则确定该数据包接收正确。反之,若两者不一致,则确定该数据包接收错误。As described in step S29, if the two are consistent, it is determined that the data packet is received correctly. On the other hand, if the two are inconsistent, it is determined that the packet is received incorrectly.
本发明实施例还提供了一种数据包的传输方法,具体包括如下步骤:The embodiment of the invention further provides a method for transmitting a data packet, which specifically includes the following steps:
步骤S31:将当前待传输的数据包依次填充至一个或多个基带帧数据域;Step S31: sequentially filling the data packet to be currently transmitted into one or more baseband frame data fields;
步骤S32:生成该数据包的校验字段,其中所述校验字段根据该数据包的信息码和该数据包在填充至基带帧数据域的过程中被分块次数的数据信息来确定;Step S32: Generate a check field of the data packet, where the check field is determined according to the information code of the data packet and the data information of the number of times of blocking of the data packet in the process of filling the data field into the baseband frame;
步骤S33:将该校验字段拼接至该数据包的信息码的末尾以完成该数据包的封装;Step S33: splicing the check field to the end of the information code of the data packet to complete the encapsulation of the data packet;
步骤S34:将该数据包承载于一个或多个基带帧并经由信道传输至接收端。Step S34: The data packet is carried in one or more baseband frames and transmitted to the receiving end via a channel.
综上所述,采用本技术方案提供的数据包封装方法和校验方法,发送端在生成数据包的校验字段时,考虑了数据包填充至基带帧数据域过程中被分块次数的数据信息,这样在接收端对接收到的数据包进行解析过程中,也将结合数据包被分块次数的数据信息来对数据包是否正确接收进行校验,从而提高了数据包(尤其是数据包被分成几个数据块承载于不同的基带帧中的情况下)在广播通信信道传输时的可靠性。In summary, according to the data packet encapsulation method and the verification method provided by the technical solution, when the sending end generates the check field of the data packet, the transmitting end considers the data of the number of times of blocking in the process of filling the data packet into the baseband frame data domain. Information, so that in the process of parsing the received data packet at the receiving end, the data packet of the number of times the data packet is blocked is also used to check whether the data packet is correctly received, thereby improving the data packet (especially the data packet). The reliability when transmitting a communication channel is divided into several data blocks that are carried in different baseband frames.
本发明虽然已以较佳实施例公开如上,但其并不是用来限定本发明,任何本领域技术人员在不脱离本发明的精神和范围内,都可以利用上述揭示的方法和技术内容对本发明技术方案做出可能的变动和修改,因此,凡是未脱离本发明技术方案的内容,依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化及修饰,均属于本发明技术方案的保护范围。 The present invention has been disclosed in the preferred embodiments as described above, but it is not intended to limit the invention, and the present invention may be utilized by the method and technical contents disclosed above without departing from the spirit and scope of the invention. The technical solutions make possible changes and modifications. Therefore, any simple modifications, equivalent changes, and modifications made to the above embodiments in accordance with the technical spirit of the present invention are not included in the technical solutions of the present invention. protected range.

Claims (11)

  1. 一种数据包的封装方法,其特征在于,包括:A method for packaging a data packet, comprising:
    在将当前待传输的数据包依次填充至一个或多个基带帧数据域的过程中,记录该数据包被分块次数的数据信息;In the process of sequentially filling the data packet to be transmitted into one or more baseband frame data fields, recording data information of the number of times the data packet is blocked;
    基于该数据包的信息码和该数据包被分块次数的数据信息以生成该数据包的校验字段;Generating a check field of the data packet based on the information code of the data packet and the data information of the data packet being blocked.
    将该校验字段拼接至该数据包的信息码的末尾以完成该数据包的封装。The check field is spliced to the end of the information code of the data packet to complete the encapsulation of the data packet.
  2. 如权利要求1所述的数据包的封装方法,其特征在于,所述将当前待传输的数据依次填充至一个或多个基带帧数据域,记录该数据包被分块次数的数据信息包括:The method for encapsulating a data packet according to claim 1, wherein the data to be currently transmitted is sequentially padded to one or more baseband frame data fields, and the data information for recording the number of times the data packet is blocked includes:
    步骤1):判断当前的基带帧数据域的可用空间是否足以承载当前待传输的数据包,该数据包包括信息码和预留校验字段长度;Step 1): determining whether the available space of the current baseband frame data field is sufficient to carry the current data packet to be transmitted, where the data packet includes the information code and the length of the reserved check field;
    步骤2):若该判断结果为否,则将该数据包进行分割以形成前半部分数据块和后半部分数据块,其中所述前半部分数据块适于填满该可用空间,所述后半部分数据块将填充至下一个基带帧数据域;Step 2): If the result of the determination is no, the data packet is segmented to form a first half data block and a second half data block, wherein the first half data block is adapted to fill the available space, the second half Part of the data block will be padded to the next baseband frame data field;
    循环执行上述步骤1)和步骤2),直至当前的基带帧数据域的可用空间足以承载当前待传输的数据包;Cycling the above steps 1) and 2) until the available space of the current baseband frame data field is sufficient to carry the data packet to be currently transmitted;
    基于上述步骤1)和步骤2)的循环执行次数确定当前待传输的数据包被分块次数的数据信息。The data information of the number of times the data packet to be transmitted is currently blocked is determined based on the number of loop executions of the above steps 1) and 2).
  3. 如权利要求1所述的数据包的封装方法,其特征在于,所述基于该数据包的信息码和该数据包被分块次数的数据信息以生成该数据包的校验字段的步骤包括:The method of encapsulating a data packet according to claim 1, wherein the step of generating the check field of the data packet based on the information code of the data packet and the data information of the data packet by the number of times of the data packet comprises:
    将该数据包被分块次数的数据信息附加至该数据包的信息码的末尾以形成待校验数据包;And appending the data information of the data packet to the end of the information code of the data packet to form a data packet to be verified;
    采用第一预设校验字段生成方式对所述待校验数据包进行处理以生成第一校验字段来作为所述数据包的所述校验字段,其中该第一预设校验字段生成方式由发送端和接收端来共同确定。Processing the to-be-checked data packet by using a first preset check field generation manner to generate a first check field as the check field of the data packet, where the first preset check field is generated The mode is determined jointly by the sender and the receiver.
  4. 如权利要求1所述的数据包的封装方法,其特征在于,所述基于该数据包的信息码和该数据包被分块次数的数据信息以生成该数据包的校验字段的步骤包括:The method of encapsulating a data packet according to claim 1, wherein the step of generating the check field of the data packet based on the information code of the data packet and the data information of the data packet by the number of times of the data packet comprises:
    采用第一预设校验字段生成方式对该数据包进行处理以生成中间数据;Processing the data packet by using a first preset check field generation manner to generate intermediate data;
    将该数据包被分块次数的数据信息附加至该中间数据的末尾,再采用第一预设校验字段生成方式对前述数据进行处理以生成第二校验字段来作为所述数据包的所述校验字段;The data information of the data packet is added to the end of the intermediate data, and the foregoing data is processed by using a first preset check field generation manner to generate a second check field as the data packet. Check field
    其中,该第一预设校验字段生成方式由发送端和接收端来共同确定。 The manner of generating the first preset check field is jointly determined by the sending end and the receiving end.
  5. 如权利要求1所述的数据包的封装方法,其特征在于,所述基于该数据包的信息码和该数据包被分块次数的数据信息以生成该数据包的校验字段的步骤包括:The method of encapsulating a data packet according to claim 1, wherein the step of generating the check field of the data packet based on the information code of the data packet and the data information of the data packet by the number of times of the data packet comprises:
    采用第一预设校验字段生成方式对该数据包进行处理以生成中间数据;Processing the data packet by using a first preset check field generation manner to generate intermediate data;
    采用第二预设校验字段生成方式对该中间数据和该数据包被分块次数的数据信息进行处理以生成第三校验字段来作为所述数据包的所述校验字段;And processing, by using a second preset check field generation manner, the intermediate data and the data information of the data packet to be blocked to generate a third check field as the check field of the data packet;
    其中,该第一预设校验字段生成方式和第二预设校验字段生成方式由发送端和接收端来共同确定。The manner of generating the first preset check field and the generating manner of the second preset check field are jointly determined by the sending end and the receiving end.
  6. 如权利要求3或4或5所述的数据包的封装方法,其特征在于,所述第一预设校验字段生成方式为循环冗余校验。The method for encapsulating a data packet according to claim 3 or 4 or 5, wherein the first preset check field is generated in a cyclic redundancy check.
  7. 如权利要求5所述的数据包的封装方法,其特征在于,所述第二预设校验字段生成方式包括异或运算、加法运算、减法运算和乘法运算中的任一种运算方式。The method of encapsulating a data packet according to claim 5, wherein the second preset check field generation mode comprises any one of an exclusive OR operation, an addition operation, a subtraction operation, and a multiplication operation.
  8. 一种数据包的校验方法,其特征在于,所述数据包由权利要求1所述的数据包的封装方法封装后填充至基带帧在信道中传输后于接收端恢复得到,所述校验方法包括:A method for verifying a data packet, wherein the data packet is encapsulated by the encapsulation method of the data packet according to claim 1, and then filled into a baseband frame and transmitted in a channel, and then recovered at the receiving end, and the verification is performed. Methods include:
    从一个或多个基带帧数据域中获取完整的数据包,该完整的数据包包括信息码和校验字段;Acquiring a complete data packet from one or more baseband frame data fields, the complete data packet including an information code and a check field;
    根据基带帧帧头中的校验算法标志位中标志的预设校验字段生成方式与校验字段长度,从该数据包的末尾截取校验字段,数据包的剩余内容作为信息码;And according to the preset check field generation manner and the check field length of the flag in the check algorithm flag bit in the baseband frame header, the check field is intercepted from the end of the data packet, and the remaining content of the data packet is used as the information code;
    对接收到的数据包的信息码以及数据包被分块次数的数据信息进行校验计算以得到待比较校验字段;Performing a check calculation on the information code of the received data packet and the data information of the number of times the data packet is blocked to obtain a check field to be compared;
    比较该待比较校验字段与获取到的校验字段是否一致;Comparing whether the check field to be compared is consistent with the obtained check field;
    若两者一致,则确定该数据包接收正确。If the two are consistent, it is determined that the data packet is received correctly.
  9. 如权利要求8所述的数据包的校验方法,其特征在于,所述从一个或多个基带帧数据域中获取完整的数据包包括如下步骤:The method for verifying a data packet according to claim 8, wherein said obtaining a complete data packet from one or more baseband frame data fields comprises the following steps:
    从当前的基带帧数据域的起始位置开始依次读取数据包,其中所述起始位置由基带帧帧头中的起始位置字段来确定;Reading a data packet sequentially from a starting position of a current baseband frame data field, wherein the starting position is determined by a starting position field in a baseband frame header;
    通过位于数据包头部的包长字段是否为零来判断该数据包是否完整地承载于当前的基带帧数据域;Whether the data packet is completely carried in the current baseband frame data field by whether the packet length field at the packet header is zero or not;
    若该数据包未完整地承载于当前的基带帧数据,则将当前基带帧起始位置开始至数据域末尾的所有数据作为该数据包的第一块,并继续从后续的若干个基带帧数据域中读取该数据包的剩余分块并依顺序与该数据包的第一块进行拼接以得到该数据包的信息码及校验字段,其中该数据包的剩余分块是根据基带帧帧头中的起始位置字段和数据域长度字段之间的关系来确定的;If the data packet is not completely carried in the current baseband frame data, all data starting from the start position of the current baseband frame to the end of the data field is used as the first block of the data packet, and continues from several subsequent baseband frame data. The remaining blocks of the data packet are read in the domain and spliced in sequence with the first block of the data packet to obtain an information code and a check field of the data packet, wherein the remaining partition of the data packet is based on a baseband frame frame. The relationship between the start position field and the data field length field in the header is determined;
    若该数据包完整地承载于当前的基带帧数据,则从当前的基带帧数据域的起 始位置开始并根据该数据包头部的包长获取该数据包的信息码及校验字段;If the data packet is completely carried in the current baseband frame data, from the current baseband frame data field Starting a position and obtaining an information code and a check field of the data packet according to a packet length of the packet header;
    记录组装该数据包的信息码及校验字段的基带帧的个数以确定该数据包被分块次数的数据信息。Recording the information code of the data packet and the number of baseband frames of the check field are assembled to determine the data information of the number of times the data packet is blocked.
  10. 如权利要求8所述的数据包的校验方法,其特征在于,所述该数据包的剩余分块根据基带帧帧头中的起始位置字段和数据域长度字段之间的关系来确定包括如下情形:The method for verifying a data packet according to claim 8, wherein said remaining block of said data packet is determined to be included according to a relationship between a start position field and a data field length field in a baseband frame header. The following situation:
    1)若某个基带帧帧头中的起始位置字段大于数据域长度字段,则确定该基带帧数据域全部用于承载数据包的剩余分块中的一个数据块,且该数据包的传输未完成;1) If the start position field in a baseband frame header is larger than the data field length field, it is determined that the baseband frame data field is all used to carry one data block in the remaining block of the data packet, and the data packet is transmitted. undone;
    2)若某个基带帧帧头中的起始位置字段等于数据域长度字段,则确定该基带帧数据域全部用于承载该数据包,且该数据包的传输已经完成;2) If the start position field in a baseband frame header is equal to the data field length field, it is determined that the baseband frame data field is all used to carry the data packet, and the transmission of the data packet has been completed;
    3)若某个基带帧帧头中的起始位置字段小于数据域长度字段,则该基带基数据域头部至起始位置之间的数据为该数据包的剩余分块中的最后一个数据块。3) If the start position field in a baseband frame header is smaller than the data field length field, the data between the baseband base data field header and the start position is the last data in the remaining partition of the data packet. Piece.
  11. 一种数据包的传输方法,其特征在于,包括:A method for transmitting a data packet, comprising:
    将当前待传输的数据包依次填充至一个或多个基带帧数据域;The data packet to be currently transmitted is sequentially padded to one or more baseband frame data fields;
    生成该数据包的校验字段,其中所述校验字段根据该数据包的信息码和该数据包在填充至基带帧数据域的过程中被分块次数的数据信息来确定;Generating a check field of the data packet, wherein the check field is determined according to an information code of the data packet and data information of a number of times of blocking of the data packet in a process of filling into a baseband frame data field;
    将该校验字段拼接至该数据包的信息码的末尾以完成该数据包的封装;Splicing the check field to the end of the information code of the data packet to complete the encapsulation of the data packet;
    将该数据包承载于一个或多个基带帧并经由信道传输至接收端。 The data packet is carried on one or more baseband frames and transmitted to the receiving end via a channel.
PCT/CN2014/089784 2013-11-04 2014-10-29 Data packet encapsulation method and check method WO2015062503A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310533289.9A CN103595504B (en) 2013-11-04 2013-11-04 The method for packing and method of calibration of packet
CN201310533289.9 2013-11-04

Publications (1)

Publication Number Publication Date
WO2015062503A1 true WO2015062503A1 (en) 2015-05-07

Family

ID=50085501

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/089784 WO2015062503A1 (en) 2013-11-04 2014-10-29 Data packet encapsulation method and check method

Country Status (2)

Country Link
CN (3) CN107017966B (en)
WO (1) WO2015062503A1 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111147931A (en) * 2019-12-31 2020-05-12 深圳Tcl新技术有限公司 Transmission method, device and equipment of TLV (threshold Length value) data packet and readable storage medium
CN112839003A (en) * 2019-11-22 2021-05-25 上海哔哩哔哩科技有限公司 Data verification method and system
CN113572578A (en) * 2021-07-28 2021-10-29 南方电网数字电网研究院有限公司 TCP data transmission method, device, equipment and medium based on data middlebox
CN114337929A (en) * 2022-01-05 2022-04-12 深圳市泛海三江科技发展有限公司 High-reliability communication verification method
CN114696944A (en) * 2020-12-25 2022-07-01 深圳Tcl新技术有限公司 Data packet processing method and device, intelligent terminal and computer readable storage medium
CN114741231A (en) * 2022-04-19 2022-07-12 深圳鲲云信息科技有限公司 Data read-write method, device and equipment based on memory and storage medium
CN114884624A (en) * 2022-07-08 2022-08-09 广州思德医疗科技有限公司 Data processing method and device
CN117692106A (en) * 2024-01-31 2024-03-12 北京中科网芯科技有限公司 Communication data redundancy check method
CN117692106B (en) * 2024-01-31 2024-05-03 北京中科网芯科技有限公司 Communication data redundancy check method

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107017966B (en) * 2013-11-04 2020-06-09 上海数字电视国家工程研究中心有限公司 Data packet packaging method and verification method
EP3163780A4 (en) * 2014-07-29 2017-07-12 Huawei Technologies Co., Ltd. Data encryption and transmission method and device
CN105812335B (en) * 2014-12-31 2019-07-23 上海数字电视国家工程研究中心有限公司 The analytic method of function field
WO2017008401A1 (en) * 2015-07-10 2017-01-19 华为技术有限公司 Protocol frame transmission method and device, node equipment and system
CN106452660A (en) * 2015-08-06 2017-02-22 鸿富锦精密工业(深圳)有限公司 Data transfer system and method
CN106484690A (en) * 2015-08-24 2017-03-08 阿里巴巴集团控股有限公司 A kind of verification method of Data Migration and device
CN106028397A (en) * 2016-05-10 2016-10-12 国网新疆电力公司经济技术研究院 High-reliability mass data wireless transmission system
CN106686526B (en) * 2016-12-16 2020-10-30 美的智慧家居科技有限公司 Method and device for acquiring routing information of electric appliance
CN106850149A (en) * 2017-04-21 2017-06-13 深圳怡化电脑股份有限公司 A kind of data transmission method, device, equipment and storage medium
CN107426770B (en) * 2017-07-21 2021-09-14 广东美的制冷设备有限公司 Data communication method, data terminal and system based on data link layer
CN108039936A (en) * 2017-12-14 2018-05-15 华南智能机器人创新研究院 A kind of communication protocol data bag and communication system for unmanned operation equipment
CN108173623B (en) * 2018-01-16 2020-08-14 四川安迪科技实业有限公司 User-defined baseband frame packaging method based on sliding CRC
CN109587112B (en) 2018-10-25 2021-02-12 华为技术有限公司 Data sending method, data receiving method, equipment and system
CN109586846A (en) * 2018-11-20 2019-04-05 湖南晨威高科有限公司 Mainboard and from the communication means between plate inside a kind of direct-current charging post
CN110297871A (en) * 2019-06-20 2019-10-01 常州冰鉴信息科技有限公司 A kind of method that isomeric data acquires in real time
CN110442044A (en) * 2019-08-19 2019-11-12 哈尔滨工业大学 A kind of semi-physical emulation platform for aircraft guidance control algorithm validation
CN110649937B (en) * 2019-09-23 2021-03-02 明格(上海)信息技术有限公司 Ultrasonic wave emission control method, and transmission and reception control method and device
CN113346980B (en) * 2021-08-02 2023-08-11 浙江国利信安科技有限公司 Method, electronic device and computer storage medium for message forwarding
CN114257338B (en) * 2021-11-26 2022-12-20 力同科技股份有限公司 Data processing method and device, communication system and communication device, equipment and medium
CN114615354A (en) * 2022-04-12 2022-06-10 支付宝(杭州)信息技术有限公司 Method and device for processing message
CN116846546B (en) * 2023-04-24 2024-03-22 广州智臣信息科技有限公司 Information loss-proof and repetition-proof cross-network data exchange system
CN116506326B (en) * 2023-06-21 2023-11-24 季华实验室 Sub-thread data receiving method, data monitoring method, upper computer and robot

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212267A (en) * 2007-12-21 2008-07-02 北京创毅视讯科技有限公司 FTP service data based method, system, and device for broadcast system
WO2008148278A1 (en) * 2007-06-06 2008-12-11 Phoenix Microelectronics (China) Co., Ltd. Method for exchanging large-capacity data between mobile terminal and smart card
CN102098125A (en) * 2009-12-15 2011-06-15 上海贝尔股份有限公司 Method and device for processing parallel baseband
CN102571272A (en) * 2011-12-14 2012-07-11 展讯通信(上海)有限公司 Method and device for receiving service data in communication system, and baseband chip
CN103595504A (en) * 2013-11-04 2014-02-19 上海数字电视国家工程研究中心有限公司 Encapsulation method and calibration method for data package

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4278850A (en) * 1978-04-11 1981-07-14 Kokusai Denshin Denwa Co., Ltd. Monitoring system for optical transmission line repeaters
JPH10190705A (en) * 1996-10-22 1998-07-21 Sony Corp Transmission device/method and reception device/method
EP1365548A1 (en) * 2002-05-21 2003-11-26 Alcatel Method for encapsulating variable length packets, and related data packet encapsulator and decapsulator
CA2423896A1 (en) * 2003-03-28 2004-09-28 Norsat International Inc. Highly integrated and compact baseband apparatus for portable newsgathering
EP1555788A1 (en) * 2004-01-15 2005-07-20 Alcatel Method for improving the quality of an encoded video bit stream transmitted over a wireless link, and corresponding receiver
CN100539677C (en) * 2006-12-29 2009-09-09 雷科通技术(杭州)有限公司 Utilize cable television network to carry out the method and apparatus of remote both way communications
CN101296055B (en) * 2007-04-29 2013-01-09 华为技术有限公司 Data package dispatching method and device
CN101459490B (en) * 2007-12-13 2012-01-11 中兴通讯股份有限公司 Data transmission method and device
CN101193284B (en) * 2007-12-27 2010-07-07 北京中星微电子有限公司 Validation method, system and device for transmission integrity of compressed file
CN101286945B (en) * 2008-05-22 2011-06-22 北京星网锐捷网络技术有限公司 Method and apparatus for processing of data fragmentation
US8068423B2 (en) * 2008-09-09 2011-11-29 Ericsson Television, Inc Packet scheduling system for digital video broadcasting
CN101916173B (en) * 2010-08-27 2013-08-28 杭州华三通信技术有限公司 RAID (Redundant Array of Independent Disks) based data reading and writing method and system thereof
CN101969359B (en) * 2010-09-29 2012-11-14 航天东方红卫星有限公司 Method for uploading and processing electric load task on small satellite

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008148278A1 (en) * 2007-06-06 2008-12-11 Phoenix Microelectronics (China) Co., Ltd. Method for exchanging large-capacity data between mobile terminal and smart card
CN101212267A (en) * 2007-12-21 2008-07-02 北京创毅视讯科技有限公司 FTP service data based method, system, and device for broadcast system
CN102098125A (en) * 2009-12-15 2011-06-15 上海贝尔股份有限公司 Method and device for processing parallel baseband
CN102571272A (en) * 2011-12-14 2012-07-11 展讯通信(上海)有限公司 Method and device for receiving service data in communication system, and baseband chip
CN103595504A (en) * 2013-11-04 2014-02-19 上海数字电视国家工程研究中心有限公司 Encapsulation method and calibration method for data package

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112839003A (en) * 2019-11-22 2021-05-25 上海哔哩哔哩科技有限公司 Data verification method and system
CN111147931A (en) * 2019-12-31 2020-05-12 深圳Tcl新技术有限公司 Transmission method, device and equipment of TLV (threshold Length value) data packet and readable storage medium
CN114696944A (en) * 2020-12-25 2022-07-01 深圳Tcl新技术有限公司 Data packet processing method and device, intelligent terminal and computer readable storage medium
CN113572578A (en) * 2021-07-28 2021-10-29 南方电网数字电网研究院有限公司 TCP data transmission method, device, equipment and medium based on data middlebox
CN113572578B (en) * 2021-07-28 2023-06-30 南方电网数字电网研究院有限公司 TCP data transmission method, device, equipment and medium based on data center
CN114337929A (en) * 2022-01-05 2022-04-12 深圳市泛海三江科技发展有限公司 High-reliability communication verification method
CN114741231A (en) * 2022-04-19 2022-07-12 深圳鲲云信息科技有限公司 Data read-write method, device and equipment based on memory and storage medium
CN114884624A (en) * 2022-07-08 2022-08-09 广州思德医疗科技有限公司 Data processing method and device
CN117692106A (en) * 2024-01-31 2024-03-12 北京中科网芯科技有限公司 Communication data redundancy check method
CN117692106B (en) * 2024-01-31 2024-05-03 北京中科网芯科技有限公司 Communication data redundancy check method

Also Published As

Publication number Publication date
CN106850143A (en) 2017-06-13
CN103595504A (en) 2014-02-19
CN103595504B (en) 2017-07-28
CN106850143B (en) 2020-08-18
CN107017966B (en) 2020-06-09
CN107017966A (en) 2017-08-04

Similar Documents

Publication Publication Date Title
WO2015062503A1 (en) Data packet encapsulation method and check method
KR102450253B1 (en) Transmitting apparatus and receiving apparatus and signal processing method thereof
KR101961444B1 (en) Transmitting apparatus and receiving apparatus and signal processing method thereof
KR102450265B1 (en) Transmitting apparatus and receiving apparatus and controlling method thereof
JP6523249B2 (en) Method and apparatus for compressing packet header
US9917930B2 (en) Transmitting apparatus and receiving apparatus and signal processing method thereof
US11700200B2 (en) Transmitting apparatus and signal processing method using removal of transport steam packet header
JP2010538535A (en) Methods and systems for various data loss protection
KR20150019328A (en) transmitting apparatus and receiving apparatus and data processing method thereof
CA2972882C (en) Transmitting apparatus and receiving apparatus and signal processing method thereof
CN107113458B (en) Transmitting apparatus and signal processing method thereof
KR102424840B1 (en) Transmitting apparatus and receiving apparatus and signal processing method thereof
KR102383598B1 (en) Broadcast receiving apparatus and signal processing method thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14859010

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 02/11/2016)

122 Ep: pct application non-entry in european phase

Ref document number: 14859010

Country of ref document: EP

Kind code of ref document: A1