Or it was past feeding time and it was trying to express its hunger.
Shepherds are very intelligent dogs. I have little doubt the dog knew exactly what he was trying to prevent.