Ultra-precision machining method and device for heterogeneous material