Exploring energy distribution of photon upconversion and downconversion luminescence in lanthanide-doped nanoparticles