Keywords

1 Introduction

Due to the rapid development of the society, life pressure is becoming more and more severe. Overloaded workload and unhealthy living habits make people in mounting numbers become sub-healthy. The health problem has become the focus of people’s attention. According to the statistics of the World Health Organization in 2020, an estimated 41 million people died of non-communicable diseases (NCDs) globally in 2016, accounting for 71% of the total deaths. It is mainly caused by four diseases: Cardio-cerebrovascular disease, 17.9 million; Cancer, 9 million; Chronic respiratory disease, 3.8 million; Diabetes, 1.6 million. Therefore, if chronic diseases are not controlled in time and effectively, serious social and economic problems will be caused. Although chronic diseases may cause serious consequences, if patients can be monitored scientifically and effectively with vital signs, many major chronic diseases can be predicted and treated in advance.

A large number of miniature sensors embedded or implanted in the human body constitute WBANs [5]. Body area networks can be used in many ways, such as health monitoring [6], fitness [7], smart cities [8], and many IoT applications [9, 10]. Based on WBAN technology, real-time, convenient and all-weather health monitoring can be realized by installing sensors on or inside the body surface of patients that can automatically collect vital signs such as ECG, EEG, EMG, temperature, blood sugar and blood pressure. Research on wireless body area networks is still in its early stages, and the inefficient use of node energy resources has become a bottleneck restricting the development of WBANS.

Based on the collaborative routing algorithm of data priority, this paper studies the energy consumed by each node from a fixed node to the sink node, so as to make efficient use of energy.

2 Algorithm Design

In the actual application of WBANs, each node needs to rely on battery power, and most nodes are relatively static. Therefore, the following assumptions are proposed for collaborative routing algorithm based on data priority:

  1. 1.

    Except for a few nodes, the other nodes are relatively static, and the sink node can receive the data information transmitted by other nodes;

  2. 2.

    In a sensor network, the energy of the sink node is infinite, and the initial energy of the remaining nodes is the same;

  3. 3.

    After each round of communication, each node calculates the current remaining energy value;

  4. 4.

    All nodes have equal status and the same computing power to support computational routing and signal processing.

  5. 5.

    When the node energy is lower than a certain value, the node dies.

The algorithm is described as follows:

  1. 1.

    Build a network. Randomly distribute wireless sensors in a certain area, and the coordinate position of each node \(i\) is \((x_i {,}y_i )\);

  2. 2.

    According to the priority of the data in a fixed node, find the maximum number of hops allowed for the data from sending to receiving;

  3. 3.

    Within the range of the maximum number of hops, find all energy consumption paths from a certain fixed node to the sink node.

  4. 4.

    According to the F algorithm (Floyd), on the basis of all the paths obtained in the third step, find the path with the least energy consumption;

  5. 5.

    The algorithm ends when the fixed node dies.

F algorithm principle.

When calculating the shortest path of each vertex in the graph \(G = (V{,}E)\) through the F algorithm, an adjacency matrix \(S\) needs to be introduced. The elements \(a[i][j]\) in matrix \(S\) represents energy consumption from vertices \(i\) (\(i\) th vertex) to \(j\) (\(j\) th vertex).

Assuming that the number of vertices in graph \(G\) is \(N\), the adjacency matrix \(S\) needs to be updated \(N\) times. Initially, the energy consumed by vertex \(a[i][j]\) in the adjacency matrix \(S\) is the weight from vertex \(i\) to vertex \(j\);If \(i\) and \(j\) are not adjacent, then \(a[i][j] = \infty\).And we start updating the adjacency matrix \(N\) times. The first update, if the energy consumption of \(a\left[ i \right]\left[ j \right] > a\left[ i \right]\left[ 0 \right] + a\left[ 0 \right]\left[ j \right]\)(\(a\left[ i \right]\left[ 0 \right] + a\left[ 0 \right]\left[ j \right]\) means “the energy consumption by the first vertex between \(i\) and \(j\)”), then \(a\left[ i \right]\left[ j \right] = a\left[ i \right]\left[ 0 \right] + a\left[ 0 \right]\left[ j \right]\).

