The invention relates to an off-line programming system and method of an optical visual sensor with a linear structure for a welding robot. The system comprises a sensor model, a robot model, a process control rule base, a graphic editing interface, an operation sequence module and a programming information output, wherein the sensor model is used for simulating a sensor imaging process to acquire a view model and simultaneously completing detection view substantiation to be convenient for user graphic programming; the robot model is used for simulating the single-point motion of the robot and providing communication interface information of connecting sensor input signals; the process control rule base is used for providing process feature extraction rules for different welding tasks andcontrol command related information of processes; the graphic editing interface is used for interactive graphic programming between a user and a system; the operation sequence module is used for saving the information of a series of detection points, wherein the information comprises single-point motion commands, process compensation control commands, process feature extraction rules and imaging signal model information; and the programming information output is used for outputting the program text of the robot and the configuration information text of the sensor system.