BEIJING — The community is walled and gated, an enclosure of rows of crowded low-rise homes and shops, where people exist in their own worlds, under the gaze of surveillance cameras and apart from the city. The police patrol around the clock, and security guards stop unfamiliar faces to check identification papers. In the morning, only one gate is open, through which parents head off to work and children go to school. At night, the gate is locked, preventing street loiterers from trespassing.