Acousto-optic Finite-difference Frequency-domain Algorithm for First-principles Simulations of On-chip Acousto-optic Devices