A data transmission method, comprising: determining, by a terminal in a disconnected state, a target configured grant occasion, CGO, corresponding to a target Synchronization Signal and PBCH block, SSB, according to a matching relationship between the SSB and the CGO; sending, by the terminal, uplink data on the target CGO, wherein, before determining a target CGO corresponding to a target SSB, the method further comprises: determining, by the terminal, the matching relationship between the SSB and CGO according to configuration of a base station; or, obtaining, by the terminal, the matching relationship between the SSB and CGO through calculation, wherein the matching relationship is valid in at least one matching period, and the matching period is preconfigured or pre-agreed, wherein, when the CG is configured as repeated transmission: in the matching relationship, M transmission occasions TO in one CGO being used as one repetition bundle corresponding to one or more SSBs, wherein M indicates the number of the CGO periods in a matching period between CGO and SSB; or, N CGOs being used as one repetition bundle corresponding to one or more SSBs, wherein each of the N CGOs includes one TO, and the N is less than or equal to the maximum number of CGOs in the matching period, a serial number of a starting CGO of the repetition bundle being an integer multiple of N. determining, by a terminal in a disconnected state, a target configured grant occasion, CGO, corresponding to a target Synchronization Signal and PBCH block, SSB, according to a matching relationship between the SSB and the CGO; sending, by the terminal, uplink data on the target CGO, wherein, before determining a target CGO corresponding to a target SSB, the method further comprises: determining, by the terminal, the matching relationship between the SSB and CGO according to configuration of a base station; or, obtaining, by the terminal, the matching relationship between the SSB and CGO through calculation, wherein the matching relationship is valid in at least one matching period, and the matching period is preconfigured or pre-agreed, wherein, when the CG is configured as repeated transmission: in the matching relationship, M transmission occasions TO in one CGO being used as one repetition bundle corresponding to one or more SSBs, wherein M indicates the number of the CGO periods in a matching period between CGO and SSB; or, N CGOs being used as one repetition bundle corresponding to one or more SSBs, wherein each of the N CGOs includes one TO, and the N is less than or equal to the maximum number of CGOs in the matching period, a serial number of a starting CGO of the repetition bundle being an integer multiple of N. determining, by the terminal, the matching relationship between the SSB and CGO according to configuration of a base station; or, obtaining, by the terminal, the matching relationship between the SSB and CGO through calculation, wherein the matching relationship is valid in at least one matching period, and the matching period is preconfigured or pre-agreed, wherein, when the CG is configured as repeated transmission: in the matching relationship, M transmission occasions TO in one CGO being used as one repetition bundle corresponding to one or more SSBs, wherein M indicates the number of the CGO periods in a matching period between CGO and SSB; or, N CGOs being used as one repetition bundle corresponding to one or more SSBs, wherein each of the N CGOs includes one TO, and the N is less than or equal to the maximum number of CGOs in the matching period, a serial number of a starting CGO of the repetition bundle being an integer multiple of N. in the matching relationship, M transmission occasions TO in one CGO being used as one repetition bundle corresponding to one or more SSBs, wherein M indicates the number of the CGO periods in a matching period between CGO and SSB; or, N CGOs being used as one repetition bundle corresponding to one or more SSBs, wherein each of the N CGOs includes one TO, and the N is less than or equal to the maximum number of CGOs in the matching period, a serial number of a starting CGO of the repetition bundle being an integer multiple of N.