Data transmission method and apparatus
The technology of this application relates to a first device configured to perform backoff on a primary 20 MHz channel, to perform data transmission with a second device. When a first preset condition is met, the first device switches from the primary 20 MHz channel to a first channel, where the first channel is a channel preconfigured for communication between the first device and the second device, the first channel does not include the primary 20 MHz channel, and the first preset condition at least includes that the primary 20 MHz channel is in a busy state.
1 . A data transmission method, comprising:
performing, by a first device, data transmission with a second device by performing backoff on a primary 20 megahertz (MHz) channel; and
in association with a first preset condition being satisfied, switching, by the first device, from the primary 20 MHz channel to a first channel preconfigured for communication between the first device and the second device, wherein
the first channel does not include the primary 20 MHz channel,
the first preset condition includes, at least, the primary 20 MHz channel being in a busy state,
the first preset condition further includes a target duration is greater than or equal to a first preset duration,
the target duration includes a remaining transmission duration of the first OBSS frame received by the first device on the primary 20 MHz channel, or the target duration includes the remaining timing duration of a first network allocation vector (NAV) on the primary 20 MHz channel, and the primary 20 MHz channel being in the busy state comprises at least one of:
the first device receives a first overlapped basic service set (OBSS) frame on the primary 20 MHz channel,
the first device determines that an energy detection result on the primary 20 MHz channel includes a busy state, or
the first device determines that a value of the first NAV on the primary 20 MHz channel is greater than 0.
2 . The method according to claim 1 , further comprising:
performing, by the first device, backoff on the first channel; and
after the first channel backs off to 0, performing, by the first device, data transmission with the second device on the first channel.
3 . The method according to claim 2 , wherein in association with the first channel including a plurality of subchannels, performing, by the first device, backoff on the first channel comprises:
performing, by the first device, backoff on each of the plurality of subchannels.
4 . The method according to claim 3 , further comprising:
in association with the first device synchronizing to a physical frame header on any subchannel of the plurality of subchannels, suspending, by the first device, backoff on all subchannels of the plurality of subchannels, and determining whether a physical frame corresponding to the physical frame header is an OBSS frame; and
(a) in association with the physical frame corresponding to the physical frame header being the OBSS frame, continuing, by the first device, to perform backoff on each subchannel of the plurality of subchannels;
(b) in association with the physical frame corresponding to the physical frame header not being the OBSS frame, continuing, by the first device, to suspend backoff on all subchannels of the plurality of subchannels until transmission of the physical frame corresponding to the physical frame header is completed; or (c) in association with the physical frame corresponding to the physical frame header not being the OBSS frame, continuing, by the first device, to suspend backoff on all subchannels of the plurality of subchannels until an NAV configured for the physical frame corresponding to the physical frame header is reduced to 0.
5 . The method according to claim 3 , further comprising:
receiving, by the first device, a physical frame on any subchannel of the plurality of subchannels; and
(a) in association with the first device determining that the physical frame is from a BSS to which the first device belongs, suspending, by the first device, backoff on all subchannels of the plurality of subchannels until transmission of the physical frame is completed; or
(b) in association with the first device determining that the physical frame is from the BSS to which the first device belongs, suspending, by the first device, backoff on all subchannels of the plurality of subchannels until an NAV configured for the physical frame is reduced to 0.
6 . The method according to claim 1 , wherein
the first channel is a secondary 20 MHz channel,
the first channel is a 20 MHz channel with a lowest frequency in an 80 MHz channel, or
the first channel is a 20 MHz channel with a highest frequency in an 80 MHz channel.
7 . A communication apparatus applied for a first device, the communication apparatus comprising:
at least one processor; and
at least one memory coupled to the at least one processor, the at least one memory storing instructions for execution by the at least one processor to cause the communication apparatus to:
perform data transmission with a second device by performing backoff on a primary 20 megahertz (MHz) channel; and
when a first preset condition is satisfied, switch from the primary 20 MHz channel to a first channel preconfigured for communication between the communication apparatus and the second device, wherein
the first channel does not include the primary 20 MHz channel,
the first preset condition includes, at least, the primary 20 MHz channel being in a busy state,
the first preset condition further includes a target duration is greater than or equal to a first preset duration,
the target duration includes a remaining transmission duration of the first OBSS frame received by the first device on the primary 20 MHz channel, or the target duration includes the remaining timing duration of a first network allocation vector (NAV) on the primary 20 MHz channel, and
the primary 20 MHz channel being in the busy state comprises at least one of:
the first device receives a first overlapped basic service set (OBSS) frame on the primary 20 MHz channel,
the first device determines that an energy detection result on the primary 20 MHz channel includes a busy state, or
the first device determines that a value of the first NAV on the primary 20 MHz channel is greater than 0.
8 . The communication apparatus according to claim 7 , wherein the communication apparatus is further caused to:
perform backoff on the first channel; and
after the first channel backs off to 0, perform data transmission with the second device on the first channel.
9 . The communication apparatus according to claim 8 , wherein when the first channel includes a plurality of subchannels, performing backoff on the first channel comprises:
performing backoff on each of the plurality of subchannels.
10 . The communication apparatus according to claim 9 , wherein the communications apparatus is further caused to:
if the communication apparatus synchronizes to a physical frame header on any subchannel of the plurality of subchannels, suspend backoff on all subchannels of the plurality of subchannels, and determine whether a physical frame corresponding to the physical frame header is an OBSS frame; and
(a) if the physical frame corresponding to the physical frame header is the OBSS frame, continue to perform backoff on each subchannel of the plurality of subchannels;
(b) if the physical frame corresponding to the physical frame header is not the OBSS frame, continue to suspend backoff on all subchannels of the plurality of subchannels until transmission of the physical frame corresponding to the physical frame header is completed; or
(c) if the physical frame corresponding to the physical frame header is not the OBSS frame, continue to suspend backoff on all subchannels of the plurality of subchannels until an NAV configured for the physical frame corresponding to the physical frame header is reduced to 0.
11 . The communication apparatus according to claim 9 , wherein the communication apparatus is further caused to:
receive a physical frame on any subchannel of the plurality of subchannels; and
(a) if the communication apparatus determines that the physical frame is from a BSS to which the communication apparatus belongs, suspend backoff on all subchannels of the plurality of subchannels until transmission of the physical frame is completed; or
(b) if the communication apparatus determines that the physical frame is from the BSS to which the communication apparatus belongs, suspend backoff on all subchannels of the plurality of subchannels until an NAV configured for the physical frame is reduced to 0.
12 . The communication apparatus according to claim 7 , wherein
the first channel is a secondary 20 MHz channel,
the first channel is a 20 MHz channel with a lowest frequency in an 80 MHz channel, or
the first channel is a 20 MHz channel with a highest frequency in an 80 MHz channel.
13 . A chip applied for a first device, the chip comprising:
a processing circuit; and
a transceiver pin, wherein the processing circuit is configured to:
perform data transmission with a second device by performing backoff on a primary 20 megahertz (MHz) channel; and
when a first preset condition is satisfied, switch from the primary 20 MHz channel to a first channel preconfigured for communication between the first device and the second device, wherein
the first channel does not include the primary 20 MHz channel,
the first preset condition includes, at least, the primary 20 MHz channel being in a busy state,
the first preset condition further includes a target duration is greater than or equal to a first preset duration,
the target duration includes a remaining transmission duration of the first OBSS frame received by the first device on the primary 20 MHz channel, or the target duration includes the remaining timing duration of a first network allocation vector (NAV) on the primary 20 MHz channel, and
the primary 20 MHz channel being in the busy state comprises at least one of:
the first device receives a first overlapped basic service set (OBSS) frame on the primary 20 MHz channel,
the first device determines that an energy detection result on the primary 20 MHz channel includes a busy state, or
the first device determines that a value of the NAV on the primary 20 MHz channel is greater than 0.
14 . The chip according to claim 13 , wherein the processing circuit is further configured to:
perform backoff on the first channel; and
after the first channel backs off to 0, perform data transmission with the second device on the first channel.
15 . The chip according to claim 14 , wherein when the first channel includes a plurality of subchannels, performing backoff on the first channel comprises:
performing backoff on each of the plurality of subchannels.
16 . The chip according to claim 15 , wherein the processing circuit is further configured to:
if the first device synchronizes to a physical frame header on any subchannel of the plurality of subchannels, suspend backoff on all subchannels of the plurality of subchannels, and determine whether a physical frame corresponding to the physical frame header is an OBSS frame; and
(a) if the physical frame corresponding to the physical frame header is the OBSS frame, continue to perform backoff on each subchannel of the plurality of subchannels;
(b) if the physical frame corresponding to the physical frame header is not the OBSS frame, continue to suspend backoff on all subchannels of the plurality of subchannels until transmission of the physical frame corresponding to the physical frame header is completed; or
(c) if the physical frame corresponding to the physical frame header is not the OBSS frame, continue to suspend backoff on all subchannels of the plurality of subchannels until an NAV configured for the physical frame corresponding to the physical frame header is reduced to 0.
17 . The chip according to claim 13 , wherein
the first channel is a secondary 20 MHz channel,
the first channel is a 20 MHz channel with a lowest frequency in an 80 MHz channel, or
the first channel is a 20 MHz channel with a highest frequency in an 80 MHz channel.