He genuinely doesn't understand that it hurts her. If he can't feel it, then it doesn't exist. This sounds like an excuse but it's utterly true. They are so self-centred at this age that their feelings are the only feelings in the world. And all he knows is the cause and effect of lashing out. I don't think he genuinely wants to hurt your dd, he just wants the ease of the reaction. It's bloody annoying and tiresome but all you can do is try and teach him a better way every. single. time.
So, in the instance you describe, I would have moved in, removed the umbrella immediately with a firm no and turned my back on ds to attend to dd. I would have checked her over, cheered her up, made sure she was okay all the time ignoring ds. As soon as I was satisfied that dd was fine, I'd retrieve the umbrella and engage dd in a game with it, so open it up, see who could spin it, who can throw a cushion in it from what distance, all still ignoring ds (he would howl and remonstrate but I would ignore it). I would then bring ds in, firmly and clearly on his level explain that we do not use the umbrella to hit and he must say sorry to dd and then he can have his turn at spinning his toy in the umbrella or chucking a cushion at it. Praise him for the better behaviour if he manages it, if he continues to hit or kick then he is moved out of the way and I continue to play with dd whilst clearly telling him what I expect of him in order to change the situation. He has to show he is sorry and I have to model what it is I want from him with dd as a happy ally.
The consequence of his behaviour is that he is ignored, dd is the centre of attention and the play is directed at her. If he tries to join in, then he is not allowed to until he has said sorry and I have explained the situation to him. It does work.
But you're right, usually not letting it get that far is best. He will grow out of it and he will finally realise that the behaviour which gets the biggest reaction is the good behaviour. It's all about gaining a reaction. I have taught dd to move away from ds the second he seems to be gearing up towards hurting her and to come and get me as calmly as possible. Usually, they're closely watched but when hanging washing/washing up/in the loo, I can't monitor them.
How is his speech? I have found that teaching ds to use key phrases often avoids the hitting in the first place. So he knows to say "play please" to dd instead of whacking her on the head to get her attention and every time he wants to play then I encourage him to ask first. It then becomes his go to way to get attention and I encourage dd to respond positively to it. Likewise, bashing on the cupboard doesn't get him a drink. He has to say "drink please" or fetch his beaker and show me what he wants. I'm trying to encourage him to see that he can communicate with us using his words and manners and we all respond positively, which is what he wants. If he's angry or violent, he gets no response. It's the simplest way.