Provided a method of designing and realizingthe General Onboard Software for Cd-Ni battery activation in-orbit.In this scheme, the onboard software completes the Cd-Ni battery activationautomatically with real-time telemetry data. It solved the problem that the ground controller can’t forecast and control the traditionalspacecraftCd-Ni battery activation process exactlywith V-T curve because of lack of real-time date overseas, the low frequency of telemetry and the working current changes all the while. And after the generalize designing, it is suitable for all kinds of spacecraftwhich used Cd-Ni battery, and improve the power supply ability and prolong the life of battery.