Method and device for data transmission, and storage medium
AssigneeBeijing Xiaomi Mobile Software Co., Ltd.
InventorZhe Wu
Life of this patent
Estimating the term…
Abstract
A method for data transmission includes: during Bluetooth communication, negotiating, by transmitting a sounding data packet at a data size which is a candidate value of a maximum transmission unit (MTU), with a second electronic device about an applied value of the MTU for the Bluetooth communication. Through the technical solution according to embodiments of the disclosure, MTU sounding is performed by sending a data packet during data transmission between Bluetooth devices. Through the MTU negotiation between the two parties of interaction, an appropriate and stable MTU value is finally obtained to serve as a standard parameter of the interaction.
Claims13
A method for data transmission, applied to a first electronic device and comprising:
- during Bluetooth communication, negotiating, by transmitting a sounding data packet at a data size which is a candidate value of a maximum transmission unit (MTU), with a second electronic device about an applied value of the MTU for the Bluetooth communication,
- wherein the negotiating, by transmitting the sounding data packet at the data size which is the candidate value of the MTU, with the second electronic device about the applied value of the MTU for the Bluetooth communication comprises:
- sending, according to the candidate value of the MTU, the sounding data packet for the Bluetooth communication to the second electronic device;
- receiving a feedback data packet from the second electronic device within a preset period of time;
- in response to that a data size of the received feedback data packet is equal to that of the sounding data packet, determining the candidate value of the MTU to be the applied value of the MTU for the Bluetooth communication between the first electronic device and the second electronic device;
- decrementing the candidate value of the MTU, in response to receiving no feedback data packet at a data size which is equal to that of the sounding data packet;
- according to the decremented candidate value of the MTU, continuing to negotiate, by transmitting a sounding data packet at a data size which is the decremented candidate value of the MTU, with the second electronic device about the applied value of the MTU for the Bluetooth communication;
- and
- stopping negotiation of the MTU, in response to receiving, from the second electronic device, the feedback data packet at the data size which is equal to that of the sounding data packet, or in response to that the candidate value has been decremented to a minimum candidate value of the MTU.
A method for data transmission, applied to a second electronic device and comprising:
- during Bluetooth communication, receiving a sounding data packet for the Bluetooth communication, wherein the sounding data packet is sent by a first electronic device according to a candidate value of a maximum transmission unit (MTU);
- and
- sending a feedback data packet to the first electronic device according to a data size of the sounding data packet, wherein the feedback data packet is used for the first electronic device to determine an applied value of the MTU,
- wherein the sending the feedback data packet to the first electronic device according to the data size of the sounding data packet comprises:
- determining whether the data size of the sounding data packet is equal to a predetermined MTU of the second electronic device;
- in response to that the data size of the sounding data packet is equal to the predetermined MTU, sending, to the first electronic device, the feedback data packet at a data size which is equal to that of the sounding data packet, wherein the feedback data packet is used for the first electronic device to determine the candidate value of the MTU as the applied value of the MTU for the Bluetooth communication between the first electronic device and the second electronic device;
- and
- in response to that the data size of the sounding data packet is different from the predetermined MTU, sending, to the first electronic device, the feedback data packet at a data size which is smaller than or equal to that of the sounding data packet.
A device for data transmission, applied to a second electronic device and comprising:
- a processor;
- and
- memory for storing instructions executable by the processor;
- wherein the processor is configured to:
- during Bluetooth communication, receive a sounding data packet for the Bluetooth communication, wherein the sounding data packet is sent by a first electronic device according to a candidate value of a maximum transmission unit (MTU);
- and
- send a feedback data packet to the first electronic device according to a data size of the sounding data packet, wherein the feedback data packet is used for the first electronic device to determine an applied value of the MTU,
- wherein the processor is further configured to:
- determine whether the data size of the sounding data packet is equal to a predetermined MTU of the second electronic device;
- in response to that the data size of the sounding data packet is equal to the predetermined MTU, send, to the first electronic device, the feedback data packet at a data size which is equal to that of the sounding data packet, wherein the feedback data packet is used for the first electronic device to determine the candidate value of the MTU as the applied value of the MTU for the Bluetooth communication between the first electronic device and the second electronic device;
- and
- in response to that the data size of the sounding data packet is different from the predetermined MTU, send, to the first electronic device, the feedback data packet at a data size which is smaller than or equal to that of the sounding data packet.
A device for data transmission, applied to a first electronic device and comprising:
- a processor;
- and
- memory for storing instructions executable by the processor;
- wherein the processor is configured to:
- during Bluetooth communication, negotiate, by transmitting a sounding data packet at a data size which is a candidate value of a maximum transmission unit (MTU), with a second electronic device about an applied value of the MTU for the Bluetooth communication,
- wherein the processor is further configured to:
- send, according to the candidate value of the MTU, the sounding data packet for the Bluetooth communication to the second electronic device;
- receive a feedback data packet from the second electronic device within a preset period of time;
- in response to that a data size of the received feedback data packet is equal to that of the sounding data packet, determine the candidate value of the MTU to be the applied value of the MTU for the Bluetooth communication between the first electronic device and the second electronic device;
- decrement the candidate value of the MTU in response to receiving no feedback data packet at a data size which is equal to that of the sounding data packet;
- according to the decremented candidate value of the MTU, continue to negotiate, by transmitting a sounding data packet at a data size which is the decremented candidate value of the MTU, with the second electronic device about the applied value of the MTU for the Bluetooth communication;
- and
- stop negotiation of the MTU, in response to receiving, from the second electronic device, the feedback data packet at the data size which is equal to that of the sounding data packet, or in response to that the candidate value has been decremented to a minimum candidate value of the MTU.
Dependencies are inferred from the claim text.