Email Record: Distributing intelligence among cloud, fog and edge in industrial cyber-physical systems