Method for enhancing clock synchronization accuracy in distributed network system

The invention relates to a method for improving the clock synchronization precision in a distributed network system. At present, the synchronized precision is relatively lower. Aiming at uncertainty and large disturbance, the invention only makes adjustment when the time offset between a local slave clock and a master clock is less than or equal to the offset value set through a register by the user; if the adjacent twice time offset is still more than the offset value, the invention adjusts the time of the local slave clock according to the time offset value. As the speed of a clock crystal oscillator is deviated, the time interval at which the local slave clock continuously twice sends sync synchronous messages to the master clock and the time interval at which the local slave clock continuously twice receives the sync synchronous messages from the master clock are compared, and then the difference between the two time intervals is evenly distributed within the synchronization interval. The method of the invention solves the problem of the decreasing of the clock synchronization precision to ensure the clock synchronization precision to reach microsecond level, through a filtering algorithm and the even adjustment of the offset of the crystal oscillator of the slave and the master clocks within the synchronization interval.