5G (fifth generation) signals have small coverage and poor stability, and 5G channels are prone to loss in substations densely populated with metal equipment. Due to the particularity of the spatial layout in the substation, traditional physical or statistical channel models cannot accurately calculate the 5G channel loss in the substation. Therefore, this paper introduces the basic idea of ray tracing algorithm for studying ray propagation. Based on the geometric optics theory of ray propagation, the effective channel path of 5G signal in substation is found. Through the electromagnetic reflection theory and consistent diffraction theory, the energy loss caused by signal reflection and diffraction is calculated. Combined with the relationship between the free space loss of 5G signal on the transceiver path and the change of electric field, the solution method of 5G channel loss in substation is deduced. According to this method, (the influence of signal receiver height, 5G antenna height and its spatial position in horizontal and vertical directions on 5G channel loss of substation is studied in turn. By optimizing the layout of communication facilities according to the influence law, the reliability of 5G channel in substation can be realized).