A service protection setting method, controller and optical network device for configuring an optical network service protection by extending an OpenFlow protocol. The method comprises: transmitting, by a controller, an OpenFlow message to an optical network node device to instruct the optical network node device to set a service protection, wherein the controller transmits a flow configuration message and a group configuration message to a head node, transmits the flow configuration message to a middle node, and transmits the flow configuration message and the group configuration message to a tail node.