The embodiments of the present application relate to the technical field of computers. Provided are a key updating method and apparatus, and a device and a storage medium. The method comprises: in response to a
state switching operation triggered for an application, a service device sending a
state switching request to a management platform; and on the basis of the
state switching request, the management platform replacing an original key with an updated key, switching a
normal state policy to a
transition state policy, and issuing the
transition state policy to an
encryption device in real time, wherein the
transition state policy can ensure the coexistence of new and old keys, so that the
encryption device can use the updated key to encrypt
plaintext data of the application, and send obtained
ciphertext data to a
database. Moreover, the service device can be synchronized with a bypass to execute a batch
data processing task, and existing data in the
database can be refreshed, such that key updating and existing
data processing in an encrypted
database are realized without affecting the normal
service provision of the application, thereby guaranteeing the service availability of the application and the database.