AN EFFICIENT INTELLIGENT ALGORITHM BASED ON WSNs OF THE DRUG CONTROL SYSTEM

Preliminary communication A new algorithm, ACORS-ANNDPF for WSNs, is proposed in this paper to improve the utilization rate of WSNs and prolong the life cycle of the IoT. Developed on the basis of ant colony algorithm, the improved algorithm is applicable to the selection of the optimal path and identification of the optimal routing node in the case of losing the routing node. To reduce the time spent on transferring network packets, the indices are selected by the neural network algorithm in light of the actual application environment and adjusted to optimize the fusion of packet data. After that, the author carries out several simulation experiments and compares the proposed algorithm with other algorithms. The results demonstrate that the proposed algorithm ensures high energy efficiency and balanced energy consumption. Therefore, it is concluded that the proposed algorithm can improve network utilization rate and lead to better network transmission performance.


Introduction
With the development of radio frequency identification (RFID), sensing technology, storage control, wireless network, data acquisition, sensor technology and the GPS, the Internet of things (IoT) has enjoyed extensive use and attracted the interests of researchers in various fields [1,2], such as Industry 4.0, aerospace, military reconnaissance, environmental monitoring, medical health, transportation, smart city, smart factory, smart home, to name but a few.The purpose of the IoT is to link up the sensor network and the Internet, and realize the interconnection between human and things through the connection between the things.In fact, the IoT has become the basis of information interaction as it transmits more information than computer or other carriers.Besides, key technologies are involved in all layers of the IoT, namely the perception layer, network layer, application layer and interface layer [3,4].
An essential component of the IoT is the wireless sensor networks (WSNs).The IoT and WSNs are inseparable.WSNs is the main way of the IoT to percieve and transmit information [5], while the concept of IoT is based on the development of WSNs.Therefore, the research of WSNs means a lot to the development of the IoT [6].This paper selects energy efficiency as the focus of the research of WSNs, aiming at saving the overall energy consumption and improving network utilization of WSNs.That is because energy saving is conducive to environmental protection and CO 2 emission reduction and consistent with the spirit of "green networks" proposed by many experts [7,8].
The past few years have seen great progress in the research on energy consumption and utilization efficiency of WSNs.Probing into ten most common MAC layer protocols of WSNs, some experts draw the conclusion that improved MAC protocols have limited capabilities, and it is necessary to strike a balance between efficiency and performance [9,10].Wendi B. et al. mention the use of LEACH protocol to gather data from target nodes by zones through the selection of cluster head of the IoT [11].However, the method is likely to cause imbalance of energy consumption between the cluster heads and nodes.Donggook Kim et al. propose to take the data fusion approach to improve efficiency and reduce energy consumption [12], but their method fails to eliminate the energy hole.Jalel et al. put forward energy efficient and QoS based routing protocol, which maximizes the network lifetime by balancing energy consumption across multiple nodes.However, the performance metrics of the protocol is affected by the network size, path length, and buffer size [13].Iwanicki et al. apply the dynamic allocation of spectrum technology and the limited spectrum allocation to the utilization of sensor node, but the lack of intelligent learning function is highly likely to cause a waste of spectrum [14].Literature [15] presents a new Bayes variable frequency algorithm based on the 802.15.4 protocol.Although it mitigates collision, saves energy, reduces the network traffic, there is still a probability of spectrum waste.To sum up, the improved protocols or strategies are capable of achieving the optimal efficiency in a certain time period or a certain state of WSNs.Nevertheless, as time goes, the protocols or strategies are not necessarily the optimal ones.In the later stage, they might cause great energy waste and consumption and the death of a lot of sensor nodes of WSNs.
This paper presents an intelligent path optimizationdata packet fusion algorithm for high efficiency and low energy consumption.Targeted at optimizing the energy consumption, the author constructs an intelligent optimization model with indices like actual use, constraints, and intelligent learning, and expects to get the best path and the maximum network utilization rate for improving the efficiency of WSNs.The remainder of this paper is organized as follows: Section 2 reviews relevant theoretical research on ant colony algorithm, introduces the improved algorithms and the data packet fusion algorithm based on artificial neural network, and describes the strategies for applying the algorithms to WSNs.Section 3 presents the ant colony optimization route selection-artificial neural network data packet fusion (ACORS-ANNDPF) algorithm, and puts forward the application process of the algorithm by taking the IoT of drug control system as an example.Section 4 verifies the performance of the proposed algorithm by analyzing the results of the simulation experiment with the network simulation tool.Section 5 gives the conclusion and prospect of the research.

