1. A data transmission method, comprising:determining, by a first device, a clear channel assessment (CCA) start moment at which a CCA is performed to determine whether a channel is idle or occupied;
determining, by the first device, a CCA interval, wherein the CCA interval is a time interval between two adjacent CCAs, and a time interval between any two adjacent CCAs is less than a preconfigured data frame period, the preconfigured data frame period including a channel occupancy period and a channel idle period;
performing, by the first device, a CCA process according to the CCA start moment and the CCA interval; and
sending, by the first device, data at an end moment of the CCA process,
wherein the determining, by the first device, the CCA start moment at which the CCA is performed comprises:
determining, by the first device, an end moment of a Qth second time length that is after an end moment of data transmission as the CCA start moment,
Q is zero or a positive integer, and
a sum of the Q second time lengths is not greater than the preconfigured data frame period.