A data transmission method, comprising: determining, by a terminal device, a first reference signal,RS, sequence corresponding to a first time interval, wherein the first RS sequence is one of N RS sequences, N is a positive integer greater than 1, and the N RS sequences are generated based on at least two root sequences; sending, by the terminal device, the first RS sequence to a base station in the first time interval; determining, by the terminal device from the N RS sequences according to the first RS sequence, one RS sequence as a second RS sequence corresponding to a second time interval, wherein the second RS sequence is determined according to the first RS sequence; sending, by the terminal device, the second RS sequence to the base station in the second time interval; sending, by the terminal device, a first data packet to the base station in the first time interval by using the first RS sequence; and sending, by the terminal device, the first data packet to the base station again in the second time interval by using the second RS sequence, wherein the second RS sequence is different from the first RS sequence; wherein the N RS sequences are in a one-to-one correspondence with N index numbers, and the determining, by the terminal device according to the first RS sequence, one RS sequence from the N RS sequences as a second RS sequence corresponding to a second time interval comprises: calculating, by the terminal device according to a first index number of the first RS sequence and a shift count of index numbers of two adjacent time intervals in which a same data packet is sent, a second index number corresponding to the second RS sequence; and determining, by the terminal device, the second RS sequence according to the second index number. determining, by a terminal device, a first reference signal,RS, sequence corresponding to a first time interval, wherein the first RS sequence is one of N RS sequences, N is a positive integer greater than 1, and the N RS sequences are generated based on at least two root sequences; sending, by the terminal device, the first RS sequence to a base station in the first time interval; determining, by the terminal device from the N RS sequences according to the first RS sequence, one RS sequence as a second RS sequence corresponding to a second time interval, wherein the second RS sequence is determined according to the first RS sequence; sending, by the terminal device, the second RS sequence to the base station in the second time interval; sending, by the terminal device, a first data packet to the base station in the first time interval by using the first RS sequence; and sending, by the terminal device, the first data packet to the base station again in the second time interval by using the second RS sequence, wherein the second RS sequence is different from the first RS sequence; wherein the N RS sequences are in a one-to-one correspondence with N index numbers, and the determining, by the terminal device according to the first RS sequence, one RS sequence from the N RS sequences as a second RS sequence corresponding to a second time interval comprises: calculating, by the terminal device according to a first index number of the first RS sequence and a shift count of index numbers of two adjacent time intervals in which a same data packet is sent, a second index number corresponding to the second RS sequence; and determining, by the terminal device, the second RS sequence according to the second index number. calculating, by the terminal device according to a first index number of the first RS sequence and a shift count of index numbers of two adjacent time intervals in which a same data packet is sent, a second index number corresponding to the second RS sequence; and determining, by the terminal device, the second RS sequence according to the second index number.