The invention discloses a method for dynamically calculating an MD5 value in a storage device, which is applied to the storage device in which an object storage S3 protocol and a file storage NAS protocol are intercommunicated to realize dynamic calculation of the MD5 value. When an object is uploaded through an NAS protocol, an MD5 value is calculated online in real time; when the object is modified in a modified writing or additional writing mode, the MD5 value is modified to be in a temporary state, meanwhile, a calculation task is created to asynchronously calculate the MD5 value, and the priority of the calculation task is set; and the background thread periodically enumerates the calculation task for calculation. Counts are set in a frequent object modification scene, and when the object is modified, the counts are increased if a previously created calculation task is not executed, so that repeated calculation is avoided; in order to reduce CPU consumption caused by frequent modification, a validity period is set, if an object is modified in the validity period, only the MD5 value is modified to be in a temporary state without calculation, and if a user needs to check the MD5 value in the validity period, an asynchronous calculation task is created, and the priority of the calculation task is improved.