Foreign household registration can be transferred to university collective account while studying in Shanghai, and Shanghai household registration book cannot be processed. After graduating from college, you can apply for a residence permit in Shanghai.
Legal basis: Article 4 of the Regulations on Household Registration in People's Republic of China (PRC) shall establish a household registration book. Cities, waters and towns with police stations shall issue household registration books to every household. Rural cooperatives issue household registration books as units; The household registration book is not issued to accounts outside the cooperative. The household register and the items registered in the household register have the effect of proving citizenship.