Disclosure of Invention
Embodiments of the present invention provide a sending end, a receiving end, and a data frame transmission method and a storage medium thereof, which can generate a frame header more efficiently.
In order to achieve the above object, an embodiment of the present invention provides a method for transmitting a data frame at a transmitting end, where the method includes: obtaining a spreading factor; determining the length of the data length indication domain of the frame header based on the corresponding relation between the spreading factor and the length of the data length indication domain of the frame header according to the spreading factor; and generating the frame header according to the length of the data length indication domain of the frame header so as to transmit the data frame.
Preferably, when generating the frame header of the downlink frame, the method further includes: the cyclic redundancy check indication field is deleted.
Preferably, transmitting the data frame comprises: carrying out interleaving processing on the data of the frame header and the first part of load data; and carrying out interleaving processing on the second part of the load data, wherein the first part of the load data and the second part of the load data form the whole load data.
Preferably, the interleaving the data of the frame header and the first partial payload data together includes: determining the size of an interleaver and the length of the data of the frame header; using a difference between a size of the interleaver and a length of data of the frame header as a length of the first partial payload data; determining the first part of the load data according to the length of the first part of the load data; and interleaving the data of the frame header and the first part of load data together.
The embodiment of the invention also provides a method for transmitting the data frame of the receiving end, which comprises the following steps: obtaining a spreading factor; and analyzing the data length indication domain based on the corresponding relation between the spreading factor and the length of the data length indication domain of the frame header according to the spreading factor so as to receive the data frame.
Preferably, the method further comprises: determining whether the data frame is an uplink frame or a downlink frame; when the data frame is a downlink frame, analyzing each field of a frame header of the data frame without a cyclic redundancy check indication field; and when the data frame is an uplink frame, analyzing each field of a frame header of the data frame containing the cyclic redundancy check indication field.
Preferably, receiving the data frame comprises: performing de-interleaving processing on the data of the frame header and the first part of load data; and performing de-interleaving processing on the second part of the load data, wherein the first part of the load data and the second part of the load data form the whole load data.
Preferably, the deinterleaving the data of the frame header and the first partial payload data together includes: data of a length of the interleaver is received and deinterleaved.
Preferably, after performing de-interleaving processing on the data of the frame header and the first partial payload data together, the method further includes: analyzing the data of the length of the data of the frame header to obtain the information of the whole load data; and processing the first part of load data with the length of the difference between the size of the interleaver and the length of the data of the frame header.
An embodiment of the present invention further provides a sending end, where the sending end includes: the device comprises a first acquisition unit, a determination unit and a generation unit, wherein the first acquisition unit is used for acquiring a spreading factor; the determining unit is configured to determine, according to the spreading factor, a length of a data length indication field of the frame header based on a correspondence between the spreading factor and the length of the data length indication field of the frame header; the generating unit is used for generating the frame header according to the length of the data length indication domain of the frame header so as to transmit the data frame.
Preferably, when generating the frame header of the downlink frame, the generating unit is further configured to: the cyclic redundancy check indication field is deleted.
Preferably, the transmitting end further includes: a transmission unit for: carrying out interleaving processing on the data of the frame header and the first part of load data; and carrying out interleaving processing on the second part of the load data, wherein the first part of the load data and the second part of the load data form the whole load data.
Preferably, the transmission unit is further configured to: determining the size of an interleaver and the length of the data of the frame header; using a difference between a size of the interleaver and a length of data of the frame header as a length of the first partial payload data; determining the first part of the load data according to the length of the first part of the load data; and interleaving the data of the frame header and the first part of load data together.
An embodiment of the present invention further provides a receiving end, where the receiving end includes: the device comprises a second acquisition unit and an analysis unit, wherein the second acquisition unit is used for acquiring a spreading factor; the analysis unit is used for analyzing the data length indication domain based on the corresponding relation between the spreading factor and the length of the data length indication domain of the frame header according to the spreading factor so as to receive the data frame.
Preferably, the parsing unit is further configured to: determining whether the data frame is an uplink frame or a downlink frame; when the data frame is a downlink frame, analyzing each field of a frame header of the data frame without a cyclic redundancy check indication field; and when the data frame is an uplink frame, analyzing each field of a frame header of the data frame containing the cyclic redundancy check indication field.
Preferably, the receiving end further includes: a receiving unit configured to: performing de-interleaving processing on the data of the frame header and the first part of load data; and performing de-interleaving processing on the second part of the load data, wherein the first part of the load data and the second part of the load data form the whole load data.
Preferably, the receiving unit is further configured to: data of a length of the interleaver is received and deinterleaved.
Preferably, after performing de-interleaving processing on the data of the frame header and the first partial payload data together, the receiving unit is further configured to: analyzing the data of the length of the data of the frame header to obtain the information of the whole load data; and processing the first part of load data with the length of the difference between the size of the interleaver and the length of the data of the frame header.
By adopting the technical scheme, the sending end, the receiving end, the data frame transmission method and the storage medium thereof can enable the domain length of the frame header to be self-adaptive, effectively reduce the generation of invalid bits and generate the frame header more efficiently.
Additional features and advantages of embodiments of the invention will be set forth in the detailed description which follows.
Detailed Description
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating embodiments of the invention, are given by way of illustration and explanation only, not limitation.
Fig. 1 is a flowchart of a method for transmitting a data frame at a transmitting end according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step S11, obtaining a spreading factor;
for example, the spreading factor is set according to actual needs, and in general, the spreading factor can be determined according to the data traffic transmission rate requirement.
Step S12, according to the spread spectrum factor, based on the corresponding relationship between the spread spectrum factor and the length of the data length indication domain of the frame header, determining the length of the data length indication domain of the frame header;
for example, the frame header contains information required for receiving payload data, such as payload data length coding rate, etc. Generally, payload data can be processed only after header data is received and information of each domain is parsed. In the prior art, in order to easily receive the frame header, the length of each field of the frame header and the contained information are fixed.
The frame header contains a data length indication field, and in general, for example, to support a payload data length of 1024 bytes, the length of the data length indication field in the frame header is 10 bits. However, when the spreading factor becomes larger, the payload data length supported by the data length indication field is smaller than 1024 bytes, and a length of 10 bits is not required. Therefore, the present invention sets the length of the data length indication field to be related to the spreading factor, and particularly sets the correspondence relationship between the preferred spreading factor and the length of the data length indication field of the frame header, as follows:
| spreading factor
|
Data length indication field length
|
Maximum payload data length
|
| 6
|
9
|
511
|
| 7
|
8
|
255
|
| 8
|
7
|
127
|
| 9
|
6
|
63
|
| 10
|
5
|
31
|
| 11
|
4
|
14
|
| 12
|
3
|
7 |
Therefore, after the spreading factor is obtained, the data length indication field length of the frame header can be determined according to the spreading factor.
Step S13, generating the frame header according to the length of the data length indication field of the frame header, so as to transmit the data frame.
For example, when the frame header is generated, the data length indication field is generated according to the determined data length indication field length. The remaining generation manner of the data frame may not be changed, and is not described herein again.
In another embodiment, a cyclic redundancy check indication field (CRC indication field) in the frame header may also be adjusted according to the uplink data frame and the downlink data frame. For example, the CRC indication field may be removed to account for the absence of a CRC check on the downlink data frame. Therefore, when generating the frame header of the downlink data frame, the method further includes: the cyclic redundancy check indication field is deleted. When the uplink data frame is generated, the CRC indication field is not adjusted. In this way, the fields of the headers of the downlink data frame and the uplink data frame are set to different categories.
Fig. 2 is a flowchart of a method for transmitting a data frame at a transmitting end according to another embodiment of the present invention. As shown in fig. 2, the method for transmitting the data frame includes:
step S21, interweaving the data of the frame header and the first part of load data;
for example, in order to improve transmission efficiency, the embodiment of the present invention may perform hybrid interleaving on the frame header data and the partial payload data. The length of the first part of the payload data can be set as desired.
Step S22, interleaving a second part of payload data, where the first part of payload data and the second part of payload data constitute the entire payload data.
For example, after the entire payload data is divided into the first partial payload data and the second partial payload data, and the first partial payload data is mixed and interleaved with the data of the frame header, the remaining second partial payload data may be interleaved alone.
The following provides a preferred embodiment of determining the length of the first partial payload data in particular.
Fig. 3 is a flowchart of a method for transmitting a data frame at a transmitting end according to another embodiment of the present invention. As shown in fig. 3, performing an interleaving process on the data of the frame header and the first partial payload data together includes:
step S31, determining the size of the interleaver and the length of the data of the frame header;
for example, assume that the interleaver size is C and the data length of the frame header is H.
Step S32, using the difference between the size of the interleaver and the length of the data of the frame header as the length of the first partial payload data;
for example, the size C of the interleaver minus the length of the data of the frame header is H to obtain the length (C-H) of the first payload data, so that interleaving by the interleaver can be maximized.
Step S33, determining the first partial payload data according to the length of the first partial payload data;
for example, after the length (C-H) of the first partial payload data is obtained, the first partial payload data may be separated from the payload data according to the length.
Step S34, interleaving the data of the frame header and the first partial payload data together.
For example, as described above, since the field length of the generated frame header may become smaller, the data length of the frame header is reduced, and at this time, the first partial payload data may be used for supplementation, and the data length of the supplemented frame header may be recovered. And finally, interleaving the data of the frame header and the first part of load data together.
It can be understood that if the length of the entire payload data is P, the length of the second partial payload data should be P- (C-H), and the remaining second partial payload data with the length of P- (C-H) is separately interleaved.
In the embodiment of the invention, the data of the frame header and part of the load data are put together for interleaving, which is beneficial to reducing the collision between frames, and can improve the interleaving utilization efficiency and the transmission efficiency of effective data. Especially, the effect is very obvious for data transmission with high spreading factor.
Fig. 4 is a transmission method of a data frame at a receiving end according to an embodiment of the present invention. As shown in fig. 4, the method includes:
step S41, obtaining a spreading factor;
for example, the spreading factor value may be obtained from frame header synchronization information received by the receiving end.
Step S42, according to the spreading factor, analyzing the data length indication field based on the corresponding relationship between the spreading factor and the length of the data length indication field of the frame header, so as to receive the data frame.
For example, the data length indication field is analyzed according to the correspondence of the length of the data length indication field of the spreading factor frame header in the table above and the obtained value of the spreading factor. The parsing manners of other fields of the frame header may not be changed, and are not described herein again.
Fig. 5 is a transmission method of a data frame at a receiving end according to another embodiment of the present invention. As shown in fig. 5, the method includes:
step S51, determining whether the data frame is an uplink frame or a downlink frame;
for example, as described above, the uplink data frame and the downlink data frame may have different configurations for the CRC indication field, and therefore, it is also necessary to determine whether the data frame is an uplink frame or a downlink frame when parsing.
Step S52, when the data frame is a downlink frame, analyzing each field of the frame head of the data frame without a cyclic redundancy check indication field;
for example, if the data frame is a downlink frame, the data frame may not include a CRC indication field, and thus each field may be parsed without a CRC indication field.
And step S53, when the data frame is an uplink frame, analyzing each field of the frame header of the data frame including the cyclic redundancy check indication field.
For example, if the data frame is an uplink frame, the data frame still contains a CRC indication field, and therefore each field needs to be parsed in a normal manner.
Fig. 6 is a transmission method of a data frame at a receiving end according to another embodiment of the present invention. As shown in fig. 6, receiving the data frame includes:
step S61, performing de-interleaving processing on the data of the frame header and the first part of load data;
for example, in the case where the data of the frame header and the first partial payload data are interleaved together, the present embodiment needs to de-interleave the data of the frame header and the first partial payload data together. More specifically, data having a length of the interleaver may be first received and deinterleaved. E.g., interleaver size C, data of length C is first received and deinterleaved.
Step S62, deinterleaving the second partial payload data, wherein the first partial payload data and the second partial payload data constitute the entire payload data.
For example, the remaining data, i.e., the second portion of payload data, is then received and deinterleaved. When the length of the whole load data is P and the length of the data of the frame header is H, the length of the second part load data should be P + H-C.
Fig. 7 is a transmission method of a data frame at a receiving end according to another embodiment of the present invention. As shown in fig. 7, after performing de-interleaving processing on the data of the frame header and the first partial payload data together, the method further includes:
step S71, analyzing the data of the length of the data of the frame header to obtain the information of the whole load data;
for example, the data of the frame header and the data of the first partial payload after being deinterleaved are divided into the data of the frame header with the length H and the first partial payload with the length (C-H), and then the data of the frame header with the length H is analyzed to obtain the length information, the coding rate and other information of the entire payload.
Step S72, the first partial payload data having a length equal to the difference between the size of the interleaver and the length of the data of the frame header is processed.
For example, a first part of payload data of length (C-H) is then processed, and finally, of course, a second part of payload data of length P + H-C is received and deinterleaved.
Fig. 8 is a block diagram of a transmitting end according to an embodiment of the present invention. As shown in fig. 8, the transmitting end includes: a first acquiring unit 81, a determining unit 82 and a generating unit 83, wherein the first acquiring unit 81 is used for acquiring a spreading factor; the determining unit 82 is configured to determine, according to the spreading factor, a length of a data length indication field of the frame header based on a correspondence between the spreading factor and the length of the data length indication field of the frame header; the generating unit 83 is configured to generate the frame header according to the length of the data length indication field of the frame header, so as to transmit the data frame.
Preferably, when generating the frame header of the downlink frame, the generating unit 83 is further configured to: the cyclic redundancy check indication field is deleted.
Preferably, the transmitting end further includes: a transmission unit 84 for: carrying out interleaving processing on the data of the frame header and the first part of load data; and carrying out interleaving processing on the second part of the load data, wherein the first part of the load data and the second part of the load data form the whole load data.
Preferably, the transmission unit 84 is further configured to: determining the size of an interleaver and the length of the data of the frame header; using a difference between a size of the interleaver and a length of data of the frame header as a length of the first partial payload data; determining the first part of the load data according to the length of the first part of the load data; and interleaving the data of the frame header and the first part of load data together.
Fig. 9 is a block diagram of a receiving end according to an embodiment of the present invention. As shown in fig. 9, the receiving end includes: a second acquiring unit 91 and an analyzing unit 92, wherein the second acquiring unit 91 is configured to acquire a spreading factor; the parsing unit 92 is configured to parse the data length indication field based on a correspondence between the spreading factor and a length of the data length indication field of the frame header according to the spreading factor, so as to receive the data frame.
Preferably, the parsing unit 92 is further configured to: determining whether the data frame is an uplink frame or a downlink frame; and when the data frame is a downlink frame, analyzing each field of a frame header of the data frame without the cyclic redundancy check indication field. And when the data frame is an uplink frame, analyzing each field of a frame header of the data frame containing the cyclic redundancy check indication field.
Preferably, the receiving end further includes: a receiving unit 93 configured to: performing de-interleaving processing on the data of the frame header and the first part of load data; and performing de-interleaving processing on the second part of the load data, wherein the first part of the load data and the second part of the load data form the whole load data.
Preferably, the receiving unit 93 is further configured to: data of a length of the interleaver is received and deinterleaved.
Preferably, after performing de-interleaving processing on the data of the frame header and the first partial payload data together, the receiving unit 93 is further configured to: analyzing the data of the length of the data of the frame header to obtain the information of the whole load data; and processing the first part of load data with the length of the difference between the size of the interleaver and the length of the data of the frame header.
The receiving end and the sending end comprise a processor and a memory, the first acquiring unit, the determining unit, the generating unit, the transmitting unit, the second acquiring unit, the analyzing unit, the receiving unit and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can set one or more, and data is sent and received by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium, on which a program is stored, where the program, when executed by a processor, implements a method for transmitting data frames of a receiving end and a transmitting end.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program runs to execute a transmission method of data frames of a receiving end and a sending end.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
obtaining a spreading factor; determining the length of the data length indication domain of the frame header based on the corresponding relation between the spreading factor and the length of the data length indication domain of the frame header according to the spreading factor; and generating the frame header according to the length of the data length indication domain of the frame header so as to transmit the data frame.
Preferably, when generating the frame header of the downlink frame, the method further includes: the cyclic redundancy check indication field is deleted.
Preferably, transmitting the data frame comprises: carrying out interleaving processing on the data of the frame header and the first part of load data; and carrying out interleaving processing on the second part of the load data, wherein the first part of the load data and the second part of the load data form the whole load data.
Preferably, the interleaving the data of the frame header and the first partial payload data together includes: determining the size of an interleaver and the length of the data of the frame header; using a difference between a size of the interleaver and a length of data of the frame header as a length of the first partial payload data; determining the first part of the load data according to the length of the first part of the load data; and interleaving the data of the frame header and the first part of load data together.
Obtaining a spreading factor; and analyzing the data length indication domain based on the corresponding relation between the spreading factor and the length of the data length indication domain of the frame header according to the spreading factor so as to receive the data frame.
Preferably, the method further comprises: determining whether the data frame is an uplink frame or a downlink frame; when the data frame is a downlink frame, analyzing each field of a frame header of the data frame without a cyclic redundancy check indication field; and when the data frame is an uplink frame, analyzing each field of a frame header of the data frame containing the cyclic redundancy check indication field.
Preferably, receiving the data frame comprises: performing de-interleaving processing on the data of the frame header and the first part of load data; and performing de-interleaving processing on the second part of the load data, wherein the first part of the load data and the second part of the load data form the whole load data.
Preferably, the deinterleaving the data of the frame header and the first partial payload data together includes: data of a length of the interleaver is received and deinterleaved.
Preferably, after performing de-interleaving processing on the data of the frame header and the first partial payload data together, the method further includes: analyzing the data of the length of the data of the frame header to obtain the information of the whole load data; and processing the first part of load data with the length of the difference between the size of the interleaver and the length of the data of the frame header.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
obtaining a spreading factor; determining the length of the data length indication domain of the frame header based on the corresponding relation between the spreading factor and the length of the data length indication domain of the frame header according to the spreading factor; and generating the frame header according to the length of the data length indication domain of the frame header so as to transmit the data frame.
Preferably, when generating the frame header of the downlink frame, the method further includes: the cyclic redundancy check indication field is deleted.
Preferably, transmitting the data frame comprises: carrying out interleaving processing on the data of the frame header and the first part of load data; and carrying out interleaving processing on the second part of the load data, wherein the first part of the load data and the second part of the load data form the whole load data.
Preferably, the interleaving the data of the frame header and the first partial payload data together includes: determining the size of an interleaver and the length of the data of the frame header; using a difference between a size of the interleaver and a length of data of the frame header as a length of the first partial payload data; determining the first part of the load data according to the length of the first part of the load data; and interleaving the data of the frame header and the first part of load data together.
Obtaining a spreading factor; and analyzing the data length indication domain based on the corresponding relation between the spreading factor and the length of the data length indication domain of the frame header according to the spreading factor so as to receive the data frame.
Preferably, the method further comprises: determining whether the data frame is an uplink frame or a downlink frame; when the data frame is a downlink frame, analyzing each field of a frame header of the data frame without a cyclic redundancy check indication field; and when the data frame is an uplink frame, analyzing each field of a frame header of the data frame containing the cyclic redundancy check indication field.
Preferably, receiving the data frame comprises: performing de-interleaving processing on the data of the frame header and the first part of load data; and performing de-interleaving processing on the second part of the load data, wherein the first part of the load data and the second part of the load data form the whole load data.
Preferably, the deinterleaving the data of the frame header and the first partial payload data together includes: data of a length of the interleaver is received and deinterleaved.
Preferably, after performing de-interleaving processing on the data of the frame header and the first partial payload data together, the method further includes: analyzing the data of the length of the data of the frame header to obtain the information of the whole load data; and processing the first part of load data with the length of the difference between the size of the interleaver and the length of the data of the frame header.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.