Chinese government to replace foreign hardware and software within three years