Detailed Description
In the current solution of the UE, a higher layer protocol and a physical layer protocol are respectively and completely implemented, but when the two protocols run on different chips, especially when a higher layer protocol module and a physical layer module come from different manufacturers, non-real-time data transmission control after the two modules are integrated is particularly important. Embodiments of the present invention provide a data transmission control method and apparatus for confirming data transmission, which can improve a wireless resource utilization rate when a high-level protocol module and a physical layer module are integrated, and implement efficient and correct data transmission.
As shown in fig. 3, a schematic diagram of a connection relationship of a data transmission control device added in a UE according to an embodiment of the present invention is provided, in which a data transmission control device 302 is added between a physical layer module 300 and a higher layer protocol module 301, the higher layer protocol module 301 sends a data block to be sent to the physical layer module 300 through the data transmission control device 302, and some related local control information is also transmitted between the physical layer module 300 and the higher layer protocol module 301 through the data transmission control device 302 to confirm correct transmission of data. The data transmission control device can be realized in a hardware mode or a software mode, can be positioned at one side of a high-level protocol module or a physical layer protocol module, and is quite flexible to use.
One possible internal structure of the data transmission control device 302 is shown in fig. 4, and includes: a control unit 401 and a data buffer unit 402, wherein:
the control unit 401: the device comprises a data block sending module, a data block receiving module, a data block caching module, a data block sending module and a data block sending module, wherein the data block sending module is used for receiving and caching a data block sent by a high layer, sending the cached data block to a physical layer, and when a message that the physical layer has sent the data block is received, clearing the data block and informing the high layer, or when a message that the high layer stops sending the data block is received, informing the physical layer to stop sending;
data cache unit 402: for storing the data blocks buffered by the control unit 401.
Since a data block transmitted by a higher layer has a state of the data block, the state of the data block is divided into three types, which are an incorrect acknowledgement (NACK) state, a NEW data (NEW) state, and a wait for acknowledgement (PEND) state, respectively. Preferably, the data buffering unit may be divided into three sub-units, and the received data blocks are respectively buffered in different sub-units according to the states of the data blocks, and each sub-unit stores the data blocks with the same state in a queue, so that the data buffering unit 402 includes a first data buffering sub-unit 4021, a second data buffering sub-unit 4022, and a third data buffering sub-unit 4023, where:
when the received data block is in an incorrect confirmation state, the control unit 401 buffers the data block in the first data buffering subunit 4021, when the received data block is in a new data state, buffers the data block in the second data buffering subunit 4022, and when the received data block is in a wait confirmation state, buffers the data block in the third data buffering subunit 4023;
the first data buffer subunit 4021: the first data buffer queue is used for storing a data block with an incorrect confirmation state;
the second data cache subunit 4022: the second data buffer queue is used for storing data blocks in a new data state;
the third data buffer subunit 4023: the third data buffer queue is used for storing a third data buffer queue, and the third data buffer queue is used for buffering the data blocks waiting for confirmation.
Of course, the three data buffer subunits may also be combined and disposed on a physical entity, that is, the data buffer unit 402 stores three data buffer queues. The physical entities adopted by the data cache unit and each data cache subunit are generally registers.
Because the data blocks buffered in the data buffer unit have different states, the data transmission control device further includes a state buffer unit 403, wherein:
the control unit 401 also records the state of the cached data block when sending the data block to the physical layer;
state cache unit 403: for storing the status of the data blocks that the control unit 401 has sent to the physical layer. The storage queues are all first-in first-out queues, and there are three flags to indicate the specific positions of the queues, respectively start (start), ready (ready) and total (total _ num), where start indicates the position information of the first data block stored in the queue, ready indicates the position information of the first data block not yet sent to the physical layer, and total _ num indicates the total number of all data blocks in the queue.
And after the high layer sends a plurality of data blocks to the data transmission control device, the data transmission control device increases the total _ num in the corresponding data cache queue by corresponding number according to the state and the number of the data blocks sent by the high layer, and the ready and the start are kept unchanged. As shown in fig. 5a, a data block sent by a higher layer to a physical layer is firstly buffered in a data transmission control device, before the data block is sent by the higher layer, the position information of the data block indicated by start and ready in a data buffer queue corresponding to the state of the data block in the data transmission control device is both 0, and total _ num is also 0, which indicates that no data block is stored in the data buffer queue; after the high layer sends two data blocks to the physical layer, the two data blocks are firstly cached in the data transmission control device, the position information indicated by start and ready in the corresponding data cache queue is not changed, and the corresponding total _ num is changed into 2, which indicates that the two data blocks are stored in the data cache queue.
And each time after the data transmission control device sends a plurality of buffered data blocks to the physical layer, the data transmission control device moves the ready in the corresponding data buffer queue forward by a corresponding number according to the number and the state of the data blocks sent to the physical layer, but the start and the total _ num are kept unchanged. As shown in fig. 5b, before the data transmission control device sends the buffered data block to the physical layer, the location information of the data block indicated by start and ready in the data buffer queue corresponding to the state of the data block in the data transmission control device is both 0, and total _ num is 2, which indicates that two data blocks are stored in the data buffer queue; after the data transmission control device sends the two data blocks to the physical layer, the position information indicated by the start in the data cache queue is unchanged, the ready moves forward by 2 positions, the indicated position information is 2, and the total _ num is still 2, which indicates that the two data blocks cached in the data cache queue are still valid.
And after the physical layer informs the data transmission control device that a plurality of data blocks are successfully transmitted to the network, the data transmission control device clears the corresponding number in the corresponding data cache queue according to the number and the state of the data blocks which are successfully transmitted to the network, at this time, the start moves the corresponding number forwards, but the ready remains unchanged, and the total _ num also decreases the corresponding number. As shown in fig. 5c, before the physical layer successfully sends the data block to the network, the location information of the data block indicated by start in the data cache queue corresponding to the state of the data block in the data transmission control device is 0, the location information indicated by ready is 2, and total _ num is 2, which indicates that two data blocks are cached in the data cache queue; when the fact that the physical layer successfully sends two data blocks to the network is known, the position information indicated by ready in the data cache queue is unchanged, the start moves forwards for two positions, the indicated position information is 2, and total _ num becomes 0, which indicates that no data block is stored in the data cache queue.
When the state of the high layer changes and the size or the content of the data block needs to be changed, namely the sending of the current data block is stopped, the data transmission control device retreats the ready in the corresponding data cache queue to the initial position according to the state of the data block, the start is kept unchanged, the total _ num is reduced by the corresponding number, and the physical layer is informed to stop using the data block which is not sent out. As shown in fig. 5d, before receiving the notification of the state change of the higher layer, the data transmission control device indicates that the data block indicated by the start in the data cache queue corresponding to the state of the data block has position information of 0, the ready indicates position information of 2, and the total _ num is 2, indicating that two data blocks are stored in the data cache unit; when the state of the high layer is changed and the size or the content of the two data blocks needs to be changed, the data transmission control device backwards returns the ready in the data cache queue to two positions according to the state of the data blocks, the indicated position information is 0, the position information indicated by the start is not changed, and the total _ num is 0, which indicates that no data block is stored in the data cache queue.
The status buffer unit stores a first-in first-out status buffer queue for recording the status of the data block which has been transmitted to the physical layer by the higher layer through the data transmission control device as a location for each data buffer queue. There are two flags to indicate the specific location of the state cache queue, start (start) which indicates the location information of the first data block that has been sent to the physical layer but not yet sent to the network, and total _ num (total _ num) which indicates the total number of data blocks held in the state cache queue. As shown in fig. 6a, in the state cache queue in the initial state, the position information of the data block indicated by the start is 0, and total _ num is also 0;
after the higher layer has sent four data blocks to the physical layer through the data transmission control device, the state buffer queue is as shown in fig. 6b, the location information of the data block indicated by start is still 0, total _ num is 4, and the stored states of the four data blocks that have been sent to the physical layer but have not been sent to the network by the physical layer are respectively: NEW, NACK, NEW.
After it is known that the physical layer successfully sends out two data blocks to the network, the state cache queue is as shown in fig. 6c, the location information of the data block indicated by the start is 2, and total _ num becomes 2, and since two data blocks have been sent to the network, the states of the two stored data blocks that are not sent to the network are respectively: NEW, NEW; the changed memory contents are then notified to higher layers. The high layer can know the state of the data block just sent out by the physical layer exactly, and then process the data buffer queue of the corresponding state.
The use of two data blocks in the above example is for illustrative convenience only, and virtually any combination of data blocks that meets the size of the storage space is possible.
As shown in fig. 7, the data transmission control method provided by the embodiment of the present invention includes steps of:
s701, receiving and caching a data block sent by a high layer;
s702, sending the cached data block to a physical layer, and when receiving a message that the physical layer has sent the data block, clearing the data block and notifying a high layer; or,
when a message that the higher layer suspends the transmission of the data block is received, the physical layer is notified to stop the transmission of the data block.
Preferably, the control unit stores the received data blocks in the three data cache queues according to the states of the data blocks, controls and processes the three data cache queues according to the local control information, respectively, when receiving a message from a higher layer, the message includes the data blocks and the local control information, and controls and processes the three data cache queues according to the following procedures, as shown in fig. 8, including:
s801, after receiving a message from a high layer, a control unit judges whether the message is a data block sent by the high layer, if so, S802 is executed, otherwise, S804 is executed;
s802, the control unit stores the data blocks into corresponding data buffer queues according to the states of the data blocks;
s803, the total _ num of the data buffer queue changes correspondingly according to the number of the data blocks,
s803, the total _ num of the data cache queue changes correspondingly according to the number of the data blocks, the start and the ready are not changed, and the step returns to the step of S801;
if the data block is not from the higher layer, the message is definitely the local control information, and then the control unit will determine whether the higher layer stops sending the data block according to the local control information, if so, the data block is cleared in the corresponding data buffer queue, and the physical layer is notified to clear the data block which is not sent out, that is, the sending of the data block is stopped, because the state of the whole protocol changes again in the process of waiting for the sending of the physical layer by the already grouped data block due to the existence of the delay, and the change of the state occurs in two cases:
one is that when a data block in the peer state in the third data buffer queue receives an acknowledgement message from the network, the data block in the third data buffer queue is not necessary to be retransmitted, and thus the data block in the peer state that has not been sent by the physical layer does not need to be sent again, and needs to be cleared and the values of three parameters start, ready and total _ num in the third data buffer queue are processed according to the situation;
another is that the network side gives NEW configuration information to the higher layer, so that the data block in the NEW state needs to be reassembled according to the size of the NEW data block, that is, the segmentation mode is changed, so that the data block which is originally sent to the physical layer and generated in the old segmentation mode cannot be used, and needs to be returned to the higher layer, and then the data block in the NEW state which is not sent out in the second data cache queue needs to be cleared, this clearing operation is called refresh and is notified to the physical layer in an interrupted manner, so the subsequent flow of the control unit receiving the local control information of the higher layer includes:
s804, judging whether the local control information is the confirmation information of the data block in the PEND state, if so, executing S805, otherwise, executing S807;
s805, clearing the data block in the PEND state in the third data cache queue;
s806, the total _ num of the third data cache queue changes, the start moves forwards, the ready does not change, and S811 is continuously executed;
s807, judging whether the local control information indicates that the high level changes the segmentation mode, namely the size of the data block needs to be changed, stopping sending the current data block, if so, executing S808, otherwise, returning to execute S801; if yes, executing S809, otherwise, returning to execute S801;
s809, returning the data block to a high layer;
s810, when the total _ num of the second data cache queue changes and the start does not change, the ready moves backwards;
s811, notify the physical layer to clear the data block that has not been sent out and return to S801.
The message transmitted by the physical layer to the higher layer via the data transfer control device contains both the content of notifying the higher layer of the number of data blocks that have just been transmitted, and the content of requesting a certain number of data blocks from the higher layer for preparation before transmission. After the physical layer notifies the high layer of the number of the sent data blocks, the high layer can know the state of the sent data blocks according to the number of the sent data blocks and the content of the state cache queue, so that the data cache queues corresponding to different data block states are processed, and the parameter values of different data cache queues are changed.
The physical layer requests a certain number of data blocks from the high layer because the buffer space of the physical layer is left, then the control unit will take out the data blocks from the data buffer queues corresponding to different states according to the order of the state priority of the data blocks and send the data blocks to the physical layer, the order of the priority is the highest NACK, the NEW is centered, the PEND is the lowest, which meets the requirement of the protocol. The status buffer queue records the status of each data block sent to the physical layer.
When the control unit receives the message from the physical layer, the control unit respectively performs control processing on the three data buffer queues and the state buffer queue according to the following procedures, as shown in fig. 9, including:
s901, judging whether a data block is successfully sent to a network by a physical layer, if so, executing S902, otherwise, executing S910;
s902, obtaining the state of the data block which is successfully sent to the network according to the state buffer queue;
s903, changing the position information indicated by the start in the state cache queue, and reducing the total _ num;
s904, judging whether the successfully sent data block is in a NACK state, if so, executing S905, otherwise, executing S906;
s905, changing the total _ num of the first data cache queue, moving the start forwards, keeping ready, and returning to execute S901; unchanged, and returns to execute S901;
s906, judging whether the successfully sent data block is in a NEW state, if so, executing S907, otherwise, executing S908;
s907, changing the total _ num of the second data cache queue, moving the start forward, keeping ready, and returning to execute the S901;
s908, judging whether the successfully sent data block is in a PEND state, if so, executing S909, otherwise, judging that an error occurs, and ending the process;
s909, changing the total _ num of the third data cache queue, moving the start forward, keeping ready, and returning to execute S901;
s910, judging whether the physical layer requests a data block from the high layer, if so, executing S911, otherwise, ending the process;
s911, judging whether a data block is cached in the first data caching queue, if so, executing S912, otherwise, executing S913;
s912, keeping the total _ num and the start of the first data cache queue unchanged, moving the ready forward, and continuing to execute S917;
s913, judging whether the second data cache queue stores the data block, if so, executing S914, otherwise, executing S915;
s914, keeping the total _ num and the start of the second data cache queue unchanged, moving the ready forward, and continuing to execute S917;
s915, judging whether the third data cache queue stores the data block in a cache manner, if so, executing S916, otherwise, ending the process;
s916, keeping the total _ num and the start of the third data cache queue unchanged, moving the ready forward, and continuing to execute S917;
s917, sending the data block in the data buffer queue to the physical layer;
s918, record the status of the data block sent to the physical layer in the status buffer queue, and return to execute S910. The data transmission control device can solve the problems of wireless resource waste and low transmission efficiency caused by time delay generated by integration between different chips and even modules of different manufacturers, so that effective integration becomes possible. The data transmission control device can be realized by hardware or software, can be positioned at one side of a high-level protocol module or a physical layer module, and is quite flexible to use. Meanwhile, the data transmission control device and the data transmission control method provided by the embodiment of the invention only need to change a small amount of interfaces of the existing modules without changing the modules, so that the connection between the modules is simple and easy, the optimal matching between the modules can be realized by changing the size of the parameters, and the cost is greatly saved.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.