Miniature electron cyclotron resonance (ECR) ion sources are widely used in compact ion implanters, miniature neutron tubes, and miniature ion thrusters. To understand the mechanism of miniature ECR ion source, a miniature deuterium ion source developed by Peking University is taken as the research object. In this work, a global model based on particle balance equations is developed for studying the hydrogen plasma and the deuterium plasma inside the miniature ECR source. The research results show that both the hydrogen discharge process and the deuterium discharge process of the ion source are strongly dependent on the gas pressure and microwave power. The calculated results show that high power is beneficial to increasing the proportion of H
+(D
+) ions, low pressure is helpful in augmenting the ratio of
$ {\text{H}}_2^ + $
(
$ {\text{D}}_2^ + $
) ions, high pressure and low power are beneficial to enhancing the proportion of
$ {\text{H}}_3^ + $
(
$ {\text{D}}_3^ + $
) ions. In addition, there is a large difference in ion proportion between hydrogen discharge and deuterium discharge. Under the same operating parameters, the proportion of D
+ions is 10%–25% higher than the proportion of H
+ions since the plasma density of deuterium discharge is higher than that of hydrogen plasma. Therefore, during the operation of miniature source, H
2gas, instead of D
2gas, can be used in experiment, and the proportion of D
+ions under the corresponding operating parameters can be estimated based on the proportion of H
+ions. Finally, the calculated results show that high microwave power is a prerequisite for achieving the high proportion of H
+(D
+) ions. However, owing to the limitation of microwave coupling efficiency, the miniature ECR ion source cannot work when the microwave power is greater than 150 W, so that the H
+(D
+) proportion cannot be further increased, thereby limiting its further applications in neutron sources, implanters, etc. Therefore, how to improve the microwave coupling efficiency has become one of the key research contents of the miniature ECR ion source. The global model proposed in this paper is helpful in understanding the physical process of the miniature ECR ion source, but there are also some shortcomings. Firstly, the effect of the secondary electron emission coefficient is not considered in the model, so it is impossible to study the influence of wall materials on ion proportion in detail. Secondly, the dissociation degree depends on the plasma measurements, and the error of plasma measurements in turn affect the accuracy of the model to a certain extent. In addition, only the hydrogen plasma model and deuterium plasma model are established in this work, based on which it is impossible to study the processes of other gas discharge plasmas. In the future, the above factors will be considered and the model will be further improved to establish a complete and self-consistent global model of the miniature ECR ion source.