The invention discloses a phosphoryl N-fatty acyl nucleoside analogue for treating viral hepatitis and liver cancer. The phosphoryl N-fatty acyl nucleoside analogue is characterized in that a nucleoside analogue is modified by a cyclophosphoryl group and then is connected to aliphatic chains having different numbers of carbon atoms. The phosphoryl N-fatty acyl nucleoside analogue can be used for convenient preparation of a nanometer transmission system and has obvious hepatocyte and tumor targeting. The nanometer transmission system comprises liposome, nonionic surfactant niosomes, nanoparticles, nano-emulsion and a self-assembled transmission system. The nucleoside analogue is selected from lamivudine, adenine arabinoside, cidofovir, gemcitabine, cytosine arabinoside, azacitidine and fludarabine. After intravenous administration, the nanometer transmission system of the phosphoryl N-fatty acyl nucleoside analogue has effects of targeting treatment on viral hepatitis and liver cancer.