Cane or umbrella would work, poking him in the gut would be more effective than trying to smack the knife out of his hands.
However if someone is intending to do you harm with a knife, they probably snuck up on you, or pulled the knife while confronting you already. It's highly unlikely that anyone would rush several yards with with a knife, which is the only time where the cane/umbrella would reawlly help.