The question "Preventing centaurs from invading China" seems to imply that the OP seeks for a solution which does not require having guards at a gate.
This also makes sense, otherwise it would completely pointless to ask the question in the first place, since the answer would be… have a gate with guards.
Every answer besides one takes this assumption. The other one is basically a "well, obviously use guards".
The only answer with more than 1 upvote opens up as:
The easiest solution would be manually guarded gates. Open them in normal use, close them when centaurs are approaching. They don't interfere with normal usage so the people of the north can use carriages or ride horses.
But your question seems to strive for a technical solution.
Can I just edit the question then, to make this explicit, since apparently it is to most, but it is not to someone? The alternative is to downvote and close it as "unclear", but I'd rather edit and upvote, since I believe this would improve the site.