Diagnostics of dense laser plasmas based on the spectra of hydrogen-like and helium-like multiply charged ions