1 Introduction

Smart manufacturing describes the new manufacturing intelligence applied to modern information technologies such as the Internet of Things, cloud computing, and artificial intelligence in the manufacturing process (Tao et al. 2018a, b). Data from various sources is becoming integrated into manufacturing intelligence to improve manufacturing in various ways. A typical example is the wide deployment of sensors in manufacturing to monitor and provide real-time manufacturing data such as temperature, humidity, speed, vibration, and acidity for better decision-making and control of the manufacturing process (Li et al. 2015). Therefore, multiple sensors of different modalities are needed in distributed locations. Wired sensor networks are extensively adopted, but the cost for their installation, testing, maintenance, and shutdown are quite high. In many cases, a wireless sensor network (WSN) is a more attractive alternative because it does not require any fixed infrastructure and can be applied over distributed areas where cabling is costly (Akyildiz et al. 2002).

A WSN is composed of sensor nodes and sink nodes. Sensor nodes are responsible for collecting and forwarding data. Sink nodes either analyze data locally or forward data to a base station (Magaia et al. 2015). Each sensor node consists of small devices for sensing, processing, transceiving, and power, and it is able to communicate with other sensor nodes or directly with a base station. A WSN can be regarded as a self-supporting unit, with which unattended operation can be realized (Stankovic 2008). It is mostly applicable where power supplies and cabling are difficult, or in hostile environments that people cannot enter. With the technological developments in cloud computing and Internet of Things, WSNs are becoming even more widely deployed. They have also been used for machine health monitoring (Tiwari et al. 2007), data center monitoring (Wang et al. 2013), and data logging (Saleem et al. 2014) in various industries. Moreover, a WSN can be used for environmental monitoring (Hart and Martinez 2006), remote health care monitoring (Malasinghe et al. 2017), and other monitoring scenarios. Overall, its application in cloud computing and Internet of things and has significant social and economic benefit (Tao et al. 2014, 2011).

WSNs have a key difference with the wired sensor network in that the sensor nodes in a WSN rely solely on their own battery, and thus have limited power resources. Moreover, their computing power and storage resources are also limited. As a consequence, reducing the energy consumption of each sensor node is a critical issue for WSNs (Carrabs et al. 2015). Ant colony optimization (ACO) has been used in WSNs to identify shortest paths, and thus reduce the energy consumed by a network. However, the ACO is prone to falling into local optima and converges slowly. We hence propose an improved ACO (IACO) that can be used to construct the sensor node transfer function and pheromone update rule, and adaptively construct a data route using the characteristics of a dynamic network.

The major contributions of this paper are listed below.

  1. 1.

    The IACO consumes less energy.

  2. 2.

    The transmission delay is reduced using the IACO.

  3. 3.

    Fewer transmission packets are lost when using the IACO.

This paper is organized as follows. Section 2 analyzes the current WSN routing algorithms and their weakness. In Sect. 3, we describe our model and its notation. In Sect. 4, a detailed description of the proposed routing IACO algorithm is given. In Sect. 5, simulation results comparing the proposed algorithm with several other algorithms are presented to show the effectiveness of the proposed method.

2 Related work

As modern information technologies such as IoT (Bi et al. 2014), cloud computing (Wang et al. 2014), digital twin (Tao et al. 2018b), etc. are applied in manufacturing systems, data-driven product lifecycle management in Service-Oriented Smart Manufacturing (Tao and Qi 2017) is widely investigated. Due to the servitization has become a prominent trend in manufacturing, manufacturing service composition, scheduling and optimal selection are the key procedures to integrate the physical world and the cyber world of manufacturing (Tao et al. 2008, 2010a, 2010b, 2012). Industrial data generated from the manufacturing resources and processes are encapsulated as manufacturing services which are managed based on industrial internet platforms (Tao et al. 2017a; Bi et al. 2016; Jiang et al. 2014a, b). Therefore, in order to realize smart interconnection in dealing with quick configuration and deployment of heterogeneous equipment, data perception devices and methods such as Industrial Internet-of-Things Hub (Tao et al. 2017b, c), smart sensors (Xiao et al. 2014) and wired sensor network (WSN) (Chi et al. 2014) offer tremendous opportunities in the integration of physical resources and virtual entities.

