Ozonolysis is a fairly simple mechanism you should have seen, if not it's easy to find on the internet.
The rearrangement is a shift of carbon group. Protonate one of the OH's to make a good leaving group, then attack down with the OH lone pair. The C-C orbital is of the correct alignment to overlap with the c-o sigma star, migrating across to form the spiro center.