Relevant theoretical research
The IoT of drug control system involves many aspects, which are dynamic or static, extrinsic or intrinsic [16].In this large, complex and diverse IoT, there are many factors that affect the network transmission channel, packet size, data quality, delay, etc. Ranging from human, environment, time, sudden incidents to emergency tasks, the influencing factors increase the complexity of the IoT of the underlying structure in the drug control system.As an important data acquisition and transmission mode of the IoT, WSNs can improve the efficiency to a great extent.If an intelligent algorithm is proposed to make decisions according to the actual state of WSNs, it would be able to choose the optimal path and the best data transmission mode, thereby increasing single node utilization rate, easing the data congestion, reducing the data traffic volume, cutting the energy consumption and lengthening the network life.For the purpose of improving network utilization, this paper proposes an improved ant colony algorithm to select the most energy efficient path and the best packet fusion mode in light of the actual situation.
The principle of the algorithm goes as follows:

Ant colony algorithm
Ant colony algorithm is a simulation algorithm derived from the foraging behaviour of ant colony in nature.Thanks to the clear division of labour and flexible organization, the ant colony can complete complex tasks that a single ant is too weak to perform.Each ant of the colony does its duty and assists each other.Researches show that the ants leave a volatile substance called pheromone on the path during the foraging process.The ants that come later tend to select the path with a high concentration of pheromone.Over the time, the shorter paths attract more and more ants due to the high concentration of pheromone, while the longer paths attract much fewer ants.Eventually, the optimal path would accumulate more pheromones than any other paths.Inspired by the ants' behaviour, researchers develop an artificial intelligence algorithm called the ant colony algorithm [17,18].

The basic ant colony algorithm and research
First proposed by the Italian scholar Dorigo, the ant colony algorithm is used to solve the classical TSP problem [19,20] and the optimal combination problem.The algorithm mainly has the following advantages: positive feedback, robustness, dynamic adaptability and so on.Based on the TSP, Dorigo also establishes a model for the ant colony system, which is designed to find the shortest path.The model is expressed by Eq. (1): In the above formulas, ρ is the pheromone evaporation coefficient, 1− ρ is the residual pheromone, m is the number of ants in the colony.
In the above formula, Q is a constant illustrating the total amount of pheromone released by an ant on all the if the k th ant uses edge (i, j) between t and t+n otherwise paths it passes through in a traversal, and L k is the total length of the paths covered by the k th ant in the cycle.
The application of the ant colony algorithm to the WSNs is mainly aimed at finding a suitable path between information collecting nodes and the sink node.Apart from saving energy and lengthening the network life, the path must be the shortest and most efficient one.There are significant correlations between the ant colony algorithm and WSNs.Firstly, the fundamental characteristic of the ant colony algorithm is the routing mechanism, while every node of WSNs can serve as a routing node.In WSNs, the nodes transmitting large amounts of data are the first to run out of energy, and the energy of other nodes is wasted.The routing mechanism of the ant colony algorithm helps strike a balance between the nodes on energy consumption.In this way, more nodes are involved in data transmission, and the life of WSNs is lengthened [21].Secondly, the energy depletion of wireless sensor nodes causes dynamic changes to the routing nodes, while the pheromone evaporation coefficient of the ant colony algorithm can change with the external environment.Finally, because of the weak mathematical foundation, the ant colony algorithm can be improved easily in application for better convergence.Thus, the ant colony algorithm is very suitable for application in WSNs [22].