Considering the resource constraints of a WSN, the network designer has to prolong the life cycle of the entire network using low power hardware and software (Chen 2016). Thus, the quality of service (QoS) of the network may be affected (Gao et al. 2016). The performance indicators of a WSN include scalability, accuracy, energy efficiency, delay, throughput, and reliability (Magaia et al. 2015). WSN routing is the basis for the highly efficient communication of a WSN and transfers information from the source node to the target node. A WSN has many characteristics including multiple-hop routing and dynamic topology (Jiang et al. 2014b). Because sensor nodes are mostly static, this makes routing detection and management very difficult. To solve the problem of WSN routing optimization, researchers have proposed many WSN routing algorithms. LEACH, a typical WSN routing algorithm, randomly selects cluster heads (CHs) equiprobably. It distributes the energy load of the whole network to each node equally, which has the characteristics of simplicity and scalability. However, it can lead to unreasonable clusters, unbalanced loads, and a limited application scope (Zhang et al. 2014). For this reason, WSN routing algorithms have been proposed that use genetic algorithms to select CH nodes. The cluster-based routing protocol divides the entire network into multiple clusters. For each cluster, one sensor node is chosen to be the CH. The other member nodes transmit their data to the CH, which aggregates the data and passes them to the sink node. In this way, cluster-based routing can decrease communication overhead and allocate resources efficiently (Bajaber and Awan 2010). The energy consumption of the whole network is reduced because of the lower interference among sensor nodes. The CH selection is a critical issue in cluster-based routing. Genetic algorithms are often used to select a CH (Wang et al. 2010). Some other methods select the CH based on the degree of energy attenuation and effective coverage (Gao et al. 2015). However, such methods do not consider the multihop communication between CHs and the base station (Dai and Li 2010). An energy-balanced WSN routing algorithm (Zou 2010) can disperse the network energy consumption over different paths. Although this algorithm can improve the energy efficiency of the network, a CH near the base station runs out of power more quickly than other CHs because of the CH data transmissions, and there is a phenomenon called the “hot zone” (Zhou et al. 2009).

For this reason, some researchers have proposed a multipath routing algorithm that can distribute the data load evenly by choosing other transmission paths, which improves network robustness and avoids congestion. Multipath routing is a significant improvement over a single path routing scheme. It has higher data transmission reliability, better distribution of network traffic, and enhanced data security (Sha at el. 2013). The Dijkstra algorithm, which finds the shortest path between nodes, is often applied for multipath routing (Felner 2011). This algorithm does not directly explore towards the destination but determines the next node based on its distance to the starting point. Therefore, the algorithm expands outward step by step from the starting point, interactively considering the closest node until it reaches the destination (Biswas et al. 2014). Thus, it is guaranteed that the algorithm finds the shortest path. However, this algorithm has an obvious weakness in that it is relatively slow in large-scale networks. ACO is another method often applied in multipath routing. The ACO algorithm is a probabilistic technique for finding good paths through graphs. It is inspired by the route-choosing behavior of ants. In this algorithm, the distance to the destination node is the parameter used to choose the next step to find the path. Therefore, it facilitates the finding of the shortest path between source and destination nodes.

There exist several extensions of the ACO algorithm. For example, energy aware ACO selects the next node based on its energy consumption or residual energy (Cheng at el. 2011). In this way, the resources at each node can be used in a more efficient way, but other QoS performance, such as information accuracy, may be reduced because of the route chosen. Another example is the location-aware ACO routing algorithm. It is a flat location awareness algorithm that provides the residual energy and the location information (both local and global) of a node to determine the probability it will be the next node for the ants (Wang et al. 2008). However, the ACO is prone to becoming trapped in local optimal and is slow to converge.

To meet the demands of various businesses on the Internet, the Internet Engineering Task Force developed three QoS service models to provide quality assurance in different scenarios. The Resource Reservation Protocol (RSVP) was adopted as the signaling work protocol in system. A data transmission channel from a source point to destination is established via RSVP signaling. Resources are reserved on each node of the channel to meet the QoS requirements of the work flow along the channel. Moreover, point-to-point QoS service is realized at same time (Crawley 1998).

In this study, WSN QoS is divided into three service levels. QoS-1 is guaranteed service. It is often adopted where the delay of a point-to-point packet is strictly defined and zero packet loss must be guaranteed. QoS-2 is controlled load service. It is often adopted where time delays are likely to happen. In addition, when the network is overloaded, the network can provide services similar to those when it is not overloaded. QoS-3 is best effort service. It is often adopted where there is no time delay limit and the network provides no QoS guarantee to its users.

