# Efficient Resource Allocation in Blockchain-Assisted Health Care Systems
## 4 Proposed Technique
### Allocation of Data Blocks to Mining Machines
#### 4.2.1 Algorithm for Load Balancing
Each result comprised three subplots and were categorized as high-priority, medium-priority, and low-priority patient data blocks, as shown in Figures 5-8. The data blocks were equally divided into three different categories with varying sizes. Figure 4: Percentage of blocks assigned against varying numbers of mining nodes. Figure 3: Number of blocks assigned against the different data block requests. The results shown in Figures 5 and 6 were obtained for the allocation of data blocks of different priority levels when the LBM had a fixed number of data blocks, and it had to allocate these data blocks to different numbers of fog mining nodes. The allocated data blocks with the different numbers of fog mining nodes were expressed in numbers, as well as in percentages, as shown in Figures 5 and 6, respectively. There were 30 data blocks of varying sizes that were equally distributed in the three categories. The allocated data blocks with a varying number of mining nodes are shown in the three subplots. The graphs shown in Figure 5 highlight that the proposed technique allocated seven blocks of data with highest priority, as compared to six ad two high-priority data blocks allocated by the \(DS_{SHS}\) and round-robin algorithms, respectively, when there was only one mining node. However, for medium- and low-priority data blocks, round-robin performed better because it does not consider priority levels. However, when the number of mining nodes was increased, then the proposed scheme allocated all blocks of data with high priority and it's allocation of medium-priority data blocks was higher than the other two schemes. Both \(DSP_{SHS}\) and \(ESM_{HCS}\) allocated data blocks by considering their priority levels. However, the proposed \(ESM_{HCS}\) allocated more priority data blocks to mining nodes as compared to \(DSP_{SHS}\) within the same caching capacity of fog mining nodes.The same trend was presented in terms of percentage, as shown in Figure 6.

Figure 5: Number of computed nonces with a varying number of mining nodes. Figure 6: Percentage of allocated blocks with a varying number of mining nodes. Figure 7: Percentage of allocated blocks with a varying number of data block requests. To validate the performance of the proposed \(ESM_{HCS}\), the data block allocation to mining nodes was observed with an increasing number of data blocks on three mining machines. The number of allocated data blocks, along with their percentages, are shown in Figures 7 and 8, respectively. The results of the allocated blocks of data with different priorities are represented in three subplots, and the number of data block requests was divided equally into the three different priority levels and increased from 15 to 90, with an increment of 15. It can be seen that the proposed technique allocated the highest number of blocks of data with high priority, as compared to the round-robin and \(DSP_{SHS}\) algorithms. When the LBM received 15 block requests, with 5 each for each priority level within the caching capacity of the mining nodes, then all blocks were allocated to mining nodes using all three schemes. However, when the number of requested data blocks was increased to 30, with 10 for each priority level, then the proposed scheme, as well as \(DSP_{SHS}\), allocated all high-priority blocks; however, the proposed scheme allocated more medium- and low-priority blocks compared to \(DSP_{SHS}\). On the other hand, the round-robin scheme allocated an almost equal number of data blocks to each priority level. Similarly, with an increased number of data block requests received by the LBM, the proposed scheme showed better performance in data block allocation, due to the use of the \(0/1\) knapsack algorithm. ## 6 Conclusions

In this paper, we present an efficient resource allocation technique for mining nodes in blockchain-assisted health care systems. The proposed technique serves two purposes, the first is to efficiently select a fog mining node for the computation of the mining task.