I had to build something similar recently while working on internal tools for Ellipticlean. AlarmManager with ELAPSED_REALTIME_WAKEUP was the only reliable method that continued to run during device sleep.
ELAPSED_REALTIME_WAKEUP