The invention provides a
router firmware updating method and
system based on a communication protocol, and belongs to the technical field of communication protocols. According to the method, the
firmware transmission
metadata is strictly verified before the
firmware is downloaded, so that the accuracy and integrity of the
metadata are ensured; in the firmware file data downloading process, structural inspection is carried out in real time, and
data transmission which does not conform to a preset structure or content is found and stopped in time; and after the firmware file data is reassembled, calculating an overall
verification value, comparing the overall
verification value with a preset value, and confirming the final integrity of the firmware data. According to the method and the device, tiny but non-
original data tampering introduced by the
proxy server can be effectively identified and corrected, and the contradictory condition that
digital signature verification is passed but internal overall verification fails is avoided; according to the method and the device, the risk of update failure is remarkably reduced, the available old
firmware version can be reliably rolled back even if the update fails, and the reliability, the safety and the user experience of
router firmware update are greatly improved.