A bad sector repair method, implemented by a solid state disk, SSD, comprising: receiving (101, 201) a first write operation instruction sent by a host, wherein the first write operation instruction comprises a logical block address, LBA of a first sector and data that needs to be written to the first sector; reading (102, 202), according to the LBA of the first sector, data of a physical page in which the first sector is located; when reading the data of the physical page fails because a Uncorrectable Error Correcting Code occurs on the entire page, allocating (103, 203), in a cache, storage space with a same size as the physical page, setting data in the storage space to preset data, and setting a flag of each storage area in the storage space to a first flag, wherein the first flag is used to indicate that data in the storage area is invalid data, the storage space comprises at least two storage areas, and each of the storage areas corresponds to one sector in the physical page; updating (104, 205) preset data that is of a storage area corresponding to the first sector and within the storage space, according to the LBA of the first sector, with the data that needs to be written to the first sector; setting a flag of the storage area corresponding to the first sector to a second flag, wherein the second flag is used to indicate that data in the storage area is valid data; writing data in the storage space to a flash memory of the SSD according to an address of the physical page and writing the flag of each storage area in the storage space to the redundant space of the SSD to complete repair on the first sector; receiving a read operation instruction sent by the host, wherein the read operation instruction comprises an LBA of a to-be-read sector; the method being further characterized by: acquiring a flag of the to-be-read sector according to the LBA of the to-be-read sector; and sending a response message to the host when the flag of the to-be-read sector is the first flag, wherein the response message is used to notify the host that data of the sector is invalid data. receiving (101, 201) a first write operation instruction sent by a host, wherein the first write operation instruction comprises a logical block address, LBA of a first sector and data that needs to be written to the first sector; reading (102, 202), according to the LBA of the first sector, data of a physical page in which the first sector is located; when reading the data of the physical page fails because a Uncorrectable Error Correcting Code occurs on the entire page, allocating (103, 203), in a cache, storage space with a same size as the physical page, setting data in the storage space to preset data, and setting a flag of each storage area in the storage space to a first flag, wherein the first flag is used to indicate that data in the storage area is invalid data, the storage space comprises at least two storage areas, and each of the storage areas corresponds to one sector in the physical page; updating (104, 205) preset data that is of a storage area corresponding to the first sector and within the storage space, according to the LBA of the first sector, with the data that needs to be written to the first sector; setting a flag of the storage area corresponding to the first sector to a second flag, wherein the second flag is used to indicate that data in the storage area is valid data; writing data in the storage space to a flash memory of the SSD according to an address of the physical page and writing the flag of each storage area in the storage space to the redundant space of the SSD to complete repair on the first sector; receiving a read operation instruction sent by the host, wherein the read operation instruction comprises an LBA of a to-be-read sector; the method being further characterized by: acquiring a flag of the to-be-read sector according to the LBA of the to-be-read sector; and sending a response message to the host when the flag of the to-be-read sector is the first flag, wherein the response message is used to notify the host that data of the sector is invalid data. acquiring a flag of the to-be-read sector according to the LBA of the to-be-read sector; and sending a response message to the host when the flag of the to-be-read sector is the first flag, wherein the response message is used to notify the host that data of the sector is invalid data.