Heterogeneous wireless technologies are widely used in the Mobile Internet and Internet of Things (IoT). When data traverse heterogeneous wireless network, packet loss is mainly caused by error rate of the unstable channel. However, TCP is unable to distinguish the true reason. It would still reduce the congestion window that will lead to severe communication performance degradation. This paper proposed a fine-grained self-adaptive mechanism to improve TCP performance in heterogeneous networks. The novel approach contains adaptive switching TCP variant and adjusting congestion window size by probing the state of connection. The state measurements include bottleneck bandwidth, round-trip delay and packet loss rate. Simulation results based on NS-2 proved that this mechanism could work well in different scenarios and achieve optimal performance.