The method and the device that are used for the micro power radio communication of local monitor, control
Technical field
The present invention relates to a kind of method and device of micro power radio communication, be specifically related to a kind of monitor signal of regional area and control signal are carried out the signal transmission by the micro power radio communication in open frequency range method and implement device thereof of being used for.
Background technology
Control in production run, and some need the occasion of remote monitoring, the signal of sensor or instrument acquisition need be passed to computing machine, perhaps the control signal that computing machine is provided passes to control device, the transmission of this class signal generally in the workshop, regional areas such as plant area, building, residential quarters carry out, its transmission range usually at hundreds of rice between thousands of rice.The quantity of sampled point or controlled point is generally between the dozens of to more or less a hundred, is connected operation with host computer through transmission system.
In the prior art, this class monitoring, control signal are transmitted by adopting wired mode to carry out, and need connect up in advance.This has increased application cost on the one hand, and simultaneously, in some production control occasion, sensing or controlled device are moved, and for example monitored object is arranged in driving, and the difficulty that this has increased wiring greatly also causes the reliability decrease of using.For this reason, people begin to consider to adopt that method of wireless communication is monitored, the transmission of control signal, but the technical scheme that is in the news in the monitoring field at present adopts gsm system to realize substantially, for example, " the Guangdong communication technology " the 4th phase in 2003 discloses a kind of " design and the realization of SMS mode remote monitoring software ", promptly be by the GSM network, transmit data, remote equipment is monitored in the mode of short message.Adopt this GSM network system, can realize the transport communication of sensing, control signal, but on the one hand, need to give each node configuration industrial control computer or complicated coupling arrangement; On the other hand, because the GSM network is commercialized running, application person need pay corresponding cost to GSM service provider, causes the increase of monitoring cost.
At wireless communication field, be provided with open frequency range, can be used for the communications in the specific region, but, can only carry out the micropower transmission during use in order to meet the regulation of radio control, reliable transmitting range is usually at 300-400 rice.Because in local monitor, control, the data volume that each signal transmits is little, can consider by providing signal relay to increase transmitting range, yet, wireless transmission is different with wire transmission, does not have clear and definite transmission direction, if increase transmitting range by signal relay, the problem that can exist a plurality of data channel to transmit simultaneously, the difficulty that causes receiver to handle.Therefore, need provide a kind of micropower communication means to solve the problems referred to above.Moreover, how to adopt fairly simple device to realize transmission, particularly and the interface between sensing, instrument, control device realize, also be to need the problem that solves.
Summary of the invention
First purpose of the present invention provides a kind of method that is used for the micro power radio communication of local monitor, control, by to the setting of transmitting signal and the control of transfer mode, is implemented in monitoring, control signal transmission in the thousands of meters scopes with trunking scheme;
Second purpose of the present invention provides a kind of device that is used for the micro power radio communication of local monitor, control;
A further object of the present invention provides the application process of this device in the communication network that adopts this wireless communications method.
For reaching first goal of the invention of the present invention, the technical solution used in the present invention is: a kind of method that is used for the micro power radio communication of local monitor, control, with the central point is root node, monitoring, control end are leaf node, relaying is a child node, constitute the dynamic tree structure of Star topology, each node adopts micropower to transmit and receive signal; Root node adds the identification sign and the signal sequence identification marking of the leaf node that receives this signal in data when sending signal, leaf node adds the identification sign and the signal sequence identification marking of this node in data when sending signal; When a node receives signal, delay time 1~5 millisecond, receive again next time or send, to each signal that receives, compare according to its signal sequence identification marking and previous useful signal, if the signal sequence identification marking is identical, then abandon, if signal sequence identification marking difference, then handle as useful signal, when root node was launched the coverage that receives to the distance of leaf node greater than wireless micro-power, signal arrived leaf node by the transmission of relaying child node, constitute the unique dynamic transmission passage between root node and particular leaf node thus, realize the transmission of monitoring or control signal.
In the technique scheme, the processing of described useful signal comprises that if this node is a root node, the recognition serial data also passes to the host computer processing; If this node is a leaf node, judge the identification sign, be this node, then handle, Monitoring Data is provided or transmits control signal, not this node, then abandon; If this node is the relaying child node, then transmit these data.
The transfer mode of preferred data-signal is that central point is a master, adopts to send a reception answer method; The relaying child node is not replied, and adopts reception-send mode; Leaf node adopts reception-transmission response mode for being subjected to prosecutor.
Further technical scheme, according to the distance of root node with the classification of relaying child node, and give each relaying child node an identification sign, when central stepchild's node transmits signal, add its relaying rank number and identification sign in data, each relaying child node only transmits the signal of its upper level node or next stage node.
For realizing second goal of the invention of the present invention, the present invention has provided a kind of micro power radio communication device that is used for local monitor, control, comprise that single-chip microcomputer, wireless receiving send control assembly and antenna, be connected with universal asynchronous communication interface expanded circuit, at least one group of 8 gauge tap, display circuit on the IO interface of single-chip microcomputer, the other end of described universal asynchronous communication interface expanded circuit connects described wireless receiving respectively and sends control assembly, a RS-232 interface and a RS-485 interface.
Further technical scheme is provided with two groups of 8 gauge tap.
The application process of said apparatus is, can use as central point, relaying child node or monitoring, control end leaf node respectively by setting, adopt 2 in 8 gauge tap to carry out device identity control setting, RS-232 or RS-485 interface are selected in 1 definition for use, all the other 5 are used to set the identification coding, when sending signal, generate the identification sign according to the identification coding.
When being provided with two groups of 8 gauge tap, adopting wherein in one group of 8 gauge tap 2 to carry out the control of device identity sets, RS-232 or RS-485 interface are selected in 1 definition for use, 3 definition relaying ranks, adopt 8 gauge tap of another group to be used to set the identification coding, when sending signal, generate the identification sign according to the identification coding.
Because the technique scheme utilization, the present invention compared with prior art has following advantage:
1. because the present invention adopts dynamic tree structure to communicate, can be implemented in the interior in a big way transport communication under the micropower emission, calculate by 8 grades of relayings are set, communication distance is greater than 2 kms.
2. because the singularity of radio communication, may there be a plurality of data-transmission channels, for example, directly transmit, transmit from other relaying, or the like, the present invention can shield most of duplicate message that transmits by other passage by 1~5 millisecond time-delay is set, and again the signal sequence of packet is set sign and judges, can the assurance system constitute the star structure of one-to-many, a channel opener is at a time only arranged.Because the uncertainty of channel opener, tree-shaped relation of the present invention is dynamic.
3. the relaying rank is set, can further limits passage, promptly relaying up receives only the signal of central point or higher level's relaying, down receives only the signal of leaf node or subordinate's relaying, improves data processing efficiency.
4. be provided with multidigit gauge tap (DIP switch) in the device of the present invention, by switch control setting device is to use as the center root node, use as repeater, still use as leaf node, make various types of nodes can use same Logic Circuit Design and device, do not need independent manufacturing, reduced system cost, improved the dirigibility of system variation.
5. the interface of apparatus of the present invention can be selected general RS-232 mouth or RS-485 mouth, thereby can be connected with various instrumentation taps easily, perhaps is connected with computing machine, and the selection of interface is switched realization by electronic switch; Simultaneously, because the application of said method, do not need the network operating system support during device networking of the present invention, each device can be transmitted or response operation according to identity and rank setting automatically.
Description of drawings
Accompanying drawing 1 is the circuit block diagram of the embodiment of the invention one;
Accompanying drawing 2 is a control command synoptic diagram in the embodiment of the invention one;
Accompanying drawing 3 is the central point data transfer workflow diagram of the embodiment of the invention one;
Accompanying drawing 4 is that the relay data of the embodiment of the invention one transmits workflow diagram;
Accompanying drawing 5 is the leaf node data transfer workflow diagram of the embodiment of the invention one;
Accompanying drawing 6 is a dynamic signal transmission passage illustration in the star network in the embodiment of the invention one;
Accompanying drawing 7 is the logic schematic diagram of emission in the embodiment of the invention one, reception and control section;
Accompanying drawing 8 is the logic schematic diagram of display part in the embodiment of the invention one.
Embodiment
Below in conjunction with drawings and Examples the present invention is further described:
Embodiment one: referring to accompanying drawing 1 to shown in the accompanying drawing 8, a kind of local monitor that is used for, the micro power radio communication device of control, comprise single-chip microcomputer (Atmega8 series CPU), wireless receiving sends control assembly (is the PTRs2000 series micropower digital transmission module of wireless transceiver with nRF401) and antenna, be connected with universal asynchronous communication interface expanded circuit on the IO interface of single-chip microcomputer, two groups 8 gauge tap (DIP switch), display circuit (8 sections charactron and light emitting diode), the XP3 socket of described universal asynchronous communication interface expanded circuit connects described wireless receiving and sends control assembly, the XP4 socket connects a RS-232 interface or a RS-485 interface, and described display circuit is used to show this machine ID and other status data.From PB0-PB5 and 8 DIP switch states of PD6-PD7 input of Atmega8 series CPU, by PC0 or selected wherein one of the two groups of switches of PC1; PC2-PC5 connects one or more light emitting diodes respectively, controls that it is bright or do not work, and state 8 section charactron data presented current with indication device are electronic switch by DB0-DB7 signal controlling PD2, PD3.
When this device uses, use as central point, relaying child node or monitoring, control end leaf node by setting respectively, adopting wherein in one group of 8 gauge tap 2 to carry out the control of device identity sets, RS-232 or RS-485 interface are selected in 1 definition for use, 3 definition relaying ranks, adopt 8 gauge tap of another group to be used to set the identification coding, when sending signal, generate the identification sign according to the identification coding.When device is defined as central point, XP4 connects the communication interface of upper microcomputer; When device is defined as leaf node, XP4 connects the communication interface of monitoring and control device.
The device of present embodiment is in use by a central point, multistage relaying child node and a plurality of monitoring, the control end leaf node constitutes the dynamic tree structure of Star topology, each monitoring, the control end leaf node adopts a playscript with stage directions device, ID number (i.e. the identification coding of being set by one group 8 control DIP switch) corresponding with acquisition controlling point is set, and according to monitoring, the on-line interface of controlling object is selected RS-232 interface or RS-485 interface, realize switching by Single-chip Controlling electronic switch (PD), selected interface and corresponding supervising device are (as secondary instrument, sensing device, etc.) connect; Central point also adopts a playscript with stage directions device to constitute, and selects RS-232 interface to be connected with host computer; Relay point is provided with different stage (being no more than 8 grades) as required, and each relay point is provided with different relaying ID number.
Its data transfer mode is:
Central point is a master, adopts to send a reception response mode, and its workflow as shown in Figure 3;
The relaying child node is not replied, and adopts reception-send mode, and its workflow as shown in Figure 4;
Monitoring, control end leaf node adopt reception-transmission response mode for being subjected to prosecutor, and its workflow as shown in Figure 5.
The data structure of transmitting is referring to shown in the accompanying drawing 2.Central point may send 2 kinds of orders, and one is a control command, is used to send an operation, steering order, this command format comprises tagged word, with the signal sequence identification marking of time correlation, receive leaf node ID number, the order data of this order; It two is a querying command, is used to send a query statement, this command format comprises tagged word, with the signal sequence identification marking of time correlation, receive leaf node ID number of this order.
The order that central point sends, may directly be received, be delivered to leaf node again after also may being received, when a node receives signal by the relaying child node by specified leaf node, delay
time 1~5 millisecond, receive again next time or send,, compare according to its signal sequence identification marking and previous useful signal to each signal that receives, if the signal sequence identification marking is identical, then abandon, if signal sequence identification marking difference is then handled as useful signal.Factors such as the coverage of wireless signals and instant environment, weather are closely related, and the passage of each signal transmission is dynamic in star network.As shown in Figure 6, at signal
Between transmission period, have three passages in the network, central point is preferential to the passage of
leaf node 3, and all the other two passages are delayed or signal sequence identification shields; And signal
During specially defeated, then may have two passages, the signal that central point sends can not directly be received by leaf node 3.Otherwise, if the direction that described signal transmits from the leaf node to the central point, situation is similar.
Relay point is delayed time 1~5 millisecond after receiving useful signal, sends the transferring command signal, and described transferring command signal adds the relaying lead data before former packet, comprises relaying rank and relaying ID number, to realize the tracking of data transfer approach.
Leaf node is removed the relaying lead data, if control command after receiving useful signal, then order is passed to controlled device, send packet subsequently, packet comprises, the ID of leaf node number, receive tagged word with the signal sequence identification marking and the control life of time correlation; If querying command then sends request signal by RS-485 or RS-232 mouth, obtain desired data after, send packet, packet comprises, the ID of leaf node number, with the signal sequence identification marking of time correlation and the Monitoring Data sequence of transmitting.
The data of leaf node can directly or by relay point pass to central point, thereby realize mutual between central point and leaf node.
Thus, the wireless receiving of present embodiment sends control assembly only need use common RF parts, it and RS-232 interface, RS-485 interface are connected on the singlechip CPU by a universal asynchronous communication interface (UART), can be implemented in monitoring, control communication in the local scope.
Embodiment two: a kind of micro power radio communication device that is used for local monitor, control, and its architectural feature is identical with embodiment one, and the data structure difference of transmitting is applicable to that leaf node connects the monitoring device of the monitoring function with more than one data.The distinctive points of its data structure is, the query statement form that central point sends comprise tagged word, with the signal sequence identification marking of time correlation, receive leaf node ID number of this order, need obtain the numbering of data.Thus, the monitoring device (as secondary instrument) that links to each other with leaf node can be beamed back corresponding desired data).
Embodiment three: a kind of micro power radio communication device that is used for local monitor, control, to compare with embodiment one, and single-chip microcomputer only connects one group of 8 DIP switch (DIP1
#), adopt 2 in 8 gauge tap to carry out device identity control setting, RS-232 or RS-485 interface are selected in 1 definition for use, and all the other 5 are used to set the identification coding; U4:LS245 and DIP2 are not installed
#The local that is applicable to monitoring, control in the effective range of micro power radio communication within 600 meters~700 meters, use with interior occasion at 32 the monitoring point, the data of radio communication are directly transmitted between central point and leaf node, perhaps transmit by 1 grade of relaying child node.