A command processing method performed by a terminal device, and comprising: receiving a first command in a case where there is at least one configured or activated bandwidth part -BWP- for the terminal device, and there is ongoing random access on at least one BWP in the at least one configured or activated BWP, the first command including at least one of a BWP switching command, a BWP activation command and a BWP deactivation command, the BWP switching command being used to instruct the terminal device to deactivate a first BWP and activate a second BWP, the BWP activation command being used to instruct the terminal device to activate a third BWP, the BWP deactivation command being used to instruct the terminal device to deactivate a fourth BWP, the first BWP and the fourth BWP being BWPs in the at least one configured or activated BWP, and the second BWP and the third BWP being BWPs except the at least one configured or activated BWP; and processing the first command according to a preset processing manner; characterized in that in a case where the first command includes the BWP switching command, processing the first command according to the preset processing manner includes: controlling the first BWP and the second BWP to ignore the BWP switching command in a case where there is ongoing random access on the first BWP and the second BWP is not configured with random access resources, or there is the ongoing random access on the first BWP and the second BWP shares hardware with any BWP, or activating the second BWP causes channel transmission or reception on any BWP in the at least one configured or activated BWP to be interrupted. receiving a first command in a case where there is at least one configured or activated bandwidth part -BWP- for the terminal device, and there is ongoing random access on at least one BWP in the at least one configured or activated BWP, the first command including at least one of a BWP switching command, a BWP activation command and a BWP deactivation command, the BWP switching command being used to instruct the terminal device to deactivate a first BWP and activate a second BWP, the BWP activation command being used to instruct the terminal device to activate a third BWP, the BWP deactivation command being used to instruct the terminal device to deactivate a fourth BWP, the first BWP and the fourth BWP being BWPs in the at least one configured or activated BWP, and the second BWP and the third BWP being BWPs except the at least one configured or activated BWP; and processing the first command according to a preset processing manner; characterized in that in a case where the first command includes the BWP switching command, processing the first command according to the preset processing manner includes: controlling the first BWP and the second BWP to ignore the BWP switching command in a case where there is ongoing random access on the first BWP and the second BWP is not configured with random access resources, or there is the ongoing random access on the first BWP and the second BWP shares hardware with any BWP, or activating the second BWP causes channel transmission or reception on any BWP in the at least one configured or activated BWP to be interrupted.