With the development of reduced-manning and unattended offshore oil and gas fields, quadruped robots have become essential tools for monitoring unattended offshore oil platforms and reducing operational costs. However, the complexity of these platforms makes real-time generation of quadruped robot motion based on environmental information a critical issue. We propose a comprehensive perception, planning, and control pipeline to optimize the robot's motion in real-time. To enhance environmental perception, we introduce an unsupervised learning clustering algorithm. Addressing the numerical challenges of terrain, we optimize the contact surface selection problem by precomputing terrain traversability and convex hull calculations, minimizing computational workload. Concurrently, a series of contact surface constraints and foothold optimizations are approximated locally and integrated into an online model predictive controller. We solve the optimal control problem using second-order sensitivity analysis and the Enhanced Generalized Gauss-Newton (EGGN) method. Combined with a filter-based line search method, this provides better convergence performance and numerical stability. In simulations and experimental environments resembling offshore oil platforms, we validated our proposed method using the Aliengo quadruped platform. Results demonstrate that our approach can meet the challenges of offshore oil platforms, which is of significant importance for future engineering applications on unattended offshore platforms.