[WSN] Research on wireless sensor network X-Y coordinates to graphical view and bit string prefix embedding method (Matlab code implementation)

Welcome to this blog

Advantages of bloggers:Blog content should be as thoughtful and logical as possible for the convenience of readers.

Motto:He who travels a hundred miles is half as good as ninety.

The directory of this article is as follows:

Table of Contents

1 Overview

2 Operation results

?

3 References

4 Matlab code implementation


1 Overview

WSN is the abbreviation of Wireless Sensor Network. Wireless sensor network is a network composed of a large number of wireless sensor nodes distributed in space. Each sensor node has sensing, processing and communication capabilities, and can collect various information in the environment and transmit it to other nodes or base stations. WSN is widely used in environmental monitoring, agriculture, medical care, transportation and other fields, and has the advantages of low cost, easy deployment, and real-time monitoring.

Researchers are deeply exploring the embedding of X-Y coordinates with graphical views and prefix B methods in the field of wireless sensor networks (WSN). This research aims to provide a more intuitive and visual display method for WSN coordinate data, and uses the prefix B method for embedding.

Wireless sensor network is a network system composed of many distributed sensor nodes that can work together to collect, process and transmit various information in the environment. In WSN, the location information of nodes is often very important, and the X-Y coordinate system is often used to describe the location of nodes. However, this coordinate information is not intuitive to humans, so the researchers hope to convert it into a graphical view that is easier to understand and interpret.

By mapping X-Y coordinates to a graphical view, researchers can visually present node location information to users. In this way, users can more easily understand the distribution pattern, density, and relative position of nodes. At the same time, the graphical view can also help users discover potential abnormal nodes or areas and better monitor and manage the entire WSN system.

In addition to the graphical view, the prefix B method was also introduced into the study. The prefix B method is a technique for embedding bit strings into coordinate data. Additional information can be injected into a node by prefixing it with a specific bit string before its X or Y coordinate. This additional information can be the function, status or other important contextual information of the node, making the coordinates of the node not only a representation of the coordinates themselves, but also a richer and more meaningful data structure.

By combining graphical views and prefix B methods, researchers will provide a more comprehensive and rich presentation of WSN data. In this way, users can not only intuitively understand the location distribution of nodes, but also obtain more valuable information through bit string prefixes. This research is expected to promote the development of the WSN field, improve system management and monitoring, and bring new possibilities to practical applications in more fields.

2 Running results

Part of the code:

%%
%G = graph(uniqueEdgeList(:,1),uniqueEdgeList(:,2),round(weights'),'OmitSelfLoops');

figure,
p = plot(G,'EdgeLabel',G.Edges.Weight,'XData', X, 'YData', Y);
xlabel('X in m')
xlabel('Y in m')
title('Netowrk Model in Graph View')
%% Spanning Tree
[T,pred] = minspantree(G);
highlight(p,T)
rootedTree = digraph(pred(pred~=0),find(pred~=0),[],G.Nodes.Name);
figure,
plot(rootedTree)
rootedTree.Edges
%% Prefix-B method
Treev=cell2mat(rootedTree.Edges{:,:});
s=rootedTree.Edges{:,:};
c1=str2num(cell2mat(s(:,1)));
c2=str2num(cell2mat(s(:,2)));
mat1=[c1 c2];

Bitstring(1).No=mat1(1,1);
Bitstring(1).Id='/0';
ab=1;
tmp=mat1(1,1);

TailNodes=[];
while(numel(tmp)>0)

[ind,val]=find(mat1(:,1)==tmp(1));
if(isempty(ind))
    TailNodes(ab)=tmp(1);
    ab=ab + 1;
end
for ik=1:numel(ind)
    Bitstring(mat1(ind(ik),2)).No=mat1(ind(ik),2);
    if(ik==1)
        Bitstring(mat1(ind(ik),2)).Id=[Bitstring(tmp(1)).Id '/0'];
    end
    if(ik==2)
        Bitstring(mat1(ind(ik),2)).Id=[Bitstring(tmp(1)).Id '/1'];
    end
    if(ik==3)
        Bitstring(mat1(ind(ik),2)).Id=[Bitstring(tmp(1)).Id '/00'];
    end
    
end
    tmp(1)=[];
    tmp=[tmp; mat1(ind,2)]
end
Bitstring.Id

%%
%G = graph(uniqueEdgeList(:,1),uniqueEdgeList(:,2),round(weights’),’OmitSelfLoops’);

figure,
p = plot(G,’EdgeLabel’,G.Edges.Weight,’XData’, X, ‘YData’, Y);
xlabel(‘X in m’)
xlabel(‘Y in m’)
title(‘Netowrk Model in Graph View’)
%% Spanning Tree
[T,pred] = minspantree(G);
highlight(p,T)
rootedTree = digraph(pred(pred~=0),find(pred~=0),[],G.Nodes.Name);
figure,
plot(rootedTree)
rootedTree.Edges
%% Prefix-B method
Treev=cell2mat(rootedTree.Edges{:,:});
s=rootedTree.Edges{:,:};
c1=str2num(cell2mat(s(:,1)));
c2=str2num(cell2mat(s(:,2)));
mat1=[c1 c2];

Bitstring(1).No=mat1(1,1);
Bitstring(1).Id=’/0′;
ab=1;
tmp=mat1(1,1);

TailNodes=[];
while(numel(tmp)>0)

[ind,val]=find(mat1(:,1)==tmp(1));
if(isempty(ind))
TailNodes(ab)=tmp(1);
ab=ab + 1;
end
for ik=1:numel(ind)
Bitstring(mat1(ind(ik),2)).No=mat1(ind(ik),2);
if(ik==1)
Bitstring(mat1(ind(ik),2)).Id=[Bitstring(tmp(1)).Id ‘/0’];
end
if(ik==2)
Bitstring(mat1(ind(ik),2)).Id=[Bitstring(tmp(1)).Id ‘/1’];
end
if(ik==3)
Bitstring(mat1(ind(ik),2)).Id=[Bitstring(tmp(1)).Id ‘/00’];
end

end
tmp(1)=[];
tmp=[tmp; mat1(ind,2)]
end
Bitstring.Id

3 References

Some content in the article is quoted from the Internet, and the source will be indicated or cited as a reference. It is inevitable that there will be some unfinished information. If there is anything inappropriate, please feel free to contact us to delete it.

[1] Li Xiaoji. Research on wireless sensor network synchronization and embedding technology [D]. Xi’an University of Electronic Science and Technology, 2012. DOI: 10.7666/d.y2238526.

[2]Chang Yan. Research on mobile node deployment method of hybrid wireless sensor network[D]. Suzhou University[2023-09-21].

[3] Wang Peng. Research on node positioning method of wireless sensor network based on machine learning [D]. Zhejiang University of Technology, 2011.

4 Matlab code implementation