CN102014456B - Method and system for searching node - Google Patents

Method and system for searching node Download PDF

Info

Publication number
CN102014456B
CN102014456B CN 201010228672 CN201010228672A CN102014456B CN 102014456 B CN102014456 B CN 102014456B CN 201010228672 CN201010228672 CN 201010228672 CN 201010228672 A CN201010228672 A CN 201010228672A CN 102014456 B CN102014456 B CN 102014456B
Authority
CN
China
Prior art keywords
node
query request
proxy
neighbor
neighbor node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN 201010228672
Other languages
Chinese (zh)
Other versions
CN102014456A (en
Inventor
殷丽华
方滨兴
贾焰
于海宁
樊华
何力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Hetian Huizhi Information Technology Co Ltd
Beijing Computer Network And Information Security Research Center Of Harbin Institute Of Technology
National University of Defense Technology
Original Assignee
Beijing Hetian Huizhi Information Technology Co Ltd
Beijing Computer Network And Information Security Research Center Of Harbin Institute Of Technology
National University of Defense Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Hetian Huizhi Information Technology Co Ltd, Beijing Computer Network And Information Security Research Center Of Harbin Institute Of Technology, National University of Defense Technology filed Critical Beijing Hetian Huizhi Information Technology Co Ltd
Priority to CN 201010228672 priority Critical patent/CN102014456B/en
Publication of CN102014456A publication Critical patent/CN102014456A/en
Application granted granted Critical
Publication of CN102014456B publication Critical patent/CN102014456B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method and a system for searching a node, belonging to the field of communication of Internet of things. The method comprises the following steps that a client sends a search request which carries the search range and the position appointed by a user; a proxy node receives the search request and broadcasts the search request to the neighbor node of the proxy node, wherein the search request carries the coding, the message information, the position and the search range of the proxy node; the neighbor node receives the search request and judges whether the research request is received or not; if the research request is not received, the neighbor node judges whether the neighbor node per se is located within the search range or not according to the position and the search range; if the research request is received, a response message which carries the message time and the coding and the position of the neighbor node is sent to the proxy node, and the the search request is broadcasted to the neighbor node; the proxy node receives the respond message and sends the respond message to the client. The invention can accurately searches the nodes.

Description

Method and system for searching node
Technical Field
The invention relates to the field of communication of the Internet of things, in particular to a method and a system for searching nodes.
Background
The internet of things is defined as a standards-based and interoperable communication protocol, which is a global network infrastructure with self-configuration capabilities and dynamic functionality. Each node in the Internet of things has the attributes of coding and the like, and seamless integration of each node and a network is realized through an intelligent interface. Many applications of the internet of things involve searching nodes, and the searching technology of the nodes in the internet of things currently comprises the following steps:
a first entity search technology based on an RFID (Radio Frequency Identification) technology, specifically: the electronic tag system provides a unique and identifiable electronic tag for each node, readers for reading the electronic tags are arranged in transit stations deployed in various places, and each transit point reads the electronic tags to search the nodes by using the RFID technology within the communication range of the transit point.
The second search method based on the earth surface specifically comprises the following steps: the nodes are searched by erecting measuring equipment, such as base stations, on the earth surface and analyzing and estimating the nodes and the positions of the nodes by detecting characteristic parameters of signals propagating between the nodes and the base stations.
The third satellite-based search method specifically comprises the following steps: the method comprises the steps of setting receiving equipment on a node in advance, receiving satellite signals by the receiving equipment, determining the position of the node through a distance measuring intersection technology according to the received satellite signals, obtaining the position of the node, and sending the position of the node to a user, so that the node is searched. The receiving device may be a Global Positioning System (GPS).
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
in the first technique, since the number and density of the sensors are limited, the nodes cannot be accurately searched, and the sensors belong to specific mechanisms, and users outside the mechanisms cannot search the nodes by using the sensors, the technique is not universal.
In the second technique, the measurement devices cannot accurately search for the node even in an area with poor coverage conditions, and each measurement device is erected by network operation, and a network operator does not usually disclose propagation signals between the node and the base station.
In the third technique, in places such as indoor places, forests, high-rise buildings, mountains, bridges, and the like, satellite signals are blocked by objects, so that the receiving device cannot accurately obtain the positions of the nodes, thereby reducing the accuracy of searching the nodes.
Disclosure of Invention
In order to improve the accuracy of searching for nodes and to provide a method for searching for nodes in general, the present invention provides a method and system for searching for nodes. The technical scheme is as follows:
a method of searching for a node, the method comprising:
a client sends a search request, wherein the search request carries a search range and a position designated by a user;
the proxy node receives the search request and broadcasts a query request to the neighbor nodes of the proxy node, wherein the query request carries the code, the message time, the position and the search range of the proxy node;
the neighbor node receives the query request and judges whether the query request is received or not;
if not, the neighbor node judges whether the neighbor node is positioned in the search range according to the position and the search range, if the neighbor node is positioned in the search range, a response message is sent to the proxy node, the response message carries message time and the code and position of the neighbor node, and the query request is broadcasted to the neighbor node;
and the proxy node receives the response message and sends the response message to the client.
The step of judging whether the inquiry request is received by the proxy node comprises the following steps:
and the neighbor node extracts the code of the proxy node and the message time from the query request, judges whether the code of the proxy node and the message time are stored or not, judges that the query request is received if the code of the proxy node and the message time are stored, and judges that the query request is not received if the code of the proxy node and the message time are not stored.
The neighbor node judges whether the neighbor node is located in the search range according to the position and the search range, and the method comprises the following steps:
and the neighbor node calculates the distance between the neighbor node and the position according to the position of the neighbor node and the position, judges whether the distance is greater than the search range, and judges that the neighbor node is located in the search range if the distance is not greater than the search range.
If there are multiple reply messages carrying the same node's code, accordingly,
the step of receiving the response message by the proxy node and sending the response message to the client comprises the following steps:
and the proxy node selects the response message with the message time closest to the current time from the plurality of response messages, discards other response messages and sends the undiscarded response message to the client.
The method further comprises the following steps:
after the agent node and/or the neighbor node broadcasts a query request to the neighbor node, the query request is uploaded to a server B;
the server B receives the query request, and searches corresponding message time, code of a reading node and position of the uploading node from the stored corresponding relation among the code of the uploading node, the code of the reading node, the message time and the position of the uploading node according to the code of the node uploading the query request;
and the B server sends a response message to the proxy node, wherein the response message carries the message time, the code of the reading node and the position of the uploading node.
After the client sends the search request, the method further comprises the following steps:
the node receiving the search request judges whether the coverage area of the node comprises the position carried by the search request;
if yes, the node sets itself as a candidate agent node, calculates its own weight, and sends a beacon message to its neighbor node, where the beacon message carries the weight;
if the candidate proxy node receives a beacon message which is sent by the neighbor node and carries the weight of the candidate proxy node, comparing whether the weight of the candidate proxy node is greater than the weight of the neighbor node, if so, electing the candidate proxy node as the proxy node, and if not, electing the node with the maximum weight as the proxy node;
and if the candidate proxy node does not receive the beacon message sent by the neighbor node, the candidate proxy node is promoted to be the proxy node.
The query request also carries an anchor node sequence, which, accordingly,
before the agent node and/or the neighbor node broadcasts the query request, adding the identifier of the agent node and/or the neighbor node into an anchor point sequence of the query request;
correspondingly, the receiving, by the neighbor node, the query request, and determining whether the query request has been received specifically include:
and the neighbor node receives the query request, judges whether the anchor point sequence of the query request has the identifier of the neighbor node, judges that the query request is received if the anchor point sequence of the query request has the identifier of the neighbor node, and judges that the query request is not received if the anchor point sequence of the query request does not have the identifier of the neighbor node.
A system for searching nodes comprises a client, a proxy node and a neighbor node;
the client is used for sending a search request, and the search request carries a search range and a position designated by a user;
the proxy node is used for receiving the search request and broadcasting a query request to a neighbor node of the proxy node, wherein the query request carries the code, the message time, the position and the search range of the proxy node; receiving a response message from the neighbor node, and sending the response message to the client;
the neighbor node is used for receiving the query request and judging whether the query request is received or not; if not, the neighbor node judges whether the neighbor node is located in the search range according to the position and the search range, if the neighbor node is located in the search range, a response message is sent to the proxy node, the response message carries message time and the code and position of the neighbor node, and the query request is broadcasted to the neighbor node.
The neighbor node includes:
the judging module is used for receiving the query request, extracting the codes of the proxy nodes and the message time from the query request and judging whether the codes of the proxy nodes and the message time are stored or not;
and the response module is used for judging whether the query request is not received if the judgment result of the judgment module is negative, judging whether the response message is in the search range according to the position and the search range, if so, sending a response message to the proxy node, wherein the response message carries message time, and the code and the position of the neighbor node, and broadcasting the query request to the neighbor node.
The response module comprises:
the judging unit is used for calculating the distance between the self and the position according to the position of the self and the position, judging whether the distance is larger than the searching range, and judging that the neighbor node is positioned in the searching range if the distance is not larger than the searching range;
and the sending unit is used for sending a response message to the proxy node, wherein the response message carries the message time, the code and the position of the neighbor node, and the query request is broadcast to the neighbor node.
If there are multiple reply messages carrying the same node's code, accordingly,
the proxy node includes:
a broadcast module, configured to receive the search request and broadcast an inquiry request to a neighboring node of the search request, where the inquiry request carries a code, a message time, the location, and the search range of the proxy node;
a sending module, configured to select, from the multiple response messages, a response message whose message time is closest to the current time, discard other response messages, and send the non-discarded response message to the client.
The system also includes a B server;
correspondingly, after the agent node and/or the neighbor node broadcasts the query request to the neighbor node, the agent node and/or the neighbor node is also used for uploading the query request to the B server;
the B server is used for receiving the query request, and searching the corresponding message time, the code of the reading node and the position of the uploading node from the stored corresponding relation among the code of the uploading node, the code of the reading node, the message time and the position of the uploading node according to the code of the node uploading the query request; and sending a response message to the proxy node, wherein the response message carries the message time, the code of the reading node and the position of the uploading node.
The proxy node is obtained by the following method;
the node receiving the search request judges whether the coverage area of the node comprises the position carried by the search request;
if yes, the node sets itself as a candidate agent node, calculates its own weight, and sends a beacon message to its neighbor node, where the beacon message carries the weight;
if the candidate proxy node receives a beacon message which is sent by the neighbor node and carries the weight of the candidate proxy node, comparing whether the weight of the candidate proxy node is greater than the weight of the neighbor node, if so, electing the candidate proxy node as the proxy node, and if not, electing the node with the maximum weight as the proxy node;
and if the candidate proxy node does not receive the beacon message sent by the neighbor node, the candidate proxy node is promoted to be the proxy node.
The query request also carries a sequence of anchor nodes,
correspondingly, the proxy node and/or the neighbor node is further configured to add its own identity to an anchor sequence of the query request before broadcasting the query request;
accordingly, the number of the first and second electrodes,
the neighbor node receives the query request, judges whether the anchor point sequence of the query request has the identifier of the neighbor node, judges whether the query request is not received if the anchor point sequence of the query request does not have the identifier of the neighbor node, judges whether the neighbor node is in the search range according to the position and the search range, sends a response message to the proxy node if the neighbor node is in the search range, and the response message carries message time, the code and the position of the neighbor node and broadcasts the query request to the neighbor node.
After receiving the search request, the proxy node broadcasts the query request to the neighbor nodes, after receiving the query request, the neighbor nodes judge whether the query request is received, if not, judge whether the neighbor nodes are located in the search range carried by the query request, if so, send response messages carrying the position, the code and the message time of the neighbor nodes to the proxy node, and then the proxy node sends the response messages to the client. The proxy node is selected near the designated position, the proxy node is utilized to search the node in the searching range, and the proxy node can be positioned near the designated position for a long time, so that the accuracy of searching the node is improved; nodes whose coverage includes the designated location are all likely to become proxy nodes, and are not limited by conditions, and thus have versatility.
Drawings
Fig. 1 is a flowchart of a method for searching nodes according to embodiment 1 of the present invention;
fig. 2 is a flowchart of a method for searching nodes according to embodiment 2 of the present invention;
fig. 3 is a schematic diagram of a system for searching for a node according to embodiment 3 of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Example 1
As shown in fig. 1, an embodiment of the present invention provides a method for searching a node, including:
step 101: a client sends a search request, wherein the search request carries a search range and a position designated by a user;
step 102: the agent node receives the search request and broadcasts an inquiry request to the neighbor nodes, wherein the inquiry request carries the code, the message time, the position and the search range of the agent node;
step 103: the neighbor node receives the query request and judges whether the query request is received or not;
step 104: if not, the neighbor node judges whether the neighbor node is positioned in the search range according to the position and the search range carried by the query request, if so, the neighbor node sends a response message to the proxy node, wherein the response message carries message time and the code and the position of the neighbor node, and broadcasts the query request to the neighbor node;
step 105: and the proxy node receives the response message and sends the response message to the client.
In the embodiment of the invention, after receiving a search request, a proxy node broadcasts the search request to a neighbor node, after receiving the search request, the neighbor node judges whether the search request is received, if not, judges whether the neighbor node is positioned in a search range carried by the search request, if so, the proxy node sends a response message carrying the position, the code and the message time of the proxy node to the proxy node, and then the proxy node sends the response message to a client. The proxy node is selected near the designated position, the proxy node is utilized to search the node in the searching range, and the proxy node can be positioned near the designated position for a long time, so that the accuracy of searching the node is improved; nodes with coverage areas including the designated positions are all possible to become proxy nodes and are not limited by conditions, so that the method has universality.
Example 2
As shown in fig. 2, an embodiment of the present invention provides a method for searching a node, including:
step 201: a client broadcasts a search request to the Internet of things, wherein the search request carries a position and a search range specified by a user;
the user may previously specify a specific location in the client, where the location may be a coordinate or a specific longitude and latitude, and the user may further input a search range to the client, where the search range may be a search radius. Then, the client generates a search request carrying the user-specified location and search range. In addition, a default search range is also set in the client in advance, and if the user does not input the search range to the client, the client generates a search request carrying the specified position and the default search range. For example, the user-specified location is coordinates (x0, y0) and the search radius is L0, the client generates a search request carrying coordinates (x0, y0) and a search radius L0.
Step 202: the nodes in the Internet of things receive the search request, judge whether the communication range of the nodes covers the position carried by the search request, and if so, set the nodes as candidate agent nodes;
for example, after each node in the internet of things receives a search request, the position of the node is extracted as coordinates (x0, y0) from the search request, and all nodes with communication range covering coordinates (x0, y0) set the node as candidate proxy nodes.
After receiving the search request, other nodes in the internet of things directly forward the search request if judging that the communication range of the other nodes cannot cover the position carried by the search request.
Step 203: each candidate agent node calculates the weight of the candidate agent node and sends a beacon message to the neighbor node, wherein the beacon message carries the weight of the candidate agent node;
wherein, each candidate agent node calculates its own weight Wi according to the following formula (1).
W i = α w d i + β w v i + γ w a i + χ w r i + ϵ · PRE . . . . . . ( 1 )
Wherein α + β + γ + χ + ∈ 1, i ∈ { 2.·. α, β, γ, χ, ε are coefficients that are set in advance by the technician in each candidate node, the technician can set the value of each coefficient according to the needs of the actual service, and typically α > χ > β > γ, PRE 1 if the candidate agent node is voluntarily the agent node, otherwise PRE 0.
Wherein, w d i = d i Σ j = 1 K d j , K ≥ 2 ,
wherein d isiThe Euclidean distance between the candidate agent node and the appointed position is calculated by the candidate agent node according to the position of the candidate agent node and the appointed position.
Wherein, w v i = v i Σ j = 1 K v j , K ≥ 2 ,
wherein v isiThe candidate agent node is a motion speed scalar of the candidate agent node, and the candidate agent node can measure the motion speed scalar of the candidate agent node.
Wherein, w a i = a i Σ j = 1 K a j , K ≥ 2 ,
wherein, aiIs the acceleration scalar of the candidate node, and the candidate agent node can measure the acceleration scalar of itself.
Figure BSA00000193822900083
Is a normalized weight of the communication radius of the candidate node. The calculation formula is as follows:
Figure BSA00000193822900084
wherein r isiIs the communication radius of the candidate node.
Step 204: if the candidate agent node receives the beacon message sent by the neighbor candidate agent node, extracting the weight of each neighbor candidate agent node from the beacon message;
if the non-candidate agent node receives the beacon message sent by the neighbor candidate agent node, the received beacon message is directly discarded.
Step 205: the candidate agent node compares the weight of the candidate agent node with the weight of each neighbor candidate agent node, if the weight of the candidate agent node is greater than that of each neighbor candidate agent node, the candidate agent node is elected as the agent node, otherwise, the candidate agent node with the maximum weight is elected as the agent node from the neighbor candidate agent nodes;
step 206: if the candidate agent node does not receive the beacon message, the candidate agent node elects the candidate agent node as the agent node;
in the embodiment, the distance between the candidate agent node and the designated position, the node communication radius, the node speed, the node acceleration, the willingness and other factors are comprehensively considered when the agent node is selected, so that the agent node can be located near the designated position for a long time and cannot leave the search range for a short time, and the accuracy of searching the node is improved.
In this embodiment, a user may input a node code and a search range to a client, the client generates a search request carrying the search range, and sends the search request to a corresponding node according to the node code input by the user, and if the node has the capability of receiving and sending messages, the node refers itself as an agent node; if the node does not have the capability to receive and send messages, the user re-enters a specific location and search scope to the client and proceeds from step 201.
Wherein, for one proxy node, the following steps 207 to 211 are executed to search for a node satisfying the search condition within the search range.
Step 207: the agent node generates an inquiry request, wherein the inquiry request carries the code of the agent node, the message time, the anchor point sequence, the position carried by the search request and the search range, the anchor point sequence stores the identifier of the agent node, and the inquiry request is broadcasted to the neighbor nodes;
specifically, the agent node acquires the current time, uses the acquired current time as the message time, generates the query request, adds the code of the agent node, the message time, the position carried by the search request and the search range in the query request, and adds the identifier of the agent node to the anchor point sequence of the search request.
The identity of the proxy node may be the current location or network address of the proxy node.
Further, if the proxy node is connected with the B server of the organization to which the proxy node belongs, the proxy node sends a query request to the B server at the same time.
Correspondingly, the B server receives the query request, extracts the code of the node uploading the query request, namely the code and message time of the proxy node, from the query request, judges whether the query request is received or not according to the extracted code and message time of the uploading node, if so, discards the query request, if not, stores the code and message time of the uploading node, searches the code, message time and position of the corresponding reading node from the corresponding relation among the code, reading time and position of the uploading node stored by the B server according to the code of the uploading node, and sends a response message to the proxy node, wherein the response message carries the code, message time and position of the reading node.
And the B server judges whether the extracted codes and message time of the uploading nodes are stored or not, if so, judges that the query request is received, and if not, does not receive the query request before.
Wherein each node in the network is deployed by a different organization, and thus each node is affiliated with a different organization, and each organization has its own B-server.
When a certain node in the network reads information of other nodes, if the node is connected with a B server of an organization to which the node belongs, the node uploads a code of the node, the code of the read node, message time and a position of the node to the B server, and the B server stores the code of the node, the code of the read node, the message time and the position of the node in a corresponding relation of the code of the upload node, the code of the read node, the message time and the position of the upload node. When reading other nodes, each other node in the network also performs the same operation with the node.
If the proxy node is directly designated by the user, the proxy node acquires the current time and the position of the proxy node, takes the current time as the message time, and generates a query request, wherein the query request carries the code of the proxy node, the message time, the anchor point sequence, the acquired position and the search range carried by the search request.
Step 208: when the neighbor node receives the query request, extracting the code and message time of the proxy node from the query request, and judging whether the query request is received according to the extracted code and message time of the proxy node; if so, directly discarding the query request, otherwise, performing step 209;
and when the neighbor node receives a new query request, the neighbor node stores the code and message time of the proxy node carried by the query request. Therefore, after the neighbor node extracts the code and message time of the proxy node from the query request, whether the neighbor node has stored the extracted code and message time of the proxy node is judged, if not, the neighbor node is judged not to receive the query request, and if so, the neighbor node is judged to have received the query request.
In addition, the neighbor node can also extract the anchor point sequence from the query request, judge whether the extracted anchor point sequence has the identifier of the neighbor node, judge that the query request is received if the extracted anchor point sequence has the identifier of the neighbor node, and judge that the query request is not received if the extracted anchor point sequence does not have the identifier of the neighbor node.
Step 209: the neighbor node extracts a position and a search range from the query request, judges whether the neighbor node is in the search range according to the position and the extracted position of the neighbor node, if so, executes the step 210, and if not, ends the operation;
specifically, the neighbor node extracts a position and a search range from the query request, calculates a distance between itself and the extracted position according to the extracted position and the location of itself, and determines whether the distance is less than or equal to the search range, if so, it indicates that the neighbor node is located within the search range, and if not, it indicates that the neighbor node is located outside the search range.
Step 210: the neighbor node sends a response message to the proxy node, the response message carries self code, self position information and current time, self identification is added to an anchor point sequence of the search request, and the added search request is broadcasted to the neighbor node;
further, if the neighbor node is also connected with the B server of the mechanism to which the neighbor node belongs, the neighbor node uploads the query request to the B server;
correspondingly, the B server receives the query request, extracts the code of the node uploading the query request, namely the code and the message time of the neighbor node, from the query request, judges whether the query request is received or not according to the extracted code and the message time of the uploading node, if so, discards the query request, if not, stores the code and the message time of the uploading node, searches the code, the message time and the position of the uploading node of the corresponding reading node from the corresponding relation among the code, the code and the message time of the uploading node and the position of the uploading node, which are stored by the B server, according to the code of the uploading node, and sends a response message to the proxy node, wherein the response message carries the searched code, the message time and the position of the uploading node.
After receiving the query request, each node in the network performs the same operation as the neighbor node.
Step 211: and when the agent node receives the first response message, the agent node starts to receive the response message within the preset time, packages the received response message and then sends the packaged response message to the client.
Further, if a plurality of response messages carry the code of the same node, the proxy node selects the response message with the message time closest to the current time from the plurality of response messages according to the message time carried by each response message, and discards other response messages. Accordingly, the proxy node packages the non-discarded response message and sends the response message to the client.
Wherein other proxy nodes in the network perform the same operation as the proxy node.
In the embodiment, a user specifies a specific position and a specific search range, then selects an agent node, and searches for a node near the specified position by using the agent node, thereby improving the accuracy of searching for the node.
The node type can be read by other nodes nearby the node type, and if the other nodes read the information of the node, the code of the node and the position information of the node are uploaded to the B server. In this embodiment, each node uploads a query request to the B-server, and information such as codes of nodes read by the node may be sent from the B-server to the proxy node, where the read nodes include nodes without capability of receiving and sending messages. Therefore, the accuracy of searching the nodes is improved.
In the embodiment of the invention, after receiving a search request, a proxy node broadcasts the search request to a neighbor node, after receiving the search request, the neighbor node judges whether the search request is received, if not, judges whether the neighbor node is positioned in a search range carried by the search request, if so, the proxy node sends a response message carrying the position, the code and the message time of the proxy node to the proxy node, and then the proxy node sends the response message to a client. The agent node is selected near the designated position, the agent node is utilized to search the node in the search range, and the agent node is selected by comprehensively considering various factors such as communication radius, node speed, node acceleration, uploading capability, volunteering and the like, so that the agent node can be ensured to be near the designated position within a long time, and the accuracy of searching the node is improved; nodes with coverage areas including the designated positions are all possible to become proxy nodes and are not limited by conditions, so that the method has universality.
Example 3
As shown in fig. 3, an embodiment of the present invention provides a system for searching for a node, including a client 301, a proxy node 302, and a neighbor node 303;
the client 301 is configured to send a search request, where the search request carries a search range and a location specified by a user;
the proxy node 302 is configured to receive the search request and broadcast an inquiry request to the neighboring node 303, where the inquiry request carries the code, the message time, the location and the search range of the proxy node 302; receiving a response message from the neighbor node 303, and sending the response message to the client 301;
the neighbor node 303 is configured to receive the query request and determine whether the query request has been received; if not, judging whether the node is positioned in the search range according to the position and the search range carried by the query request, if so, sending a response message to the proxy node 302, wherein the response message carries message time and the code and the position of the neighbor node 302, and broadcasting the query request to the neighbor node;
wherein the neighbor node 303 includes:
a judging module, configured to receive the query request, extract the coding and message time of the proxy node 302 from the query request, and judge whether the coding and message time of the proxy node 302 are stored;
the response module is used for judging whether the query request is not received if the judgment result of the judgment module is negative, judging whether the response message is in the search range according to the position and the search range carried by the query request, and if the response message is in the search range, sending a response message to the proxy node 302, wherein the response message carries message time, the code and the position of the neighbor node 302, and broadcasting the query request to the neighbor node;
wherein, the response module includes:
a judging unit, configured to calculate a distance between the self and the position carried in the query request according to the position of the self and the position carried in the query request, judge whether the distance is greater than the search range, and if not, judge that the neighbor node 303 is located within the search range;
a sending unit, configured to send a response message to the proxy node 302, where the response message carries a message time, and a code and a position of the neighbor node 303, and broadcasts the query request to the neighbor node;
wherein, if there are multiple reply messages carrying the same node's code, accordingly,
the proxy node 302 includes:
a broadcasting module, configured to receive the search request and broadcast an inquiry request to a neighboring node, where the inquiry request carries a code of the proxy node 301, a message time, a location carried by the search request, and a search range;
the sending module is used for selecting the response message with the message time closest to the current time from the plurality of response messages, discarding other response messages and sending the response messages which are not discarded to the client;
further, the system also comprises a server B;
correspondingly, after the agent node 302 and/or the neighbor node 303 broadcasts the query request to the neighbor node, the agent node and/or the neighbor node is further configured to upload the query request to the B server;
the server B is used for receiving the query request, and searching the corresponding message time, the code of the reading node and the position of the uploading node from the stored corresponding relation among the code of the uploading node, the code of the reading node, the message time and the position of the uploading node according to the code of the node uploading the query request; sending a response message to the agent node 302, wherein the response message carries the message time, the code of the reading node, and the position of the uploading node;
wherein, the agent node 302 is obtained by the following method;
the node receiving the search request judges whether the coverage area of the node comprises the position carried by the search request;
if so, the node sets itself as a candidate agent node, calculates its weight, and sends a beacon message to its neighbor node, wherein the beacon message carries the weight;
if the candidate proxy node receives the beacon message carrying the self weight sent by the neighbor node, comparing whether the self weight is larger than the weight of the neighbor node, if so, electing the candidate proxy node as the proxy node, and if not, electing the node with the maximum weight as the proxy node;
if the candidate agent node does not receive the beacon message sent by the neighbor node, the candidate agent node is elected as the agent node;
further, the query request also carries an anchor node sequence,
correspondingly, the proxy node 302 and/or the neighbor node 303 are further configured to add its own identity to the anchor sequence of the query request before broadcasting the query request;
accordingly, the number of the first and second electrodes,
the neighbor node 303 receives the query request, determines whether an identifier of the neighbor node exists in an anchor point sequence of the query request, determines that the query request is not received if the identifier does not exist, determines whether the neighbor node is in the search range according to a position and a search range carried by the query request, and sends a response message to the proxy node 302 if the identifier does not exist, wherein the response message carries message time, and a code and a position of the neighbor node 303, and broadcasts the query request to the neighbor node.
In the embodiment of the invention, after receiving a search request, a proxy node broadcasts the search request to a neighbor node, after receiving the search request, the neighbor node judges whether the search request is received, if not, judges whether the neighbor node is positioned in a search range carried by the search request, if so, the proxy node sends a response message carrying the position, the code and the message time of the proxy node to the proxy node, and then the proxy node sends the response message to a client. The proxy node is selected near the designated position, the proxy node is utilized to search the node in the searching range, and the proxy node can be positioned near the designated position for a long time, so that the accuracy of searching the node is improved; nodes with coverage areas including the designated positions are all possible to become proxy nodes and are not limited by conditions, so that the method has universality.
All or part of the technical solutions provided by the above embodiments may be implemented by software programming, and the software program is stored in a readable storage medium, for example: hard disk, optical disk or floppy disk in a computer.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (14)

1. A method of searching for a node, the method comprising:
a client sends a search request, wherein the search request carries a search range and a position designated by a user;
the proxy node receives the search request and broadcasts a query request to the neighbor nodes of the proxy node, wherein the query request carries the code, the message time, the position and the search range of the proxy node;
the neighbor node receives the query request and judges whether the query request is received or not;
if not, the neighbor node judges whether the neighbor node is positioned in the search range according to the position and the search range, if the neighbor node is positioned in the search range, a response message is sent to the proxy node, the response message carries message time and the code and position of the neighbor node, and the query request is broadcasted to the neighbor node;
and the proxy node receives the response message and sends the response message to the client.
2. The method of claim 1, wherein the proxy node determining whether the query request has been received comprises:
and the neighbor node extracts the code of the proxy node and the message time from the query request, judges whether the code of the proxy node and the message time are stored or not, judges that the query request is received if the code of the proxy node and the message time are stored, and judges that the query request is not received if the code of the proxy node and the message time are not stored.
3. The method of claim 1, wherein the neighbor node determining whether it is within the search range based on the location and the search range comprises:
and the neighbor node calculates the distance between the neighbor node and the position according to the position of the neighbor node and the position, judges whether the distance is greater than the search range, and judges that the neighbor node is located in the search range if the distance is not greater than the search range.
4. The method of claim 1, wherein if there are multiple reply messages carrying the same node's code, accordingly,
the step of receiving the response message by the proxy node and sending the response message to the client comprises the following steps:
and the proxy node selects the response message with the message time closest to the current time from the plurality of response messages, discards other response messages and sends the undiscarded response message to the client.
5. The method of claim 1, wherein the method further comprises:
after the agent node and/or the neighbor node broadcasts a query request to the neighbor node, the query request is uploaded to a server B;
the server B receives the query request, and searches corresponding message time, code of a reading node and position of the uploading node from the stored corresponding relation among the code of the uploading node, the code of the reading node, the message time and the position of the uploading node according to the code of the node uploading the query request;
and the B server sends a response message to the proxy node, wherein the response message carries the message time, the code of the reading node and the position of the uploading node.
6. The method of claim 1, wherein after the client sends the search request, further comprising:
the node receiving the search request judges whether the coverage area of the node comprises the position carried by the search request;
if yes, the node sets itself as a candidate agent node, calculates its own weight, and sends a beacon message to its neighbor node, where the beacon message carries the weight;
if the candidate proxy node receives a beacon message which is sent by the neighbor node and carries the weight of the candidate proxy node, comparing whether the weight of the candidate proxy node is greater than the weight of the neighbor node, if so, electing the candidate proxy node as the proxy node, and if not, electing the node with the maximum weight as the proxy node;
and if the candidate proxy node does not receive the beacon message sent by the neighbor node, the candidate proxy node is promoted to be the proxy node.
7. The method of claim 1, wherein the query request further carries a sequence of anchor nodes, and wherein, accordingly,
before the agent node and/or the neighbor node broadcasts the query request, adding the identifier of the agent node and/or the neighbor node into an anchor point sequence of the query request;
correspondingly, the receiving, by the neighbor node, the query request, and determining whether the query request has been received specifically include:
and the neighbor node receives the query request, judges whether the anchor point sequence of the query request has the identifier of the neighbor node, judges that the query request is received if the anchor point sequence of the query request has the identifier of the neighbor node, and judges that the query request is not received if the anchor point sequence of the query request does not have the identifier of the neighbor node.
8. A system for searching nodes is characterized in that the system comprises a client, a proxy node and a neighbor node;
the client is used for sending a search request, and the search request carries a search range and a position designated by a user;
the proxy node is used for receiving the search request and broadcasting a query request to a neighbor node of the proxy node, wherein the query request carries the code, the message time, the position and the search range of the proxy node; receiving a response message from the neighbor node, and sending the response message to the client;
the neighbor node is used for receiving the query request and judging whether the query request is received or not; if not, judging whether the neighbor node is located in the search range according to the position and the search range, if the neighbor node is located in the search range, sending a response message to the proxy node, wherein the response message carries message time, and the code and the position of the neighbor node, and broadcasting the query request to the neighbor node.
9. The system of claim 8, wherein the neighbor node comprises:
the judging module is used for receiving the query request, extracting the codes of the proxy nodes and the message time from the query request and judging whether the codes of the proxy nodes and the message time are stored or not;
and the response module is used for judging whether the query request is not received if the judgment result of the judgment module is negative, judging whether the response message is in the search range according to the position and the search range, if so, sending a response message to the proxy node, wherein the response message carries message time, and the code and the position of the neighbor node, and broadcasting the query request to the neighbor node.
10. The system of claim 9, wherein the reply module comprises:
the judging unit is used for calculating the distance between the self and the position according to the position of the self and the position, judging whether the distance is larger than the searching range, and judging that the neighbor node is positioned in the searching range if the distance is not larger than the searching range;
and the sending unit is used for sending a response message to the proxy node, wherein the response message carries the message time, the code and the position of the neighbor node, and the query request is broadcast to the neighbor node.
11. The system of claim 8, wherein if there are multiple reply messages carrying the same node's code, accordingly,
the proxy node includes:
a broadcast module, configured to receive the search request and broadcast an inquiry request to a neighboring node of the search request, where the inquiry request carries a code, a message time, the location, and the search range of the proxy node;
a sending module, configured to select, from the multiple response messages, a response message whose message time is closest to the current time, discard other response messages, and send the non-discarded response message to the client.
12. The system of claim 8, wherein the system further comprises a B-server;
correspondingly, after the agent node and/or the neighbor node broadcasts the query request to the neighbor node, the agent node and/or the neighbor node is also used for uploading the query request to the B server;
the B server is used for receiving the query request, and searching the corresponding message time, the code of the reading node and the position of the uploading node from the stored corresponding relation among the code of the uploading node, the code of the reading node, the message time and the position of the uploading node according to the code of the node uploading the query request; and sending a response message to the proxy node, wherein the response message carries the message time, the code of the reading node and the position of the uploading node.
13. The system of claim 8, wherein the proxy node elects to obtain in the following manner;
the node receiving the search request judges whether the coverage area of the node comprises the position carried by the search request;
if yes, the node sets itself as a candidate agent node, calculates its own weight, and sends a beacon message to its neighbor node, where the beacon message carries the weight;
if the candidate proxy node receives a beacon message which is sent by the neighbor node and carries the weight of the candidate proxy node, comparing whether the weight of the candidate proxy node is greater than the weight of the neighbor node, if so, electing the candidate proxy node as the proxy node, and if not, electing the node with the maximum weight as the proxy node;
and if the candidate proxy node does not receive the beacon message sent by the neighbor node, the candidate proxy node is promoted to be the proxy node.
14. The system of claim 8, wherein the query request further carries a sequence of anchor nodes,
correspondingly, the proxy node and/or the neighbor node is further configured to add its own identity to an anchor sequence of the query request before broadcasting the query request;
accordingly, the number of the first and second electrodes,
the neighbor node receives the query request, judges whether the anchor point sequence of the query request has the identifier of the neighbor node, judges whether the query request is not received if the anchor point sequence of the query request does not have the identifier of the neighbor node, judges whether the neighbor node is in the search range according to the position and the search range, sends a response message to the proxy node if the neighbor node is in the search range, and the response message carries message time, the code and the position of the neighbor node and broadcasts the query request to the neighbor node.
CN 201010228672 2010-07-09 2010-07-09 Method and system for searching node Active CN102014456B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010228672 CN102014456B (en) 2010-07-09 2010-07-09 Method and system for searching node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010228672 CN102014456B (en) 2010-07-09 2010-07-09 Method and system for searching node

Publications (2)

Publication Number Publication Date
CN102014456A CN102014456A (en) 2011-04-13
CN102014456B true CN102014456B (en) 2013-03-27

Family

ID=43844413

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010228672 Active CN102014456B (en) 2010-07-09 2010-07-09 Method and system for searching node

Country Status (1)

Country Link
CN (1) CN102014456B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102184191A (en) * 2011-04-19 2011-09-14 中国联合网络通信集团有限公司 Method and system for inquiring peripheral environment information based on Internet of things, and Internet of things platform
CN105530172A (en) * 2015-12-28 2016-04-27 小米科技有限责任公司 User information obtaining method, device, terminal device and server
CN105682033B (en) * 2016-01-19 2019-01-25 福建师范大学 A kind of neighbour's detection method based on mobile AP
CN106507286A (en) * 2016-11-22 2017-03-15 北京三快在线科技有限公司 A kind of document transmission method, source device and non-source device
CN112668998B (en) * 2020-12-23 2023-12-19 树根互联股份有限公司 Flow implementation method, device, system, electronic equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039321A (en) * 2007-02-02 2007-09-19 南京邮电大学 Mixed mobile agent-based wireless sensor network data transmission method
CN101420337A (en) * 2007-10-26 2009-04-29 北大方正集团有限公司 Method, device and indexing server for resource positioning

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1719325B1 (en) * 2004-01-23 2017-03-29 Tiversa IP, Inc. Method for optimally utilizing a peer to peer network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039321A (en) * 2007-02-02 2007-09-19 南京邮电大学 Mixed mobile agent-based wireless sensor network data transmission method
CN101420337A (en) * 2007-10-26 2009-04-29 北大方正集团有限公司 Method, device and indexing server for resource positioning

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
传感器网络中分布式最优小波压缩算法;杨圣洪等;《计算机工程与应用》;20091031;第45卷(第10期);第4-6页 *
杨圣洪等.传感器网络中分布式最优小波压缩算法.《计算机工程与应用》.2009,第45卷(第10期),第4-6页.

Also Published As

Publication number Publication date
CN102014456A (en) 2011-04-13

Similar Documents

Publication Publication Date Title
JP4100320B2 (en) Position detection system and apparatus
US9639557B2 (en) Positioning system
CN108107461B (en) Indoor and outdoor positioning seamless switching method based on mobile terminal
US9313617B2 (en) Identification of points of interest and positioning based on points of interest
US20140211691A1 (en) System and method for choosing suitable access points in quips autarkic deployment
RU2489800C2 (en) System and method for efficient filling of cellular network model
US9052204B2 (en) Behavior pattern extraction system, apparatus, method and recording medium storing program
US8378891B2 (en) Method and system for optimizing quality and integrity of location database elements
CN102014456B (en) Method and system for searching node
JP6740731B2 (en) Communication device, data collection method, program, and safety confirmation system
EP2928245A1 (en) A wireless access point, a transmitter-implemented method, a mobile user device and a user-implemented method for localization
US10547983B2 (en) Controlling radio fingerprint observation report collection
CN109429330B (en) Indoor positioning method, device, equipment and medium
KR101791259B1 (en) Method for Measuring Position Hierarchically, System And Apparatus Therefor
EP2653881B1 (en) Cooperative localization of portable electronic devices
JP4876140B2 (en) Wireless communication terminal and cell list creation method
US11803580B2 (en) Apparatus and method for machine-learning-based positioning database creation and positioning of uncollected points using matching feature with wireless communication infrastructure
CN110740422A (en) Radio fingerprint acquisition with reduced collection range
US20160306025A1 (en) Method for determining indoor locations of mobile receiver units
US20220198178A1 (en) Method and apparatus for identifying the floor of a building
US10123298B1 (en) Estimating the location of a wireless terminal based on detection of whether it is moving or stationary
KR101878487B1 (en) Method of generating position database of heterogeneous infrastructure for position determination
JP2018141721A (en) Building specification device, communication terminal, building specification method, and program
JP2011185891A (en) Mobile terminal and positioning method for the same
KR101355411B1 (en) Method And Apparatus for Measuring In-Building Radio Wave

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant