In wireless sensor network(WSN) based positioning system in substation, the propagation path of the measurement signal is easily blocked by various devices in the substation, which leads to an increase in measurement error and affects the final positioning accuracy. In view of the fact that the existing real-time positioning algorithm is greatly affected by the measurement error, this paper proposes a new high-precision positioning method. This algorithm is less affected by the measurement error and can achieve accurate positioning of moving targets in the substation. The two-step linear least squares method is used for preliminary positioning, and the error probability algorithm is introduced to process the initial positioning result. The maximum probability point is the optimal position estimation of the target to be positioned. Simulation analysis and experimental verification were carried out, and compared with existing algorithms. The algorithm proposed in this paper controls each single coordinate error within 30cm in the substation environment. Compared with the existing real-time positioning algorithm, the positioning accuracy is improved more than 50%. The results show that the proposed real-time positioning method can effectively improve the accuracy of positioning results in substation environment.