Ant colony algorithm improvement strategies
For WSNs, the ant colony algorithm still has some limitations.After all, the intelligent algorithm does not need to consider the energy consumption after each ant reaches the target path.However, all the protocols and algorithms for WSNs are improved based on energy consumption.Therefore, the ant colony algorithm must be improved before it is applied to WSNs.Below are three improvement strategies. (

1) The improvement of heuristic function ij h
The ant colony algorithm should take into account energy consumption.The wireless sensor nodes consume energy in three processes: sending, receiving, waiting for the storage.On this basis, the heuristic function ij h is improved as follows: In the above formula, i is the node of the data packet; j is the possible node of the next hop; m is the total number of nodes that can be reached from node i in the next hop; E I is a constant indicating the initial energy of node j; Functions E S (j), E R (j) and E W (j) are respectively the energy consumption of the sending, receiving, and waiting for storage processes.It can be seen from the formula that the higher the value of the heuristic function ) ( ij h , the more residual energy of a node, and the more likely the node is chosen as the node in the next hop. (2) The improvement of pheromone of the ant colony algorithm should also be improved.The improvement accelerates the convergence of the algorithm and the search for the optimal solution, and speeds up the finding of an energy-saving and efficient path.Eqs. ( 2) and ( 3) are retained for the pheromone updating formula, but the formula t Δ need to be improved as follows: The above formula makes improvement in accordance with the ant colony system with elite strategy.The basic principle is to find the optimal solution among the paths which have been covered, apply the optimal solution to the current path so that the current solution has better convergence [23].E min is the path with minimal energy consumption among all the paths covered by ants before k.E c (j) is the energy consumed if node j is chosen for the next hop at node i; E avg (i) is average energy consumption of the k th ant from the initial node to node i.
ω and 3 ω are the corresponding weights, which reflect the importance of the three energy functions.
From the above formula, it can be inferred that the algorithm converges faster and the optimal solution is easier to find if the pheromone is updated for each ant on every hop.In other words, the improved ant colony algorithm can select the best path based on the residual energy consumption, thereby extending the life cycle of the whole WSNs.

Data packet fusion algorithm based on artificial neural network
Artificial neural network is a mathematical calculation method designed to imitate the learning process of the neural cells in human brain.It is characterized by strong nonlinear processing ability, good error tolerance, excellent associative memory, and powerful ability of adaptive learning [24].Neural network is widely used because it is simple in structure, easy to use and adaptive to environmental changes.To improve network utilization rate, this paper looks for proper data packet fusion mode by the artificial neural network and in light of the actual influencing factors [25]. (

1) Data packet fusion in WSNs
After receiving data, the routing node of the WSNs usually sends out the data directly.Common as it is, the practice actually increases the load of the network and leads to frequent conflicts between data packets.If the routing node can wait for the packet size to reach a certain limit before sending it out, the number of small packets in the WSNs would be much smaller and the network utilization would be greatly improved.To put it in another way, the routing node, in this case, gathers several small packets and combines them into a large one.As displayed  In this figure, the hollow node is the data acquisition node; the solid black node is the routing node; the red node is the sink node.The figure depicts the data transmission from four data acquisition nodes to the sink node.If real-time property is not necessary, the sink node can go through the "waiting-storage-fusion-forward" process for the data collected from the four data acquisition nodes.The practice can improve the utilization of the channel.In the IoT of drug control system, however, the data transmission is affected by various factors, such as human, the environment, etc.For instance, the node represented by the dotted line is used to collect the information of inspectors, temperature, humidity, etc.The information has a high demand of timeliness, and should be transmitted immediately once it arrives at the sink node.Therefore, in the data packet fusion of WSNs, the fusion mode should be adjusted according to the influencing factors so as to meet the actual needs and improve network utilization.In this paper, the neural network is selected to adjust the data packet fusion mode.

(2) Data packet fusion algorithm based on artificial neural network
The topological structure of the artificial neural network model consists of three layers: input layer, hidden layer and output layer.The input layer contains the possible inputs of a transmission channel in WSNs, the hidden layer contains the various influencing factors (the value range is [0, 1]).The output layer contains the final results.Fig. 2 illustrates the three layers: In the figure above, the input layer has different packet lengths and durations.The two factors are collectively known as the fusion mode.
If n is the number of selectable fusion modes and n x is the residual energy after using the n-th fusion mode, the input layer is expressed as

=
. The hidden layer can be regarded as a set of various influencing factors.The values of the factors are constantly changing.The specific number of influencing factor k should be determined according to the specific needs.Each factor has a corresponding weight, denoted as k w .As the result of the input layer, the output layer is expressed as

=
. By comparing the results of the output layer, the maximum value should be taken as the optimal solution.The formula is shown below: In the above formula, y is the output layer, x is the input layer, w is the weight of the influencing factor in the hidden layer, and θ is the threshold.The threshold is calculated by the Eq.(8).
In the IoT of drug control, a variety of fusion modes are available according to the fusion period, length, and size of data packets.These modes are considered to be the values of the input layer.The influencing factor of the intermediate layer is selected by experience.The mode corresponding to the results of Eqs. ( 7) and ( 8) is regarded as the optimal mode for the data fusion at the node.

Practical scenarios and procedures of the algorithm 3.1 The IoT based on the drug control system
The IoT of the drug control system is mainly divided into the following categories: sample whole-process management system, lab data acquisition system, lab environmental monitoring system, drug control staff management system, instrument and equipment monitoring and management system, document management system, and fire control system.To gather information from so many systems, the staff should make full use of all sorts of sensing technologies and deploy various types of multi-function sensors.Different sensors percept different information sources, which vary on information format and content.Therefore, the network of the IoT of the drug control system should be constructed in full consideration of the actual scenarios.See Fig. 3 for its structure.
In the figure, the perception layer of the IoT of the drug control system lies in the bottom.This layer converts information in the physical world into digital information.The source information includes images, statistics, videos, barcodes, RFID, texts, ELN, etc. Different types of information require different types of sensors.With different real-time properties and data packet sizes, the data gathered are transmitted in the same network.
The second layer is WSNs.This layer is mainly used to transmit the data gathered by the sensor nodes to the sink node.Most of the nodes in this layer are routing nodes.All the information collected by the sensors can be transmitted through the WSNs, but the timeliness differs from case to case.Thus, there is no universal data packet fusion mode for all kinds of data transmission.The top layer is cloud computing of drug control (CCDC).This layer mainly classifies, processes, and analyses the data information of the sink node so that the user can find the required data quickly from the platform.The sink node is connected to the CCDC via an internal high-speed network.There are also intermediate interface layers between the three layers which are designed to ensure the docking of equipment with the IoT of the drug control system.
Figure 3 The IoT of the drug control system

The principle of ACORS-ANNDPF algorithm
The proposed ACORS-ANNDPF algorithm is based on the WSNs in the IoT of the drug control system.The algorithm is divided into two parts: the ant colony optimization route selection and artificial neural network data packet fusion.The former uses the improved ant colony algorithm to select the optimal path, i.e. the group of WSNs routing nodes with the highest residual energy.To select the optimal route, the ant cycle model is adopted to enhance the convergence of the algorithm, relevant indices of energy consumption are added to the heuristic function to enhance the exploration ability of the ant colony, and the pheromone is weighted to find the optimal solution more quickly.Based on specific scenarios of the bottom layer in the IoT of the drug control system, the latter identifies different factors and assigns weights to these factors.In light of the optimal path selected in the first part, the set of values obtained from the multiple fusion modes in the normalized data packets are taken as the inputs.Then, the algorithm of artificial neural network is operated with the weights of the factors.The calculation results are the outputs.Finally, through the comparison of the outputs, the optimal value is taken as the optimal data packet fusion mode.

The procedures of the algorithm
The optimal path should be determined in accordance with the above-mentioned principle and the actual scenarios.The optimal data packet fusion mode should be selected on the basis of the optimal path.The procedures of the algorithm are defined as follows: Step 1: Initialize the relevant indices, including a , β , ij t , ij h and m (total number of ants), and use the radio broadcast recognition to identify the surrounding wireless sensor nodes, the neighbour nodes, the length of the paths between the nodes, the residual energies of the paths to the sink node, etc.
Step 2: Carry out traversal search of each existing path by the traversal search function of the ant colony algorithm.At t+n, the traversal completes, i.e. all the ants have completed a traversal.Solve each path between data collection nodes and the sink node by Eq. (1) to find the path with minimum energy consumption, and take it as the optimal path.
Step 3: After a period of time, obtain min E , c E and avg E , and assign 1 ω , 2 ω and 3 ω corresponding values.
Use Eqs. ( 5) and ( 6) to update heuristic function and pheromone.Traverse all paths again according to the changes of the heuristic function and pheromone.
Step 4: Repeat Steps 2 and 3 until the data transmission is complete; Step 5: Based on the optimal path determined by the improved ant colony algorithm, sort the data packet fusion modes of the optimal path in descending order, define them as set X of the input layer, and map the set items to different values.
Step 6: Build the hidden layer through the analysis of the actual conditions of the various factors, and assign weights to all factors.
Step 7: Initialize neural network indices.Calculate the threshold θ by Eq. ( 8), and the output value set Y by Eq. ( 7).Make a comparison to get the maximum value y i .The input layer x i corresponding to the value is the best data packet fusion mode of neural network.Keep observing the influencing factors.If there is any change, repeat steps 6 and 7 until the data packet transmission is complete.

Network simulation experiment and data analysis 4.1 Network simulation tool and experimental environment
Network simulation is a common tool to study computer technology.Through reliable and objective simulation, network simulation fully demonstrates the advantages and disadvantages of the new network design, helps reduce the investment, and discloses the problems in the design [26].
There are many types of network simulations, namely OPNET, NS2, Qualnet, Tinyos and so on.This paper adopts NS2 as the simulation tool.As open-sourced and free software, NS2 has many advantages.It takes a short time to develop and simulate network environment.With the codes written in C++, it is convenient to revise and add protocols, and to find and modify bugs.More importantly, the simulated data are highly recognizable [27].
For the purpose of saving energy and lengthening the life cycle of the network, this paper mainly explores the optimal route selection method and the optimal data packet fusion mode in WSNs.Route selection and packet fusion happens in the routing layer.In WSNs, the routing layer generally uses the AODV protocol.Thus, this paper adds ACORS-ANNDPF algorithm according to the rules of NS2, and configures the experimental environment as follows: The operating system is LINUX.The kernel is 2.4.20-31.9.NS2 version is 2.34.WSNs protocol is 802.15  The above figure is the instance graph, which displays the whole process of data packet sendingreceiving-dropping. In total, there are 125 nodes.These nodes can serve as both information collection nodes and routing nodes.The data packet traffic is analogized with CRB's NS2.

Experimental data analysis
The experimental data of this paper is obtained by the tracing function of the simulation tool NS2.Each time, a trace file with the suffix*.tr is generated.The author uses the gawk program to extract the required contents from the *.tr file, such as time, node name, energy, data packets, etc.Finally, the author uses gnuplot to draw graphics, and combines several experimental graphics into one.

(1) Comparison of packet reception rate
Packet reception rate is an important indicator of the network performance.The higher the packet reception rate, the better the network performance.Packet reception rate is usually associated with the packet length and transmission frequency.This paper compares the packet reception rate of AODV protocol with that of ACORS-ANNDPF in the scene introduced in Section 4.1.All nodes are connected to the sink node (the 0 node) through the IoT or WSNs.The ACORS-ANNDPF algorithm may have dependence on environmental factors.The factors directly affect the fusion of the data packets.The effect on data packet fusion increases with the number of these factors.The main factors are task, human, environment, time, equipment, etc.In this paper, the weights of the influencing factors are determined by the AODV protocol and ACORS-ANNDFP algorithms for three times.Four experiments are conducted based on the three different sets of weights.See Tab. 1 and Fig. 5 for the weights allocation and experimental results.AODV is an ondemand plane distance vector routing protocol.The routing table is updated constantly by the periodic routing information between nodes, which displays the network topology and changes.The three ACORS-ANNDPF algorithms, ACORS-ANNDPF-1, ACORS-ANNDPF-2 and ACORS-ANNDPF-3 are three different packet fusion forwarding rules applied after the route selection by improved routing ant colony algorithm.ACORS-ANNDPF-1 is influenced by all the factors.All the data packets need to be forwarded immediately when they arrive at the routing nodes.The algorithm only uses the route selection function of the improved ant colony algorithm.In ACORS-ANNDPF-2, half of the data packets are fused, and other half are forwarded in real time.In ACORS-ANNDPF-3, all the data packets are forwarded after they are fused to a certain condition.The experiment indicates that, in the early stage when 2000 data packets are sent, ACORS-ANNDPF has similar performance with AODV.When 3000÷4000 data packets are sent, ACORS-ANNDPF-1 receives fewer data packets than AODV.This is because a number of data packets are consumed as ACORS-ANNDPF needs to select the optimal path or measure the residual energy by the ant colony algorithm.As time goes, the optimal path is selected, the residual energy is determined and the data packets are fused.Thus, the superiority of ACORS-ANNDPF becomes more and more obvious.When the number of data packets sent through the network reaches 5500, the acceptance rate of AODV is 53 %, that of ACORS-ANNDPF-1 is 62 %, that of ACORS-ANNDPF-2 is 68 %, and that of ACORS-ANNDPF-3 is close to 81 %.With data packet fusion, the last two algorithms ease the load of network, reduce the overall number of packets, and improve the network utilization.This indicates that ACORS-ANNDPF algorithm helps improve the efficiency of WSNs.(The ACORS-ANNDPF algorithm used in the following experiment is ACORS-ANNDPF-2.)

(2) Node survival time (Network life cycle)
The survival time of WSNs nodes directly affects the life of the whole network.The life cycle of WSNs lengthens with the service life of the nodes.This experiment compares AODV, LEACH, ACORS-ANNDPF protocols to verify the nodes survival time of the three protocols.The scene in Section 4.1 is chosen for the experiment.The enegy indices are set as follows: the sink node has infinite energy, the WSNs routing nodes each has 800 uw of energy, and the data collection nodes each has 1000 uw of energy.The collection nodes send data packets at 5 packets/s, 10 packets/s, 20 packets/s, 30 packets/s, respectively.It takes 0,2 uw of energy to fuse a data packet, 0,2 uw of energy to receive a data packet, 0,1 uw/s in waiting, and 0,2 uw of energy to forward a data packet.Take the number of data packets received by the sink node as the x-axis and the number of dead nodes as the y-axis.The data analysis graph for the scenario in Section 4.1 is as follows.
As shown in Fig. 6, AODV looks for routing nodes by multicasting if the data packets fail to reach the destination node.After finding routing nodes, the algorithm makes full use of these nodes to transmit data packets.If the routing nodes die, it would look for other routing nodes by multicasting again.It can be seen from the figure that the protocol nodes are dying gradually.After sending about 4300 data packets, the number of dead nodes reaches a balance at about 82 data packets.The death number is stable because most of the data packets sent by the protocol are discarded at that time.LEACH is a clustering routing protocol, which transmits data packets by selecting a cluster head node in the area.It is illustrated by the blue line in the figure.The number of death nodes of the protocol achives a balance at certain levels, e.g. between 1700÷2400 packets, 2700÷3500 packets, and 3700÷4500 packets.This is because a relatively stable cluster head node is chosen to transmit data packets, which ensures stable transmission within a certain period of time.When 5000 to 5500 of data packets are sent, the algorithm has more dead nodes than AODV, indicating that no suitable cluster head node could be selected, and a lot of energy is consumed in the transmission.With optimal routing and data packet fusion, ACORS-ANNDPF algorithm not only consumes less energy, but also make full use of routing nodes.The experiment proves that the algorithm has the best performance.Without additional control, it effectively avoids overload of some forwarding nodes, balances the energy distribution between the nodes, and extends the survival time of the entire WSNs.2), let the number of packets sent be 5500, and measure the energy consumed in uw.The 3D curves of the total energy consumption of all nodes in AODV and ACORS-ANNDPF are as follows: Comparing the two graphs, it can be seen that the curves are messy and the different coloured contours intersect each other in Fig. 7; In Fig. 8, however, the curves are relatively smooth.The only exception is the nodes near the sink node, where the curves are more concentrated due to the high energy consumption.In other areas, the curves are quite smooth.The contour lines are almost straight.This indicates that ACORS-ANNDPF is capable of balancing energy consumption, preventing certain nodes from consuming excessive energy, and assuring the best network transmission performance.