3 System model

Assuming that the network monitoring area is a square area with a side of length M, a total number of N sensor nodes are randomly distributed within it. The base station is located at the top of the network monitoring area. There is only one base station. It has the following characteristics:

  1. 1.

    When the base station and the sensor nodes have been deployed, the network topology no longer changes. That is, the sensor nodes are static.

  2. 2.

    Each node in the network is not only a source node, but also a transmitting node, and the base station is the only destination node.

  3. 3.

    Base station energy is sufficient. Each sensor node has a unique ID number, the initial energy is the same, and the energy cannot be added. The topology of the WSN network is shown in Fig. 1. Because WSN energy is not inexhaustible and the WSN routing algorithm design is closely related to the channel energy loss model, the loss model adopted in this study is shown in Fig. 2.

Fig. 1
figure 1

Topology of WSNs

Fig. 2
figure 2

Channel loss model

The energy consumption of a sensor node sending 1 Kb of data is

$${E_{sd}}\left( {k,d} \right)=\left\{ {\begin{array}{l} {k*{E_{elec}}+k*{\varepsilon _{fs}}*{d^2},d<{d_0}} \\ {k*{E_{elec}}+k*{\varepsilon _{amp}}*{d^4},d<{d_0}} \end{array}} \right\}.$$
(1)

The energy consumption of the node that receives the 1 Kb of data is

$${E_{rv}}\left( {k,d} \right)=k*{E_{elec}},$$
(2)

where, d is the distance of communication, \({{\text{E}}_{{\text{elec}}}}\) is the basic power dissipation coefficient of the transceiver circuit, and \({{{\varvec{\upvarepsilon}}}_{{\text{fs}}}}\) and \({{{\varvec{\upvarepsilon}}}_{{\text{amp}}}}\) are the energy consumption of free space and the multipath fading channel model power amplifier, respectively.

4 Design of the WSN routing algorithm for IACO

ACO comprises a group of intelligent algorithms for simulating the foraging behavior of an ant colony. Ants leave a substance called a pheromone on the feeding path, which can be sensed by other ants and affects their crawling path. Other workers leave the pheromone to enhance the original pheromone, but the pheromone also gradually evaporates over time, so the length of the path and the number of ants travelling on it and leaving pheromone residues have an impact in the ants group behavior as a positive feedback phenomenon. Using this information exchange method, ants can quickly find food. The ACO algorithm is a probabilistic technique for solving computational problems that can be reduced to finding good paths through graphs. This algorithm is a member of the ACO family, which is a type of swarm intelligence method, and it constitutes some metaheuristic optimizations. The aim of the first ACO algorithm was to search for an optimal path in a graph based on the behavior of ants seeking a path between their colony and a source of food. The original aim has since been diversified to solve a wider class of numerical problems, and as a result, several problems have emerged, drawing on various aspects of the behavior of ants. From a broader perspective, ACO performs a model-based search and shares some similarities with estimation of distribution algorithms.

4.1 Sensor node transfer function

Equation 3 shows the relationship between the success rate of a packet and the distance it is transmitted. When the node has high communication performance, the packet success rate is more than 90%. If it has low communication performance, the success rate of the packet is less than 10%. see Fig. 3.

Fig. 3
figure 3

Relationship between packet success rate and distance

The success rated of packets for forward and reverse links are, respectively, and the expected value of the transmitted data packet is

$$ETXlink=\frac{1}{{{d_f} \times {d_r}}},$$
(3)

where df × dr is the expected reception and confirmation probability.

Suppose ETX = 0 for the base station node, the path of the other sensor nodes to the base station node ETX path is the sum of the single-hop links ETXlink, giving

$$ET{X_{path}}=\mathop \sum \limits_{{i=1}}^{{hops}} ETX_{{link}}^{i}.$$
(4)

According to Eq. (4), the ETXpath of a WSN can accurately describe the distance between a sensor node and base station. The smaller the ETXpath, the closer the node is to the base station. The sensor node should be selected as a data forwarding route, indicated as Direct (j) as follows:

$$Direct\left( j \right)=\left\{\begin{array}{ll} {1}, & \quad {ETX_{path}^{j}< ETX_{path}^{i}} \\ {0,} & \quad {ETX_{path}^{j}> ETX_{path}^{i}} \end{array}\right\}$$
(5)

