As the traditional centralized Internet of Things(Io T)application scenarios tend to be dynamic and complex,problems such as high equipment deployment and management costs,data trust,and privacy leaks are gradually exposed.Blockchain,Oracle and homomorphic encryption(HE)are reliable solutions to these problems.Therefore,this thesis proposes a blockchain-based Io T Oracle system,the main work is as follows:First,aiming at the supply problem of blockchain trusted data.A public Io T data acquisition scheme based on blockchain in an untrusted environment is proposed and implemented.This scheme uses a distributed Oracle network to provide trusted data for the blockchain,in which the gateway acts as an Oracle to form an Oracle network based on the Byzantine fault-tolerant algorithm.Aiming at the limited resources of Io T devices,a gateway data aggregation method based on the Representational State Transfer(REST)API event publishing/subscribing mechanism is designed.It uses Structured Query Language(SQL)to realize flexible aggregation of data at the gateway.The simulation results show that by reasonably allocating the number of Oracle aggregation nodes,the gateway data aggregation can alleviate the high complexity problem caused by the Byzantine fault tolerance algorithm in the proposed scheme.Compared with the method of directly uploading data to the chain,the communication frequency of the proposed aggregation algorithm is lower.Second,aiming at the problem of data privacy leakage,an improved method of on-chain data aggregation based on Paillier encryption algorithm is proposed.In a distributed scenario,the application of the Paillier encryption algorithm has the problem of data request link exposure.In response to this problem,this thesis designs a traffic coverage method based on multi-contract construction.This method builds multiple request contracts and mixes false requests into a single request to hide the true intention of the data requester.The encryption and decryption time test of the proposed improved scheme was carried out on the computer and the Raspberry Pi.The simulation and test results show that in a single request,each additional false request will cause a delay of about2 seconds in data acquisition.The proposed method can achieve a request response within 20 seconds in a small-scale scenario of 5000 data nodes. |