(4) The comparison of the energy consumption of multiple algorithms
To further demonstrate the performance of the proposed algorithm, this paper compares it with multiple WSNs routing algorithms.The author selects AODV, LEACH, SRP (self-selecting reliable path) [28] and ACORS-ANNDPF.The scenario is still taken from Section 4.1, the node energy indices are the same with those in experiments (1), ( 2), the residual energy of the whole network is taken as the Y-axis, the number of data packets sent is 5500, and the number of packets received is taken as the X-axis.Through experiments and data analysis, the following figure is obtained.2), it can be seen that most of the data packets sent after that moment are discarded.As most of routing nodes are dead in the later stage, it is increasingly difficult to find a good cluster head node.In contrast, SRP looks for a reliable path.Once a routing node is damaged, the algorithm would adjust itself.Thus, it saves more energy than LEACH.When 5500 packets are transmitted, the whole network still has 8 % of residual energy.ACORS-ANNDPF can balance energy consumption of the network and make good use of the transmission mode of each routing node.Compared with other three algorithms, it not only optimizes the existing transmission path, but also acquires the best transmission mode.As shown in this figure, the network has 29 % of residual energy after 5500 packets are sent.With gentle gradient, little fluctuation and long survival time, the algorithm is highly energy efficient.Its energy consumption is slower and smaller than the other three algorithms.

