Rapidly changing blood sugars, like a fast spike or a hard drop, as well as hyper and hypoglycemia, can impact the heart this way. You'll want to check what your sugars are doing with your meter to be sure. If blood sugars seem alright though, or if at any time you feel uneasy about this, go see your GP. We can't diagnose on here, just hazard guesses... Alas. Hope you'll feel better soon!
Ring your GP for advice particularly as it has happened a couple of times. My husband has AFib and is on medication to control it however his heart rate still occasionally races and increased to 180 bpm one day which meant a long night in A&E.