The invention discloses a main control unit of an electric locomotive based on a QNX (Quick Unix). The electric locomotive comprises the main control unit and a slave control unit which have the same software and hardware configuration, constitute a hot standby redundancy system and communicate with each other through full duplex RS485, wherein the hardware structure of the main control unit comprises a power board card, an MCPB (Main CPU (Central Processing Unit) board) card, a CAN (Controller Area Network) communication board card, an HDLC (High-level Data Link Control) communication board card, an ETHN (Ethernet) board card, a digital input board card, a digital output board card and an analog board card; according to the specific requirements of a novel electric locomotive, acquisition and processing of state information of the locomotive and storage of key data of the locomotive are realized, and each device of the locomotive is controlled to run harmonically and normally. Various functions of the novel electric locomotive can be met, the integration degree is high, the size is small, the cost is reasonably reduced, the universality is strong, and the locomotive is easy to maintain, strong in instantaneity and high in reliability.