Conclusion
Based on the application of IoT to drug control system, this paper focuses on the energy efficiency of WSNs in the IoT.For the purpose of improving network energy utilization rate and saving energy, the author proposes the ACORS-ANNDPF algorithm.The algorithm is divided into two parts: the ant colony optimization route selection and artificial neural network data packet fusion.The former uses the improved ant colony algorithm to select the optimal path, also the most energy efficient path.In light of the optimal path selected in the first part and the actual conditions, the latter uses the algorithm of artificial neural network to reduce the times of data packet transmission and improve the network utilization rate.After that, the author constructs simulation scenarios according to the actual application of IoT to the drug control system, and carries out several simulation experiments to verify the advantages of the proposed protocol in terms of packet loss rate, life cycle, energy consumption curve, energy consumption, etc.The author also compares the algorithm with multiple other protocols, and proves that it is capable of improving network utilization rate, extending network life cycle, exhibiting the best network transmission performance and effective saving energy.
The main purposes and significance of this paper is as follows: (1) Based on IoT of the drug control system, this paper probes into the self-regulating energy consumption algorithm with the self-learning ability.The goal is to achieve the best results of multiple tasks with the minimum energy consumption.
(2) This paper examines the main performance indices of the Internet of things.However, the nodes of the study are static.Since the performance of the network is even better when the nodes are mobile, further discussion and research are needed for mobile nodes.
(3) In future, the proposed algorithm should be applied to the real IoT of the drug control system to study its delay, multi-constraint optimization, congestion control, etc.
(4) With the aid of intelligent algorithm, the proposed algorithm would be better fitted to the actual environment.To further prove the practical effect of the proposed algorithm, packet capture software should be used to analyse the results.

