The invention discloses a power generation type offshore drilling platform heave compensation device which is characterized in that a spring, a pressing plate and a floating crown block are arranged in a drilling derrick, one end of the spring is connected to the top of a guide groove, the other end of the spring is connected to the pressing plate, the floating crown block is installed below the pressing plate, and a center sheave with a plurality of wire grooves formed in the cylindrical surface is installed in the floating crown block; the heave compensation device mainly comprises four parts, namely a compensation mechanism part, a drilling winch part, a winding device part and a power generation device part. The compensation mechanism part is mainly used for compensating the displacement of the marine riser caused by heaving of sea surface waves, and the winding devices comprise the winding device I, the winding device II, the winding device III and the winding device IV which are arranged at the left position, the right position, the front position and the rear position around the vertical axis of the marine riser respectively. The device is simple in structure, easy in manufacturing of required parts, high in compensation efficiency, capable of generating power, capable of adjusting the lowering angle of the marine riser, capable of guaranteeing vertical lowering and high in reliability.