So, I'm guessing from your comments you have no idea why your co-worker is showing this behavior. This means you might want to ask them, to get a conversation about the behavior going. Not in a confrontational way though!
Include in your 'conversation starter':
- One or two examples of his behavior, and how this bothers you. Describe the behaviour factually and make it about you, not their behavior (e.g. that X is distracting you by hovering around your desk meeting, or how it's very counterproductive to leave 10 messages all stating the same since you have to read/listen to all of them before you can go and help him and maybe others).
- A request as to why X thinks it necessary to do so anyway.
- A promise that things will go better/smoother if they just call once and maybe leave a chat message so they won't forget what exactly the problem was. Also you might include that a promise that it will only take one message for you to go and help him as soon as possible, but only if you can keep that.
I can think of many reasons why a co-worker would do this, maybe it's a habit formed over the years, maybe he once worked with somebody that didn't take chat/calls serious and he feels he needs to make sure you understand the seriousness of the business, maybe he's just a little awkward... etcetera.
Find out why he is doing it. The most common problem with all of the above boils down to 'it's a habit', so I'll be working from that.
He does it a little less aggressive now but he keeps spamming and pinging.
I'm seeing a positive sign here. This may mean that his behavior is most likely just a habit/coming from ignorance, but he is willing to try to break it after you asked them the first time. Now they might just need a reminder now and again. (Mind you, this is my interpretation of the situation, you'll only know once you've asked).
I've had to be patient with several people because of this. My parents had a habit of texting me for important stuff and expecting an immediate reply, and calling repeatedly for not so important stuff and when I called back they said 'Oh, it's no longer necessary'. I asked them why, and they confirmed in their case it was ignorance and not understanding that I'm not always able to reply and that a call has a higher priority than a text message. I explained to them that calling is for emergencies, texting for those things that can wait. But I've had to remind them a lot.
So, the 'best' way to get your co-worker to stop might, in this case, be to sound like a broken record. If he hovers near your desk, remind him that he's distracting you, and then ask him to go so you can focus on the business at hand and be with him sooner. If he sends you a lot of messages, remind him that you had to work through all of them before you could come over and that they weren't necessary because you're here now and you will also come when there's only one message.
Hopefully, with more repetition, your co-worker will keep improving. You might want to add in the occasional compliment when he's doing 'good', or use that to sandwich your feedback when he's not doing so good:
Hey, remember, last week you did well and it worked fine for the both of us. No need to send me 20 messages now.
But apart from complaining to HR or a manager about this co-workers behaviour, this is about the best you can do.