Task-driven joint channel time slot allocation method facing data center
Technical Field
The invention relates to the technical field of wireless sensor network communication, in particular to a task-driven multi-data center joint channel time slot allocation method.
Background
A wireless network composed of a sensing terminal, an information transmission and processing center and an application user has wide application in various fields such as intelligent industry, intelligent agriculture, intelligent logistics, intelligent transportation and the like. The industrial wireless sensor network realizes the organic integration of wireless network and industrial process by embedding and assembling the sensor into various industrial devices such as power grid, railway, bridge, tunnel, highway, building, water supply system, oil gas pipeline and the like, thereby greatly improving the production and manufacturing efficiency, improving the product quality, reducing the product cost and resource consumption and promoting the traditional industry to the intelligent industry.
The sensor network based on task driving distributes communication resources according to transmission task requirements in the network, namely, distributes the communication resources according to the distribution condition of data transmission in each time slot network, thereby improving the efficiency of data transmission. There are sink nodes (sink nodes) or gateway nodes in the network, and the data of periodic or non-periodic rows generated in the sensor network are all required to be finally transmitted to the sink nodes. And by adopting a task-driven distribution mode, the consumption of electric quantity can be reduced to the maximum extent.
Data center nodes are function specific devices such as handheld devices, industrial tablet devices, etc. that have been deployed in traditional networks in recent years. The data center node is different from the sink node, and only the information of the local peripheral nodes of the network needs to be acquired. In order to obtain the health condition of peripheral running equipment in real time in an intelligent factory, if a certain delay exists when the forwarding of a sink node is waited or the forwarding is carried out in a cloud service mode, the real-time performance of data cannot be guaranteed. Therefore, there is a need for a channel allocation algorithm that requires real-time reception of data in the range of peripheral nodes in a network without waiting for a long data period, and without affecting the efficiency of the original normal transmission of the network.
Disclosure of Invention
In view of the problems in the field, the invention provides a task-driven-based joint channel time slot allocation method for a data center, which supports a multi-channel TDMA allocation mode and is considered to be a mode with higher reliability in industrial wireless. The invention avoids the main conflict and the secondary conflict in the communication, ensures the reliable transmission of the data, optimizes the data transmission efficiency, and shortens the time for the data to reach the sink node as much as possible, thereby reducing the overall communication delay of the network.
A task-driven-based joint channel time slot allocation method facing a data center comprises two main processes. The first process is as follows: after the network node completes the network networking process, the sensor node sends position information (optional) and neighbor information to the sink node, a routing tree for data transmission is constructed according to network topology information, time slot allocation is carried out according to a link mode that each time slot can be maximally paralleled by a dynamic allocation algorithm, and channel allocation is carried out in a mode of a minimum available channel; and a second process: the data center node broadcasts the data center node existing information, the N-hop neighbor nodes receive the information of the data center node to respond, a route reaching the data center is established, and then conflict-free communication time slots and links are distributed according to the strategy selected by the minimum time slot. Through tests, the delay of data collection by adopting the sink node is not influenced, and the data delay of a data center is greatly reduced.
The joint channel time slot allocation means that a node A needs to transmit data to a node B, the allocated time slot is t, an available channel is c, the node A is switched to the channel c for transmission in the t time slot, and after the transmission is finished, the node A enters a receiving state to receive Ack messages. And the node B is switched to a channel c for receiving in the time slot t, checks after receiving the information, and replies a message with Ack being 1 if the message is successful, or replies with Ack being 0 if the message is not successful.
The channel allocation is to transmit messages among nodes, and different channels are used for communication to solve the problem of secondary collision or hide a terminal. For example, node a transmits data to node B and nodes C and D transmit data. When the distance between the node B and the node C is smaller than the communication radius, different channels need to be used. The invention adopts the channel allocation mode that the minimum available channel is adopted for allocation, namely, each node selects the channel with the minimum number of the currently available channels.
The maximum parallelizable link is a maximum node transmission link capable of performing parallel transmission when the current node is a root node, and the condition to be met is that the node has data to be transmitted. Thus, in the present invention, each time slot is the maximum possible parallel node transmission.
The task-driven-based joint channel time slot allocation method facing the data center comprises the following steps:
step 1: deploying a sink node, a sensor node and a data center node in a network environment, wherein the sensor node periodically collects surrounding environment information and sends the surrounding environment information to the sink node and the data center node; the data center node can periodically collect environment information and receive and display the collected data of the surrounding sensor nodes; the sink node receives and stores information collected by all sensor nodes in the whole network, and performs scheduling control on communication time slots of all the nodes;
step 2: the method comprises the following steps that a sensor node monitors information of surrounding neighbor nodes, completes network time synchronization, completes networking process, monitors information of the neighbor nodes, and a sink node constructs network topology and routing by collecting neighbor information of each sensor node in a network;
and step 3: the sink node schedules and allocates time slots and channels when the sensor nodes communicate by adopting a dynamic planning mode according to the topological structure and the route of the network, and generates a time slot scheduling table 1 of the joint channel time slot; data collected by the sensor nodes can be transmitted to the sink node;
and 4, step 4: forming a routing tree with the data center node as a root node by the data center node and the surrounding sensor nodes, and adding a time slot scheduling table 2 for the sensor nodes to transmit information to the data center on the basis of the time slot scheduling table 1 generated in the step 3, so that the sensor nodes transmit the acquired data to the data center node;
and 5: the sensor node transmits the acquired data to the sink node and the data center node according to the time slot scheduling table 2;
the condition that the communication main conflict is met is that one sensor node can only receive data sent by another sensor node;
the dynamic planning is to adopt a strategy of enumerating all possible conditions and selecting the optimal selection;
the scheduling allocation of the time slots and the channels during the communication of the sensor nodes is that each time slot is transmitted by the node which can be maximally paralleled, and each node selects the channel with the minimum number of the currently usable channels;
the generation method of the time slot scheduling table 2 allocates the communication time slots and routes without conflict according to the strategy of minimum time slot selection.
The method for constructing the routing tree in the step 4 is that the data center node broadcasts the data center node existing message, the N-hop neighbor node receives the data center node message to respond, establishes a route reaching the data center, and then constructs the routing tree; the routing tree is a tree structure formed by paths from each sensor node in the network to the data center node through data forwarding.
The data center node existence message comprises that the network address of the data center node is sent in a competition time slot in a broadcasting mode. The broadcast range is determined according to the actual requirements of the application, and the value of N is generally [1,3 ].
The response comprises agreement or rejection, the default value is agreement, the rejection response is sent under special conditions, if the rejection response is received, the data center node resends the data center message after waiting for a certain time, after the neighbor node agrees to respond to the data center and completes corresponding routing distribution, two data packets are generated after data are generated each time, one data packet is sent to the sink node, and the other data packet is sent to the data center node.
The minimum time slot selection is that the node selects the current minimum time slot which can be communicated for trying, and if the conflict resolution condition is not met, the time slot is increased until the communication can be carried out.
The networking process is that the sink node periodically sends beacon superframes, the sensor node completes time synchronization after receiving the beacon superframes, and sends an adding request, and the sensor node completes the configuration of a network address according to the content of the response after receiving the response of the sink node.
The response of the sink node contains the network address assigned to the sensor node.
The information of the neighbor nodes is the information of other sensor nodes which can communicate with the sensor node in the communication range of the neighbor nodes, the communication range is related to the transmitting power of the sensor node and is inversely proportional to the square of the distance.
The network topology structure is a communication relation connection graph of the whole network constructed according to neighbor node information sent by each sensor node.
A sensor network node: the wireless sensor network node can sense environmental information such as temperature, humidity, illuminance, gas concentration and the like of the surrounding space. The sensor network node periodically generates sensing data; the sensor network node has the forwarding function.
A data center node: the data center node is a handheld device or an industrial flat panel device with a display function, and the running state and data information of peripheral nodes can be conveniently checked in real time. In order to achieve better real-time performance, the best solution is that the peripheral nodes generate data packets directly to the data center and transmit the data packets by using idle time slots.
A sink node: the node with the strongest computing power in the sensor network has a function of connecting the sensor network with the Internet or other forms of networks, and is also called a gateway node. In the invention, the distribution algorithm can be operated by the sink node or the network topology information is sent to the server with strong calculation function, and then the distribution result is forwarded to each node.
The invention provides a task-driven multi-data center joint channel time slot allocation method, which maximizes the number of nodes in each parallel time slot according to the condition that the distribution condition of data in the nodes is allocated, thereby enabling the nodes to reach sink nodes more quickly. Meanwhile, the data center is used as a root node, a routing tree in an N-hop range is constructed, and routes and links from peripheral nodes to the data center are increased, so that the data center node can acquire data more quickly.
The invention has the following beneficial effects:
the task-driven multi-channel TDMA time slot allocation method is provided, nodes which can be paralleled in the same time slot can be paralleled to the maximum extent, fast links from peripheral nodes to a data center are established, and the delay received by the data center is greatly improved. The performance of the method is improved by 15% compared with other algorithms of the same type, and the new requirements of the application of the existing intelligent factory can be better met.
Drawings
FIG. 1 is a diagram of wireless sensor network communication interference range;
wherein the sink is a sink node, n1, n2, n3, n4 and n5 are sensor nodes, and dc is a data center;
FIG. 2 is a route constructed by a wireless sensor network;
fig. 3 is a data center node route.
Detailed Description
The present invention will be described in further detail with reference to examples and drawings, but the present invention is not limited thereto.
Step 1: and deploying sink nodes, sensor nodes and data center nodes in a network environment. As shown in fig. 1, a sink node sink, five sensor nodes n1, n2, n3, n4, n5, and a data center node dc are deployed in the network. All sensor nodes and data center nodes generate data periodically and transmit the data to the sink node.
Step 2: and the sensor node monitors the information of surrounding nodes, and completes the network time synchronization and networking process after receiving the beacon frame of the sink. The sink node constructs a network topology and a route by collecting neighbor information of each node.
Step 2-1: and the sink node periodically sends beacon frames. And the sensor node continuously switches the channel to monitor until the beacon of the sink is monitored, and sends a joining request after the network synchronization is completed. And after receiving the joining request, the Sink node sends a joining response. The join response contains the network address of the node.
Step 2-2: the sensor node periodically sends beacon and keep-alive frames. And sending beacon frames to help other nodes with communication distances smaller than the sink distance to join the network. Keep-alive is used to inform the surrounding nodes of their own status. The sensor determines the neighbor nodes in the communication range of the sensor by receiving keep-alive information sent by the peripheral nodes. And the sensor node sends the collected neighbor information to the sink node.
Step 2-3: and after the sink node collects the neighbor information, forming the route of the wireless sensor network of fig. 2 according to the topology of the network fig. 1. The sensor nodes n2, n3, n4, n5 and dc need to transmit data to the sink node.
And step 3: and the sink node performs scheduling allocation on the time slot and the channel when the sensor nodes communicate by adopting a dynamic planning mode according to the topological structure and the route of the network, and generates a link scheduling table of the combined channel time slot. And sending the data to each sensor node, and transmitting the data according to the scheduling table, so that the data acquired by the sensor nodes can be transmitted to the sink node. The token value of each node is set to be 1, and the token value changes along with the successful link allocation to represent the distribution condition in the data transmission process.
Step 3-1: the current time slot is t, the sink node calculates the maximum number M of nodes which can be transmitted in parallel in the network, and the specific calculation formula is as follows:
wherein v isiIs a node in the network, M (v)i) Is expressed as viThe topology is the maximum number of links that can be communicated in parallel in the topology of the root node. H (v)i) Denotes viSet of node children, where h1∈H(vi) Denotes its first child node, hi∈H(vi) Represents its ith child node, hf∈H(vi) Representing the last child node. The number of the child nodes is determined through the routing graph, the number of the child nodes of each node is inconsistent, the number of the child nodes of the sink in fig. 2 is 3, and the number is n1, n2 and n3 respectively. The number of child nodes of n1 is 1, which is n 4.
M(vi) The value of (A) is the maximum value selected as the result of the calculation of the various conditions. The task-driven allocation principle is considered if the child node has data transmission, that is, the token value of the child node is greater than 0. The first expression indicates that a pair of nodes are guaranteed to communicate first when the first sub-h 1 node is selected to communicate. Then, the sum of the maximum number of the links which can be paralleled by taking the other child nodes of vi as the root node is calculated, and the sum of the maximum number of the links which can be paralleled by taking the child nodes of h1 as the root node is added. The second expression indicates that the middle subsection hi is selected for communication, similar to the expression where the first subsection h1 is selected. And by analogy, the third expression is to select the last child node for communication.
The last expression vi indicates that none of the child nodes is selected for communication, and therefore the sum of the M values with the child nodes as root nodes needs to be calculated.
In the implementation process of the invention, a bottom-up calculation mode is adopted to calculate the M values of all the points. And the M value of the sink node is the maximum link number which can be paralleled in the whole network.
Step 3-2: and according to the calculation result in the step 3-1, starting from the sink node, allocating channels from the minimum sequence number of the channels, and increasing the sequence number if collision occurs until an available channel is found or all the channels are tried. If there is a channel c available, the nodes are allowed to communicate with the channel c at the current time slot t. And subtracting 1 from the token value of the sending node, and adding 1 to the token value of the receiving node. If there is still no channel available for allocation, the node does not allocate any link and the token value does not change. The sink node is the end point of all data transmission, so the token value is always 0.
And the analogy is carried out, and the channel calculation and the link distribution are completed until the nodes which can be in parallel are calculated in the step 3-1.
Step 3-3: and if the tokens of all the nodes in the network are 0, completing time slot allocation, otherwise, repeatedly executing the steps 3-1 and 3-2.
Step 3-4: after the allocation is completed, the data generated by the node is transmitted according to the allocation result.
Table 1 shows the calculated link assignment results obtained in FIG. 1
Table 1: TDMA stage calculation link allocation results
And 4, step 4: the transmission process to the data center node is completed.
Step 4-1: the data center node broadcasts a data center node presence message. The message contains the network address of the data center node and is sent in a contention time slot in a broadcast mode. The broadcast range is determined according to the actual requirements of the application, and the value of N is generally [1,3 ]. The peripheral node replies the response including agreement or rejection, the default value of the peripheral node response is agreement, and the rejection response is sent under special conditions. If the response is rejected, the data center node will resend the data center message after waiting for a certain time.
Step 4-2: and the data center node allocates links according to the peripheral nodes which agree to respond. The data center and surrounding sensor nodes form a support tree, and a route is formed as shown in fig. 3. Sorting according to the node sequence of the received responses, for example: n2, n3, n4, n 5.
Step 4-3: and (3) on the basis of the time slot scheduling table generated in the step (3), adding time slot scheduling for transmitting information to the data center by the sensor node, so that the sensor node transmits the acquired data to the data center. The available collision-free time slots t are found starting from the smallest time slot.
Step 4-4: and judging whether available channels exist after finding. If there is an available channel c, then the two nodes communicate on channel c at t-slots. If there is no available channel, step 4-3 is performed to find the next available slot.
And 4-5: and repeating the step 4-3 and the step 4-4 until all nodes needing to be allocated with links obtain the links. And the peripheral nodes form two data packets according to the sensing data generated in each period, wherein one data packet is transmitted to the sink node, and the other data packet is transmitted to the data center node.
On the basis of table 1, a time slot schedule for transmitting information to the data center by the sensor node is added, so that the sensor node transmits the acquired data to the data center, as shown in table 2.
Table 2: TDMA stage whole network data transmission time slot table
And 5: and the nodes in the network transmit data according to the time slot scheduling table of the table 2, so that the data acquired by the nodes are transmitted to the sink node and the data center.