This latest research has resulted in a good theory of their origin based on the latest evidence and has excellent agreement with that evidence.
http://physicsworld.com/cws/article/news/2017/sep/21/ultra-high-energy-cosmic-rays-have-extra-galactic-origins
Their theory is that supermassive black holes in other gallaxies (other than the Milky way ) power relativistic jets of particles which, after they have been deflected and scattered by the magnetic fields that permeate the Milky Way so to appear to be coming from all directions, are the ultra-high-energy cosmic rays we observe.