We proposed a method for implementing impedance matching and phase locking of Josephson junction arrays based on Hes previous report on the coupling mechanism of a millimeter wave radiation to bicrystal Josephson junction arrays embedded in a Fabry-Perot resonator,and relevant electromagnetic simulations and numerical calculations were performed. A bicrystal Josephson junction array was fabricated on a YSZ bicrystal substrate,and embedded in a Fabry-Perot resonator. Impedance matching was implemented by integrating an optimized half-wavelength dipole array fed in series with the junction array,and numerical calculations showed that the radiation efficiency of a single junction reached 94%. Through making good use of the radiation characteristics of the antenna array and optimizing the model,the FP resonator and the substrate can be driven to resonate in proper modes respectively,which benefits the high frequency electromagnetic coupling between the junction array and the resonators. The numerical simulations proved that this method is effective for realizing self-voltage locking and mutual-phase locking of junction arrays. The method proposed in this paper and calculation results are valuable for guiding the applications of Josephson junction arrays in THz signal generators and voltage standards.