Disclosure of Invention
The technical problem is as follows: the invention mainly aims to provide a novel tracking and positioning method based on a label Sensor network (RFSN) aiming at container logistics management, wherein a W-KNN algorithm is adopted in a positioning algorithm.
The technical scheme is as follows: first, several definitions are given:
Wi-Fi based RFSN networks: (Wi-Fi-RFSN, Wireless Fidelity Radio Frequency Sensor Networks), utilize Wi-Fi network to realize the intercommunication between all RFID readers, and then through Wi-Fi-WSN gateway, realize the communication between RFID network and WSN network.
Wi-Fi-WSN gateway: the network equipment comprises a wireless network card, a WSN wireless transceiver and a data processing unit, and is used for connecting a Wi-Fi network and the WSN network and realizing the intercommunication of the two networks.
Wi-Fi-RFID reader: a wireless network card function module is added on a traditional RFID reader-writer, and mutual communication is realized through a wireless Access Point (AP), wherein the RFID reader-writer or the reader-writer is referred to as the RFID reader-writer for short.
The monitoring center: and the system is responsible for monitoring and acquiring information of all APs, sensor nodes, RFID readers, RFID labels and the like on the ship in real time and reporting the information to a master control center.
W-KNN (Weighted k-Nearest Neighbor) positioning algorithm: an attribute weighted k-nearest neighbor positioning algorithm is a classification algorithm oriented to container positioning. Calculating a correlation coefficient for all anchor nodes in the test area, calculating a weight value of each anchor node (distributed in the whole ship space) by the correlation coefficient, and finally expressing the Euclidean distance between the two nodes by using a weighted distance square sum.
Positioning a node: and (3) fixing the sensor node on a ship, wherein the spatial position is known, calculating the relative distance between the sensor node and the sensor node of the container according to a W-KNN positioning algorithm by taking the positioning node as a reference point, and then obtaining the spatial coordinate value of the sensor node to finish positioning.
The WSN clustering method comprises the following steps: the WSN base station node traverses the neighbor list, selects neighbor nodes with high energy values and short response time as first-layer cluster head nodes, and establishes first-layer clustering; traversing the neighbor list by the first layer of cluster heads, and selecting certain neighbor nodes with high energy values and short response time as relay nodes; the relay node traverses the neighbor list, selects neighbor nodes with high energy values and short response time as second-layer cluster head nodes, and establishes second-layer clustering; and repeating the steps to complete the establishment of the WSN whole network clustering process.
Wi-Fi-RFSN packet format: as shown in fig. 6, the packet header and the data content are both included; the data packet header is 96 bits (12 bytes) long, and contains 8 bits of message type, 8 bits of total length, 16 bits of area ID, 16 bits of message destination, 16 bits of message source, 16 bits of destination address, and 16 bits of source address, and the data packet is in the format.
Message type: the method has 9 kinds of different data packet messages, and each kind of message name and its corresponding field value are shown in table 1.
Total length: the total length refers to the length of the sum of the header and the data content, in bytes. The total length field is 8 bits, so the maximum length of the packet is 256 bytes.
Area ID: since each area contains a unique positioning node, the area ID can be represented by the area positioning node ID.
Message homing: the transmission of the data packet needs to be forwarded via a multi-hop route, so that the message destination needs to be noted, i.e. the object which finally needs to receive the data packet is indicated.
Message source: indicating the object from which the packet was originally sent.
Destination address: A. and B, two parties directly communicate without forwarding through a midway route, A sends a data packet to B, and the address of B becomes a destination address.
Source address: the address of a becomes the source address.
(note: the destination address and source address can be ID of monitoring center, ID of gateway, ID of wireless AP, ID of RFID reader, ID of RFID tag, ID of WSN base station, ID of anchor node, ID of positioning node, ID of container sensing node, etc.)
The invention realizes the functions of reading the label information in the container, collecting the sensor node information, positioning the container and the like by using the RFSN network. Before this, the RFSN needs to be initialized.
Before network deployment, each ship is provided with a monitoring center, a Wi-Fi-WSN gateway, a plurality of APs, a plurality of Wi-Fi-RFID readers and containers which are arranged in order. An RFID label for marking the identity is pasted in each container, a sensor node for marking the identity is installed, and the identity marks of the RFID label and the sensor node are the same. Each tag stores an identification (ID number), information identifying the type of cargo in the container, origin, destination, lot, etc. Each node stores an identity (ID number), an energy value, a cluster head node (the ID number of a certain node indicates which cluster the node belongs to), a node type identifier (the identifier is one of a cluster head, a relay and a common node), and an area to which the node belongs. Each node also contains a neighbor list, and records information such as ID number, energy value, cluster head number, response time and the like of the neighbor nodes.
After the above information is configured, the network starts to be deployed.
Method flow
The whole process of the broadcast tracking and positioning method will be described in detail as follows:
the radio frequency identification RFID network and the wireless sensor network WSN are connected through a wireless compatibility authentication Wi-Fi network, and the positioning of the container is realized by adopting an attribute weighted k neighbor positioning algorithm W-KNN, wherein the flow of the method can be described as follows:
initialization of networks
Step 1) arranging and installing a monitoring center, a Wi-Fi-WSN gateway, all containers, RFID tags, sensor nodes, a Wi-Fi wireless access point AP, a Wi-Fi-RFID reader-writer and anchor nodes;
step 2) at the moment, all APs self-form a Wi-Fi wireless network, all sensor nodes self-form a WSN network according to a Leach algorithm, and a base station stores a functional node identity Identification (ID) table, stores ID numbers of anchor nodes and positioning nodes and prepares for collecting position information below;
step 3) dividing the whole test space into m × n test areas according to the distribution of the positioning nodes, wherein each test area is provided with a unique positioning node, so that the area ID can be represented by the area positioning node ID, the space coordinates of the positioning nodes are known, wherein m represents the number of layers, the height of each layer is the height of one container, and n represents the number of the equally divided test areas of each layer;
step 4) broadcasting a 'region positioning' data packet by all m x n positioning nodes, wherein the message type is 'region positioning', the total length is 12 bytes, the data packet only comprises a header, the data content part is empty, the region ID is empty, the message is hosted to be empty, the message source is empty, and the destination address is (0110101000000000)2=(j0)16The object for receiving the data packet is all container sensing nodes in the area, and the source address is the ID of the positioning node;
step 5) after the container sensing node receives the 'area positioning' data packet, storing a source address, namely the positioning node ID of the area, and indicating that the container sensing node belongs to the area where the positioning node is located;
step 6) performing data training once for each test area, namely taking a positioning node as a test sample in the area, wherein the sample is responsible for collecting Received Signal Strength Indication (RSSI) values of all anchor nodes in the test area, generating an RSSI value response data packet, the message type is RSSI value response, the total length is more than 12 bytes, the area ID is the area positioning node ID, the message is hosted as a monitoring center ID, the message source is the positioning node ID, the data content is data in a multi-group form such as 'anchor node ID and RSSI value', and all RSSI values are transmitted to cluster head nodes in the cluster, the cluster head nodes are further uploaded to a base station node, and finally the base station node is transmitted to the monitoring center through a Wi-Fi-WSN gateway;
step 7) the monitoring center receives a plurality of groups of RSSI value response data packets M in M x n areas
rssiCalculating a correlation coefficient matrix R by using a W-KNN positioning algorithm with each area as a unit, wherein the number of the correlation coefficient matrixes is m, n, k anchor nodes are arranged in the area a, and a is 1, 2
Is the correlation coefficient between anchor node i and anchor node j in region a, i is 1, 2
a,j=1,2,...,k
aA1, 2,.., m.n, and
when the value of i is equal to j,
wherein,
And
respectively representing the observed values of the RSSI of the anchor node i and the RSSI of the anchor node j of the test sample in the area a, E (X) and D (X) respectively representing the mathematical expectation and the variance of a random variable X, and Cov (X, Y) representing the covariance of the random variables X and Y; if the detectable ranges of two anchor nodes do not intersect, that is, they are never detected simultaneously, or the variance of the observed value of RSSI of at least one anchor node is 0, defining the correlation coefficient of the anchor node pair to be 0; then, the weight of the anchor node i in the region a is calculated as
Wherein,
to represent
By means of, i.e.
Storing the processed data into an area positioning information data table of a background database;
second, information acquisition process
Step 8) the monitoring center broadcasts an information acquisition data packet, wherein the message type is information acquisition, the total length is 12 bytes, the data packet only comprises a header, the data content part is empty, the area ID is empty, the message is hosted to be empty, the message source is the ID of the monitoring center, the destination address is all 0, the object for receiving the data packet is all receiving devices in the Wi-Fi-RFSN whole network, and the source address is the ID of the monitoring center;
step 9) after the Wi-Fi-WSN gateway receives the 'information acquisition' data packet, converting the data packet into a WSN data packet format and a Wi-Fi data packet format, and respectively sending the WSN data packet format and the Wi-Fi data packet format to the WSN base station and the wireless AP of Wi-Fi;
2.1 Collection of Container sensor node information
Step 10) after receiving the information acquisition information of the gateway, the WSN base station broadcasts a sensing information acquisition data packet in the whole WSN network, wherein the information type is sensing information acquisition, the total length is 12 bytes, the data packet only comprises a header, the data content is empty, and the information destination address is (0110101000000000)2=(j0)16The object for receiving the data packet is all container sensing nodes in the WSN whole network, the message source is the ID of the monitoring center, and the source address is the ID of the base station node;
step 11) after all the container sensing nodes receive the sensing information acquisition data packet, acquiring internal environment information of the container, and generating a sensing acquisition response data packet, wherein the message type is sensing acquisition response, the total length is greater than 12 bytes, the area ID is a positioning node ID of an area where the container sensing nodes are located, the message is collected to be a monitoring center ID, the message source is the container sensing node ID, the destination address is a cluster head node ID of a cluster where the container sensing nodes are located, the source address is the container sensing node ID, and the data content is the internal environment information of the container acquired by the container sensing nodes;
step 12), the container sensing node sends a sensing acquisition response data packet to a cluster head node of the cluster where the container sensing node is located, and the cluster head node transmits the data packet to an upper-layer cluster head node through a relay node until the data packet is sent to a base station node;
step 13), the base station node sends a sensing acquisition response data packet to the Wi-Fi-WSN gateway, wherein the destination address is a gateway ID, the source address is a WSN base station ID, and the rest messages are unchanged;
step 14) the Wi-Fi-WSN gateway sends a sensing acquisition response data packet to a monitoring center, wherein the destination address is the ID of the monitoring center, the source address is the ID of the gateway, and the rest messages are unchanged;
step 15) the monitoring center stores the received data packet into a sensor sensing information data table of a background database;
2.2 Collection of Container RFID tag information
Step 16) after the Wi-Fi wireless AP receives the 'information acquisition' message of the gateway, broadcasting a 'label information acquisition' data packet in the whole network, namely the Wi-Fi signal coverage area, wherein the message type is 'label information acquisition', the total length is 12 bytes, the data packet only comprises a header, the data content is empty, the area ID is empty, the message is homed (0110001000000000)2=(b0)16The object for finally receiving the data packet is all RFID tags in the Wi-Fi whole network, the message source is the monitoring center ID, and the destination address is (0111100100000000)2=(y0)16The object for receiving the data packet is all readers-writers in the Wi-Fi whole network, and the source address is the ID of the wireless AP for sending the message;
step 17) after the Wi-Fi-RFID reader receives the 'tag information acquisition' message of the wireless AP, the Wi-Fi-RFID reader sends electromagnetic waves, after the RFID tag receives the electromagnetic waves, a coil generates induction current, and information built in the tag is transmitted out through the electromagnetic waves;
step 18) after receiving the electromagnetic wave of the tag, the reader-writer converts the electromagnetic wave into a data packet suitable for communication in a Wi-Fi network, namely a tag acquisition response data packet, wherein the message type is tag acquisition response, the total length is more than 12 bytes, the area ID is empty, the message is hosted as a monitoring center ID, the message origin is a container RFID tag ID, the destination address is a wireless AP capable of directly communicating with the reader-writer, the source address is the ID of the Wi-Fi-RFID reader-writer for reading tag information, and the message content is the built-in information of the container RFID tag;
step 19) communication among the wireless APs, and finally sending a 'tag acquisition response' data packet to the Wi-Fi-WSN gateway, wherein the destination address is a gateway ID, the source address is the ID of the AP closest to the gateway, and the rest messages are unchanged;
step 20) the Wi-Fi-WSN gateway sends a 'tag acquisition response' data packet to a monitoring center, wherein the destination address is the ID of the monitoring center, the source address is the ID of the gateway, and the rest messages are unchanged;
step 21) the monitoring center stores the received data packet into an RFID label information data table of a background database;
2.3 Collection of Container position information
Step 22) after receiving the information acquisition information of the gateway, the WSN base station broadcasts a position information acquisition data packet in the whole WSN network, wherein the information type is position information acquisition, the total length is 12 bytes, the data packet only comprises a header, the data content is empty, the area ID is empty, and the information homing and destination addresses are (0110110100000000)2=(m0)16The object for receiving the data packet is all anchor nodes in the WSN whole network, the message source is the ID of the monitoring center, and the source address is the ID of the base station node;
step 23), after receiving the data packet of 'position information acquisition', the anchor node broadcasts the data packet;
step 24), the positioning node and the container sensing node send a 'position acquisition response' data packet to the cluster head node of the cluster where the positioning node and the container sensing node are located, wherein the message type is 'position acquisition response', the total length is more than 12 bytes, the area ID is the positioning node ID of the area where the container sensing node is located, the message is homed to the monitoring center ID, the message source and source addresses are the ID of the positioning node or the container sensing node, the destination address is the cluster head node ID of the cluster where the positioning node or the container sensing node is located, and the data content is the received signal strength of all anchor nodes in the area, namely RSSI value;
step 25), the cluster head node transmits the data packet to the cluster head node on the upper layer through the relay node until the data packet is transmitted to the base station node;
step 26) the base station node sends a 'position acquisition response' data packet to the Wi-Fi-WSN gateway, wherein the destination address is a gateway ID, the source address is a WSN base station ID, and the rest messages are unchanged;
step 27) the Wi-Fi-WSN gateway sends a 'position acquisition response' data packet to a monitoring center, wherein the destination address is the ID of the monitoring center, the source address is the ID of the gateway, and the rest messages are unchanged;
step 28), the monitoring center stores the received data packet into a 'sensing node/positioning node position information data table' of a background database;
third, information processing procedure
3.1 location information calculation
Step 29) the monitoring center finds out a sensing node/positioning node position information data table from the background database, divides the data in the table into m x n groups according to the area ID, calculates the distances d (e, f) between the positioning node and all container nodes in the area by using a W-KNN positioning algorithm in each group,
<math><mrow>
<mi>d</mi>
<mrow>
<mo>(</mo>
<mi>e</mi>
<mo>,</mo>
<mi>f</mi>
<mo>)</mo>
</mrow>
<mo>=</mo>
<msqrt>
<msubsup>
<mi>Σ</mi>
<mrow>
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<msub>
<mi>k</mi>
<mi>a</mi>
</msub>
</msubsup>
<msubsup>
<mi>w</mi>
<mi>i</mi>
<mi>a</mi>
</msubsup>
<msup>
<mrow>
<mo>(</mo>
<msubsup>
<mi>rssi</mi>
<mrow>
<mi>e</mi>
<mo>,</mo>
<mi>i</mi>
</mrow>
<mi>a</mi>
</msubsup>
<mo>-</mo>
<msubsup>
<mi>rssi</mi>
<mrow>
<mi>f</mi>
<mo>,</mo>
<mi>i</mi>
</mrow>
<mi>a</mi>
</msubsup>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</msqrt>
<mo>,</mo>
</mrow></math> where e denotes a positioning node in area a, f denotes a container sensing node in area a and f is 1, 2
a;l
aIndicates the number of container nodes, k, in the area a
aIndicating the number of anchor nodes within region a,
represents the weight of the ith anchor node in region a,
respectively representing RSSI observed values of a positioning node e and a node f in the area a to the ith anchor node; coordinates of a positioning node of the known area a are (x, y, z), x represents an abscissa, y represents an ordinate, and z represents a vertical coordinate, so that spatial coordinates of a container sensing node f are (x, y + d (e, f), z); the monitoring center stores the calculated data into a sensor coordinate information data table of a background database;
3.2 all information Synthesis
Step 30) the monitoring center finds out a sensor sensing information data table, an RFID label information data table and a sensor coordinate information data table from a background database, combines data in the three tables into a piece of container data information according to a rule that container sensing node IDs correspond to container RFID label IDs one by one, and stores the container data information into a container information data table of the background database, wherein the container IDs are IDs of sensing nodes in a container or IDs of RFID labels, and the content of container information comprises three parts of information, namely sensor sensing information, RFID label information and sensor position coordinate information;
fourth, information sending process
Step 31), the monitoring center sends a container data message to a communication satellite through a GSM module; the communication satellite forwards the data to a receiving tower on the ground; the receiving tower sends the real-time tracking and positioning message to a ground master control center or a mobile terminal through the Internet or the GSM network.
Has the advantages that: the invention provides a container logistics tracking and positioning method based on a label sensor network, which has the following advantages:
(1) the problem of short communication distance of an RFID reader-writer is solved by utilizing a tag sensor network to track and position logistics, the communication range is expanded, the content of acquired information is perfected by combining the application of sensor nodes, and the environmental condition in the container can be known more comprehensively;
(2) by combining the W-KNN positioning algorithm with the sensor nodes, the container on the ship can be positioned, the weight values of the anchor nodes are distributed according to the relevance, and the positioning accuracy is improved to a certain extent.
Detailed Description
The technical scheme and the method flow of the present invention will be further described in detail by taking the figures as examples and a specific example.
Initialization of networks
Step 1) arranging and installing a monitoring center, a Wi-Fi-WSN gateway, all containers (provided with RFID labels and sensor nodes), an AP (access point), a Wi-Fi-RFID reader, anchor nodes and positioning nodes, wherein FIG. 2 is a layout structure diagram of an RFSN example after arrangement and installation;
step 2) at this time, all APs self-form a Wi-Fi wireless network, and all sensor nodes self-form a WSN network according to a Leach algorithm, as shown in the network topology of FIG. 3; in fig. 2, nodes d1 and d2 are positioning nodes, and nodes m1, m2 and m3 are anchor nodes, and the base station stores a functional node ID table recording the positioning nodes and the anchor nodes according to the formats of [ positioning nodes, d1, d2], [ anchor nodes, m1, m2 and m3], so as to prepare for collecting position information below;
step 3) in fig. 2, the space of the whole ship is divided into 2 x 1 test areas according to the distribution of the positioning nodes, wherein the containers 1, 2 and 3 are in the area 1, and the containers 4, 5 and 6 are in the area 2; each test area has a positioning node, the positioning node of the area 1 is d1, and the positioning node of the area 2 is d 2;
step 4) all the positioning nodes (2 x 1) in fig. 2 broadcast the "area positioning" packet, the format of which is shown in fig. 6, taking positioning node d1 in area 1 as an example, it broadcasts packet Mqd"area location", 12, null, null, null, j0, d1, null]Wherein, the "area location" is a message type, 12 indicates that the total length is 12 bytes, three null respectively indicate that the area ID is null, the message is hosted null, and the message source is null, j0 is a destination address (indicating that an object receiving the data packet is all container sensing nodes in the area), d1 is a source address, and the last null indicates that the data content part is null;
step 5) the container sensing node in fig. 2 receives the 'area positioning' data packet MqdThen, taking the container sensing nodes j1, j2 and j3 in the area 1 as an example, the container sensing nodes store the source address d1, which indicates that the container belongs to the area where the positioning node d1 is located;
step 6) performing data training once for each test area, taking area 1 in fig. 2 as an example, taking positioning node d1 as a test sample, and d1 being responsible for acquiring RSSI values of all anchor nodes (M1, M2, M3) in area 1, and generating an "RSSI value response" data packet Mrssi[ "RSSI value response", > 12, d1, jc, d1, c2, d1, (mi, 5)]Wherein "RSSI value response" is message type, > 12 indicates total length greater than 12 bytes, data content is not empty, three d1 are area ID, message source and source address respectively, jc is message destination, c2 is destination address, (mi, 5) is message content, mi can take m1, m2, m3 (anchor node ID indicating the area), 5 is measured RSSI value; as shown in FIG. 3, without setting the node d1 to belong to the cluster 2, the d1 will send all the zone location response messages MrssiThe data is transmitted to a cluster head node c2 in the cluster, the cluster head node c2 is transmitted to a relay node z1, z1 is transmitted to a cluster head node c1 at the upper layer, c1 is transmitted to a base station node, and finally the base station node is transmitted to a monitoring center through a Wi-Fi-WSN gateway;
step 7) in fig. 2, the monitoring center jc receives multiple sets of RSSI value response data packets M in 2 x 1 regions
rssiUsing W-KNN positioning algorithm to calculate correlation coefficient matrix R (total 2 × 1) for each region, taking region 1 as an example, and 3 anchor nodes in region 1, the corresponding correlation coefficient matrix is
Is the correlation coefficient of the anchor node mi and the anchor node mj, and
(i-1, 2, 3, j-1, 2, 3), wherein,
and
represents the observed values of the test sample d1 for the RSSI of the anchor node mi and the anchor node mj, respectively, e (X) and d (X) represent the mathematical expectation and variance, respectively, of the random variable X, and Cov (X, Y) represents the covariance of the random variables X and Y; it is not assumed that the correlation coefficient matrix of region 1 is obtained by calculation
Then, the weight of all anchor nodes in the region 1 is calculated, and the weight of the node m1 is
<math><mrow>
<msubsup>
<mi>w</mi>
<mn>1</mn>
<mn>1</mn>
</msubsup>
<mo>=</mo>
<mfrac>
<mn>1</mn>
<mrow>
<msubsup>
<mi>R</mi>
<mn>1</mn>
<mn>1</mn>
</msubsup>
<mo>*</mo>
<msup>
<mrow>
<mo>(</mo>
<msubsup>
<mi>R</mi>
<mn>1</mn>
<mn>1</mn>
</msubsup>
<mo>)</mo>
</mrow>
<mi>T</mi>
</msup>
</mrow>
</mfrac>
<mo>=</mo>
<mfrac>
<mn>1</mn>
<mrow>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>·</mo>
<mfrac>
<mn>1</mn>
<mn>2</mn>
</mfrac>
<mo>·</mo>
<mfrac>
<mn>1</mn>
<mn>2</mn>
</mfrac>
<mo>)</mo>
</mrow>
<mo>*</mo>
<msup>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>·</mo>
<mfrac>
<mn>1</mn>
<mn>2</mn>
</mfrac>
<mo>·</mo>
<mfrac>
<mn>1</mn>
<mn>2</mn>
</mfrac>
<mo>)</mo>
</mrow>
<mi>T</mi>
</msup>
</mrow>
</mfrac>
<mo>=</mo>
<mfrac>
<mn>1</mn>
<mrow>
<mn>1</mn>
<mo>+</mo>
<mfrac>
<mn>1</mn>
<mn>4</mn>
</mfrac>
<mo>+</mo>
<mfrac>
<mn>1</mn>
<mn>9</mn>
</mfrac>
</mrow>
</mfrac>
<mo>=</mo>
<mfrac>
<mn>36</mn>
<mn>49</mn>
</mfrac>
<mo>,</mo>
</mrow></math> By the same way, obtain
And in accordance with
Is stored in a background database, and represents that the weight of the anchor node m1 in the area where the positioning node d1 is located is
The situations of the anchor node m2 and the anchor node m3 in the region are similar, and the situations of the other regions are also similar, which are not described again;
second, information acquisition process
Step 8) the monitoring center broadcasts an 'information acquisition' data packet Mxc[ "information collection", 12, null, null, jc, 00, jc]Wherein, the "information acquisition" is a message type, 12 indicates that the total length is 12 bytes (indicating that the data packet only contains a header and the data content part is empty), two null respectively indicate that the area ID is empty and the message is hosted as empty, two jc respectively indicate a message source and a message source address, and 00 (hexadecimal number), that is, 16-bit number all 0 of the destination address (indicating that the object for receiving the data packet is all receiving devices in the Wi-Fi-RFSN whole network);
step 9) the Wi-Fi-WSN gateway receives the 'information acquisition' data packet MxcThen, the data packet is converted into a WSN data packet format MxcsAnd Wi-Fi packet format MxcfRespectively sending the data to the WSN base station and the wireless AP of the Wi-Fi;
2.1 Collection of Container sensor node information
Step 10) the WSN base station receives an information acquisition data packet M of the gatewayxcsThen, a 'sensing information acquisition' data packet M is broadcasted in the whole WSN networkcc"sensory information collection", 12, null, j0, jc, j0, jz]Wherein, the "sensing information collection" is a message type, 12 indicates that the total length is 12 bytes (indicating that the data packet only contains a header and the data content is empty), null indicates that the area ID is empty, two j0 respectively indicate the message destination and destination addresses (indicating that the object receiving the data packet is all container sensing nodes in the WSN whole network), jc indicates the message source, and jz indicates the source address;
step 11) all the container sensing nodes receive the sensing information acquisition data packet MccThen, the internal environment information of the container is collected to generate a sensing collection response data packet MccxTaking the container sensor node j1 of FIG. 3 as an example, j1 generates the data packet Mccx[ "sensory acquisition response", > 12, d1, jc, j1, c2, j1, 34 ℃ C]Wherein, the "sensing acquisition response" is a message type, where > 12 indicates that the total length is greater than 12 bytes, the data content is not empty, d1 is an area ID, jc is a message sink, two j1 are a message source and a message source respectively, c2 is a destination address, and 34 ℃ (taking this as an example, it indicates the container internal environment information acquired by the container sensor node) is the message content;
step 12) the container sensing node j1 transmits the sensing acquisition response data packet MccxThe data packet is sent to a cluster head node c2 of the cluster where the data packet is located, and the c2 transmits the data packet to an upper-layer cluster head node c1 through a relay node z1 until the data packet is sent to a base station node jz;
step 13) the base station node sends the data packet of 'sensing acquisition response' to the Wi-Fi-WSN gateway, Mccx[ "sensory acquisition response", > 12, d1, jc, j1, wg, jz, 34 ℃ C]At this time, the gateway wg is a destination address, jz is a source address, and the rest of messages are unchanged;
step 14) the Wi-Fi-WSN gateway sends a sensing acquisition response data packet to a monitoring center, Mccx[ "sensory acquisition response", > 12, d1, jc, j1, jc, wg, 34 ℃ C]At this time, the monitoring center jc is both the message destination and the destination address, the gateway wg is the source address, and the rest of the messages are unchanged;
step 15), the monitoring center jc is stored into a background database according to the format of [ j1, 34 ℃ and indicates that the temperature in the container where the container node j1 is located is 34 ℃;
2.2 Collection of Container RFID tag information
Step 16) the Wi-Fi wireless AP receives the 'information acquisition' message M of the gatewayxcfThen, broadcasting a 'tag information acquisition' data packet M in the Wi-Fi whole networkbcTaking the wireless access point a3 in FIG. 3 as an example, Mbc"tag information collection", 12, null, b0, jc, y0, a3]Wherein, the "tag information collection" is a message type, 12 indicates that the total length is 12 bytes (indicating that a data packet only includes a header and a data content is empty), null indicates that an area ID is empty, b0 indicates that a message is received (indicating that an object finally receiving the data packet is all RFID tags in a Wi-Fi global network), a monitoring center jc is a message source, y0 is a destination address (indicating that an object receiving the data packet is all readers/writers in the Wi-Fi global network), and a3 is a source address:
step 17), taking reader/writer y1 and tag b1 in fig. 3 as examples, y1 receives "tag information acquisition" message M of wireless APbcThen, electromagnetic waves are sent, after the RFID tag b1 receives the electromagnetic waves, the coil generates induction current, and the information in the tag is transmitted out through the electromagnetic waves;
step 18) after receiving the electromagnetic wave of the tag b1, the reader-writer y1 converts the electromagnetic wave into a data packet suitable for communication in the Wi-Fi network, namely a tag acquisition response data packet Mbcx"tag Collection response", > 12, null, jc, b1, a1, y1, "origin" Beijing, and "destination" Nanjing "]Wherein, the 'tag collecting response' is a message type, the total length is larger than 12 bytes by > 12, the data content is not null, null indicates that the area ID is null, the monitoring center jc is a message sink, and the source RFID tag b1 is a messageIn the source, a wireless Access Point (AP) a1 is a destination address, a Wi-Fi-RFID reader y1 which transmits a Wi-Fi wireless signal is a source address, and a "origin place ═ beijing," a mean place ═ nanjing "(built-in information of a container RFID tag) is a message content;
step 19) communication between the wireless APs, and finally, a 'tag acquisition response' data packet MbcxSending to a Wi-Fi-WSN gateway wg, Mbcx"tag Collection response", > 12, null, jc, b1, wg, a3, "origin of transportation to Beijing," destination of transportation to Nanjing "]At this time, the gateway wg is a destination address, the wireless access point a3 closest to the gateway is a source address, and the rest of messages are unchanged;
step 20) the Wi-Fi-WSN gateway wg collects the data packet M of the' label acquisition responsebcxSending to a monitoring center jc, Mbcx"tag Collection response", > 12, null, jc, b1, jc, wg, "origin of transportation to Beijing, and origin of transportation to Nanjing"]At this time, the monitoring center jc is both the message destination and the destination address, the gateway wg is the source address, and the rest of the messages are unchanged;
step 21) the monitoring center jc stores the information into the background database according to the format of [ b1, "origin place is beijing, and destination place is nanjing" ], which indicates that the origin place of the container in which the label b1 is located is beijing and the destination place is nanjing;
2.3 Collection of Container position information
Step 22) the WSN base station receives the 'information acquisition' M of the gatewayxcsAfter the information, broadcasting a 'position information acquisition' data packet M in the WSN whole networkwcPosition information collection [ "position information collection", 12, null, m0, jc, m0, jz]The location information acquisition is of a message type, 12 indicates that the total length is 12 bytes (indicating that a data packet only contains a header and the data content is empty), null indicates that the area ID is empty, two m0 are respectively a message destination address and a destination address (indicating that an object receiving the data packet is all anchor nodes in the WSN whole network), the monitoring center jc is a message source, and the base station node jz is a source address;
step 23) anchoringThe node receives the data packet M of' position information acquisitionwcThen, broadcasting the data packet;
step 24) in the fig. 3, the positioning node d1 and the container sensing node j1 send a 'position acquisition response' data packet M to the cluster head node c2 in the clusterwcx(ii) [ "position acquisition response", > 12, d1, jc, d1 (or j1), c2, d1 (or j1), rssi [ ]d1(or rssi)j1)]Wherein, the 'position collecting response' is a message type, the total length is larger than 12 bytes by more than 12, the data content is not null, d1 is a region ID, the monitoring center jc is a message sink, two d1 (or j1) are respectively a message source and a message source address, the cluster head node c2 is a destination address, rssid1(or rssi)j1) (representing received signal strength of the anchor node) as data content;
step 25) the cluster head node c2 transmits the data packet to the cluster head node c1 of the upper layer through the relay node z1 until transmitting to the base station node jz;
step 26) base station node jz sends "position acquisition response" data packet MwcxSent to a Wi-Fi-WSN gateway, MwcxPosition acquisition response [, > 12, d1, jc, d1 (or j1), wg, jz, rsid1(or rssi)j1)]At this time, the gateway wg is a destination address, the WSN base station jz is a source address, and the rest of messages are unchanged;
step 27) the Wi-Fi-WSN gateway wg sends a 'position acquisition response' data packet MwcxSending to a monitoring center jc, MwcxPosition acquisition response [, > 12, d1, jc, d1 (or j1), jc, wg, rsid1(or rssi)j1)]At this time, the monitoring center jc is a destination address, the gateway wg is a source address, and the rest of messages are unchanged;
step 28) the monitoring center jc is according to [ d1 (or j1), d1, rssid1(or rssi)j1)]Is stored in the background database, and represents the anchor node signal strength (i.e., RSSI value) received by the positioning node d1 (or the container sensing node j1) in the area where the positioning node d1 is located;
third, information processing procedure
3.1 location information calculation
Step 29) the monitoring center finds out a table shown as (d) in the table 2 from the background database, divides the data in the table into 2 x 1 groups according to the area ID, calculates the distances d (e, f) between the positioning nodes and all container nodes in the area by using a W-KNN positioning algorithm in each group, takes the area 1 as an example as shown in FIG. 4,
<math><mrow>
<mi>d</mi>
<mrow>
<mo>(</mo>
<mi>e</mi>
<mo>,</mo>
<mi>f</mi>
<mo>)</mo>
</mrow>
<mo>=</mo>
<msqrt>
<msubsup>
<mi>Σ</mi>
<mrow>
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mn>3</mn>
</msubsup>
<msubsup>
<mi>w</mi>
<mi>i</mi>
<mn>1</mn>
</msubsup>
<msup>
<mrow>
<mo>(</mo>
<mrow>
<msubsup>
<mi>rssi</mi>
<mrow>
<mi>e</mi>
<mo>,</mo>
<mi>i</mi>
</mrow>
<mn>1</mn>
</msubsup>
<mo>-</mo>
<msubsup>
<mi>rssi</mi>
<mrow>
<mi>f</mi>
<mo>,</mo>
<mi>i</mi>
</mrow>
<mn>1</mn>
</msubsup>
</mrow>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</msqrt>
<mo>,</mo>
</mrow></math> where e denotes a location node within zone 1, f denotes a container sensing node within zone 1 and f is 1, 2, 3,
represents the weight of the ith anchor node in region 1,
respectively representing RSSI observed values of the positioning node e and the container sensing node f in the area 1 to the ith anchor node; if the RSSI values of the positioning node d1 for the 3 anchor nodes in the area 1 are 2, 3 and 4, respectively, and the RSSI values of the container node j1 for the 3 anchor nodes are 3, 3 and 4, respectively, then the distance between d1 and j1 is set as
<math><mrow>
<mi>d</mi>
<mrow>
<mo>(</mo>
<mi>d</mi>
<mn>1</mn>
<mo>,</mo>
<mi>j</mi>
<mn>1</mn>
<mo>)</mo>
</mrow>
<mo>=</mo>
<msqrt>
<msubsup>
<mi>Σ</mi>
<mrow>
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mn>3</mn>
</msubsup>
<msubsup>
<mi>w</mi>
<mi>i</mi>
<mn>1</mn>
</msubsup>
<msup>
<mrow>
<mo>(</mo>
<msubsup>
<mi>rssi</mi>
<mrow>
<mi>e</mi>
<mo>,</mo>
<mi>i</mi>
</mrow>
<mn>1</mn>
</msubsup>
<mo>-</mo>
<msubsup>
<mi>rssi</mi>
<mrow>
<mi>f</mi>
<mo>,</mo>
<mi>i</mi>
</mrow>
<mn>1</mn>
</msubsup>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
</msqrt>
<mo>=</mo>
</mrow></math> Given the coordinates (5, 4, 3) of location node d1 in area 1, x representing the abscissa, y the ordinate, and z the ordinate, the spatial coordinate of container sensing node f is
Monitoring center jc according to
Is stored in a background database, and represents the space coordinate of the container sensing node j1 as
The conditions of the container node j2 and the container node j3 in the area 1 are similar, and the conditions of the other areas are similar, so the details are not described herein;
3.2 all information Synthesis
Step 30) the monitoring center jc finds out tables (b), (c) and (e) in the table 2 from the background database, and merges the data in the three tables into a piece of container data information according to the rule that the ID of the container sensing node corresponds to the ID of the RFID label of the container one by one
Where j1/b1 (intra-container sensor node/RFID tag ID) represents the container ID,
the container information content comprises three parts of information, namely sensor sensing information, RFID label information and sensor position coordinate information;
fourth, information sending process
Step 31) the monitoring center jc sends 'container data' M to the communication satellite through the GSM modulegd(ii) a The communication satellite forwards the data to a receiving tower on the ground; the receiving tower sends the real-time tracking and positioning message to a ground master control center or a mobile terminal through the Internet or the GSM network.
Table 1 below is a table of message types and corresponding field values:
serial number |
Message name |
Message field value |
1 |
Area location |
00000001 |
2 |
RSSI value response |
00000010 |
3 |
Information collection |
00000011 |
4 |
Sensing information collection |
00000100 |
5 |
Sensing acquisition response |
00000101 |
6 |
Label information collection |
00000110 |
7 |
Tag Collection response |
00000111 |
8 |
Location information collection |
00001000 |
9 |
Location acquisition response |
00001001 |
Table 2 below is a database storage data format table:
serial number |
Regional positioning node ID |
Anchor node ID |
Weight of anchor node |
1 |
|
|
|
2 |
|
|
|
(a) Data table of area positioning information
Serial number |
Container sensing node ID |
Sensing message content |
1 |
|
|
2 |
|
|
(b) Sensor sensing information data table
Serial number |
Container RFID tag ID |
Tag message content |
1 |
|
|
2 |
|
|
(c) RFID tag information data sheet
(d) Sensing node/positioning node position information data table
Serial number |
Container, especially container for transporting goodsSensing node ID |
Spatial coordinates |
1 |
|
|
2 |
|
|
(e) Sensor coordinate information data sheet
Serial number |
Container ID |
Container message content |
1 |
|
|
2 |
|
|
(f) Container information data sheet.