A comparison between repeating bursts of FRB 121102 and giant pulses from Crab pulsar and its applications