  Primordial black holes (PBHs) formed in the early Universe can accret dark
matter particles due to gravity and form ultracompact minihalos (UCMHs). The
theoretical researches and simulations have shown that the density profile of
dark matter in UCMHs is in the form of $\rho (r) \sim r^{-2.25}$. Compared with
the popular dark matter halo model, e.g. NFW model, dark matter annihilation
rate is larger in UCMHs. Considering dark matter annihilation, there is a
maximum core density $\rho_{\rm max}$ in UCMHs which has been treated
independent on redshift. While in this work, we point out that $\rho_{\rm max}$
depends on redshift and dark matter annihilation rate in UCMHs also changes
with time. We re-investigate the $\gamma$-ray flux from UCMHs due to dark
matter annihilation and focus on their contributions to the extragalactic
gamma-ray background (EGB). Utilizing the EGB data of Fermi, the constraints on
the abundance of PBHs are derived, $\Omega_{\rm PBH,EGB} \lesssim 2\times
10^{-8}$. Motivated by the recent observations of global 21cm signals by the
EDGES experiment, we investigate the influences of dark matter annihilation in
UCMHs on global 21cm signals and derive the constraints on the abundance of
PBHs, $\Omega_{\rm PBH,21cm} \lesssim 2\times 10^{-10}$. The derived
constraints are valid for mass range of $10^{-6} M_{\odot} \lesssim M_{\rm PBH}
\lesssim 10^{3} M_{\odot}$.
