The present invention relates to a method for automatically allocating addresses for the same node on a communication bus, comprising: step S1, setting a global variable address allocation flag, initializing the address allocation flag as address unallocated, judging whether the address allocation flag of this node is unallocated, if not, Execute step S2, yes, execute step S3; step S2, judge whether the address of this node conflicts with the stored address, yes, execute step S3, no, execute step S5; step S3, assign the initial address to the node as the minimum address on the bus No. "1"; step S4, judge whether the address of this node conflicts with the stored address, if no, execute step S5, if yes, increase the address of this node by 1, and execute step S4 again; step S5, change the address assignment flag to address assigned , and remain unchanged. The present invention avoids address redistribution when the CAN bus is changed due to node movement, automatically rearranges repeated addresses in time, and avoids bus data errors caused by address repetition.