Acknowledgement
This research is made possible by the generous support from the National Natural Science Foundation of China (61003130; 61303029), Hubei Nature Foundation (2014CFC1021), China Food and Drug Administration Fund (2012X1-029), Fundamental Research Funds for the Central Universities (2014-VII-027).
Internet of Things (IoT): A vision, architectural elements, and future directions.// Future Generation Computer figure, the specific process of data packet fusion varies by influencing factors.

Figure 1
Figure 1 Data packet fusion in WSNs

Figure 2
Figure 2 Hierarchical structure of artificial neural network in WSNs

. 4 .
Routing protocol is AODV.The simulation object is the IoT of the drug control system.The image is divided into three parts: Centring on the sink node, there are two 60*40 m*m labs in the lower part, one 60*30 m*m office area in the upper left corner, and a 60*30 m*m sample storage room in the upper right corner.Different types of nodes are marked in different colours.The sink node in the centre is coloured red.The node has infinite energy.When it receives data packets, no queuing or packet loss occurs.The environmental monitoring nodes are coloured blue with data packet size of 50 bytes.The green nodes are experimental apparatus and equipment with different data packet sizes (50/100/500/1,200 bytes).The orange nodes are inspection staff with data packet size of 80 bytes.These nodes are mobile.The sample monitoring nodes are coloured purple with data packet size of 40 bytes.The black nodes surrounding these system nodes are WSNs' routing nodes, which transmit the data information to the sink nodes.The TCL script file is written according to Section 3.1 and the instance graph (Fig.4) is prepared with the NAM tool.

