The invention relates to a tree-shaped logic software design method of a dual-power automatic change-over switch. The design method comprises the following steps that the design method comprises the following steps of: S1, designing a container structure, wherein S101, the container linked list comprises a linked list structure realized by using a template; different types of container objects canbe received by specifying different template parameters, and each container object holds pointers of the front container object and the rear container object so as to form a linked list structure, S102, designing a container adding method, S103, designing a container deleting method and S104, designing a traversal algorithm; S2, four classes are created according to the dual-power-supply workingmode, each working mode comprises multiple working states, the working states are abstracted into container classes, objects are created for each container class and added to the corresponding workingmode, and a top-down tree-shaped structure is finally formed by the same class; And S3, designing a scheduling algorithm of a tree structure. The logic structure is clear, the later modification riskis reduced, and the test workload is reduced.