The transfer probability function of the ant from sensor node i to neighbor node j is calculated as:

$${\text{s}}=\left\{ {\begin{array}{ll} {{\arg \mathop{\hbox{max} }\limits_{{j \notin tab{u_k}}} \left\{ {{{\left( {\tau_{{ij}}^{{{Q_O}S - t}}} \right)}^a} \cdot {{\left( {\eta_{{ij}}^{{{Q_O}S - t}}} \right)}^\beta } \cdot Direct\left( j\right)} \right\},}} & \quad {q \leq {q_0}} \\ {S,} & \quad{q>{q_0}} \end{array}} \right\},$$
(6)
$${\text{S}} = \left( {P_{{ij}}^{{Q_{O} S - t}} } \right)_{k} \left\{ {\begin{array}{ll} {\frac{{\left( {\tau _{{ij}}^{{Q_{O} S - t}} } \right)^{a} \cdot \left( {\eta _{{ij}}^{{Q_{O} S - t}} } \right)^{\beta } \cdot Direct\left( j \right)}}{{\sum\nolimits_{{j \notin tabu_{k} }} {\left( {\tau _{{ij}}^{{Q_{O} S - t}} } \right)^{a} } \cdot \left( {\eta _{{ij}}^{{Q_{O} S - t}} } \right)^{\beta } }},} & {j \notin tabu_{k} } \\ {0,} & {j \in tabu_{k} } \\ \end{array} } \right\}$$
(7)

where \({{\varvec{\uppi}}}_{{\text{i}}}^{{{\text{QoS}} - {\text{t}}}}\) is the pheromone of service \(t,{{ \varvec{\upeta}}}_{i}^{{(QoS - t)}}\) is a heuristic factor, and α and β represent the importance of the residual pheromone and heuristic factors.

4.2 Global pheromone update

When the entire ant colony has completed a route search, to select the best route, the following specific measure is used:

$$u_{{cur}}^{{{Q_O}S - t}}=\hbox{max} \left\{ {{{\left( {u_{{path}}^{{{Q_O}S - t}}} \right)}_k}} \right\}, \quad k=1,2, \cdots ,m,$$
(8)

where \({\left( {{\text{u}}_{{{\text{path}}}}^{{{\text{QoS}} - {\text{t}}}}} \right)_k}\) is the path utility value of ant k.

If nodes i and j are on this path, the pheromones are updated as follows:

$$\tau _{{ij}}^{{{Q_O}S - t}}=\left( {1 - {\rho _G}} \right)\tau _{{ij}}^{{{Q_O}S - t}}+{\rho _G}\Delta \tau _{{ij}}^{{{Q_O}S - t}},$$
(9)
$$\Delta \tau _{{ij}}^{{Q_{O} S - t}} = \left\{ {\begin{array}{ll} {\frac{{Q \cdot u_{{cur}}^{{Q_{O} S - t}} }}{{L\left( p \right)}},} & {i,j \in P} \\ {0,} & {i,j \notin P~} \\ \end{array} } \right\},$$
(10)

where L(P) is path length, Q is adjustment coefficient, t indicates the QoS category, PG is the volatility coefficient, and \({{\varvec{\Delta}\varvec{\uptau}}}_{{{\text{ij}}}}^{{{\text{QoS}} - {\text{t}}}}\) is amount of increased pheromone of Number t. Finally, P is the path corresponding with \({\text{u}}_{{{\text{cur}}}}^{{{\text{QoS}} - {\text{t}}}}\).

4.3 Local pheromone update

When the ants pass through adjacent nodes, they update the pheromone as follows:

$$\tau _{{ij}}^{{{Q_O}S - t}}=\left( {1 - {\rho _L}} \right)\tau _{{ij}}^{{{Q_O}S - t}}+{\rho _L}\Delta \tau _{{ij}}^{{{Q_O}S - t}},$$
(11)

where \({\rho} _{\text{L}}\) is a parameter.

5 Simulation and results

5.1 Simulation parameters