Figure 4
Figure 4The instance graph of the IoT of the drug control system

Table 1 Figure 5
Figure 5 Comparison of packet reception rates Fig. 5 introduces four protocols.AODV is an ondemand plane distance vector routing protocol.The routing table is updated constantly by the periodic routing information between nodes, which displays the network topology and changes.The three ACORS-ANNDPF algorithms, ACORS-ANNDPF-1, ACORS-ANNDPF-2 and ACORS-ANNDPF-3 are three different packet fusion forwarding rules applied after the route selection by improved routing ant colony algorithm.ACORS-ANNDPF-1 is influenced by all the factors.All the data packets need to be forwarded immediately when they arrive at the routing nodes.The algorithm only uses the route selection function of the improved ant colony algorithm.In ACORS-ANNDPF-2, half of the data packets are fused, and other half are forwarded in real time.In ACORS-ANNDPF-3, all the data packets are forwarded after they are fused to a certain condition.The experiment indicates that, in the early stage when 2000 data packets are sent, ACORS-ANNDPF has similar performance with AODV.When 3000÷4000 data packets

Figure 6
Figure 6 The lifetime of nodes (3) 3D curve comparison of total energy consumption Taking the scenario of Section 4.1 as an example, suppose all the nodes have infinite energy and will never die.Besides, set the other indices of each node based on experiments (1) & (2), let the number of packets sent be 5500, and measure the energy consumed in uw.The 3D curves of the total energy consumption of all nodes in AODV and ACORS-ANNDPF are as follows:

