This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < 1 Enhancing cybersecurity using blockchain technology based on IoT data fusion Sung-Jung Hsiao and Wen-Tsai Sung Abstract—In this study, blockchain technology is used to strengthen the security of wireless sensing data in the network architecture of the Internet of Things. For many organic farms that contain crops with high unit prices, the environmental parameters of the crops grown on the farm are often regarded as confidential data. First, a wireless sensing network is used to transmit sensing data to the farm’s front-end integrated microcontroller for fusion of the sensing data. After fusion of the sensing data is completed, the processed data is transmitted to the data processing center of the entire farm for encapsulation of the blockchain algorithm. Data are sent to the cloud database for storage after they are packaged by the system. At the same time, the data in the cloud database can be managed and analyzed by remote operators. Data encapsulation based on blockchain technology is used to effectively prevent any data from being stolen or destroyed by hackers. A complete blockchain encapsulation database system is implemented in the experimental stage, and the operator can use this system to encrypt the data that have been fused at the remote end for blockchain technology. In the encryption process of this blockchain, the security of data processing can be specifically enhanced by the system. Finally, each encapsulated block of data is securely stored in a private cloud database. There is a function to check whether the data in the cloud have been tampered with. A very innovative approach to using blockchain technology is proposed in this paper to enhance the security of data processing. Index Terms—Wireless sensor networks (WANs), Internet of Things (IoT), blockchain, cloud database, fusion. T I. INTRODUCTION he proposed system uses blockchain technology to enhance the security of sensor data transmission, which is the most important goal of this research project. For a smart farm that contains crops with high unit prices, the growth parameters of the crops that are usually planted are the most important confidential information in the industry. Often, a pot of orchids may be worth from a few hundred yuan to a few thousand yuan. Therefore, the information on the growth parameters of high unit price crops on the farm is very confidential. Currently, most smart farms use wireless sensor networks (WSNs) systems to monitor various growth conditions of crops.[1] [2] These systems also transmit various environmental parameters related to plant growth to the farm's central processing unit. Usually, the transmission of data may only be encrypted with a simple password, which is easily Manuscript received xx xx, 2022; revised xx xx, 2022 and xx xx, 2022; accepted xx xx, 2022. Date of publication xx xx, 2022; date of current version xx xx, 2022 This work was supported in part by the Department of Information Technology, Takming University of Science and Technology and Department of Electrical Engineering, National Chin-Yi University of Technology.” Corresponding author: Wen-Tsai Sung. cracked or tampered with by network hackers. Assuming that the central control processing unit utilizes remote login monitoring, the probability of the system being attacked is very high. Therefore, it is only a matter of time before the system is hacked. Currently, issues related to information security have become the focus of attention. This project uses blockchain, which is a very important technology. to enhance the security of data transmission. To date, most researchers have applied blockchain technology to finance because the blockchain method is very rigorous, and it is difficult for hackers to tamper with the existing ledger data. Therefore, blockchain technology has been applied in the financial world for virtual currency. In our method, blockchain technology is applied to enhance the transmission of growth parameters of high unit price crops to ensure that the data will not be tampered with or stolen by hackers. Fig. 1 shows the difference between the use of blockchain technology for virtual currency and this study. Smart farms are used as the research basis for this study; please refer to Fig. 2 for the system architecture of the proposed approach. In the smart farm used in this study, the researchers placed different kinds of environmental sensors inside the planting platform. These sensors include air temperature and humidity sensors, soil moisture sensors, illuminance sensors, gas sensors, and soil pH sensors. When these sensors are used to measure environmental parameters, the sensed data is transmitted to integrated microcontrollers.[3][4] These microcontrollers run on Windows or Linux operating systems. Therefore, these microcontrollers perform different types of sensing data fusion processes. The first step in the system is to process the sensing data through these fusion processes. After the data of various sensors have been integrated, the data is encapsulated through the block chain algorithm through the control unit center. Then, each packaged block is transmitted to the cloud database. Remote operators can log in to the system to query and view various data. The data can also be presented through various graphics, which are convenient for users to analyze and observe.[5][6] II. THE DEVELOPMENT OF BLOCKCHAIN In most of the current applications, the blockchain is almost regarded as a decentralized ledger system, which is integrated using cryptography, mathematical algorithms and economic Sung-Jung Hsiao is with the Department of Information Technology, Takming University of Science and Technology, Taipei City, 11451, Taiwan (e-mail: sungjung@ gs.takming.edu.tw). Wen-Tsai Sung. is with the Department of Electrical Engineering, National Chin-Yi University of Technology, Taichung, 411030, Taiwan (e-mail: songchen@ncut.edu.tw). © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < models. This type of decentralized ledger system operates in a peer-to-peer (P2P) network architecture and is used to combine associated data blocks into a chain-like data structure according to timestamps. The characteristics of this type of network architecture result in data that cannot be tampered with. Additional benefits include liquidated transactions, secure encryption mechanisms and improved traceability.[7][8][9] Zhou et al. proposed an optimized deployment mechanism of blockchain under the architecture of the Internet of Things [10]. 2 The proposal of this method is that the mechanism based on the blockchain can effectively solve the security problems in the wireless Internet of Things system. Xu et al. proposed a lightweight and anti-attack bidirectional blockchain paradigm for IoT [11]. Bataineh et al. proposed a novel secure blockchain framework for IoT health applications [12]. Alrubei et al. proposed the application of blockchain platform in IoT [13]. Mahrous et al. proposed the application of blockchain in IoT digital forensics architecture [14]. Fig. 1. Comparison of current examples of blockchain technology. Fig. 2. The system architecture of the proposed approach. In blockchain development technology, the peer-to-peer technology, the blockchain network developed into a network architecture, which was used as the network decentralized network architecture. However, the network architecture of early blockchain technology, is the most architectures of the web applications that are commonly used characteristic network. After the improvement of network today are all in the form of centralized servers and clients. © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < While there may still be some network architectures that are decentralized, only a few newer network architectures are decentralized.[15][16] The clear concept of a decentralized network architecture is that no node will be instructed by other nodes to complete an action, and there is no important central node in the entire network architecture. The rights and obligations between all nodes are equal, so when any node in the network stops working or fails, the execution of the entire system is not affected. Therefore, the system is very stable. The most important aspect of the decentralized network architecture is its reduced dependence on the "center" or "key node". In the current online world, most of the system services are summarized in a centralized network architecture, such as Facebook, Twitter, and Google. Although these are internet-based service companies, their internal network system architectures almost all use decentralized networks. This architecture, which has become the foundation of their base layer of service, is used to improve computing power and data reliability and shorten the service time. In terms of the above network architecture, a network service system can include both a centralized architecture and a decentralized architecture. For users of network services, all data, resources, management rights and responsibilities in system services are centralized in the company's server. Assuming that the number of users continues to increase, the internet company's centrally managed infrastructure, servers, and network must also increase. If the system fails, all users' data access will be affected. As 2 previously mentioned, these disadvantages are very clear. In addition, if the servers of these internet-based companies are accidentally compromised, the data stored in their databases may be tampered with or stolen. These companies have absolute "manipulation authority" over all user data, so users are fearful that their data will be leaked.[17][18] Blockchain technology is a "decentralized web of trust" that creates a set of "public ledgers" on the internet. All users in the network jointly "book" and "check" on the ledger to ensure the authenticity and immutability of the information. Before blockchain technology, all transactions required an intermediary agency, such as a financial information company, that was responsible for bank transfers and ATM, credit card and other transactions. With the implementation of blockchain, the original intermediary no longer exists. All cash flow transaction processes use encrypted technology and a decentralized public ledger to allow the computers of all participants to book and confirm together, becoming a decentralized transaction system. Since its development, blockchain has undergone three stages of evolution. The first stage is Blockchain 1.0 - Bitcoin, where the decentralization of virtual currency was introduced. The second stage is Blockchain 2.0 - Ethereum, where smart contract authentication was introduced. The third stage is Blockchain 3.0 - IOTA, where the Internet of Things was connected. Today's blockchain technology covers smart contracts, remote identification systems, digital currency payment processors, smart wallets and exclusive digital currencies.[19][20] Fig. 3. The evolution of blockchain technology. data directly to the fusion center. The results, which are III. DECISION FUSION RULES presented later, are based on generalized simple assumptions As shown in Fig. 4, a total of N sensors are randomly that can be adapted to different network structures. An example distributed in a region of interest (ROI), where the ROI is a is presented below to illustrate how this method can be adapted square whose area is equal to b2. The variable N is random and to complex practical applications.[21][22] It is assumed that the sensor area is large and the signal decays obeys the Poisson distribution, as shown in Eq. (1): rapidly with increasing distance to the target. Therefore, as ππ −ππ ππ ππ p(N) = , N = 0,β―, ∞ (1) shown in Fig. 5, only a small fraction of the sensors are able to ππ! detect the signal from the target. The measurement data A. Hierarchical Network Structure obtained by most sensors are pure noise. Since the local The proposed study focuses on the application aspects of decisions from these sensors do not convey enough information wireless sensor networks. A network structure has been implied about the target, this approach is not only ineffective but also in the previous discussion; that is, all sensors in the ROI send wastes energy. Moreover, when the network scale is very large, © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < scalability problems exist. A reasonable solution is to use a 3level hierarchical network structure, as shown in Fig. 6. Nodes that are relatively close to each other form a cluster, and each cluster has its own cluster head, which acts as a local fusion center and has more powerful computing and communication capabilities. As shown in Fig. 5, each cluster is used to detect a certain subregion in the ROI. These sensors send data to their respective cluster heads rather than to the fusion centers, which are farther away. Based on the data sent by the sensors in a certain cluster or subarea to the corresponding cluster head, a decision will be made on whether there is a target in the subarea. This decision will then be sent to the fusion center, and the fusion center will collect the information on whether there is a target or an event in a specific area.[23] 2 area. Fig. 5. Energy contours of a target located in the sensor region, which consists of 9 cluster heads and their corresponding subregions. As long as the previous assumptions are still valid in every cluster or subregion, an estimate of the detection performance of the cluster head layer can be made.[24][25] Fig. 4. Signal energy contours for targets located in the sensor Fig. 6. The 3-level hierarchical sensor network structure. Obviously, when N is given and the assumption condition is B. System-Level False Alarm Rate H0, π¬π¬ obeys the binomial distribution with the majority (N, In this section, the derivation of the detection performance of ππππππ ). When N is large enough, ππππ {π¬π¬ ≥ ππ | ππ, π»π»0 } can be the system version is presented, that is, the false alarm approximated by the Laplace-De Moivre theorem as Eq. (3) probability ππππππ and the discovery probability ππππ at the fusion center. In addition, the simulation results are compared with the ππ {π¬π¬ ≥ ππ | ππ, π»π» } = ππ 0 theoretical analysis. The false alarm rate at the fusion center ππππππ ππ ππ − ππππππππ ππ−1 ππ ππ is given by Eq. (2): οΏ½1 − ππππππ οΏ½ ≈ ππ οΏ½ οΏ½ (3) οΏ½ οΏ½ οΏ½ ππππππ ππ οΏ½ππππππππ (1 − ππππππ ) ππππππ = ∑∞ (2) ππ=ππ ππ(ππ)ππππ {π¬π¬ ≥ ππ | ππ, π»π»0 } ππ=ππ © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 2 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < It is known that the kurtosis coefficient of the Poisson distribution is 3+(1/ππ). When λ becomes larger, the kurtosis coefficient of the Poisson distribution will be close to that of the Gaussian distribution, which can be explained by the unique properties of the Poisson distribution. A Poisson random variable with mean λ can be considered the sum of M independent and identically distributed Poisson random variables with mean λ0=λ/M. Therefore, if a Poisson random variable has a large mean λ, then it is obtained by adding a large number (M) of independent and identically distributed Poisson random variables with a constant mean λ0. Therefore, according to the central limit theorem (CLT), its distribution will be close to a Gaussian distribution. Therefore, when λ is large, the probability mass of N will be concentrated around the mean (λ), as illustrated in Fig. 7, which shows the probability mass function of N when λ=1,000 and λ=10,000. According to this characteristic of the Poisson distribution and using the condition that both the mean and variance of the Poisson distribution are λ, when λ is large, the following approximate conclusions can be drawn, are shown in Eqs. (4) and (5). ππππ οΏ½ ππ − 6√ππ ≤ ππ ≤ ππ + 6√ππ οΏ½ β 1 (4) or −ππ ππ 3 ππ ππ ∑ππ ππ1 ππ! β1 where N1 =οΏ½ππ − 6√πποΏ½, N3 =⌈ππ −6√πποΏ½ (5) Therefore, for a large λ, the typical value of N is also a large number. The probability of this N taking a small value is negligible. For example, when λ=10,000, ππππ { ππ < 810} = 2.4 × 10−10 . When ππ = 10,000 , ππππ {ππ < 9400} = 6.6 × 10−10 . Therefore, when λ is large enough, Eq. (6) yields ∞ ππ ππ=0 ππ3 ππ=ππ ππ ππ ππ−ππ οΏ½1 − ππππππ οΏ½ ππππππ = οΏ½ ππ(ππ) οΏ½ οΏ½ οΏ½ ππππππ ππ β οΏ½ ππ=ππ2 ππ − ππππππππ ππππ ππ −ππ ππ ( ) ππ! οΏ½ππππππππ (1 − ππππππ ) ππ3 = οΏ½ ππ=ππ2 ππ − ππ0 ππππ ππ −ππ ππ οΏ½ οΏ½ … … … … . (6) ππ! ππ0 where N2=max (T, N1), ππ0 β ππππππππ , and ππ0 β οΏ½ππππππππ (1 − ππππππ ). Since the Laplace-De Moivre approximation in Eq. (3) is valid for sufficiently large N, this can be exploited to derive Eq. (6). The importance of Eq. (5) is that it can significantly reduce the computational load for calculating pfa or pd. This is because it is enough to perform an accumulation less than or equal to 12√ππ during the computation but not an infinite number of accumulations. C. System-level Detection Probability From the nature of the problem discussed and the content expressed, different local sensors have different ππππππ , where ππππππ is a function of ππππ . Therefore, under the assumption of H1, the total number of discoveries (π¬π¬) no longer obeys the binomial distribution, and it is difficult to derive the analytical formula for the probability distribution of π¬π¬. However, the system can obtain ππππ by an approximation or simulation method. When the number of sensors N is large, the system-level ππππ can be obtained by approximating with the CLT, as shown in Eq. (7) Fig. 7. Probability mass function of the Poisson distribution. ππ−ππππΜ ππ ππππ {Λ ≥ T|N, π»π»1 } ≅ ππ οΏ½ οΏ½ππππ −2 (7) οΏ½ where the relevant calculations are shown in Eqs. (8), (9), (10) and (11) πποΏ½ 2 = ππΜ ππ = ππ/2 ππ ∫ πΆπΆ(ππ)ππππππ + (1 − 4 )πΎπΎ ππ 2 0 ππ ππ 2 2ππ 2ππ οΏ½ [1 − πΆπΆ(ππ)]πΆπΆ(ππ)ππππππ + οΏ½1 − οΏ½ πΎπΎ(1 − πΎπΎ) ππ 2 0 4 πΆπΆ(ππ) = ππ οΏ½ππ − οΏ½ ππ0 1+πΌπΌπΌπΌ ππ πΎπΎ = ππ οΏ½ππ − οΏ½ οΏ½ ππ0 1+πΌπΌ( √2ππ ππ ) 2 (8) (9) (10) οΏ½ Another approximate expression of πΎπΎ is Eq. (12): πΎπΎ = ππ(ππ) = ππππππ (11) (12) Here, Eq. (11) is used for approximation. However, when the ROI is large, that is, when b is large, this difference can be ignored. Using a derivation method such as Eq. (6), taking the average of Eq. (7) according to the value of N, the system-level ππππ , which is given by Eq. (13), can be obtained. ππ3 ππππ β οΏ½ ππ3 = οΏ½ ππ=ππ2 ππ=ππ2 ππ −ππ ππ ππ ππ! ππππ ππ −ππ ππ − ππππΜ ππ ( ) ππ! √ππππ −2 ππ − ππ1 ππ ( ) ππ1 (13) where ππ1 β ππππΜ ππ , ππ1 β √ππππ −2 . Likewise, when ππ is large, the typical value of N is also large. Therefore, the Gaussian approximation determined by the CLT in Eq. (7) is still valid. D. Simulation Results System-level ππππ and ππππππ can also be estimated by simulation. © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 3 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < The ROC curves of the receiver in Figs. 8-11 are obtained by the approximation method and simulations under different system parameters. Fig. 8 and Fig. 10 are the simulation results obtained by 105 Monte Carlo samplings, while Fig. 9 and Fig. 11 are the simulation results obtained by 107 Monte Carlo samplings. As seen from these figures, the results obtained by the approximation method are very close to the results obtained by the simulation method, even when the ππππππ at the system level is very low (Fig. 9 and Fig. 11). written in the form of T = βλ, then Eq. (15) can be obtained. ππ 3 ππππππ β ∑ππ=ππ 2 ππππ ππ −ππ ππ! ππ οΏ½ οΏ½π½π½−ππππππ οΏ½√ππ οΏ½ … … … … ..(15) οΏ½ππππππ οΏ½1−ππππππ οΏ½ Similarly, Eq. (16) can be obtained according to Eq. (13). ππ 3 ππππππ β ∑ππ=ππ 2 ππππ ππ −ππ ππ! (π½π½−ππΜ ππ )√ππ ππ οΏ½ οΏ½ππ −2 οΏ½ … … … … ..(16) Therefore, when λ→ ∞, if π½π½ < ππππππ , then ππππππ =ππππ = 1. If ππππππ < π½π½ < ππΜ ππ , then ππππππ = 0 and ππππ = 1 . If π½π½ > ππΜ ππ , then ππππππ =ππππ = 0. Therefore, if only the value of β is between ππππππ and ππΜ ππ , the detection performance of the infinite sensor network can be perfect when λ→ ∞, that is, ππππππ = 0 and ππππ = 1. Fig. 12 and Fig. 13 show the curves of ππππππ and ππΜ ππ as a function of λ. As λ increases, ππππ gradually tends to 1, while ππππππ gradually tends to 0. The system adjusts the value of π½π½ to satisfy π½π½(ππππππ + ππΜ ππ )/2. In addition, λ is large enough. Therefore, even if SNR0 is small, the system can achieve good detection performance. Fig. 8. The ROC curves obtained by approximation and simulation. ( ππ = 1000, ππ = 2, ππ = 100, ππ = 200, ππ0 = 1000, 500, 100, corresponding, ππ = 0.77, 0.73, 0.67). Fig. 10. The ROC curves obtained by approximation and simulation. (ππ0 = 500, ππ = 3, ππ = 100, πΌπΌ = 40, ππ = 0.90)). Fig. 9. The ROC curves obtained by approximation and simulation (107 Monte Carlo simulations). E. Incremental Analysis Incremental analysis is very useful to analyze system performance when the average number of sensors λ is large. From Eq. (6), it is known that Eq. (14) can be given as: maxοΏ½ππ, οΏ½ππ − 6√πποΏ½οΏ½ ≤ ππ ≤ οΏ½ππ + 6√πποΏ½ (14) Fig. 11. The ROC curves obtained by approximation and simulation. (107 Monte Carlo simulations). Therefore, when λ → ∞ , if ππ ≤ οΏ½ππ + 6√πποΏ½ , then N approaches λ. Assuming that the system-level threshold can be © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 4 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < ∞ Pr{Λ = ππ | π»π»1 } = οΏ½ ππ(ππ)ππππ { Λ = ππ | ππ, π»π»1 } β ∑∞ ππ=0 ππππ ππ −ππ ππ! 1 √2ππππ1 ππ=0 2 2 ππ −[ππ−ππ1 (ππ)] οΏ½[2ππ1 (ππ)] … … … … …(18) (ππ) where, ππ1 (ππ) = ππππΜ ππ , ππ1 (ππ) = √ππππ −2 . Similarly, under the assumption of π»π»0 , for a larger ππ, Eq. (19) can be obtained. Pr {Λ = ππ | π»π»0 } ∞ 1 ππππ ππ −ππ 2 2 ππ −[ππ−ππ0 (ππ)] οΏ½[2ππ0 (ππ)] β οΏ½ ππ! √2ππππ0 (ππ) ππ=0 Fig. 12. Variations in the system-level discovery probability ππππ with λ. (ππ = 2, ππ = 100, πΌπΌ = 200, ππ = 0.5). (19) where, ππ0 (ππ) = ππππππππ , ππ0 (ππ) = οΏ½ππππππππ (1 − ππππππ ). It can be deduced that the likelihood ratio of Λ is Eq. (20). πΏπΏ(Λ) = ππππ{Λ | π»π»1 } β ππππ{Λ | π»π»0 } ππ −[Λ−ππ1 (ππ)]2οΏ½[2ππ2 1 (ππ)] ∑∞ ππ=0ππ οΏ½[ππ!ππ1 (ππ)]ππ 2 (ππ)] 2 (ππ)] οΏ½ −[Λ−ππ [2ππ ∞ 0 0 ∑ππ=0ππππ ⁄[ππ!ππ0 (ππ)]ππ (20) Therefore, the optimal fusion rule at the fusion center is the test of the likelihood ratio, which is given by Eq. (21) πΏπΏ(Λ) ≤ πππΏπΏ (π»π»0 ), πΏπΏ(Λ) ≥ πππΏπΏ (π»π»1 ) Fig. 13. Variations in the system-level discovery probability ππππππ with λ. (ππ = 2, ππ = 100, πΌπΌ = 200, ππ = 0.5). F. Optimality of Decision Fusion Rules The decision fusion rule (i.e., the counting rule) proposed by the previous system is actually a threshold test performed by local sensors on the total number of detected targets, which is a very intuitive method. It is necessary to compare this fusion rule with the optimal decision fusion rule, which is proposed based on the total number of detected targets. The parameter Λ in the above formula is a random variable of lattice type, that is, it takes values at equal intervals between 0 and N. Therefore, according to the CLT, for a large N, the probability ππππ = ππππ {Λ = ππ⁄ππ} is equal to a sample of Gaussian density, as shown in Eq. (17): Pr{Λ = ππ⁄ππ } β 2 2 1 ππ −(ππ−ππ) ⁄(2ππ ) √2ππππ (ππ = 0, … , ππ) (17) Therefore, under the assumption of π»π»1 , for a larger ππ, Eq. (18) can be obtained. (21) Since the system-level ππππππ is given, the NP decider needs to be implemented by the counting rule mentioned above, and the system-level threshold T can be found by Eq. (6) only by knowing λ and τ. To obtain the optimal threshold, the value of P0 must also be known. However, even without an optimal τ value, the counting rule can still be implemented, and often a better τ value can be obtained based on some prior knowledge of P0. Therefore, it is not necessary to know the exact information of P0 when implementing the counting rule, even when estimating the detection performance at the system level. For the optimal fusion rule, it is necessary to know the exact values of α, P0 and b. Therefore, more information, especially the signal power P0, must be known when using the optimal fusion rule. However, the parameter P0 is unknown in most cases. Moreover, due to its dependence on the signal power P0, the optimal fusion rule is more sensitive to errors in the estimation of P0. Therefore, the optimal fusion rule only has theoretical significance. In some practical applications, its role and robustness are not ideal. Therefore, estimating the value of P0 in these applications is often difficult. It can be seen from Eq. (20) that πΏπΏ(Λ) is a nonlinear transformation of Λ . If πΏπΏ(Λ) is a monotonically increasing transformation of Λ, then thresholding Λ and πΏπΏ(Λ) has the same detection performance. In Fig. 14 and Fig. 15, L is a function of Λ for different system parameters. In all cases, πΏπΏ(Λ) is monotonically increasing with respect to Λ, which means that the counting rule and the optimal fusion rule are equivalent in detection performance. In addition to the cases shown in Fig. 14 and Fig. 15, the relationship between L and Λ for different system parameters is also studied. © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < For all system parameters studied, πΏπΏ(Λ) is monotonically increasing with respect to Λ. 5 In Fig. 16, the ROC curves obtained by simulating the counting rule and the optimal fusion rule (based on 106 Monte Carlo simulations) are given. The ROC curves of the counting rule and the optimal fusion rule almost coincide. IV. INTRODUCTION TO BLOCKCHAIN TECHNOLOGY Fig. 14. The πΏπΏ(Λ) function. (λ = 1000, n = 2, b = 100, α = 200, ππ0 = 50, 100, 500, 1000, 2000, relatively, ππ = 0.66, 0.67, 0.73, 0.77, 0.82). The encryption technology currently used in the blockchain uses the secure hash algorithm (SHA)-256 algorithm. Generally, the operations of hash functions have a common feature. Regardless of how many bits there are in the original data, as long as the hash operation is performed, the length of the result is fixed. Usually, this result is called a "digest". A digest is unique, as if it were a human fingerprint. A hash function, also known as a hash algorithm, is a method of creating a small digital "fingerprint" from any kind of data. The hash function compresses the message or data into a summary so that the amount of data decreases and the format of the data is fixed. Using this function, the data is shuffled and a fingerprint called hash values, hash codes, hash sums, or hashes, is recreated. A hash value is usually represented by a short string of random letters and numbers. Good hash functions rarely have hash collisions in the input domain. In hash tables and data processing, it not suppressing that conflicts to distinguish data can make database records more difficult to find. Today, hash algorithms are also used to encrypt password strings stored in databases. Since the hash value calculated by the hash algorithm is irreversible (i.e., the calculated value cannot be reversed back to the original value), passwords can be effectively protected. Fig. 15. The πΏπΏ(Λ) function. (n = 3, b = 100, α = 40, ππ0 = 500 ππ = 0.90). Fig. 16: The ROC curves of the counting rule and optimal fusion rule. (ππ = 1000, ππ = 2, ππ = 100, ππ = 200, ππ0 = 1000, 500, 100, relatively, ππ = 0.77, 0.73, 0.67). Fig. 17. Example of a hash algorithm based on entering values of different lengths. Fig. 17 shows that when strings of different lengths are input, a unique 64-character is output after calculation using the SHA256 algorithm. These results, which are similar to fingerprints, are unlikely to be easily replicated. Assume that the first three characters of the output by the system are set as "666". In addition to the original input data, other input values need to be added to the calculation using the SHA-256 algorithm. These other input values are the values to be mined by the system. As shown in Fig. 18, after combining the original measurement data of the system with another unknown data string, the hash algorithm calculates the result © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < that the first three characters are "666". These unknown data must be calculated by mining the system. Fig. 18. The hash calculation state when the first 3 characters of the output result are "666". As shown in Fig. 19, the unknown data contain the block number nonce, the timestamp and the hash value of the previous block. The nonce value is the calculated value of the system that is used to perform mining. When the nonce value of each block is calculated, the hash value of the block conforms to the specified "666" in the first 3 characters, which is an assumption of the system development. Other characters can also be set by 6 the system, for example, 222, 33, abc, or 1111. However, the more characters there are, the more time the system needs to complete calculations. Fig. 19. The unknown data contain the block number nonce, the timestamp and the hash value of the previous block. Fig. 20. System interface for the implementation of the proposed method. V. SMART FARM BLOCKCHAIN TECHNOLOGY IMPLEMENTATION In practice, our research team has developed applications that apply blockchain technology to encapsulate sensing data. For information on the system operation interface of system, please refer to the screen in Fig. 20. The left half of this figure shows the system operation interface, which is where the input of sensing data occurs. The right half of this figure shows the system interface, which is where the operation of the cloud database occurs. In the interface shown in Fig. 21, the “Key” field represents the key value in front of the hash value that the system wants to calculate. In the example shown in Fig. 21, this key value is set to "666". The "No." field represents the number field of this block. The "Nonce" field represents the value mined by the system. In this example, the nonce value is set to “14574”, which allows the hash value of this block to meet the standard set by the system. When the operator presses the "Mining" button, the hash value of the block will be calculated by the system. The nonce "14574" is mined through the hash value © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < calculation of the block. The "Previous Hash" field indicates the hash value of the previous block. The hash value of the previous block of Fig. 21 is 64 "0" characters. Because this screen is the first block of this system, there is no block in front of this system, which is represented by "0". After the block hash value is calculated by the system, the operator can press the "Save" button to save the block hash value, as shown by the screenshot in Fig. 22. The operator can view the actual data in each encapsulated block in real time, as shown in the screenshot in Fig. 23. The proposed system normally packs block data every half hour. The environmental parameters do not change much in a short time. However, the sensor network system of the whole farm monitors the environmental data of the whole farm at any time. As shown in Fig. 24, after the operator inputs different sensing data, the second block is encapsulated. In addition to the hash value of Block 2, the value "3116" is calculated by the system. This value is the nonce value of Block 2. 2 Fig. 21. Calculation of the hash value of the first block. Fig. 22. Representation of pressing the "Save" button to save the calculated data. Fig. 23. Real-time view of block data in the database. Fig. 24. The second block data situation of the system package. © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < A function is designed within the proposed system to check whether the block data have been tampered with. When the system is running, this function is automatically executed. In Fig. 25, the hash value field of its own block has been tampered 2 with by the operator to the value "6631c73f8d71295...", which is obviously different from that specified by "666". When the operator presses the "Check" button, the system immediately notifies the operator that the data have been tampered with. Fig. 25. Representation of the operator pressing the "Check" button to check whether the data have been tampered with. Fig. 26 shows the situation where the proposed blockchain technology data are encapsulated in the database system. Operators can add, delete, update or search for any record data in the blockchain database. Fig. 26. The database operation interface of the proposed blockchain system. Table 1 shows the pseudocode of the proposed method based on blockchain technology. This pseudocode is the algorithmic process by which the system calculates the hash value of each block. In this algorithmic process, the operator sets the first 3 characters of the hash value of each block to "666". The operator can also set other characters. However, according to the experimental results, the longer the character set is, the larger the number of calculations and the more time it takes to calculate the result. TABLE I BLOCKCHAIN TECHNOLOGY PSEUDOCODE Input: The current block number, the previous block hash value (if block number=1, the previous block hash value =”0”), the current block sensing data, and the current timestamp. Output: The current block hash value and the nonce value Method: Step 1: Set the first three digits of the current block hash value to 6 (set by the system), and then mine the nonce value. Step 2: nonce is incremented from 0 to a qualifying value Step 3 while (the first three digits of the current block hash value are equal to 6) { Step 3.1 Compute the current block hash value Step 3.2 nonce + = 1 } Step 4 Return the current block hash value and the nonce value End Fig. 27 shows the comparison of the time used in the data processing system using or not using (the tradition method) blockchain technology, where the time spent refers to the encapsulation time of each block. In addition to the comparison of blockchain technology, this analysis includes a comparison of the time required for the system to check for tampering. When the number of data records is less than 10,000 records, the computing time is within 5 seconds. When the number of data records reaches 50,000 records, the computing time significantly increases. In addition, the gap between the © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < computing time required by the system using blockchain technology and the computing time not using blockchain technology increases. 2 perform data fusion between heterogeneous sensors. After data fusion is completed, the fused data is encrypted with blockchain technology. This encryption process will affect the operational efficiency of the entire system in calculating the hash value of the block. In the process of calculating the hash value of the block, when the number of specified preceding characters is greater, the overall calculation amount of the system will become very large, and the system also needs more data processing time. Therefore, the entire system using blockchain technology needs to pay more attention to the process in the calculation. ACKNOWLEDGMENT Fig. 27. Comparison of the time spent storing data using the traditional method and the method using the blockchain in this system. Fig. 28 shows a comparison of the probability of tampering with the sensing data when the system does or does not utilize blockchain technology. When the data consist of 2,000 records, the probability of data tampering increases to 18% of the whole. When the data consist of 5,000 records, the probability data tampering is 40%. The above situation shows that when the amount of data in the system is larger, the probability of data corruption is higher. In this case, it is a very important contribution to the system that blockchain technology is utilized to encapsulate data to strengthen the security of the data. Fig. 28. Comparison of the probability of data tampering. VI. CONCLUSION A very innovative approach using blockchain technology is proposed in this paper to enhance the security of data processing. Currently, blockchain technology is usually used in encrypted virtual currency transactions, such as bitcoin and ether, in the financial industry. This technology is very rigorous, and the proposed method can effectively improve the security of the system by applying it to the data transmission of the Internet of Things. Currently, issues related to information security have become the focus of attention. In this paper, blockchain technology is used to enhance the security of data transmission, which is a very important key technology. First, the crop environment sensing data from the farm is used to This research was supported by the Department of Information Technology, Takming University of Science and Technology, Department of Electrical Engineering, National Chin-Yi University of Technology. The authors would like to thank the National Chin-Yi University of Technology, Takming University of Science and Technology, Taiwan, for financially supporting this research. REFERENCES [1] C. K. D. S. Rodrigues and V. Rocha, “Towards Blockchain for Suitable Efficiency and Data Integrity of IoT Ecosystem Transactions,” IEEE Latin America Transactions, vol. 19, no. 7, pp. 1199–1206, 2021. [2] K. Zhang, Z. Wang, L. Guo, Y. Peng and Z. Zheng, “An asynchronous data fusion algorithm for target detection based on multi-sensor networks,” IEEE Access, vol. 8, pp. 59511–59523, 2020. [3] J. Ren, J. Li, H. Liu and T. Qin, “Task offloading strategy with emergency handling and blockchain security in SDN-empowered and fog-assisted healthcare IoT,” Tsinghua Science and Technology, vol, 27, no. 4, pp. 760– 776, 2022. [4] F. Deng, Y. Huang, S. Lu, Y. Chen, J. Chen et al., “A multi-sensor data fusion system for laser welding process monitoring,” IEEE Access, vol. 8, pp. 147349–147357, 2020. [5] P. P. Ray, D. Dash, K. Salah and N. Kumar, “Blockchain for IoT-Based Healthcare: Background, Consensus, Platforms, and Use Cases,” IEEE Systems Journal, vol. 15, no. 1, pp. 85–94, 2021. [6] A. A. Sadawi, M. S. Hassan and M. Ndiaye, “A Survey on the Integration of Blockchain With IoT to Enhance Performance and Eliminate Challenges,” IEEE Access, vol. 9, pp. 54478–54497, 2021. [7] P. P. Ray, B. Chowhan, N. Kumar and A. Almogren, “BIoTHR: Electronic Health Record Servicing Scheme in IoT-Blockchain Ecosystem,” IEEE Internet of Things Journal, vol. 8, no. 13, pp. 10857–10872, 2021. [8] S. Sun, R. Du, S. Chen and W. Li, “Blockchain-Based IoT Access Control System: Towards Security, Lightweight, and Cross-Domain,” IEEE Access, vol. 9, pp. 36868–36878, 2021. [9] Q. Yang and H. Wang, “Privacy-Preserving Transactive Energy Management for IoT-Aided Smart Homes via Blockchain,” IEEE Internet of Things Journal, vol. 8, no. 14, pp. 11463–11475, 2021. [10]J. Zhou, G. Feng and Y. Wang, “Optimal Deployment Mechanism of Blockchain in Resource-Constrained IoT Systems,” IEEE Internet of Things Journal, vol. 9, no. 11, pp. 8168–8177, 2022. [11]C. Xu, Y. Qu, T. H. Luan, P. W. Eklund, Y. Xiang et al., “A Lightweight and Attack-Proof Bidirectional Blockchain Paradigm for Internet of Things,” IEEE Internet of Things Journal, vol. 9, no. 6, pp. 4371–4384, 2022. [12]M. R. Bataineh, W. Mardini, Y. M. Khamayseh and M. M. B. Yassein, “Novel and Secure Blockchain Framework for Health Applications in IoT,” IEEE Access, vol. 10, pp. 14914–14926, 2022. [13]S. M. Alrubei, E. Ball and J. M. Rigelsford, “A Secure Blockchain Platform for Supporting AI-Enabled IoT Applications at the Edge Layer,” IEEE Access, vol. 10, pp. 18583–18595, 2022. © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply. This article has been accepted for publication in IEEE Internet of Things Journal. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2022.3199735 > REPLACE THIS LINE WITH YOUR MANUSCRIPT ID NUMBER (DOUBLE-CLICK HERE TO EDIT) < [14]W. A. Mahrous, M. Farouk and S. M. Darwish, “An Enhanced BlockchainBased IoT Digital Forensics Architecture Using Fuzzy Hash,” IEEE Access, vol. 9, pp. 151327–151336, 2021. [15]E. A. Shammar, A. T. Zahary and A. A. A.-Shargabi, “A Survey of IoT and Blockchain Integration: Security Perspective,” IEEE Access, vol. 9, pp. 156114–156150, 2021. [16]K. Cai, H. Chen, W. Ai, X. Miao, Q. Lin et al., “Feedback Convolutional Network for Intelligent Data Fusion Based on Near-Infrared Collaborative IoT Technology,” IEEE Transactions on Industrial Informatics, vol. 18, no. 2, pp. 1200–1209, 2022. [17]X. Li, Q. Yu, B. Alzahrani, A. Barnawi, A. Alhindi et al., “Data Fusion for Intelligent Crowd Monitoring and Management Systems: A Survey,” IEEE Access, vol. 9, pp. 47069–47083, 2021. [18]F. Alam, R. Mehmood, I. Katib, N. N. Albogami and A. Albeshri, “Data Fusion and IoT for Smart Ubiquitous Environments: A Survey,” IEEE Access, vol. 5, pp. 9533–9554, 2017. [19]S. Kianoush, S. Savazzi, M. Beschi, S. Sigg and V. Rampa, “A Multisensory Edge-Cloud Platform for Opportunistic Radio Sensing in Cobot Environments,” IEEE Internet of Things Journal, vol. 8, no. 2, pp. 1154–1168, 2021. [20]H. Lin, J. Hu, X. Wang, M. F. Alhamid and M. J. Piran, “Toward Secure Data Fusion in Industrial IoT Using Transfer Learning,” IEEE Transactions on Industrial Informatics, vol. 17, no. 10, pp. 7114–7122, 2021. [21]S. Singh, A. S. M. S. Hosen and B. Yoon, “Blockchain Security Attacks, Challenges, and Solutions for the Future Distributed IoT Network,” IEEE Access, vol. 9, pp. 13938–13959, 2021. [22]L. D. Nguyen, I. L. Mayorga, A. N. Lewis and P. Popovski, “Modeling and Analysis of Data Trading on Blockchain-Based Market in IoT Networks,” IEEE Internet of Things Journal, vol. 8, no. 8, pp. 6487–6497, 2021. [23]A. Asheralieva and D. Niyato, “Throughput-Efficient Lagrange Coded Private Blockchain for Secured IoT Systems,” IEEE Internet of Things Journal, vol. 8, no. 19, pp. 14874–14895, 2021. [24]M. H. Chinaei, H. H. Gharakheili and V. Sivaraman, “Optimal Witnessing of Healthcare IoT Data Using Blockchain Logging Contract,” IEEE Internet of Things Journal, vol. 8, no. 12, pp. 10117–10130, 2021. [25]H. Liu, D. Han and D. Li, “Fabric-iot: A Blockchain-Based Access Control System in IoT,” IEEE Access, vol. 8, pp. 18207–18218, 2020. 3 Foundation. His research interests include Artificial Intelligence Internet of Things (AIoT), Wireless Sensors Network. (songchen@ncut.edu.tw) Sung-Jung Hsiao is working with the Department of Information Technology, Takming University of Science and Technology as an associate professor. He received the BS degree in electrical engineering from the National Taipei University of Technology, Taiwan, in 1996 and the MS degree in computer science and information engineering from National Central University, Taiwan in 2003. Ph.D. degree in department of Electrical Engineering, National Taipei University of Technology, Taiwan in 2014. He has had the work experience of research and design at the famous computer company of Acer Universal Computer Co., Mitsubishi, and FIC. (sungjung@gs.takming.edu.tw) Wen-Tsai Sung is working with the Department of Electrical Engineering, National Chin-Yi University of Technology as a professor and Dean of Research and Development. He received a PhD and MS degree from the Department of Electrical Engineering, National Central University, Taiwan in 2007 and 2000. He has won the 2009 JMBE Best Annual Excellent Paper Award and the dragon thesis award that sponsor is Acer © 2022 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. Authorized licensed use limited to: REVA UNIVERSITY. Downloaded on September 29,2022 at 08:34:51 UTC from IEEE Xplore. Restrictions apply.