Research Article

A Data Collection Strategy for Heterogeneous Wireless Sensor Networks Based on Energy Efficiency and Collaborative Optimization

Algorithm 1

Pseudocode of cluster head selection strategy.
(1)Step 1: initialization of clustered data collection
(2)Step 2: select the cluster head
(3)net = net(X(n), M)//Create SOM, X(n) is the input vector, M is the number of neurons
(4)ISSA-SOM(, , n, N )//Set parameters and variables, , are the weight, n is the number of training times, N is the number of network training times
(5) for i, j in(M, n)//Set variable
(6)  {if j == 0//initialization
(7)
(8)  else }
(9) for k, l in(M, n)//initialization
(10)  {if (k == l)  = 1
(11)  else
(12) for (i = 1, i < M, i++)
(13)  {Call Distance ()
(14)Call Energy()
(15)Call Countnodenumber ()//Count the number of neighbor nodes
(16) Broadcast(Dis, Ei, Ni)//The node transmits the distance to the base station Dis, the node’s remaining energy Ei and the number of neighbor nodes Ni to the base station
(17)for i, j in(M, n)
(18)
(19)yk(0) = f1(s)//Calculate the output result of the input layer }
(20)for (i = 1, i < M, i++)
(21)for (j = 1, j < N, j++)
(22){call OutputVector()//Calculate the result of the output layer }
(23)if(The output results meet the expected requirements)
(24){ Cluster-head = output()//The output result represents the set of heterogeneous sensor nodes selected as the cluster head
(25)//Update the weight vector }
(26)else
(27) { n1 = n1 + 1
(28)goto step 20 }
(29)goto step 14
(30)else end net()//End cluster head selection
(31)Step 3: the formation of clusters is calculated by the number of clusters.
(32)Step 4: data transfer between clusters.
(33)Step 5: stable network operation.