The invention provides an on-chip light source, a preparation method of the on-chip light source and a photoelectronic device. An insulating layer is formed on a substrate, an optical array layer is formed on the insulating layer, an isolating layer is formed on the optical array layer, a two-dimensional material layer is formed on the isolating layer, a dielectric layer is formed on the two-dimensional material layer, and a hyperbolic metamaterial layer is formed on the dielectric layer. When the wavelength of the resonance peak of the photon mode of the optical array layer is equal to the wavelength of the exciton peak of the two-dimensional material layer, the luminous intensity of the two-dimensional material layer is enhanced. In addition, the surface plasmon polaritons of the hyperbolic metamaterial layer can generate a strong coupling effect with the two-dimensional material layer, and the Purcell effect is further enhanced. According to the invention, the hyperbolic metamaterial is utilized to enhance the Purcell effect of the two-dimensional material, so that not only can the luminous intensity of the on-chip light source be remarkably improved, but also high luminous efficiency and high response speed can be realized, the size is small, the structure is compact, high-density integration is easy, and good CMOS integration process compatibility is realized.