A communication method, comprising: detecting, by a terminal device, first downlink control information DCI on a first physical downlink control channel PDCCH monitoring occasion, and detecting second DCI on a second PDCCH monitoring occasion, wherein the first DCI and the second DCI are for scheduling a same transport block TB, and the first DCI and the second DCI carry a same downlink assignment index DAI indication; generating, by the terminal device, a hybrid automatic repeat request acknowledgement HARQ-ACK codebook based on the first PDCCH monitoring occasion and the DAI indication carried in at least one of the first DCI and the second DCI; and sending, by the terminal device, the HARQ-ACK codebook, wherein the method further comprises: wherein before the sending, by the terminal device, the HARQ-ACK codebook, the method further comprises: receiving configuration information, wherein the configuration information indicates that a first PDCCH candidate and a second PDCCH candidate have an association relationship, the first DCI corresponds to the first PDCCH candidate, and the second DCI corresponds to the second PDCCH candidate; determining a group of DCI, wherein the group of DCI comprises the first DCI and the second DCI, and HARQ-ACK feedback information corresponding to the group of DCI is fed back on a same PUCCH resource; sorting the group of DCI, wherein an order of the first DCI and the second DCI in the group of DCI is determined based on the first monitoring occasion; and determining target DCI from the group of DCI based on an order of each of the group of DCI, wherein the target DCI indicates the PUCCH resource, wherein the DAI is classified into a counter DAI and a total DAI, and wherein the counter DAI and the total DAI carried in the first DCI and the second DCI are the same. detecting, by a terminal device, first downlink control information DCI on a first physical downlink control channel PDCCH monitoring occasion, and detecting second DCI on a second PDCCH monitoring occasion, wherein the first DCI and the second DCI are for scheduling a same transport block TB, and the first DCI and the second DCI carry a same downlink assignment index DAI indication; generating, by the terminal device, a hybrid automatic repeat request acknowledgement HARQ-ACK codebook based on the first PDCCH monitoring occasion and the DAI indication carried in at least one of the first DCI and the second DCI; and sending, by the terminal device, the HARQ-ACK codebook, wherein the method further comprises: wherein before the sending, by the terminal device, the HARQ-ACK codebook, the method further comprises: receiving configuration information, wherein the configuration information indicates that a first PDCCH candidate and a second PDCCH candidate have an association relationship, the first DCI corresponds to the first PDCCH candidate, and the second DCI corresponds to the second PDCCH candidate; determining a group of DCI, wherein the group of DCI comprises the first DCI and the second DCI, and HARQ-ACK feedback information corresponding to the group of DCI is fed back on a same PUCCH resource; sorting the group of DCI, wherein an order of the first DCI and the second DCI in the group of DCI is determined based on the first monitoring occasion; and determining target DCI from the group of DCI based on an order of each of the group of DCI, wherein the target DCI indicates the PUCCH resource, wherein the DAI is classified into a counter DAI and a total DAI, and wherein the counter DAI and the total DAI carried in the first DCI and the second DCI are the same. receiving configuration information, wherein the configuration information indicates that a first PDCCH candidate and a second PDCCH candidate have an association relationship, the first DCI corresponds to the first PDCCH candidate, and the second DCI corresponds to the second PDCCH candidate; determining a group of DCI, wherein the group of DCI comprises the first DCI and the second DCI, and HARQ-ACK feedback information corresponding to the group of DCI is fed back on a same PUCCH resource; sorting the group of DCI, wherein an order of the first DCI and the second DCI in the group of DCI is determined based on the first monitoring occasion; and determining target DCI from the group of DCI based on an order of each of the group of DCI, wherein the target DCI indicates the PUCCH resource, wherein the DAI is classified into a counter DAI and a total DAI, and wherein the counter DAI and the total DAI carried in the first DCI and the second DCI are the same.