The embodiment of the invention provides a
time synchronization method, a controller, a vehicle and a
computer program product, and the method comprises the steps: obtaining a time lapse
rate ratio between a driving end and a driven end through calculation based on message interaction data, and providing a basis for
time synchronization; the stability of
network delay and
time deviation is further evaluated through peer-to-peer
delay message interaction, and the dynamic adaptability enables
time synchronization to more accurately adapt to changes of
network conditions; and when it is confirmed that the change condition of the
time deviation is within a preset stable interval, performing time synchronization
processing. By introducing the deviation
stability parameter and the
rate ratio, when the deviation
stability parameter and the
rate ratio are in a controllable interval, the subsequent time synchronization
processing is carried out, otherwise, the time synchronization
processing is not carried out, the condition judgment mechanism endows the driven end with the capability of judging an abnormal message, unnecessary synchronization operation in an unstable state is avoided, and the reliability of the driven end is improved. Therefore, the stability and the reliability of the
system are improved.