Carlos Alcaraz will meet Daniil Medvedev in the semi-finals of the China Open after beating Karen Khachanov.