Wireless sensor network QoS routing method for improving bee colony protocol energy
By introducing node residual energy factors and dynamic routing updates into the wireless sensor network, combined with the bee colony protocol and QoS constraints, routing path finding is optimized, which solves the problem that the routing protocol in the wireless sensor network cannot meet the requirements of high bandwidth, low latency and energy balance. problem, achieving more stable and efficient network transmission.
Patent Information
- Application Number
- CN202410710533.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing wireless sensor network QoS routing protocols cannot meet the high bandwidth, low latency, low delay jitter, low loss rate and long life cycle requirements of wireless sensor networks, and fail to effectively utilize the remaining energy of nodes, resulting in poor network stability. and energy imbalance.
Introduce the node residual energy factor, improve the bee colony protocol, and optimize routing pathfinding by dynamically updating the routing protocol and combining network delay and energy consumption constraints to ensure the reliability and efficiency of the transmission route, using high-energy nodes to protect low-energy nodes , extending the network life cycle.
It improves the reliability and efficiency of wireless sensor network routing and transmission, extends the network life cycle, balances node energy consumption, and enhances the self-organizing ability of the network. It is suitable for fields such as environmental monitoring and disaster prevention.
Smart Images

Figure CN118678316A
Abstract
Description
Technical Field
[0001] The present application relates to a wireless sensor network QoS routing method, and in particular to a wireless sensor network QoS routing method for improving swarm protocol energy, and belongs to the technical field of wireless sensor network routing. Background Art
[0002] Wireless sensor networks are composed of many wireless sensor nodes that can perform data storage and computing in addition to data transmission. The current research focus of this technology is on reducing the energy consumption of nodes and the self-organizing ability of the network.
[0003] A wireless sensor network is a self-adaptable network composed of many tiny sensor nodes arranged in the measurement and control range to perform simple calculations and data transmission. The function of the wireless sensor network is to collect and process information of various objects in the measurement and control area, and finally transmit the processed data to the user or base station. The composition of wireless sensors is generally composed of a base station and a large number of wireless network nodes arranged in the monitoring range. The power consumption of a single node is relatively small, with limited computing and communication capabilities, and the processed data is relatively unreliable. However, the reliability of the network system formed by a large number of such nodes self-organizing generally meets the requirements of related technical fields. With the development of wireless sensor technology, this technology has been applied to many fields, including smart medical care, smart transportation, smart home appliances, infrastructure monitoring, ecological monitoring and disaster warning, agricultural production, industry and other fields.
[0004] With the development of technology, wireless network technology will be applied to more harsh environments. Compared with traditional network nodes, it is easy for a single wireless sensor node to fail, reducing the service support for the overall sensor network. Wireless sensor networks still face many challenges in the process of continuous expansion and improvement: First, the energy consumption problem. Most of the sensor nodes in wireless sensor networks are powered by batteries, and the energy of sensor nodes is limited. The energy of the entire network is also limited, and it can only work normally for a certain period of time. The network fails due to energy exhaustion. By optimizing the transmission protocol and improving the equipment of the sensor node, the energy consumption of the network can be reduced to achieve the goal of extending the network life cycle, but the energy consumption problem is still the biggest problem facing wireless sensor networks at present. Second, the topological structure directly affects the quality of multiple services of the network, including network coverage, connectivity, etc. A topological structure that is suitable for applications and improves service quality is crucial. Third, the cost problem. The hardware cost comes from the sensor node. Although the equipment cost of a single sensor node is low, the wireless sensor network is usually a network with a large number of nodes. The maintenance process of the network requires updating the various protocols and specific application services involved in the network. The overhead affects the life of the equipment. It can be considered from the perspective of network management and maintenance to reduce the network cost. Fourth, the security issue. Wireless sensor networks can save costs by reducing network service quality or changing the number of working nodes, allowing some nodes to enter a sleep state to reduce network energy consumption. Although energy is saved, it inevitably brings some potential security issues. At the physical layer, the network is prone to wireless interference or physical damage. At the data link layer, the network may have communication conflicts, energy exhaustion, and unfair competition. At the network layer, the network may encounter routing message discards, misleading attacks, and black hole attacks.
[0005] In addition, the problems that need to be solved in the existing wireless sensor network QoS routing and the key technical difficulties of this application include:
[0006] (1) The routing protocols in the existing technology cannot meet the needs of wireless sensor networks. In addition to the bandwidth, delay, delay jitter, loss rate, throughput and other performance requirements required by traditional networks, wireless sensor networks also require the overall network life cycle, network coverage, connectivity and network energy consumption to be considered. Traditional network routing protocols cannot meet the service quality requirements of wireless sensor networks and have defects in network delay, node and system overall energy consumption, number of surviving nodes, etc. The reliability and efficiency of the transmission route are low.
[0007] (2) The existing wireless sensor network QoS routing does not take into account the residual energy factor of the node. In the path finding process, it does not consider the impact of path energy consumption on the judgment of the optimal path. It is unable to fully utilize high-energy nodes and protect low-energy nodes, resulting in energy imbalance of network nodes and poor stability of the wireless sensor network.
[0008] (3) The existing routing protocol cannot be updated dynamically. During the operation of the network, the nodes of the optimal path may reduce their working capacity due to energy exhaustion, damage, etc., which affects the service quality of the path. The existing technology cannot regularly update the routing information to ensure that the acquired path is the optimal path at the time, resulting in a short network life cycle and uneven energy consumption of nodes in the network. Summary of the invention
[0009] In view of the shortcomings of the prior art, this application improves the traditional network routing protocol, introduces the node residual energy factor, realizes the dynamic update of the routing protocol, and meets the requirements of the wireless sensor network for service quality. The improved swarm algorithm incorporates the new protocol and energy source to complete the routing path, and on this basis, adds some QoS constraints, including network delay and network energy consumption to ensure the reliability and efficiency of the transmission route. The routing protocol of this application meets the needs of wireless sensor networks. In addition to the bandwidth, delay, delay jitter, loss rate, throughput and other performance requirements required by traditional networks, the network can also fully consider the life cycle of the overall network, the coverage, connectivity and energy consumption of the network. There are significant improvements in network delay, overall energy consumption of nodes and systems, and the number of surviving nodes, and the reliability and efficiency of the wireless sensor network routing transmission route are improved.
[0010] In order to achieve the above technical effects, the technical solutions adopted in this application are as follows:
[0011] The wireless sensor network QoS routing method based on improved swarm protocol energy is based on the service quality requirements of wireless sensor networks. The network routing protocol is improved by introducing node residual energy factors and dynamic updates of routing protocols. The improved swarm algorithm incorporates new protocols and energy to complete routing path finding, and on this basis, some QoS constraints are added, including network delay and network energy consumption to ensure the reliability and efficiency of the transmission route. The specific improvements include:
[0012] 1) Introduce node residual energy factor: In the path-finding process, strengthen the influence of path energy consumption on the judgment of the optimal path, make more use of high-energy nodes, protect low-energy nodes, and make the network nodes more energy balanced than before.
[0013] 2) Dynamic update of routing protocol: In the improved algorithm, the routing information is updated regularly to ensure that the acquired path is the optimal path at the time, and to avoid the nodes of the optimal path from reducing their working capacity due to energy exhaustion or damage, which affects the service quality of the path.
[0014] Preferably, the swarm protocol energy routing algorithm is improved:
[0015] First, a wireless sensor network model is established, the number of nodes and the geographical location of the nodes are set, the values of various parameters of the nodes are randomly set, including the energy of the nodes, the range of neighboring nodes, and the location information, and the bandwidth size between adjacent nodes is set;
[0016] Analyze random nodes V i The process of calculating the next hop of a node: define the next hop node as node j, then j must be a neighbor node of node i, and the probability of node j becoming the next hop node is expressed by formula 1, where Pi j It indicates the probability of selecting the next hop node from node i and selecting neighbor node j:
[0017]
[0018] Bees are divided into three types: exploring bees, leading bees, and following bees. Different bees have different probabilities of choosing the same route. j Represents different bee types. The probability of selecting the next hop node j at node i is obtained by formula 2, where ei j Represents QoS constraints, and determines the probability of node j becoming the next hop node by the compliance with QoS conditions, thereby realizing the QoS constraints of routing selection:
[0019]
[0020] The probability P of the search bee choosing the next node ij Using formula 3, we can get the path that the bee has not walked as m:
[0021] w ij =1 / m Formula 3
[0022] The probability P of the follower bee selecting the next node is obtained using Formula 4, where D is the number of paths:
[0023]
[0024] Calculate the network routing QoS data of path P. The delay consumption in the network is expressed by formula 5:
[0025] Cost(P)=∑Delay(P) Equation 5
[0026] The energy fluctuation Equal(P) is calculated by formula 6, where E max Represents the maximum energy value in the node, and energy(i) represents the energy value of each node in the path:
[0027]
[0028] Different applications have different requirements for network layer QoS. The fitness function 7 is set to test the suitability for various types of applications. λ represents the weight of various parameters in the service requirements. The smaller the calculated value, the higher the degree to which the selected path meets the QoS requirements of the service provided by the application, and the better the energy consumption:
[0029] FIT i =λ1 / Cost(P)+λ2 / Equal(P) Equation 7
[0030] After completing the construction of a path, repeat the above steps until the regional network is traversed, compare the fitness of each path, and select the path with the best fitness as the optimal path.
[0031] Preferably, it is assumed that there is a path P=(v1v2…v n ), P is one of the candidate paths, then this path must comply with the following QoS routing constraints:
[0032] (1) Delay constraint: The delay of path P ≤ the minimum required delay;
[0033] (2) Energy constraint: the energy of each node on path p ≥ the minimum energy value of the node;
[0034] (3) Bandwidth constraint: The bandwidth of each link on path p ≥ the minimum required bandwidth.
[0035] Preferably, the wireless sensor network QoS routing process of improving the swarm protocol energy is divided into three steps:
[0036] Step 1: Neighboring nodes update and maintain routing information: In the initial stage, all nodes do not have any network routing information. They send detection packets to obtain routing information of neighboring nodes. If a node does not receive a response message from a neighboring node within the response time set by the protocol, it is considered that the neighboring node has died or failed, and the routing information of the node is removed from the routing table.
[0037] Step 2: Exploring bees detect routing: The sending node uses exploratory bees to detect routing and forward data packets in a broadcast manner. During the forwarding process, the exploratory bees record the information of the nodes passed through each time, including the node address, minimum energy, and number of information, and save them in the form of a stack. After reaching the target node, the exploratory bees return to the sending node with the path information. The sending node calculates the fitness value of each path based on the information returned by each exploratory bee, and periodically updates the routing information and deletes the invalid path information in the routing table.
[0038] Step 3: Bee-collecting routing selection stage: Bee-collecting selects the path according to the roulette method. The path with higher fitness has higher probability of being selected. Bee-collecting also needs to return to the sending node. Bee-collecting not only transmits data but also records routing information. After returning to the sending node, the bee-collecting will update the routing information.
[0039] Preferably, the QoS routing architecture of the wireless sensor network: defines two types of bees as exploring bees F and homing bees B. The exploring bees start exploring from the starting node, pass through several intermediate nodes, and reach the target node. During the transmission process of the intermediate nodes, the bees record the number of hops through the nodes, the delay and bandwidth information of the links between the nodes. After the bees find the target node, the exploring bee F changes its state to the homing bee B, carries the previously collected and saved information and returns to the starting point along the original path, and analyzes the suitability of the service quality of this path at the starting point.
[0040] 6. The wireless sensor network QoS routing method for improving the swarm protocol energy according to claim 1, characterized in that the wireless sensor network QoS routing architecture node structure includes:
[0041] Starting node address (src_address_): an independent identifier of a node in a wireless sensor network, and the only standard for node identity authentication when other nodes transmit information to it;
[0042] Destination node address (des_address_): The sending node uses the destination node address as the basis for routing selection and data transmission;
[0043] Node energy (node_energy_): It is the amount of remaining energy of a single node. Its usage time is the life cycle of the node.
[0044] Send packet size (packet_size_): the size of the routing data packet sent;
[0045] Routing Table (Vector <routertable>): All nodes are equipped with routing tables to store routing data of nodes and local or global networks. The routing information stored in the routing table includes the target node address, neighbor node address, neighbor node routing status, path energy consumption between the current node and the next node, and network overhead. The questing bee selects the next hop node by analyzing the routing information to achieve the search for the honey source. The leading bee and the following bee maintain or update the routing table during the network communication process to achieve path convergence.
[0046] Forwarding packet pointer (temp_packet_): The information transmission process of the sending node to the target node is reflected in the forwarding packet. The forwarding packet pointer points to this forwarding packet. When a node receives a forwarding packet, it needs to compare the information in the forwarding packet with itself to confirm whether it is the target node of the forwarding packet. If not, the forwarding packet will continue to be forwarded. During the forwarding process, a timer is set for the forwarding packet. The value of the timer is set globally and will not be changed by the intermediate nodes. The setting of the timer helps the system monitor the internal nodes.
[0047] Data packet life cycle (tll_max_): Set a life cycle for the forwarded data packet to limit the number of hops of the data packet in the network. When the node reaches the life cycle, the system determines that the node is useless or dead and discards the node. The setting of the data packet life cycle prevents the data packet from doing useless forwarding work in the network;
[0048] The amount of data sent by the node (send_numb): indicates the number of data packets sent out by the sending node;
[0049] The amount of data received by the node (recieve_numb_): indicates the number of feedback data packets received by the sending node;
[0050] After reaching the target node, the quest bee sends a data feedback with path information to the sending node. The sending node determines the optimal path by analyzing the received feedback information. By comparing the amount of data sent and the amount of data fed back at the end, the amount of information lost before and after sending and receiving is obtained, and the loss rate of the line is calculated.
[0051] Preferably, the routing table structure of the wireless sensor network QoS routing architecture includes:
[0052] Target node address (des_address_): At the initial stage of the process of data transmission from a node to a target node, the sending node checks its own routing table and extracts useful data from the target node. If this part of information is not detected, the sending node starts to explore the route;
[0053] Next hop node: In the process of information transmission in wireless sensor networks, the data packet sent by the sending node passes through several intermediate nodes and finally reaches the target node. Every time it reaches an intermediate node, the intermediate node selects one of the adjacent nodes as the next hop node after certain routing calculation and analysis, and repeats this process until the next hop is the target node and the data transmission is completed;
[0054] Path node stack: saves the routing information of the intermediate nodes on the complete path from the sending node to the target node in the form of a stack;
[0055] Hop count: indicates the length of time a data packet exists in the network. Its value is the same as the number of nodes the data packet passes through during forwarding. Each time it is forwarded to a new node, the hop count is increased by one to record the length of the entire path. It is one of the evaluation factors for measuring the optimal path.
[0056] Minimum energy value: The energy supply of nodes is randomly distributed and different from each other. There is a node with the least energy. In a complete path, if an intermediate node fails due to energy consumption, the line where it is located will also lose its working ability;
[0057] Fitness: It is the final basis for determining which path to choose. Fitness is obtained by adding the quantitative data of multiple QoS standards in the network with a certain weight value. The higher the fitness value, the more this path meets the application and user requirements or complies with the reasonable energy allocation and resource management of the network. However, after a data transmission is completed, the fitness value of the path will change, and the network needs to dynamically update the optimal path.
[0058] Preferably, the wireless sensor network QoS routing architecture data packet structure is:
[0059] Sending node address (src_address_): The data packet sent by the sending node to the target node contains the sending node address information. The quest bee in the model carries this address information of the sending node. After the target node receives the message, it reads the address information of the sending node and saves the feedback information together with the address information to the returning node bee.
[0060] Current node address (temp_address): indicates the corresponding node address in the confirmed path. When the bee transmits on the path and reaches a certain node, the node extracts the current node address from the information carried by the bee and compares it with its own address information. If the two are the same, it is the node itself and receives the data packet and continues to forward it. Otherwise, it gives up receiving the bee.
[0061] Destination node address (des_address_): is the address information of the destination node of the complete path. When the data packet sent by the sending node arrives at the destination node, the destination node compares the destination address carried in the data packet with its own address. If they are consistent, it means that it is the destination node and forwards the data. Otherwise, it compares other information of the data packet, such as the current node information, and makes corresponding processing.
[0062] Path node stack (Vector<path_stack> ): During the exploration process, the exploring bee records the address information of all nodes that the complete path passes through and saves it in the path node stack, and returns to the sending node to reserve the data of the path node stack for the sending node. The collecting bee performs routing addressing by reading the information of the path node stack, and reaches the same target node according to the route composed of several nodes in the path stack;
[0063] Previous node (index_): During the exploration phase, each time a searching bee reaches a new node, it stores the data of the previous node at the top of the path node stack. The searching bee obtains the address information of the nodes on the backtracking path from the top of the stack in turn, and returns to the sending node along the original path.
[0064] Data packet life cycle (tll_): Set a life cycle for the forwarded data packet to limit the number of hops of the data packet in the network. When the node reaches the life cycle, the system determines that the node is useless or dead and discards the node. The setting of the data packet life cycle can avoid useless forwarding of data packets in the network.
[0065] Acknowledgement type (ack_): Mark the data packet with the acknowledgement type, using 0 and 1 to distinguish. 0 means that the sending node has received a data packet with feedback information, and 1 means that the destination node has received a data packet sent by the sending node.
[0066] Bee type (type_): Analyze the function of the data packet and divide it into two types from the perspective of bee type: exploratory bees and collecting bees. The type can be set to "0", "1", and "2". Type 0 means that adjacent nodes are exchanging information; type 1 means that this data packet is an exploratory bee type; type 2 means that the data packet is a collecting bee type.
[0067] Compared with the prior art, the innovations and advantages of this application are:
[0068] (1) This application improves the traditional network routing protocol to achieve the service quality requirements of wireless sensor networks. The improved swarm algorithm incorporates new protocols and energy sources to complete routing, and on this basis, adds some QoS constraints, including network delay and network energy consumption to ensure the reliability and efficiency of the transmission route. The routing protocol of this application meets the needs of wireless sensor networks. In addition to the performance requirements such as bandwidth, delay, delay jitter, loss rate, throughput, etc. required by traditional networks, the network can also fully consider the life cycle of the overall network, network coverage, connectivity and network energy consumption. There are significant improvements in network delay, overall energy consumption of nodes and systems, and the number of surviving nodes, and the reliability and efficiency of wireless sensor network routing transmission routes are improved.
[0069] (2) The present application creatively introduces the factor of residual energy of nodes: in the process of path finding, the influence of path energy consumption on the judgment of the optimal path is strengthened, more high-energy nodes are utilized, and low-energy nodes are protected, so that the energy of network nodes is more balanced than before. Combined with the network service quality QoS, a certain guarantee is provided to realize the smooth transmission of application instruction information in the network, thereby reducing the energy consumption of nodes and strengthening the self-organizing ability of the network, which is conducive to the better application of this technology to environmental monitoring, natural disaster prevention and control, and other fields.
[0070] (3) This application creatively implements dynamic updating of routing protocols: During network operation, the nodes of the optimal path may reduce their working capacity due to energy exhaustion, identification damage, etc., affecting the service quality of the path. In the improved algorithm, the routing information will be updated regularly to ensure that the acquired path is the optimal path at that time. Through the analysis of experimental results, the improved algorithm has achieved the expected goal. While ensuring that the delay does not change much, the life cycle of the network is extended, and the energy consumption of the nodes in the network is more balanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 It is a node structure diagram of the QoS routing architecture of wireless sensor networks.
[0072] Figure 2 It is a diagram of the routing table structure of the wireless sensor network QoS routing architecture.
[0073] Figure 3 It is a packet structure diagram of the QoS routing architecture of wireless sensor networks.
[0074] Figure 4 It is a flow chart of a wireless sensor network QoS routing method that improves the energy of a swarm protocol.
[0075] Figure 5 This is the architecture diagram of the wireless sensor network with 16 nodes in the experiment.
[0076] Figure 6 This is a comparison chart of the total residual energy of the system before and after the simulation experiment algorithm improvement.
[0077] Figure 7 This is a comparison chart of the time required for node death before and after the algorithm improvement recorded in the simulation experiment. DETAILED DESCRIPTION
[0078] The following, in conjunction with the accompanying drawings, further describes the technical solution of the wireless sensor network QoS routing method for improving the swarm protocol energy provided by the present application, so that those skilled in the art can better understand the present application and implement it.
[0079] Wireless sensor networks are self-organizing networks formed by deploying a large number of low-cost sensor nodes in the target area. A large number of nodes collect data in the target area and transmit the information to the base station. The network service quality QoS is a guarantee provided by the network to ensure that the application command information is transmitted smoothly in the network. The characteristics of wireless sensor networks make this technology widely used in environmental monitoring, natural disaster prevention and control, and other fields.
[0080] Traditional routing protocols cannot meet the needs of wireless sensor networks. In addition to the bandwidth, delay, delay jitter, loss rate, throughput and other performance requirements required by traditional networks, wireless sensor networks also require the overall network life cycle, network coverage, connectivity and network energy consumption. This application improves the traditional network routing protocol to achieve the quality of service requirements of wireless sensor networks. The improved swarm algorithm incorporates new protocols and energy sources to complete routing, and on this basis adds some QoS constraints, including network delay and network energy consumption to ensure the reliability and efficiency of the transmission route.
[0081] The specific improvements include:
[0082] (1) Introducing the node residual energy factor: In the path finding process, the influence of path energy consumption on the judgment of the optimal path is strengthened, more high-energy nodes are used, and low-energy nodes are protected, so that the network nodes are more energy balanced than before.
[0083] (2) Dynamic update of routing protocol: During network operation, the nodes of the optimal path may reduce their working capacity due to energy exhaustion, identification damage, etc., affecting the service quality of the path. In the improved algorithm, the routing information will be updated regularly to ensure that the acquired path is the optimal path at that time.
[0084] Through the analysis of the experimental results, the improved algorithm achieved the expected goal. While ensuring that the delay did not change much, the life cycle of the network was extended and the energy consumption of the nodes in the network was more balanced.
[0085] 1. QoS Routing Architecture for Wireless Sensor Networks
[0086] Two types of bees are defined as exploring bees F and homing bees B. The exploring bees start their exploration from the starting node, pass through several intermediate nodes, and reach the target node. During the transmission process of the intermediate nodes, the bees record the number of hops through the nodes, the delay and bandwidth information of the links between the nodes. After the bees find the target node, the exploring bee F changes its state to the homing bee B, carrying the previously collected and saved information and returning to the starting point along the original path, and analyzing the suitability of the service quality of this path at the starting point.
[0087] The node structure, routing table structure and data packet structure are as follows: Figure 1 , Figure 2 , Figure 3 shown.
[0088] Starting node address (src_address_): an independent identifier of a node in a wireless sensor network, and the only standard for node identity authentication when other nodes transmit information to it;
[0089] Destination node address (des_address_): The sending node uses the destination node address as the basis for routing selection and data transmission;
[0090] Node energy (node_energy_): The energy of nodes in wireless sensor networks is provided by batteries and is limited. Node energy is the amount of residual energy of a single node. Its usage time is the life cycle of the node. Node energy is the basis for evaluating the quality of service of wireless sensor networks.
[0091] Send packet size (packet_size_): the size of the routing data packet sent;
[0092] Routing Table (Vector <routertable>): All nodes are equipped with routing tables to store routing data of nodes and local or global networks. The routing information stored in the routing table includes the target node address, neighbor node address, neighbor node routing status, path energy consumption between the current node and the next node, and network overhead. The questing bee selects the next hop node by analyzing the routing information to achieve the search for the honey source. The leading bee and the following bee maintain or update the routing table during the network communication process to achieve path convergence.
[0093] Forwarding packet pointer (temp_packet_): The information transmission process of the sending node to the target node is reflected in the forwarding packet. The forwarding packet pointer points to this forwarding packet. When a node receives a forwarding packet, it needs to compare the information in the forwarding packet with itself to confirm whether it is the target node of the forwarding packet. If not, the forwarding packet will continue to be forwarded. During the forwarding process, a timer is set for the forwarding packet. The value of the timer is set globally and will not be changed by the intermediate nodes. The setting of the timer helps the system monitor the internal nodes.
[0094] Data packet life cycle (tll_max_): Set a life cycle for the forwarded data packet to limit the number of hops of the data packet in the network. When the node reaches the life cycle, the system determines that the node is useless or dead and discards the node. The setting of the data packet life cycle prevents the data packet from doing useless forwarding work in the network;
[0095] The amount of data sent by the node (send_numb): indicates the number of data packets sent out by the sending node;
[0096] The amount of data received by the node (recieve_numb_): indicates the number of feedback data packets received by the sending node;
[0097] After reaching the target node, the quest bee sends a data feedback with path information to the sending node. The sending node determines the optimal path by analyzing the received feedback information. By comparing the amount of data sent and the amount of data fed back at the end, the amount of information lost before and after sending and receiving is obtained, and the loss rate of the line is calculated.
[0098] The data packet sending delay (follow_bee_delay_) and the scout packet sending delay (scout_bee_delay_) set the delay of two packets to control the processing time of the node for the two packets, preventing the node from sending a large number of data packets and causing congestion in the entire network;
[0099] Maximum delay (overtime_max): A timer is set in the data packet sent by the sending node to the target node. The timer starts from the time the node sends the data packet. If the time reaches the maximum delay critical value and the sending node still does not receive the feedback data sent back from the target node, the system determines that the sent data packet has failed and needs to resend the information. If the feedback information can be received before the maximum delay, the timer is reset and the next round of information forwarding is carried out;
[0100] Bandwidth(Map<id_,bandwidth_> ): Records the bandwidth of the link between the node and each adjacent node. This data is used as a QoS constraint to influence the selection of the best route.
[0101] Forwarding delay device (out_timer_): The sending node performs routing selection and information transmission based on the target node address;
[0102] The delayed sending of data packets and scout packets is achieved by setting the data packet sending delay device (send_follow_bee_timer_) and the scout packet sending delay device (send_scout_bee_timer_).
[0103] Figure 2 It is the routing table structure. Target node address (des_address_): At the initial stage of the process of data transmission from a node to a target node, the sending node checks its own routing table and extracts the useful data of the target node. If this part of information is not detected, the sending node starts to explore the route;
[0104] Next hop node: In the process of information transmission in wireless sensor networks, the data packet sent by the sending node passes through several intermediate nodes and finally reaches the target node. Every time it reaches an intermediate node, the intermediate node selects one of the adjacent nodes as the next hop node after certain routing calculation and analysis, and repeats this process until the next hop is the target node and the data transmission is completed;
[0105] Path node stack: saves the routing information of the intermediate nodes on the complete path from the sending node to the target node in the form of a stack;
[0106] Hop count: indicates the length of time a data packet exists in the network. Its value is the same as the number of nodes the data packet passes through during forwarding. Each time it is forwarded to a new node, the hop count is increased by one to record the length of the entire path. It is one of the evaluation factors for measuring the optimal path.
[0107] Minimum energy value: The energy supply of nodes is randomly allocated and different from each other. There is a node with the least energy. In a complete path, if an intermediate node fails due to energy consumption, the line where it is located will also lose its working ability. The minimum energy value in the path is an important factor in selecting the optimal path.
[0108] Fitness: It is the final basis for determining which path to choose. Fitness is obtained by adding the quantitative data of multiple QoS standards in the network with a certain weight value. The higher the fitness value, the more this path meets the application and user requirements or complies with the reasonable energy allocation and resource management of the network. However, after a data transmission is completed, the fitness value of the path will change, and the network needs to dynamically update the optimal path.
[0109] Figure 3 It is a data packet structure. Sending node address (src_address_): The data packet sent by the sending node to the target node contains the sending node address information. The quest bee in the model carries this address information of the sending node. After the target node receives the message, it reads the address information of the sending node and saves the feedback information together with the address information to the returning node bee.
[0110] Current node address (temp_address): indicates the corresponding node address in the confirmed path. When the bee transmits on the path and reaches a certain node, the node extracts the current node address from the information carried by the bee and compares it with its own address information. If the two are the same, it is the node itself and receives the data packet and continues to forward it. Otherwise, it gives up receiving the bee.
[0111] Destination node address (des_address_): is the address information of the destination node of the complete path. When the data packet sent by the sending node arrives at the destination node, the destination node compares the destination address carried in the data packet with its own address. If they are consistent, it means that it is the destination node and forwards the data. Otherwise, it compares other information of the data packet, such as the current node information, and makes corresponding processing.
[0112] Path node stack (Vector<path_stack> ): During the exploration process, the exploring bee records the address information of all nodes that the complete path passes through and saves it in the path node stack, and returns to the sending node to reserve the data of the path node stack for the sending node. The collecting bee performs routing addressing by reading the information of the path node stack, and reaches the same target node according to the route composed of several nodes in the path stack;
[0113] Previous node (index_): During the exploration phase, each time a searching bee reaches a new node, it stores the data of the previous node at the top of the path node stack. The searching bee obtains the address information of the nodes on the backtracking path from the top of the stack in turn, and returns to the sending node along the original path.
[0114] Data packet life cycle (tll_): Set a life cycle for the forwarded data packet to limit the number of hops of the data packet in the network. When the node reaches the life cycle, the system determines that the node is useless or dead and discards the node. The setting of the data packet life cycle can avoid useless forwarding of data packets in the network.
[0115] Acknowledgement type (ack_): Mark the data packet with the acknowledgement type, using 0 and 1 to distinguish. 0 means that the sending node has received a data packet with feedback information, and 1 means that the destination node has received a data packet sent by the sending node.
[0116] Bee type (type_): Analyze the function of the data packet and divide it into two types from the perspective of bee type: exploratory bees and collecting bees. The type can be set to "0", "1", and "2". Type 0 means that adjacent nodes are exchanging information; type 1 means that this data packet is an exploratory bee type; type 2 means that the data packet is a collecting bee type.
[0117] Bandwidth (bandwidth_): records the bandwidth required by the user's QoS. If it is lower than the bandwidth threshold, the link is considered invalid.
[0118] Send time (send_time_): records the start time of information transmission from the sending node to the target node;
[0119] Receiving time (recieve_time_): records the time when the sending node receives the feedback data packet from the target node. By calculating the receiving time and the sending time, we can know the round-trip time of the sending data packet on a certain path.
[0120] 2. Improved energy routing algorithm of swarm protocol
[0121] First, a wireless sensor network model is established, the number of nodes and the geographical location of the nodes are set, the values of various parameters of the nodes are randomly set, including the energy of the nodes, the range of neighboring nodes, and the location information, and the bandwidth size between adjacent nodes is set;
[0122] Analyze random nodes V i The process of calculating the next hop of a node: define the next hop node as node j, then j must be a neighbor node of node i, and the probability of node j becoming the next hop node is expressed by formula 1, where Pi j It indicates the probability of selecting the next hop node from node i and selecting neighbor node j:
[0123]
[0124] Bees are divided into three types: exploring bees, leading bees, and following bees. Different bees have different probabilities of choosing the same route. j Represents different bee types. The probability of selecting the next hop node j at node i is obtained by formula 2, where ei j Represents QoS constraints, and determines the probability of node j becoming the next hop node by the compliance with QoS conditions, thereby realizing the QoS constraints of routing selection:
[0125]
[0126] The probability Pi of the quest bee choosing the next node j Using formula 3, we can get the path that the bee has not walked as m:
[0127] w ij =1 / m Formula 3
[0128] The probability P of the follower bee selecting the next node is obtained using formula 4:
[0129]
[0130] Calculate the network routing QoS data of path P. The delay consumption in the network is expressed by formula 5:
[0131] Cost(P)=∑Delay(P) Equation 5
[0132] The energy fluctuation Equal(P) is calculated by formula 6, where E max Represents the maximum energy value in the node, and energy(i) represents the energy value of each node in the path:
[0133]
[0134] Different applications have different requirements for network layer QoS. The fitness function 7 is set to test the suitability for various types of applications. λ represents the weight of various parameters in the service requirements. The smaller the calculated value, the higher the degree to which the selected path meets the QoS requirements of the service provided by the application, and the better the energy consumption:
[0135] FIT i =λ1 / Cost(P)+λ2 / Equal(P) Equation 7
[0136] After completing the construction of a path, repeat the above steps until the regional network is traversed, compare the fitness of each path, and select the path with the best fitness as the optimal path.
[0137] Assume that there is a path P = (v1v2…v n ), P is one of the candidate paths, then this path must comply with the following QoS routing constraints:
[0138] (1) Delay constraint: The delay of path P ≤ the minimum required delay;
[0139] (2) Energy constraint: the energy of each node on path p ≥ the minimum energy value of the node;
[0140] (3) Bandwidth constraint: The bandwidth of each link on path p ≥ the minimum required bandwidth.
[0141] 3. Improved QoS Routing Process of Wireless Sensor Networks Based on Swarm Protocol Energy
[0142] The wireless sensor network QoS routing process of improving the energy of the swarm protocol is divided into three steps:
[0143] Step 1: Neighboring nodes update and maintain routing information: In the initial stage, all nodes do not have any network routing information. They send detection packets to obtain routing information of neighboring nodes. If a node does not receive a response message from a neighboring node within the response time set by the protocol, it is considered that the neighboring node has died or failed, and the routing information of the node is removed from the routing table.
[0144] Step 2: Exploring bees detect routing: The sending node uses exploratory bees to detect routing and forward data packets in a broadcast manner. During the forwarding process, the exploratory bees record the information of the nodes passed through each time, including the node address, minimum energy, and number of information, and save them in the form of a stack. After reaching the target node, the exploratory bees return to the sending node with the path information. The sending node calculates the fitness value of each path based on the information returned by each exploratory bee, and periodically updates the routing information and deletes the invalid path information in the routing table.
[0145] Step 3: Bee-collecting routing selection stage: Bee-collecting selects the path according to the roulette method. The path with higher fitness has a higher probability of being selected. Bee-collecting also needs to return to the sending node, so bees not only transmit data, but also record routing information. After returning to the sending node, the routing information is updated. The specific process is as follows: Figure 4 shown.
[0146] 4. Experimental Results Analysis
[0147] (I) Network delay analysis
[0148] The experimental scenario of this experiment is as follows Figure 5 As shown. 16 sensor nodes are arranged in a 500*500 scene. The communication range of the sensor node is set to 250, and the initial energy of each node is 500. The value between the nodes represents the bandwidth size of the link. In order to accurately reflect the changes in the results caused by the algorithm design, the sending node 0 is set to send a quest bee every 2 seconds, a collection bee every 0.5 seconds, and the experiment duration is set to 100 seconds. For the energy consumption of the node, it is set that the behavior of the intermediate node will reduce the remaining energy of the node by one every time it sends or forwards. The node IDs of the sending node and the target node are 0 and 15 respectively. Simulation experiments are carried out under two conditions of 5Kpbs and 10Kpbs for the user QoS bandwidth requirements.
[0149] Since the original algorithm only considers the number of hops of the path, the network delay value is relatively low before the improvement. Considering that there are nodes in the network that process data, there will be some fluctuations in the time, and there is delay jitter in the network. Since the improved algorithm introduces energy factors, the path selected by the improved algorithm may not be the path with the least hops and the shortest delay among the alternative paths. Compared with the original algorithm, the network performance is inferior to that before the improvement. From the experimental results, it can be seen that the broken line represented by the improved delay is on the broken line before the improvement most of the time, but the delay jitter before and after the improvement is on the same level, and the delay jitter is not serious. Because the improved algorithm introduces energy factors, it is inevitable that it will affect the quality of service of other paths, but by setting the weights between different service quality parameters, it can be suitable for various applications.
[0150] When the bandwidth requirement of the QoS constraint is 10Kpbs, the network delay is significantly higher than when the bandwidth requirement is 5Kpbs. This is because when the bandwidth requirement is 10Kpbs, the link bandwidth from node 0 to node 2 and from node 14 to node 15 does not meet the requirement, so data transmission cannot pass through these two links. This directly causes the original 5 shortest paths with only 6 hops to no longer be used for data transmission. The shortest path needs 9 hops to transmit to the target node. The length of the network delay also becomes longer accordingly. This comparison reflects the impact of QoS constraints on network service quality. When the bandwidth requirement is 5Kpbs, the shortest paths are paths A, B, C, D, and E.
[0151] Path A: n2→n3→n8→n 13 →n 11
[0152] Path B: n2→n4→n7→n 10 →n 14
[0153] Path C: n2→n4→n6→n 10 →n 14
[0154] Path D: n1→n5→n9→n 12 →n 14
[0155] Path E: n1→n5→n6→n 10 →n 14
[0156] When the bandwidth requirement is 10Kpbs, the shortest path is path F,G;
[0157] Path F: n1→n5→n6→n4→n7→n8→n 13 →n 11
[0158] Path G: n1→n5→n6→n4→n 10 →n8→n 13 →n 11 .
[0159] (II) Node residual energy analysis
[0160] When evaluating a path, it is necessary to count the energy of the nodes on the path, and calculate the energy fluctuation Cost(P) of path P to represent the average energy of the nodes on this path. This is used as one of the criteria for measuring the path. In this experiment, the QoS bandwidth requirement is set to 5K in the scenario, and the data of the remaining energy of the nodes of the original bee swarm algorithm and the improved bee swarm algorithm are compared.
[0161] The results of the residual energy changes of the nodes shown in the two groups of experiments are quite different. In contrast, in the experiment of the original bee colony algorithm, the residual energy of each node after 60 seconds is quite different and unevenly distributed. Some nodes have died, and some nodes have only consumed a small amount of energy. The method of evaluating the path of the original bee colony algorithm is formula 8:
[0162] Metric i =1 / TTL(P) Formula 8
[0163] Therefore, the energy consumption of the path is only related to the number of hops of the sending and receiving path. The longer the path, the longer the round trip time of the data, and the lower the evaluation metric value, which means that the path is more difficult to be selected. From node 0 to node 15, only considering the shortest path, the sending node needs to pass through 5 intermediate nodes. Node 2\node 10 and node 14 exist on at least three shortest paths, so these nodes are more likely to be selected as intermediate nodes. During the test time, they are selected as intermediate nodes for data forwarding more times than other nodes. Forwarding data packets consumes more energy, so the energy of these nodes varies greatly and dies faster. Analyzing from the simulation results, it is found that these three nodes do consume faster than the average level. The energy consumption of nodes adjacent to multiple nodes is generally faster because they exist in more hop paths. When the questing bees reach these nodes, they will have more choices and perform more sending and receiving behaviors.
[0164] After 60 seconds, the node distribution area is more concentrated than before the improvement. In the improved algorithm, the residual energy of the nodes in the path is considered as one of the criteria for evaluating the path. Under the same delay, the path with a larger average capacity of the nodes on the path is selected. Since the residual energy of each node in the network may change every time the exploration bee conducts a new exploration, the node capacity on the path that was originally selected more frequently will be consumed faster during the latest exploration, and its superiority will be surpassed by other paths. Therefore, the path selection is actually a dynamic process. Due to the inclusion of energy factors, the delay factor is not the only criterion for determining path selection. For several paths with the same number of hops and a small delay difference, the number of times they are selected tends to be similar, so the residual energy of the nodes on these paths changes relatively close. Therefore, from the perspective of node residual energy, it can be concluded that the improved algorithm helps to balance node energy for the network.
[0165] (III) System overall energy consumption analysis
[0166] The life cycle of the network is most obviously affected by the system energy consumption. If the system energy consumption of the network is relatively high, the life cycle of the network will be relatively short. Set 40 nodes in the preset space of 1000*1000, the communication range of each node is 250, and the delay operation time is set to 200 seconds.
[0167] The sending node is set to send a quest bee every 2 seconds and a collection bee every 0.5 seconds. Assume that the behavior of the intermediate node receiving the packet does not consume energy each time, and each forwarding consumes energy and is set to the node's remaining energy minus one. In this experiment, it is assumed that the initial energy of each node is 1000, and the total remaining energy of the system is recorded through simulation experiments. Figure 6 shown.
[0168] from Figure 6 It can be seen that at the beginning of the experiment, the line graphs representing the original bee colony algorithm and the improved algorithm are relatively close. This is because at the beginning, the initial values of all nodes are similar and large, so the energy factor does not play a big role in path selection at this stage. The decisive factor at this time is the round-trip delay of the path under the fixed network topology structure, which can be regarded as the number of hops of the path to some extent. Figure 6 It is found that the total energy consumption of the system is relatively large in the initial stage. This is because in the initial stage, a search bee is sent to find the optimal path. If there are multiple adjacent nodes in the process, multiple search packets may be forwarded, so the total energy consumption of the system is relatively large in the initial stage.
[0169] After the system has been running for a period of time, the residual energy value of the network has increased compared to before the improvement. In the original bee colony algorithm, the system does not consider energy factors, but only considers the delay problem. Then the sending node always chooses a path with the least hops and the shortest sending and receiving delay for data transmission, and the energy consumption of the nodes on this path will be relatively faster. In the network, some nodes may not only exist on a certain path, but may be used by multiple paths. In this case, these nodes on the optimal path will die earlier, which will cause the network to choose other paths for data transmission, which will invisibly increase the network load of other paths. In the improved algorithm, taking energy into consideration is beneficial to the reasonable distribution of traffic in the network, the shortest path will not be overused, and the use of nodes will be more balanced to reduce the energy loss of the system. Therefore, the improved algorithm can extend the overall life cycle of the system by reducing energy consumption.
[0170] (IV) Analysis of the number of surviving nodes
[0171] The number of surviving nodes can reflect the effective life of the network and the load balance of the network. If the initial settings are the same, after a certain period of time, the node survival ratio of one network is high, then the energy consumption difference of the network nodes is relatively close, and the node load is relatively balanced. Although a larger number of surviving nodes does not mean that the total remaining energy of the system is high, in general, if the node survival ratio is high and the death of the first node is regarded as the end of the network life cycle, then the life cycle of the network is longer.
[0172] The death time of the first node in the original bee colony algorithm network is earlier than the death time of the first node after the improvement, and the difference between the two broken lines increases with time, that is, the death rate of nodes in the improved network is lower than that of the original bee colony algorithm network. This is because before the improvement, the network's choice of path is based on the transmission delay. The fewer the hops, the shorter the delay, and the energy of the nodes is in a sufficient state, which plays a small role. However, due to the introduction of energy factors after the improvement, the network traffic may be balanced to other paths. Then the load of the node on the optimal path before the improvement is smaller than the load of the node on the optimal path before the improvement. The larger the load, the faster the energy consumption, so the first node in the network before the improvement dies. As time goes by, in the improved algorithm, when the transmission delay is similar, the network always tends to choose the path composed of nodes with relatively large residual energy and relatively balanced energy of each node for data transmission, which reduces the selection of the path where the low-energy node is located. The frequency of these low-energy nodes being used to forward data packets will be reduced, which will extend the survival time of the low-energy nodes.
[0173] (V) Network life cycle analysis
[0174] It directly reflects the service life of the network. The time when the first dead z node appears, the time when the number of dead nodes reaches 5, 10, 15, 20, and 25 is recorded respectively. The experimental results are as follows: Figure 7 shown.
[0175] Under the same network initial settings, the time when the first dead node appears in the network before and after the improvement is relatively close, and the time difference between the 10th, 15th, 20th, and 25th dead nodes is getting bigger and bigger. This is because in the initial stage of the simulation, the remaining energy of the nodes is relatively large, and the energy factor has limited impact on the network. However, when the number of dead nodes reaches 20 and 25 respectively, the improved algorithm considers the need to balance the energy of the nodes, so it prolongs the life cycle of the network.< / routertable> < / routertable>
Claims
1. A wireless sensor network QoS routing method based on improved swarm protocol energy, characterized in that: Based on the requirements of wireless sensor networks for service quality, the network routing protocol is improved by introducing node residual energy factors and dynamic updates of routing protocols. The improved bee colony algorithm incorporates new protocols and energy to complete routing. On this basis, some QoS constraints are added, including network delay and network energy consumption to ensure the reliability and efficiency of the transmission route. The specific improvements include: 1) Introducing node residual energy factors: In the process of path finding, the influence of path energy consumption on the judgment of the optimal path is strengthened, more high-energy nodes are used, and low-energy nodes are protected, so that the network nodes are more energy balanced than before; 2) Dynamic update of routing protocol: In the improved algorithm, the routing information is updated regularly to ensure that the acquired path is the optimal path at the time, and to avoid the nodes of the optimal path from reducing their working capacity due to energy exhaustion or damage, which affects the service quality of the path.
2. The wireless sensor network QoS routing method for improving the swarm protocol energy according to claim 1 is characterized in that: Improved swarm protocol energy routing algorithm: First, a wireless sensor network model is established, the number of nodes and the geographical location of the nodes are set, the values of various parameters of the nodes are randomly set, including the energy of the nodes, the range of neighboring nodes, and the location information, and the bandwidth size between adjacent nodes is set; Analyze random nodes V i The process of calculating the next hop of a node: define the next hop node as node j, then j must be a neighbor node of node i, and the probability of node j becoming the next hop node is expressed by formula 1, where Pi j It indicates the probability of selecting the next hop node from node i and selecting neighbor node j: Bees are divided into three types: exploring bees, leading bees, and following bees. Different bees have different probabilities of choosing the same route. j Represents different bee types. The probability of selecting the next hop node j at node i is obtained by formula 2, where ei j Represents QoS constraints, and determines the probability of node j becoming the next hop node by the compliance with QoS conditions, thereby realizing the QoS constraints of routing selection: The probability Pi of the quest bee choosing the next node j Using formula 3, we can get the path that the bee has not walked as m: w ij =l / m Formula 3 The probability P of the follower bee selecting the next node is obtained using Formula 4, where D is the number of paths: Calculate the network routing QoS data of path P. The delay consumption in the network is expressed by formula 5: Cost(P)=∑Delay(P) 式5 The energy fluctuation Equal(P) is calculated by formula 6, where Ema x Represents the maximum energy value in the node, and energy(i) represents the energy value of each node in the path: Different applications have different requirements for network layer QoS. The fitness function 7 is set to test the suitability for various types of applications. λ represents the weight of various parameters in the service requirements. The smaller the calculated value, the higher the degree to which the selected path meets the QoS requirements of the service provided by the application, and the better the energy consumption: FITi=R / Cost(P)+R / Equal(P) Formula 7 After completing the construction of a path, repeat the above steps until the regional network is traversed, compare the fitness of each path, and select the path with the best fitness as the optimal path.
3. The wireless sensor network QoS routing method for improving swarm protocol energy according to claim 1 is characterized in that: Assume that there is a path P = (v1v2…v n ), P is one of the candidate paths, then this path must comply with the following QoS routing constraints: (1) Delay constraint: The delay of path P ≤ the minimum required delay; (2) Energy constraint: the energy of each node on path p ≥ the minimum energy value of the node; (3) Bandwidth constraint: The bandwidth of each link on path p ≥ the minimum required bandwidth.
4. The wireless sensor network QoS routing method for improving swarm protocol energy according to claim 1 is characterized in that: The wireless sensor network QoS routing process of improving the energy of the swarm protocol is divided into three steps: Step 1: Neighboring nodes update and maintain routing information: In the initial stage, all nodes do not have any network routing information. They send detection packets to obtain routing information of neighboring nodes. If a node does not receive a response message from a neighboring node within the response time set by the protocol, it is considered that the neighboring node has died or failed, and the routing information of the node is removed from the routing table. Step 2: Exploring bees detect routing: The sending node uses exploratory bees to detect routing and forward data packets in a broadcast manner. During the forwarding process, the exploratory bees record the information of the nodes passed through each time, including the node address, minimum energy, and number of information, and save them in the form of a stack. After reaching the target node, the exploratory bees return to the sending node with the path information. The sending node calculates the fitness value of each path based on the information returned by each exploratory bee, and periodically updates the routing information and deletes the invalid path information in the routing table. Step 3: Bee-collecting routing selection stage: Bee-collecting selects the path according to the roulette method. The path with higher fitness has higher probability of being selected. Bee-collecting also needs to return to the sending node. Bee-collecting not only transmits data but also records routing information. After returning to the sending node, the bee-collecting will update the routing information.
5. The wireless sensor network QoS routing method for improving the swarm protocol energy according to claim 1 is characterized in that: QoS routing architecture for wireless sensor networks: Two types of bees are defined as exploring bees F and homing bees B. An exploring bee starts its exploration from the starting node, passes through several intermediate nodes, and reaches the target node. During the transmission process of the intermediate nodes, the bee records the number of hops through the node, the delay and bandwidth information of the link between the nodes. After the bee finds the target node, the exploring bee F changes its state to the homing bee B, carrying the previously collected and saved information and returning to the starting point along the original path, and analyzing the suitability of the service quality of this path at the starting point.
6. The wireless sensor network QoS routing method for improving swarm protocol energy according to claim 1 is characterized in that: The node structure of the wireless sensor network QoS routing architecture includes: Starting node address (src_address_): an independent identifier of a node in a wireless sensor network, and the only standard for node identity authentication when other nodes transmit information to it; Destination node address (des_address_): The sending node uses the destination node address as the basis for routing selection and data transmission; Node energy (node_energy_): It is the amount of remaining energy of a single node. Its usage time is the life cycle of the node. Send packet size (packet_size_): the size of the routing data packet sent; Routing Table (Vector <routertable> ): All nodes are equipped with routing tables to store routing data of nodes and local or global networks. The routing information stored in the routing table includes the target node address, neighbor node address, neighbor node routing status, path energy consumption between the current node and the next node, and network overhead. The questing bee selects the next hop node by analyzing the routing information to achieve the search for the honey source. The leading bee and the following bee maintain or update the routing table during the network communication process to achieve path convergence.< / routertable> Forwarding packet pointer (temp_packet_): The information transmission process of the sending node to the target node is reflected in the forwarding packet. The forwarding packet pointer points to this forwarding packet. When a node receives a forwarding packet, it needs to compare the information in the forwarding packet with itself to confirm whether it is the target node of the forwarding packet. If not, the forwarding packet will continue to be forwarded. During the forwarding process, a timer is set for the forwarding packet. The value of the timer is set globally and will not be changed by the intermediate nodes. The setting of the timer helps the system monitor the internal nodes. Data packet life cycle (tll_max_): Set a life cycle for the forwarded data packet to limit the number of hops of the data packet in the network. When the node reaches the life cycle, the system determines that the node is useless or dead and discards the node. The setting of the data packet life cycle prevents the data packet from doing useless forwarding work in the network; The amount of data sent by the node (send_numb): indicates the number of data packets sent out by the sending node; The amount of data received by the node (recieve_numb_): indicates the number of feedback data packets received by the sending node; After reaching the target node, the quest bee sends a data feedback with path information to the sending node. The sending node determines the optimal path by analyzing the received feedback information. By comparing the amount of data sent and the amount of data fed back at the end, the amount of information lost before and after sending and receiving is obtained, and the line loss rate is calculated accordingly.
7. The wireless sensor network QoS routing method for improving swarm protocol energy according to claim 1 is characterized in that: The routing table structure of the wireless sensor network QoS routing architecture includes: Target node address (des_address_): At the initial stage of the process of data transmission from a node to a target node, the sending node checks its own routing table and extracts useful data from the target node. If this part of information is not detected, the sending node starts to explore the route; Next hop node: In the process of information transmission in wireless sensor networks, the data packet sent by the sending node passes through several intermediate nodes and finally reaches the target node. Every time it reaches an intermediate node, the intermediate node selects one of the adjacent nodes as the next hop node after certain routing calculation and analysis, and repeats this process until the next hop is the target node and the data transmission is completed; Path node stack: saves the routing information of the intermediate nodes on the complete path from the sending node to the target node in the form of a stack; Hop count: indicates the length of time a data packet exists in the network. Its value is the same as the number of nodes the data packet passes through during forwarding. Each time it is forwarded to a new node, the hop count is increased by one to record the length of the entire path. It is one of the evaluation factors for measuring the optimal path. Minimum energy value: The energy supply of nodes is randomly distributed and different from each other. There is a node with the least energy. In a complete path, if an intermediate node fails due to energy consumption, the line where it is located will also lose its working ability; Fitness: It is the final basis for determining which path to choose. Fitness is obtained by adding the quantitative data of multiple QoS standards in the network with a certain weight value. The higher the fitness value, the more this path meets the application and user requirements or complies with the reasonable energy allocation and resource management of the network. However, after a data transmission is completed, the fitness value of the path will change, and the network needs to dynamically update the optimal path.
8. The wireless sensor network QoS routing method for improving swarm protocol energy according to claim 1 is characterized in that: Wireless sensor network QoS routing architecture data packet structure: Sending node address (src_address_): The data packet sent by the sending node to the target node contains the sending node address information. The quest bee in the model carries this address information of the sending node. After the target node receives the message, it reads the address information of the sending node and saves the feedback information together with the address information to the returning node bee. Current node address (temp_address): indicates the corresponding node address in the confirmed path. When the bee transmits on the path and reaches a certain node, the node extracts the current node address from the information carried by the bee and compares it with its own address information. If the two are the same, it is the node itself and receives the data packet and continues to forward it. Otherwise, it gives up receiving the bee. Destination node address (des_address_): is the address information of the destination node of the complete path. When the data packet sent by the sending node arrives at the destination node, the destination node compares the destination address carried in the data packet with its own address. If they are consistent, it means that it is the destination node and forwards the data. Otherwise, it compares other information of the data packet, such as the current node information, and makes corresponding processing. Path node stack (Vector<path_stack> ): During the exploration process, the exploring bee records the address information of all nodes that the complete path passes through and saves it in the path node stack, and returns to the sending node to reserve the data of the path node stack for the sending node. The collecting bee performs routing addressing by reading the information of the path node stack, and reaches the same target node according to the route composed of several nodes in the path stack; Previous node (index_): During the exploration phase, each time a bee reaches a new node, it stores the data of the previous node at the top of the path node stack. The bee obtains the address information of the nodes on the backtracking path from the top of the stack in turn, and walks the original path back to the sending node. Data packet life cycle (tll_): Set a life cycle for the forwarded data packet to limit the number of hops of the data packet in the network. When the node reaches the life cycle, the system determines that the node is useless or dead and discards the node. The setting of the data packet life cycle can avoid useless forwarding of data packets in the network. Acknowledgement type (ack_): Mark the data packet with the acknowledgement type, using 0 and 1 to distinguish. 0 means that the sending node has received a data packet with feedback information, and 1 means that the destination node has received a data packet sent by the sending node. Bee type (type_): Analyze the function of the data packet and divide it into two types from the perspective of bee type: exploratory bees and collecting bees. Set the type to "0", "1", and "2". Type 0 means that adjacent nodes exchange information; type 1 means that this data packet is of exploratory bee type; type 2 means that the data packet is of collecting bee type.
