A communications device, comprising: a container, at least one power module, at least one temperature regulating module, and multiple boards (13, 14, 15), wherein the container is configured to accommodate the at least one temperature regulating module and the multiple boards (13, 14, 15); the container is further configured to accommodate a power bus layer; the power bus layer is connected to the at least one power module, the at least one temperature regulating module, and the multiple boards (13, 14, 15); the at least one power module is configured to supply power to the at least one temperature regulating module and the multiple boards (13, 14, 15) by using the power bus layer; and at least part of communication among the multiple boards (13, 14, 15), the at least one power module, and the at least one temperature regulating module is performed in a power line communications manner by using the power bus layer; the communication device is characterized in that: at least one of the multiple boards (13, 14, 15), at least one of the at least one power module, or at least one of the at least one temperature regulating module comprises: a slot ID module, wherein the slot ID module comprises multiple Boolean signal generation mechanical parts and a control circuit; and the communications device further comprises: an ID encoding mechanical part that is disposed in the container, wherein the ID encoding mechanical part comprises a base and multiple matching parts that are disposed on the base, that are matched with the Boolean signal generation mechanical parts, and that meet a predefined encoding rule; and the base is fixedly disposed in the container, the multiple matching parts are configured to match the multiple Boolean signal generation mechanical parts to generate multiple Boolean signals, and the control circuit is configured to generate a slot ID according to the multiple generated Boolean signals. a container, at least one power module, at least one temperature regulating module, and multiple boards (13, 14, 15), wherein the container is configured to accommodate the at least one temperature regulating module and the multiple boards (13, 14, 15); the container is further configured to accommodate a power bus layer; the power bus layer is connected to the at least one power module, the at least one temperature regulating module, and the multiple boards (13, 14, 15); the at least one power module is configured to supply power to the at least one temperature regulating module and the multiple boards (13, 14, 15) by using the power bus layer; and at least part of communication among the multiple boards (13, 14, 15), the at least one power module, and the at least one temperature regulating module is performed in a power line communications manner by using the power bus layer; the communication device is characterized in that: at least one of the multiple boards (13, 14, 15), at least one of the at least one power module, or at least one of the at least one temperature regulating module comprises: a slot ID module, wherein the slot ID module comprises multiple Boolean signal generation mechanical parts and a control circuit; and the communications device further comprises: an ID encoding mechanical part that is disposed in the container, wherein the ID encoding mechanical part comprises a base and multiple matching parts that are disposed on the base, that are matched with the Boolean signal generation mechanical parts, and that meet a predefined encoding rule; and the base is fixedly disposed in the container, the multiple matching parts are configured to match the multiple Boolean signal generation mechanical parts to generate multiple Boolean signals, and the control circuit is configured to generate a slot ID according to the multiple generated Boolean signals. at least one of the multiple boards (13, 14, 15), at least one of the at least one power module, or at least one of the at least one temperature regulating module comprises: a slot ID module, wherein the slot ID module comprises multiple Boolean signal generation mechanical parts and a control circuit; and the communications device further comprises: an ID encoding mechanical part that is disposed in the container, wherein the ID encoding mechanical part comprises a base and multiple matching parts that are disposed on the base, that are matched with the Boolean signal generation mechanical parts, and that meet a predefined encoding rule; and the base is fixedly disposed in the container, the multiple matching parts are configured to match the multiple Boolean signal generation mechanical parts to generate multiple Boolean signals, and the control circuit is configured to generate a slot ID according to the multiple generated Boolean signals.