Summary of the invention
Technical problem: purpose of the present invention is mainly to manage for container cargo distribution, propose a kind of novel based on tag sensor network (RFSN, Radio Frequency Sensor Networks) tracking and localization method, wherein location algorithm has adopted the W-KNN algorithm.
Technical scheme: the several definition of given first:
RFSN network based on Wi-Fi: (Wi-Fi-RFSN, Wireless Fidelity Radio Frequency Sensor Networks), utilize the Wi-Fi network to realize the intercommunication mutually between whole rfid interrogators, again by the Wi-Fi-WSN gateway, realize communicating by letter between RFID network and WSN network.
Wi-Fi-WSN gateway: comprise wireless network card, WSN wireless transceiver, data processing unit, be used to connecting Wi-Fi network and WSN network, realize the network equipment that two nets intercom mutually.
Wi-Fi-RFID read write line: increased the wireless network card function module on traditional rfid interrogator, by WAP (wireless access point) (AP), realized communication each other, hereinafter to be referred as rfid interrogator or read write line.
Surveillance center: be responsible for monitoring in real time the information such as all AP on acquisition vessel, sensor node, rfid interrogator, RFID label, and report to overall control center.
W-KNN (Weighted k-Nearest Neighbor) location algorithm: attribute weight k neighbour location algorithm is the sorting algorithm of a kind of object container location.All anchor nodes in test zone are calculated to coefficient correlation, and the weights by each anchor node of Calculation of correlation factor (being distributed in whole boats and ships space), finally mean two Euclidean distances between node by the Weighted distance quadratic sum.
Location node: be fixed on boats and ships, locus is known, and the location node of take is reference point, after according to the W-KNN location algorithm, calculating the relative distance of it and container sensing node, obtains the spatial value of sensing node, completes location.
The WSN cluster-dividing method: WSN base-station node traversal neighbor list, selecting energy value neighbor node high, that the response time is short is the ground floor leader cluster node, sets up the ground floor sub-clustering; Ground floor bunch head traversal neighbor list, selecting energy value certain several neighbor node high, that the response time is short is via node; Via node traversal neighbor list, selecting energy value neighbor node high, that the response time is short is second layer leader cluster node, sets up second layer sub-clustering; Repeat above-mentioned steps, complete the foundation of WSN the whole network clustering process.
Wi-Fi-RFSN data packet format: as shown in Figure 6, comprise data packet header and data content two parts; Wherein, long 96 bits (12 byte) of data packet header, the type of message that comprises 8 bits, the total length of 8 bits, the regional ID of 16 bits, the message home to return to of 16 bits, the message origin of 16 bits, the destination address of 16 bits, the source address of 16 bits, below said packet all according to this form.
Type of message: in this method, have 9 kinds of different data packet message, every kind of message name and corresponding field value thereof, as shown in table 1.
Total length: total length refers to the length of stem and data content sum, and unit is byte.Total length field is 8 bits, so the maximum length of packet is 256 bytes.
Zone ID: because a unique location node is contained in each zone, mean so regional ID is available this zone location node ID.
The message home to return to: the transmission of packet need to be passed through the multi-hop routing forwarding, so, need to indicate the message home to return to, namely mean finally need to receive the object of packet.
Message origin: the object that means to start most to send packet.
Destination address: A, B two side's direct communications, do not need through routing forwarding midway, and A sends a packet to B, and the address of B becomes destination address.
The address of source address: A becomes source address.
(annotate: destination address and source address can be ID, ID, the ID of wireless aps of gateway, ID, the ID of RFID label of rfid interrogator, ID, the ID of anchor node of WSN base station, the ID of location node, ID of container sensing node etc. of Surveillance center.)
The present invention utilizes the RFSN network to realize the functions such as container interior label information reads, sensor node information gathering, container location.Before this, need to carry out initialization to RFSN.
Before network design, a Surveillance center, Wi-Fi-WSN gateway, a plurality of AP, a plurality of Wi-Fi-RFID read write line, the neat container of some discharges are arranged on every ship.In each container, post RFID label, a sensor node of indicating identity of installation of indicating identity, both identify labels are the same.Type of merchandize, port of shipment in the vanning of identify label of each tag storage (No. ID), identification sets, refer to fortune ground, batch etc. information.Each node storage identify label (No. ID), energy value, leader cluster node (certain node No. ID, mean which bunch this node belongs to), node type sign (being designated a bunch head, relaying, common thrin), affiliated area.Each node also contains a neighbor list, records the information such as No. ID of neighbor node, energy value, bunch No.1 and response time.
After configuring above information, network starts to dispose.
Method flow
This broadcast is followed the tracks of and will be specifically described as follows with the complete procedure of localization method:
Wireless radio frequency discrimination RFID network and wireless sensor network WSN are coupled together by wireless compatible authentication Wi-Fi network, and the location of adopting attribute weight k neighbour location algorithm W-KNN to realize container, its method flow can be described below:
One, the initialization of network
Step 1) Surveillance center, Wi-Fi-WSN gateway, all container, RFID label, sensor node, Wi-Fi wireless access point AP, Wi-Fi-RFID read write line and anchor node arrange to be installed;
Step 2) now, all AP are from forming the Wi-Fi wireless network, and all sensor nodes are according to the Leach algorithm from forming the WSN network, and functional node identify label ID of base station stored shows, deposit anchor node and location node No. ID, for following assembling position information is prepared;
Step 3) the whole test space is divided into to m*n test zone according to the distribution of location node, each test zone has unique location node, therefore Free Region location node ID represents regional ID, the location node space coordinates is known, wherein m means the number of plies, every layer height is the height of a container, and n means the test zone number of every layer of decile;
Step 4) all m*n location node broadcast " zone location " packet, wherein, type of message is " zone location ", total length is 12 bytes, means that packet only contains stem, and data content is partly empty, zone ID is empty, the message home to return to is empty, and the message origin is empty, and destination address is (0110101000000000)
2=(j0)
16, meaning that the object of this packet of reception is all container sensing nodes in this zone, source address is this location node ID;
Step 5) after the container sensing node is received " zone location " packet, by source address, namely this regional location node ID preserves, and means that this container sensing node belongs to the zone at this location node place;
Step 6) to each test zone, carry out a secondary data training, the location node of namely take in this zone is test sample book, this sample is responsible for gathering the received signal strength indicator RSSI value of all anchor nodes in this test zone, generate " response of RSSI value " packet, wherein, type of message is " response of RSSI value ", total length is greater than 12 bytes, zone ID is this zone location node ID, the message home to return to is the ID of Surveillance center, the message origin is location node ID, data content is that many group shapes are as " anchor node ID, the RSSI value " data of form, and all RSSI values are transferred to the leader cluster node in this bunch, leader cluster node is uploaded to base-station node more step by step, last base-station node sends Surveillance center to by the Wi-Fi-WSN gateway,
Step 7) m*n many groups of " response of RSSI value " packet M in zone receive in Surveillance center
Rssi, take each zone to calculate correlation matrix R as unit utilizes the W-KNN location algorithm, total m*n, might as well establish total k anchor node in regional a, a=1,2 ..., m*n, its corresponding correlation matrix is
For the coefficient correlation of anchor node i in regional a and anchor node j, i=1,2 ..., k
a, j=1,2 ..., k
a, a=1,2 ..., m*n, and
When i=j,
Wherein,
With
Mean respectively the measured value of regional a build-in test sample to the RSSI of anchor node i and anchor node j, E (X) and D (X) mean respectively mathematic expectaion and the variance of stochastic variable X, and Cov (X, Y) means the covariance of stochastic variable X and Y; If but the detection range of two anchor nodes is not occured simultaneously, be that they were never detected simultaneously, or wherein the variance of the measured value of the RSSI of at least one anchor node is 0, defining the right coefficient correlation of this anchor node is 0; Then, in a of zoning, the weights of anchor node i are
Wherein,
Mean
Transposition, namely
And the data after processing store in background data base " zone location information data table ";
Two, information gathering process
Step 8) Surveillance center's broadcast " information gathering " packet, wherein, type of message is " information gathering ", and total length is 12 bytes, mean that packet only contains stem, data content is partly empty, and regional ID is empty, and the message home to return to is empty, the message origin is the ID of Surveillance center, the destination address full 0, mean that the object of this packet of reception is all receiving systems in Wi-Fi-RFSN the whole network, and source address is the ID of Surveillance center;
Step 9) after the Wi-Fi-WSN gateway is received " information gathering " packet, convert packet to WSN data packet format and Wi-Fi data packet format, send to respectively the wireless aps of WSN base station and Wi-Fi;
2.1 gather container sensing node information
Step 10) after gateway " information gathering " message is received in the WSN base station, broadcast " heat transfer agent collection " packet in WSN the whole network, wherein, type of message is " heat transfer agent collection ", total length is 12 bytes, mean that packet only contains stem, data content is partly empty, and message home to return to and destination address are all (0110101000000000)
2=(j0)
16, meaning that the object of this packet of reception is all container sensing nodes in WSN the whole network, the message origin is the ID of Surveillance center, source address is base-station node ID;
Step 11) after all container sensing nodes are received " heat transfer agent collection " packet, gather the internal environment information of container, generate " sensing acquisition response " packet, wherein, type of message is " sensing acquisition response ", total length is greater than 12 bytes, zone ID is the location node ID of this container sensing node region, the message home to return to is the ID of Surveillance center, the message origin is this container sensing node ID, destination address is the leader cluster node ID of container sensor node place sub-clustering, source address is this container sensing node ID, data content is the environment inside containers information that the container sensor node gathers,
Step 12) the container sensing node is by the leader cluster node of " sensing acquisition response " Packet Generation to the place sub-clustering, and leader cluster node sends packet to by via node the leader cluster node on upper strata, until send to base-station node;
Step 13) to the Wi-Fi-WSN gateway, now destination address is gateway ID to base-station node by " sensing acquisition response " Packet Generation, and source address is the WSN base station IDs, and remaining message is constant;
Step 14) to Surveillance center, now destination address is the ID of Surveillance center to the Wi-Fi-WSN gateway by " sensing acquisition response " Packet Generation, and source address is gateway ID, and remaining message is constant;
Step 15) packet that will receive of Surveillance center stores in " the sensor senses information data table " of background data base;
2.2 gather container RFID label information
Step 16) after the Wi-Fi wireless aps is received gateway " information gathering " message, it in the whole network, is broadcast " label information collection " packet in the Wi-Fi signal coverage areas, wherein, type of message is " label information collection ", total length is 12 bytes, means that packet only contains stem, and data content is partly empty, zone ID is empty, and the message home to return to is (0110001000000000)
2=(b0)
16, meaning that the final object that receives this packet is all RFID labels in Wi-Fi the whole network, the message origin is the ID of Surveillance center, destination address is (0111100100000000)
2=(y0)
16, the object that means this packet of reception is all read write lines in Wi-Fi the whole network, source address is the ID of the wireless aps of this message of transmission;
Step 17) after the Wi-Fi-RFID read write line is received wireless aps " label information collection " message, send electromagnetic wave, after the RFID label was received electromagnetic wave, coil produced induced current, and the information exchange that label is built-in is crossed electromagnetic wave and launched;
Step 18) after read write line is received the electromagnetic wave of label, be converted into and be adapted at the packet of communicating by letter in the Wi-Fi network, be " label collection response " packet, wherein, type of message is " label collection response ", total length is greater than 12 bytes, zone ID is empty, the message home to return to is the ID of Surveillance center, the message origin is container RFID label ID, destination address be can with the wireless aps of read write line direct communication, source address is the ID of the Wi-Fi-RFID read write line of reading tag information, message content is the built-in information of container RFID label;
Step 19) between wireless aps, communicate by letter, " label collection response " Packet Generation is to the Wi-Fi-WSN gateway the most at last, and now destination address is gateway ID, and source address is the ID of the AP of close gateway, and remaining message is constant;
Step 20) to Surveillance center, now destination address is the ID of Surveillance center to the Wi-Fi-WSN gateway by " label collection response " Packet Generation, and source address is gateway ID, and remaining message is constant;
Step 21) packet that will receive of Surveillance center stores in " the RFID label information tables of data " of background data base;
2.3 gather container position information
Step 22) after gateway " information gathering " message is received in the WSN base station, broadcast " positional information collection " packet in WSN the whole network, wherein, type of message is " positional information collection ", total length is 12 bytes, means that packet only contains stem, and data content is partly empty, zone ID is empty, and message home to return to and destination address are all (0110110100000000)
2=(m0)
16, meaning that the object of this packet of reception is all anchor nodes in WSN the whole network, the message origin is the ID of Surveillance center, source address is base-station node ID;
Step 23) after anchor node is received " positional information collection " packet, broadcast this packet;
Step 24) location node and container sensing node send " station acquisition response " packet to the leader cluster node of place sub-clustering, wherein, type of message is " station acquisition response ", total length is greater than 12 bytes, zone ID is the location node ID of this container sensing node region, the message home to return to is the ID of Surveillance center, message origin and source address are all this location node or container sensing node ID, destination address is the leader cluster node ID of this location node or the place sub-clustering of container sensor node, data content is that to receive the signal strength signal intensity of all anchor nodes in region be the RSSI value,
Step 25) leader cluster node sends packet to by via node the leader cluster node on upper strata, until send to base-station node;
Step 26) to the Wi-Fi-WSN gateway, now destination address is gateway ID to base-station node by " station acquisition response " Packet Generation, and source address is the WSN base station IDs, and remaining message is constant;
Step 27) to Surveillance center, now destination address is the ID of Surveillance center to the Wi-Fi-WSN gateway by " station acquisition response " Packet Generation, and source address is gateway ID, and remaining message is constant;
Step 28) packet that will receive of Surveillance center stores in " sensing node/location node location information data table " of background data base;
Three, information process
3.1 positional information calculation
Step 29) Surveillance center is from finding out " sensing node/location node location information data table " background data base, data in table are divided into to the m*n group according to regional ID, every group utilize the W-KNN location algorithm come in compute location node and this zone between all container nodes apart from d (e, f)
Wherein e means the location node in regional a, and f means container sensing node and f=1 in regional a, 2 ..., l
al
aMean container nodes in regional a, k
aMean the anchor node number in regional a,
The weights that mean i anchor node in regional a,
Mean respectively location node e, the node f RSSI measured value to i anchor node in regional a; The coordinate of known region a location node is (x, y, z), and x means abscissa, and y means ordinate, and z means ordinate, the space coordinates of container sensing node f be (x, y+d (e, f), z); Surveillance center by after computing data store in " the sensor coordinates information data table " of background data base;
3.2 all information is synthetic
Step 30) Surveillance center is from finding out " sensor senses information data table " background data base, " RFID label information tables of data ", " sensor coordinates information data table ", rule according to " container sensing node ID is corresponding one by one with container RFID label ID " is merged into " container data " information by the data in three tables, and store in " the container information tables of data " of background data base, wherein, container ID is the ID of sensing node in container or the ID of RFID label, the container message content comprises three partial informations, be sensor senses information, RFID label information and sensor location coordinates information,
Four, information process of transmitting
Step 31) Surveillance center, by gsm module, sends " container data " message to communication satellite; Communication satellite is transmitted to it reception tower on ground again; Overall control center or mobile terminal send this real-time tracking localization message earthward by Internet or GSM net again to receive tower.
Beneficial effect: the present invention proposes based on the container cargo distribution of tag sensor network and follow the tracks of and localization method, the method has following advantage:
(1) by utilizing the logistics of tag sensor network track and localization to overcome the short problem of rfid interrogator communication distance, enlarged communication range, and the application of combined sensor node, the perfect content of Information Monitoring, can more fully understand the ambient conditions in container;
(2) by utilizing W-KNN location algorithm combined sensor node, can realize the location to container on boats and ships, according to correlation, the anchor node weights be distributed, improve to a certain extent the accuracy of location.
Embodiment
The accompanying drawing of below take is example, further describes technical scheme of the present invention and method flow by a concrete example.
One, the initialization of network
Step 1) Surveillance center, Wi-Fi-WSN gateway, all container (RFID label and sensor node have been installed), AP, Wi-Fi-RFID read write line, anchor node and location node arrange to be installed, Fig. 2 for arrange install after RFSN example layout structure figure;
Step 2) now, all AP are from forming the Wi-Fi wireless network, and all sensor nodes form the WSN network certainly according to the Leach algorithm, as shown in the network topology of Fig. 3; In Fig. 2, node d1, d2 are location node, and node m1, m2, m3 are anchor node, and base station is according to [location node, d1, d2], [anchor node, m1, m2, m3] record location node of form storage and the functional node ID table of anchor node, for following assembling position information is prepared;
Step 3) in Fig. 2, the space of whole piece ship is divided into to 2*1 test zone according to the distribution of location node, wherein, container 1,2,3 is in zone 1, and container 4,5,6 is in zone 2; Each test zone has a location node, and the location node in zone 1 is d1, and the location node in zone 2 is d2;
Step 4) as shown in Figure 6, the location node d1 of take in zone 1 is example for all location node (2*1) broadcast " zone location " packet in Fig. 2, form, its broadcast data packet M
Qd=[" zone location ", 12, null, null, null, j0, d1, null], wherein, " zone location " is type of message, 12 mean that total length is 12 bytes, and three null mean that respectively regional ID is that sky, message home to return to are sky for empty, message origin, and j0 is destination address (object that expression receives this packet is all container sensing nodes in this zone), d1 is source address, and last null means that data content is partly for empty;
Step 5) in Fig. 2, the container sensing node is received " zone location " packet M
QdAfter, zone 1 interior container sensing node j1, j2, the j3 of take is example, they preserve source address d1, mean that this container belongs to the zone at location node d1 place;
Step 6) to each test zone, carry out a secondary data training, the zone 1 of take in Fig. 2 is example, and the location node d1 of take is test sample book, d1 is responsible for the RSSI value of all anchor nodes (m1, m2, m3) in pickup area 1, generates " response of RSSI value " packet M
Rssi=[" response of RSSI value ",>12, d1, jc, d1, c2, d1, (mi, 5)], wherein " response of RSSI value " is type of message,>12 mean that total length is greater than 12 bytes, the data content non-NULL, and three d1 are respectively regional ID, message origin, source address, jc is the message home to return to, and c2 is destination address, (mi, 5) be message content, the desirable m1 of the value of mi, m2, m3 (meaning the anchor node ID that this is regional), 5 is the RSSI value of surveying; As Fig. 3, might as well establish node d1 and belong to bunches 2, d1 is by all zone location response message M
RssiBe transferred to the leader cluster node c2 in this bunch, leader cluster node c2 passes to via node z1 again, and z1 passes to last layer leader cluster node c1 again, and c1 is uploaded to base-station node again, and last base-station node sends Surveillance center to by the Wi-Fi-WSN gateway;
Step 7) in Fig. 2, the jc of Surveillance center receives 2*1 many groups of " response of RSSI value " packet M in zone
Rssi, take each zone to calculate correlation matrix R (total 2*1) as unit utilizes the W-KNN location algorithm, take zone 1 and be example, zone 1 is interior has 3 anchor nodes, and its corresponding correlation matrix is
For the coefficient correlation of anchor node mi and anchor node mj, and
(i=1,2,3, j=1,2,3), wherein,
With
Mean respectively the measured value of test sample book d1 to the RSSI of anchor node mi and anchor node mj, E (X) and D (X) mean respectively mathematic expectaion and the variance of stochastic variable X, and Cov (X, Y) means the covariance of stochastic variable X and Y; Might as well suppose to calculate the correlation matrix in zone 1
Then, the weights of zoning 1 interior all anchor nodes, the weights of node m1 are
In like manner, obtain
And according to
Form, store in background data base, mean that the weights of the anchor node m1 in the zone at location node d1 place are
Anchor node m2, anchor node m3 situation in this zone are similar, and all the other regional situations are also similar, repeat no more herein;
Two, information gathering process
Step 8) Surveillance center's broadcast " information gathering " packet M
Xc=[" information gathering ", 12, null, null, jc, 00, jc], wherein, " information gathering " is type of message, and 12 mean that total length is that 12 bytes (mean that packet only contains stem, data content is partly empty), two null mean that respectively regional ID is sky for empty, message home to return to, and two jc are respectively message origin and source address, and 00 (hexadecimal number) is the 16 bit number full 0s (object that expression receives this packet is all receiving systems in Wi-Fi-RFSN the whole network) of destination address;
Step 9) the Wi-Fi-WSN gateway is received " information gathering " packet M
XcAfter, convert packet to WSN data packet format M
xcsWith Wi-Fi data packet format M
xcf, send to respectively the wireless aps of WSN base station and Wi-Fi;
2.1 gather container sensing node information
Step 10) gateway " information gathering " packet M is received in the WSN base station
xcsAfter, broadcast " heat transfer agent collection " packet M in WSN the whole network
Cc=[" heat transfer agent collection ", 12, null, j0, jc, j0, jz], wherein, " heat transfer agent collection " is type of message, 12 mean that total length is that 12 bytes (mean that packet only contains stem, data content is partly empty), null means that regional ID is for empty, two j0 mean respectively message home to return to and destination address (object that means this packet of reception is all container sensing nodes in WSN the whole network), jc means the message origin, and jz means source address;
Step 11) all container sensing nodes are received " heat transfer agent collection " packet M
CcAfter, the internal environment information of collection container, generate " sensing acquisition response " packet M
ccx, the container sensing node j1 of Fig. 3 of take is example, j1 generated data bag M
ccx=[" sensing acquisition response ",>12, d1, jc, j1, c2, j1,34 ℃], wherein, " sensing acquisition response " is type of message, and>12 mean that total length is greater than 12 bytes, the data content non-NULL, d1 is regional ID, and jc is the message home to return to, and two j1 are respectively message origin and source address, c2 is destination address, and 34 ℃ (as example, the environment inside containers information that the container sensor node gathers being described) are message content;
Step 12) container sensing node j1 is by " sensing acquisition response " packet M
ccxSend to the leader cluster node c2 of place sub-clustering, c2 sends packet to by via node z1 the leader cluster node c1 on upper strata, until send to base-station node jz;
Step 13) base-station node by " sensing acquisition response " Packet Generation to the Wi-Fi-WSN gateway, M
ccx=[" sensing acquisition response ",>12, d1, jc, j1, wg, jz, 34 ℃], now gateway wg is destination address, and jz is source address, and remaining message is constant;
Step 14) the Wi-Fi-WSN gateway by " sensing acquisition response " Packet Generation to Surveillance center, M
ccx=[" sensing acquisition response ",>12, d1, jc, j1, jc, wg, 34 ℃], now the jc of Surveillance center not only is the message home to return to but also be destination address, and gateway wg is source address, and remaining message is constant;
Step 15) jc of Surveillance center stores in background data base according to the form of [j1,34 ℃], means that the interior temperature of container at container node j1 place is 34 ℃;
2.2 gather container RFID label information
Step 16) the Wi-Fi wireless aps is received gateway " information gathering " message M
xcfAfter, broadcast " label information collection " packet M in Wi-Fi the whole network
Bc, the WAP (wireless access point) a3 of take in Fig. 3 is example, M
Bc=[" label information collection ", 12, null, b0, jc, y0, a3], wherein, " label information collection " is type of message, 12 mean that total length is 12 bytes (mean that packet only contains stem, data content is partly empty), and null means that regional ID is for empty, b0 is message home to return to (meaning that the final object that receives this packet is all RFID labels in Wi-Fi the whole network), the jc of Surveillance center is the message origin, and y0 is destination address (object that means this packet of reception is all read write lines in Wi-Fi the whole network), and a3 is source address:
Step 17) with read write line y1 in Fig. 3, label b1 is example, and y1 receives " label information collection " message M of wireless aps
BcAfter, sending electromagnetic wave, after RFID label b1 received electromagnetic wave, coil produced induced current, and the information exchange that label is built-in is crossed electromagnetic wave and is launched;
Step 18) after read write line y1 receives the electromagnetic wave of label b1, be converted into and be adapted at the packet of communicating by letter in the Wi-Fi network, be " label collection response " packet M
bcx=[" label collection response ",>12, null, jc, b1, a1, y1, " port of shipment=Beijing, refer to fortune ground=Nanjing "], wherein, " label collection response " is type of message,>12 mean that total length is greater than 12 bytes, the data content non-NULL, null means that regional ID is for empty, the jc of Surveillance center is the message home to return to, source RFID label b1 is the message origin, WAP (wireless access point) (AP) a1 is destination address, the Wi-Fi-RFID read write line y1 of emission Wi-Fi wireless signal is source address, " port of shipment=Beijing, refer to fortune ground=Nanjing " (the built-in information of container RFID label) be message content,
Step 19) between wireless aps, communicate by letter, the most at last " label collection response " packet M
bcxSend to Wi-Fi-WSN gateway wg, M
bcx=[" label collection response ",>12, null, jc, b1, wg, a3, " port of shipment=Beijing, refer to fortune ground=Nanjing "], now gateway wg is destination address, and the WAP (wireless access point) a3 of close gateway is source address, and remaining message is constant;
Step 20) Wi-Fi-WSN gateway wg is by " label collection response " packet M
bcxSend to the jc of Surveillance center, M
bcx=[" label collection response ",>12, null, jc, b1, jc, wg, " port of shipment=Beijing refers to fortune ground=Nanjing "],, now the jc of Surveillance center not only is the message home to return to but also be destination address, and gateway wg is source address, and remaining message is constant;
Step 21) jc of Surveillance center stores in background data base according to the form of [b1, " port of shipment=Beijing refers to fortune ground=Nanjing "], means that the port of shipment of the container at label b1 place is Beijing, refers to that fortune ground is Nanjing;
2.3 gather container position information
Step 22) gateway " information gathering " M is received in the WSN base station
xcsAfter message, broadcast " positional information collection " packet M in WSN the whole network
Wc=[" positional information collection ", 12, null, m0, jc, m0, jz], wherein, " positional information collection " is type of message, 12 mean that total length is that 12 bytes (mean that packet only contains stem, data content is partly empty), null means that regional ID is for empty, two m0 are respectively message home to return to and destination address (object that means this packet of reception is all anchor nodes in WSN the whole network), the jc of Surveillance center is the message origin, and base-station node jz is source address;
Step 23) anchor node is received " positional information collection " packet M
WcAfter, broadcast this packet;
Step 24) in Fig. 3, location node d1 and container sensing node j1 send " station acquisition response " packet M to the leader cluster node c2 of place sub-clustering
wcx=[" station acquisition response ",>12, d1, jc, d1 (or j1), c2, d1 (or j1), rssi
D1(or rssi
J1)], wherein, " station acquisition response " is type of message,>12 mean that total length is greater than 12 bytes, data content non-NULL, d1 are regional ID, and the jc of Surveillance center is the message home to return to, two d1 (or j1) are respectively message origin and source address, and place sub-clustering leader cluster node c2 is destination address, rssi
D1(or rssi
J1) (expression receives the signal strength signal intensity of anchor node) be data content;
Step 25) leader cluster node c2 sends packet to by via node z1 the leader cluster node c1 on upper strata, until send to base-station node jz;
Step 26) base-station node jz is by " station acquisition response " packet M
wcxSend to the Wi-Fi-WSN gateway, M
wcx=[" station acquisition response ",>12, d1, jc, d1 (or j1), wg, jz, rssi
D1(or rssi
J1)], now gateway wg is destination address, and WSN base station jz is source address, and remaining message is constant;
Step 27) Wi-Fi-WSN gateway wg is by " station acquisition response " packet M
wcxSend to the jc of Surveillance center, M
wcx=[" station acquisition response ",>12, d1, jc, d1 (or j1), jc, wg, rssi
D1(or rssi
J1)], now the jc of Surveillance center is destination address, and gateway wg is source address, and remaining message is constant;
Step 28) jc of Surveillance center is according to [d1 (or j1), d1, rssi
D1(or rssi
J1)] form store in background data base, be illustrated in the zone at location node d1 place the anchor node signal strength signal intensity (being the RSSI value) that location node d1 (or container sensing node j1) is received;
Three, information process
3.1 positional information calculation
Step 29) Surveillance center is from finding out the table of shape as shown in (d) in table 2 background data base, by the data in table, according to regional ID, be divided into the 2*1 group, every group utilize the W-KNN location algorithm come in compute location node and this zone between all container nodes apart from d (e, f), as shown in Figure 4, take zone 1 is the example explanation
Wherein e means the location node in zone 1, and f means zone 1 interior container sensing node and f=1,2,3,
The weights that mean i anchor node in zone 1,
Mean respectively zone 1 interior location node e, the container sensing node f RSSI measured value to i anchor node; Might as well establish the location node d1 of zone in 1 the RSSI value of 3 anchor nodes is respectively to 2,3,4, container node j1 is respectively 3,3,4 to the RSSI value of 3 anchor nodes, between d1 and j1 apart from being
In known region 1, the coordinate of location node d1 is (5,4,3), and x means abscissa, and y means ordinate, and z means ordinate, and the space coordinates of container sensing node f is
The jc of Surveillance center according to
Form store in background data base, mean that the space coordinates of container sensing node j1 is
Container node j2, container node j3 situation in zone 1 are similar, and all the other regional situations are also similar, repeat no more herein;
3.2 all information is synthetic
Step 30) jc of Surveillance center, from background data base, finding out the table of (b) in shape such as table 2, (c), (e), merges into " container data " information according to the rule of " container sensing node ID is corresponding one by one with container RFID label ID " by the data in three tables
Wherein, j1/b1 (sensing node in container/RFID label ID) means container ID,
Be the container message content, comprise three partial informations, be i.e. sensor senses information, RFID label information and sensor location coordinates information;
Four, information process of transmitting
Step 31) jc of Surveillance center, by gsm module, sends " container data " M to communication satellite
GdCommunication satellite is transmitted to it reception tower on ground again; Overall control center or mobile terminal send this real-time tracking localization message earthward by Internet or GSM net again to receive tower.
Following table 1 is type of message and corresponding field value table:
Sequence number |
Message name |
The message field value |
1 |
Zone location |
00000001 |
2 |
The response of RSSI value |
00000010 |
3 |
Information gathering |
00000011 |
4 |
Heat transfer agent gathers |
00000100 |
5 |
The sensing acquisition response |
00000101 |
6 |
Label information gathers |
00000110 |
7 |
Label collection response |
00000111 |
8 |
Positional information gathers |
00001000 |
9 |
The station acquisition response |
00001001 |
Following table 2 is data database storing form shffts:
Sequence number |
The zone location node ID |
Anchor node ID |
The anchor node weights |
1 |
|
|
|
2 |
|
|
|
(a) zone location information data table
Sequence number |
Container sensing node ID |
The sensing message content |
1 |
|
|
2 |
|
|
(b) sensor senses information data table
Sequence number |
Container RFID label ID |
The tag message content |
1 |
|
|
2 |
|
|
(c) RFID label information tables of data
(d) sensing node/location node location information data table
Sequence number |
Container sensing node ID |
Space coordinates |
1 |
|
|
2 |
|
|
(e) sensor coordinates information data table
Sequence number |
Container ID |
The container message content |
1 |
|
|
2 |
|
|
(f) container information tables of data