Recent intelligent diagnostic algorithms for industrial practice have achieved impressive results. However, due to safety considerations, complex environments and deployment cost constraints in real industrial production, there are still some challenges in the form of edge computing as a vehicle. Therefore, this work proposes a fault diagnosis and distance localization model and deploys the model on edge computing devices for real-time fault diagnosis and distance localization. Lightweight is achieved by modifying the embedding module of the Transformer module as well as self-attention (MFLOPs: 0.487, Params: 6.148 k). Simultaneously, the introduction of Ddformable Concolution in self-attention and multidimensional output in decoding achieves strong robustness (95.92% of accuracy and ± 1.32 cm of error in the noise environments with SNR of −10 dB to 10 dB). Finally, this method was deployed on two edge computing devices for real-time diagnosis (FPS: 34 and 38). As the first attempt to explore the feasibility of deploying fault diagnosis and distance location strategies in edge computing devices, this work not only provides a novel solution for the challenge in industrial practice, but also is expected to promote the process of advanced information processing technology from theoretical design to industrial practice.