# Efficient Load Balancing for Blockchain-Based Healthcare System in Smart Cities
## 3 System Model  
The patient's healthcare data collected through multiple healthcare sensors are forwarded directly to the load balancing node. To convert this data block as a member of the blockchain, a unique nonce value to determine the hash value within a specified range is required to be computed. To efficiently compute a specific nonce value, the load balancing node forwards these data blocks to one of its directly connected fog mining nodes by applying a load balancing algorithm. Each fog mining node fetches one of the data blocks placed in its cache to compute nonce. Mining nodes compute nonce by generating random numbers to meet the specified conditions. The successful data block with a nonce value is sent back to the load balancer to become a part of the blockchain and forwarded to the healthcare center for necessary action through the internet cloud. We assume that nonce computing tasks are transmitted using traditional cryptographic schemes and the security for the transmission of these tasks is not the focus of this paper.  
In this work, we considered three different severity levels of a varying number of patient data, such as high-risk patient data, moderate-risk patient data, and low-risk or routine patient data. Each of these patient data is treated separately and is required to be sent to the centrally placed healthcare system of a smart city. These patients' data are forwarded to one of the sparsely placed load balancing nodes that are backwardly connected with multiple fog mining nodes. A load-balancing node randomly receives a varying number of data requests that are required to be forwarded to one of its neighboring mining nodes by considering patient data severity and the load on the mining fog computing nodes. Each mining node has a uniform caching capacity to store a data block before computing its nonce value that meets the specific conditions.  
There are \(Y\) healthcare application networks placed in different localities of a smart city. Each healthcare network \(Y_{j}\) comprises three different severity levels of patient data and are categorized as \(h_{ls}\), \(h_{ms}\), and \(h_{hs}\) as low, medium, and highly sensitive data, respectively. Each \(Y_{j}\) consists of \(X\) number of fog mining nodes and each \(X_{i}\) fog mining node has \(N\) number of blocks. If \(N_{ls}\), \(N_{ms}\), and \(N_{hs}\) are the total number of low, medium, and highly sensitive types of data blocks, respectively, which are received by all fog mining nodes, then they are computed in Equations (1)-(3) as  
\[N_{ls}=\sum_{j=1}^{Y}\sum_{i=1}^{X}N_{ij}(h_{ls}) \tag{1}\]  
\[N_{ms}=\sum_{j=1}^{Y}\sum_{i=1}^{X}N_{ij}(h_{ms}) \tag{2}\]  
\[N_{hs}=\sum_{j=1}^{Y}\sum_{i=1}^{X}N_{ij}(h_{hs}) \tag{3}\]The total number of data blocks (\(N_{DB}\)) received by all fog mining nodes placed in a smart city is calculated as:  
\[N_{DB}=N_{ls}+N_{ms}+N_{hs} \tag{4}\]  
The patient's data are forwarded directly from the patient to the central load-balancing node using wireless communications, such as 5G. Similarly, the data from the the load-balancing node to the mining node also use 5G communications.  
We assume that there are multiple channels available between the load balancing node and healthcare patients' data nodes to transmit all required data blocks simultaneously without considering any queuing delay. Similarly, there are multiple channels between load-balancing nodes and fog-mining nodes. A complete system model is shown in Figure 2.