If so, how important was slavery for Chinese economy and how prevalent was it (for exampe Egypt used to have slaves but they made only 5% population and were not very important)? Also, who were their slaves?
Yes, although in a rather different form than in the Mediterranean and colonial American societies (and of course it was but static over the 2000+ years of Imperial history). In those cases, which you are probably most familiar with, the economic concentration of slaves was in what we might call the "private sector"--individual landowners, workshops, etc--while in China forced labor was primarily used in public works projects and the mechanism of enslavement was through the court system. That is, when imagining the "typical condition" of forced labor, it would be convicts or the families of convicts performing work under Imperial guidance (eg public works projects). Private slavery did exist but at least as far back as we can tell (say around the late Waring Stares and particularly the Han) it was fairly marginal in economic terms, being concentrated as domestic servants or status symbols (eg dancing girls) rather than economic production.
This more or less holds true throughout the imperial period, but it is worth noting that efforts were made by both the Song and Ming courts to limit or end the practice of slavery.
Walter Scheidel "Slavery and forced labor in early China and the Roman world" is a good overview of this, also see William Rowe Crimson Rain for general discussion of forced labor.