The invention provides a
time synchronization method and device based on a heterogeneous multi-
core system and a
system on
chip, the heterogeneous multi-
core system comprises a first kernel serving as a master node and a second kernel serving as a slave node, the method is executed by the second kernel, and the method comprises the following steps: determining a local hardware
timestamp when an event to be synchronized occurs; obtaining a synchronization
time parameter through bidirectional message interaction based on a hardware
timestamp between the first kernel and the second kernel; and converting the local hardware
timestamp into a corresponding global timestamp based on the synchronization
time parameter. A two-way measurement mechanism of a
precision time protocol (PTP) is transplanted to inter-core communication in a
chip, and hardware-level timestamp capture is combined, so that
software jitter and communication
delay uncertainty are systematically eliminated, and therefore, sub-
microsecond synchronization precision which can only be achieved by depending on external hardware connection in the past is realized on the pure
software level, and the precision of the
chip is improved. And meanwhile, the hardware cost and the integration complexity are obviously reduced.