A communications method, comprising: obtaining a grouping relationship, wherein the grouping relationship represents a correspondence between a first parameter and N groups of time-frequency resources, the N groups of time-frequency resources are obtained by grouping time-frequency resources in one time unit, each group of time-frequency resources corresponds to one or more first parameters, the first parameter is related to downlink control information, DCI, a time-frequency resource in each group of time-frequency resources is available for an uplink channel that carries a hybrid automatic repeat request-acknowledgement, HARQ-ACK, and N is a positive integer greater than or equal to 2; receiving first DCI; determining, in the N groups of time-frequency resources based on the grouping relationship, the i th group of time-frequency resources corresponding to a first parameter related to the first DCI, wherein i is a positive integer less than or equal to N; and determining a first uplink channel that carries a first HARQ-ACK on a first time-frequency resource in the i th group of time-frequency resources, wherein the first parameter comprises one or more of a K1 value, a first time length, a codebook identifier, a radio network temporary identifier, RNTI, an uplink channel end symbol, a physical downlink control channel, PDCCH, monitoring occasion, or a start and length indicator value, SLIV, index, the K1 value is a time unit offset between a time unit in which a physical downlink shared channel, PDSCH, is located and a time unit in which an uplink channel of a HARQ-ACK corresponding to the PDSCH is located, and the first time length represents a time length corresponding to the K1 value. obtaining a grouping relationship, wherein the grouping relationship represents a correspondence between a first parameter and N groups of time-frequency resources, the N groups of time-frequency resources are obtained by grouping time-frequency resources in one time unit, each group of time-frequency resources corresponds to one or more first parameters, the first parameter is related to downlink control information, DCI, a time-frequency resource in each group of time-frequency resources is available for an uplink channel that carries a hybrid automatic repeat request-acknowledgement, HARQ-ACK, and N is a positive integer greater than or equal to 2; receiving first DCI; determining, in the N groups of time-frequency resources based on the grouping relationship, the i th group of time-frequency resources corresponding to a first parameter related to the first DCI, wherein i is a positive integer less than or equal to N; and determining a first uplink channel that carries a first HARQ-ACK on a first time-frequency resource in the i th group of time-frequency resources, wherein the first parameter comprises one or more of a K1 value, a first time length, a codebook identifier, a radio network temporary identifier, RNTI, an uplink channel end symbol, a physical downlink control channel, PDCCH, monitoring occasion, or a start and length indicator value, SLIV, index, the K1 value is a time unit offset between a time unit in which a physical downlink shared channel, PDSCH, is located and a time unit in which an uplink channel of a HARQ-ACK corresponding to the PDSCH is located, and the first time length represents a time length corresponding to the K1 value.