A data transmission method, wherein the method comprises: separately sending, by a terminal device, at least one precoded reference signal on at least one reference signal resource corresponding to a first precoding resource block group PRG, wherein different reference signals in the at least one precoded reference signal are precoded by using different precoding matrixes, the first PRG is a PRG of the at least one precoded reference signal, and the at least one precoded reference signal comprises a sounding reference signal SRS; receiving, by the terminal device, reference signal resource indication information, wherein the reference signal resource indication information is used to indicate a reference signal resource corresponding to a second PRG, and the reference signal resource corresponding to the second PRG is at least one reference signal resource selected from the at least one reference signal resource corresponding to the first PRG whose frequency domain position is the same as that of the second PRG, the second PRG is a PRG of a physical uplink shared channel PUSCH, and a size of the first PRG is equal to n times a size of the second PRG, wherein n is 1 or a positive integer greater than 1; and sending, by the terminal device, a precoded PUSCH on the second PRG based on the reference signal resource indication information, wherein a precoding matrix used for the PUSCH is determined based on a precoding matrix used for a reference signal sent on the reference signal resource corresponding to the second PRG, and the reference signal resource indication information is carried in downlink control information DCI, a media access control control element MAC CE, or a physical downlink shared channel PDSCH, wherein at least a part of at least one precoding matrix used for the at least one precoded reference signal sent on the first PRG is different from at least one precoding matrix used for at least one precoded reference signal sent on another first PRG, the another first PRG is a first PRG that is in a plurality of first PRGs and whose frequency domain position is different from that of the first PRG, and a plurality of reference signal resources corresponding to a plurality of second PRGs of the PUSCH are at least one reference signal resource selected from a plurality of reference signal resources corresponding to the plurality of first PRGs whose frequency domain positions are the same as frequency domain positions of the plurality of second PRGs. separately sending, by a terminal device, at least one precoded reference signal on at least one reference signal resource corresponding to a first precoding resource block group PRG, wherein different reference signals in the at least one precoded reference signal are precoded by using different precoding matrixes, the first PRG is a PRG of the at least one precoded reference signal, and the at least one precoded reference signal comprises a sounding reference signal SRS; receiving, by the terminal device, reference signal resource indication information, wherein the reference signal resource indication information is used to indicate a reference signal resource corresponding to a second PRG, and the reference signal resource corresponding to the second PRG is at least one reference signal resource selected from the at least one reference signal resource corresponding to the first PRG whose frequency domain position is the same as that of the second PRG, the second PRG is a PRG of a physical uplink shared channel PUSCH, and a size of the first PRG is equal to n times a size of the second PRG, wherein n is 1 or a positive integer greater than 1; and sending, by the terminal device, a precoded PUSCH on the second PRG based on the reference signal resource indication information, wherein a precoding matrix used for the PUSCH is determined based on a precoding matrix used for a reference signal sent on the reference signal resource corresponding to the second PRG, and the reference signal resource indication information is carried in downlink control information DCI, a media access control control element MAC CE, or a physical downlink shared channel PDSCH, wherein at least a part of at least one precoding matrix used for the at least one precoded reference signal sent on the first PRG is different from at least one precoding matrix used for at least one precoded reference signal sent on another first PRG, the another first PRG is a first PRG that is in a plurality of first PRGs and whose frequency domain position is different from that of the first PRG, and a plurality of reference signal resources corresponding to a plurality of second PRGs of the PUSCH are at least one reference signal resource selected from a plurality of reference signal resources corresponding to the plurality of first PRGs whose frequency domain positions are the same as frequency domain positions of the plurality of second PRGs.