Figure 7AODV total energy consumption curveFigure 8
Figure 7AODV total energy consumption curve

Figure 9
Figure 9Comparing the effect of multiple algorithms According to the above figure, AODV has a relatively poor effect.When 4000 data packets are sent, the residual energy of network is almost depleted.LEACH does better than SRP in the early stage (when 1000 data packets are sent) because the cluster head node chosen by LEACH can save energy in the early stage.As more and more data packets are sent, LEACH falls behind SRP.For LEACH, when 5000 data packets are sent, the residual energy of the whole network comes to a standstill.In light of experiment (2), it can be seen that most of the data packets sent after that moment are discarded.As most of routing nodes are dead in the later stage, it is increasingly difficult to find a good cluster head node.In contrast, SRP looks for a reliable path.Once a routing node is damaged, the algorithm would adjust itself.Thus, it saves more energy than LEACH.When 5500 packets are transmitted, the whole network still has 8 % of residual energy.ACORS-ANNDPF can balance energy consumption of the network and make good use of the transmission mode of each routing node.Compared with other three algorithms, it not only optimizes the existing transmission path, but also acquires the best transmission mode.As shown in this figure, the network has 29 % of residual energy after 5500 packets are sent.With gentle gradient, little fluctuation and long survival time, the algorithm is highly energy efficient.Its energy consumption is slower and smaller than the other three algorithms.