To address the problems of malicious camouflage devices and high consensus response delay in the internet of things system based on traditional PBFT consensus algorithm in complex network environment,a credible location and time-based Byzantine fault tolerant consensus mechanism(CBFT)was proposed.The devices were grouped according to the location infor-mation of the edge server,the location timer of the devices was created using GeoHash(geographic hash,GeoHash)protocol,and the trusted devices were selected according to the trusted time of the timer.A two-layer network was generated based on the credit value of the edge server to carry out consensus and decompose consensus tasks in parallel.A token based credit evaluation mechanism was introduced to encourage edge servers to standardize consensus behavior.Experimental results show that the improved consensus algorithm can effectively screen out malicious devices,reduce the consensus time and improve the system throughput.