how to measure state of charge of a battery through algorithm?
Algorithms cannot measure anything; they can only compute. So the measurements are the same as for the other methods you mentioned : voltage for the voltage method; and in practical terms, current and time for the coulomb counting method.

How to get the signals to a software module? 

Voltage would be measured in an ADC (Analog to Digital Converter) which usually has a register your software can read, containing a number that (multiplied by a scale factor) gives you the voltage. Many embedded CPUs include an ADC which can read several voltages as part of the chip, making the hardware design easier. 

Current would be measured in a small value sense resistor, making a small voltage which is amplified and measured in the ADC. Note that current changes sign (reverses) when the battery switches between charging and discharging.

Time ... a timer or RTC (real time clock).

Software then uses these inputs; possibly your algorithm can use both voltage and coulomb-counting methods and fuse the results for better accuracy or to look for signs of battery failure.