We employ the thermal optimal path method to explore both the long-term and short-term interaction patterns between the onshore CNY and offshore CNH exchange rates (2012-2015). For the daily data, the CNY and CNH exchange rates show a weak alternate lead-lag structure in most of the time periods. When CNY and CNH display a large disparity, the lead-lag relationship is uncertain and depends on the prevailing market factors. The minute-scale interaction pattern between the CNY and CNH exchange rates change over time according to different market situations. We find that US dollar appreciation is associated with a lead-lag relationship running from offshore to onshore, while a (contrarian) Renminbi appreciation is associated with a lead-lag relationship running from onshore to offshore. These results are robust with respect to different sub-sample analyses and variations of the key smoothing parameter of the TOP method.