Can you please explain how BAT54C (D4A,D4B,D4A,D5B,D7,BAT54A) works in this circuit?
D4A and D4B allow switching between power supplied by the regulator (u5) and from an external supply connected at J4. Whichever supply provides a higher voltage will power the rest of the circuit.

D5A and D5B protect against reverse connection of the external supply at J6 or J5. I suspect they are doubled-up only because BAT54C is a dual part and the designer did not want to leave one device floating. And did not want to use an alternate PN in order to gain higher purchasing volumes and lower costs for the BAT54C.