In the same way, the \(k\) th update, if the energy consumption of \(a\left[ i \right]\left[ j \right] > a\left[ i \right]\left[ k \right] + a\left[ k \right]\left[ j \right]\), then \(a\left[ i \right]\left[ j \right] = a\left[ i \right]\left[ k \right] + a\left[ k \right]\left[ j \right]\). After \(N\) updates, the operation is completed.

Fig. 1.
figure 1

A network

In a network, Fig. 1 shows the energy consumption relationship of each node.

Fig. 2.
figure 2

Adjacency matrix

The adjacency matrix generated by the F algorithm is Fig. 2.

Fig. 3.
figure 3

Pass Node 1

Fig. 4.
figure 4

Pass Node 1, 2

Fig. 5.
figure 5

Pass Node 1, 2, 3

Fig. 6.
figure 6

Pass all nodes

In the case that only vertex 1 is allowed to pass through, the minimum energy consumption between any two points is updated as Fig. 3; If only vertices 1 and 2 are allowed to pass through, the minimum energy consumption between any two points is updated as Fig. 4; Similarly, when only vertices 1, 2, and 3 are allowed to transit, the minimum energy consumption between any two points is updated to Fig. 5; Finally, all vertices are allowed to be used as a transit, and the final minimum energy consumption between any two points is Fig. 6.

Therefore, when the sensor nodes of WBAN transmit information according to the path of F algorithm, the energy consumed is the least, which can greatly reduce the overall energy consumption of WBAN, and thus we can efficiently utilize the energy resources of the network.

3 Simulation Environment

In short-distance free space communication, the transmission power domain is proportional to the transmission distance. So energy consumption can be expressed as \(E = \lambda d^2\), \(\lambda\) is a fixed parameter. (Fig. 7 and Fig. 8).

Fig. 7.
figure 7

The hops set according to data priority

Fig. 8.
figure 8

Experimental parameters

Since it is a simulation verification of the WBAN routing algorithm, the position of each node on the human body does not need to be accurately measured, only needs to be defined by itself according to the approximate ratio. In order to facilitate the comparison of the position and distance between the various wireless sensors, the distance of each node is enlarged in equal proportion and rounded to facilitate the comparison of the multiple relationship between the various distances. According to the distribution of sensor nodes on the human body, the position coordinates of each wireless sensor node are now defined according to Fig. 9.

Fig. 9.
figure 9

Node coordinates

The position of each body node is shown in Fig. 10.

Fig. 10.
figure 10

Position of each body node

Due to the movement of the human body, the sink node 14 may not receive the information of the node 10 or the node 9.

4 Simulation Results

First, data packets with priority 1, 2, 3 and 4 are randomly input to node 1. Simulation results of energy consumption of each node are shown in the figure below.

Fig. 11.
figure 11

Energy consumption of each node

As can be seen from Fig. 11, node 7 has the fastest energy consumption, while nodes 2, 3, 9 and 13 have no energy consumption. The remaining energy of nodes 4, 5, 10 and 12 remains unchanged for a period of time because the priority of the data changes. The energy of nodes closer to node 1 is consumed first. The nearest or farthest node is consumed at last.

The packets of priority 1 and 2, priority 3 and 4, and priority 1, 2, 3 and 4 are sent to node 1 respectively. The life cycle of the whole network is as follows:

Fig. 12.
figure 12

Network life cycles of different priorities

It can be seen from Fig. 12 that when node 1 sends data packets with data priorities 1, 2, 3, and 4, the whole network has longer lifetime.

5 Conclusion

When node 1 sends data packets with priority 1, 2, 3, and 4, the lifetime of the entire network is longer than that of sending only packets with priority 1 and 2, and priority 3, and 4. However, when node 1 dies, most of the energy of some nodes is not consumed, which needs to be improved in future studies.