The coding rules of ID number are clearly stipulated in GB11643-1999 "Citizen Identity Number":
Citizenship number is a characteristic combination code, which consists of 17 bit ontology code and check code. The order from left to right is: six-digit address code, eight-digit date of birth code, three-digit serial code and one-digit check code. According to the first three address codes, you can judge which province the ID card belongs to.