All-inorganic perovskite nanocrystals (NCs) are considered as new candidates for low-cost semiconductor luminescent materials. Plentiful efforts have been made to improve the efficiency of perovskite NCs and reveal the mechanism by ion doping with the same valence and different ionic radii. However, only a few selected metal ion dopants can efficiently enhance the luminescence performance of NCs, and some underlying mechanisms are not clear. Here, we employ the opposite strategy to show how to enhance the photoluminescence quantum yield (PLQY) of CsPbBr3 NCs via Sr2+ and La3+ with similar ionic radii and different valence states. With the optimization of doping conditions, the PLQY of divalent Sr2+ and trivalent La3+ doped CsPbBr3 NCs can increase to 87%, but the enhancement mechanisms are the reduction of bromine vacancy defects in the bulk and surface of CsPbBr3 NCs to increase radiative recombinations, respectively. Divalent Sr2+ doping can eliminate halide vacancies and decrease the formation of defect states and nonradiative recombinations. Based on this mechanism, in order to achieve charge balance, trivalent La3+ doping establishes Br-rich conditions due to the absorptive effect of Br, and forms CsPbBr3@Br- NCs as the core-shell-like structures, which induces self-passivation of surface defects, thereby increasing the radiative recombination on the surfaces. Density functional theory calculations confirm the experimental conclusions, showing that Sr2+/La3+ dopants enrich the conduction band edge states of CsPbBr3, resulting in enhanced photoluminescence. This work sheds light on the highly efficient luminescence of divalent and trivalent metal ion-doped halide perovskite NCs and their enhancement mechanisms, illustrating their potential applications in fluorescence anti-counterfeiting.