The normal operation of the main transformer in the photovoltaic power station is the basis for the power generation output, however, the magnetizing inrush current may lead the differential protection of the transformer to malfunction. In this paper, a method of magnetizing inrush current identification based on histogram and cosine similarity is proposed. The histogram technology is used to extract the distribution characteristics of differential current sampling values. The matching degree between differential current distribution and standard sine wave distribution, the self-symmetry of differential current distribution are calculated through the proposed comprehensive cosine similarity index to realize inrush current identification. Moreover, the bias coefficient is defined in the distribution histogram of differential current as an auxiliary criterion, which improves the reliability of differential protection under the extreme circumstance that inrush when the transformer closed with high remanence. The simulation results based on PSCAD/EMTDC show that the proposed method can accurately identify magnetizing inrush current, and ensure the rapidity of protection action in case of transformer faults, without being affected by the current harmonics of the photovoltaic system.