To test the proposed algorithm, we developed simulation software using the VC++ programming language. The IACO algorithm is compared with the ACO, Dijkstra algorithm, and data equilibrium based algorithm (DEBA). Because the most important QoS issues while designing routing protocols for WSN are energy consumption, data transmission delay, and transmission packet loss, these indicators are used to compare the performance of the algorithms. The simulation settings are as follows: (1) The coverage area is limited to a 100 × 100 m space, which is the general scenario of a WSN system. (2) The base station is located at the center of simulation system. (3) The system has 100 nodes. This is the upper limit of commonly used values. (4) Node initial energy is 0.4 J, which is the most common value used in the real world. The simulation parameters are shown in Table 1.

Table 1 Simulation parameter setting
Table 2 Packets loss rates of different algorithms

5.2 Results and analysis

5.2.1 Data transmission delay comparison

As shown in Fig. 4, in different sensor data systems, there is difference in the data transmission delay of QoS-3 for all routing algorithms. When the distance between the sensor nodes and the base station is small, for QoS-1 and QoS-2, there is no difference in the data transmission delay for all routing algorithms. As the distance to the base station increases, the transmission delay of the routing algorithms gradually increases. For QoS-3 data, the data transmission delay of all four algorithms is obvious. The IACO and ACO algorithms perform better while the Dijkstra algorithm and DEBA perform worse. The transmission delay of the IACO algorithm is about 80% lower than that of the Dijkstra algorithm and is also slightly smaller than the data transmission delay of ACO. The simulation result shows that although the ACO routing algorithm can choose good neighbor nodes and the data transmission delay is already quite low, its results can be further improved using our proposed IACO algorithm.

Fig. 4
figure 4

Transmission delay of different algorithms (QoS-3)

5.2.2 Packet loss rate comparison

Under different sensor data conditions, the transmission loss of QoS-2 and QoS-3 also differ. When the distance between a sensor node and the base station is low, the data transmission packet loss rates of all routing algorithms are similar. As the perceived distance increases, the difference in data loss rate gradually increases. This is mainly because, as the distance from the base station increases, the number of hops needed for data forwarding increases, and the packet loss rate increases accordingly. Under the same conditions, the Dijkstra algorithm data transmission packet loss rate reaches 54%. However, the IACO algorithm data transmission packet loss rate is relatively small (26%). The results show that, considering the transmission delay and packet loss rate, the IACO algorithm can perform well. It can choose the best node to forward data to, reducing the packet loss rate and ensuring the effectiveness of data transmission (Table 2).

5.2.3 Node residual energy comparison

After a WSN has been running for some time, the sensor node residual energy follows the curve shown in Fig. 5. Here, the energy consumption of the IACO algorithm is relatively small and the residual energy is relatively large, mainly because the IACO algorithm chooses nodes on paths with few hops to forward the data. It further optimizes the routing process to maintain the energy balance of the whole WSN.

Fig. 5
figure 5

Network energies of different algorithms

5.2.4 Overall performance comparison

For the three QoS levels, the average QoS values for different algorithms are shown in Fig. 6. It is clear that the average QoS values of the nodes of the IACO algorithm are better than that those of the comparison algorithms.

Fig. 6
figure 6

Overall performance of different algorithms

These results indicate that, regardless of the transmission delay, data reliability, and energy consumption, the IACO algorithm has a significant advantage over other algorithms.

6 Conclusions

This paper proposed the IACO routing algorithm, which is an extended ACO. The algorithm establishes and updates the pheromone concentration of the gradient field and path by broadcasting messages and exchanging hops between neighbor nodes in the whole network. Next, data transmission, delay packet loss rate, and node residual energy are determined by calculating the corresponding probability of the neighbor nodes. Routing is selected by considering both the shortest path and highest residual energy. In the routing maintenance process, data are transferred to increase the pheromone concentration. Therefore, the energy consumption of the whole network is closer to the average while data packets are sent along the shortest paths. Consequently, the lifetime of network is effectively prolonged. Moreover, the control of special regions cannot be lost because of the rapid death of nodes along the shortest path.

According to the requirements of applications using the IACO, the QoS is divided into three levels according to the data transmission delay, data transmission reliability, and the network energy consumption. Then, IACO is used to design the wireless sensor routing algorithm, and the optimal path are selected according to the QoS level. A simulation experiment was used to test the performance of the algorithm. The simulation results show that the IACO algorithm not only reduces the data transmission delay and improves the data forwarding efficiency, but also reduces the data packet loss rate, reduces the energy consumption of the network, and prolongs the overall network performance and resource utilization.