The jockey of wireless sensor network and internet and method of attachment
Technical field
The present invention relates to a kind of two and use the solution of communicating by letter between the network of different agreement, belong to the crossing domain of embedded development and computer networking technology.
Background technology
Wireless sensor network (Wireless Sensor Network, be called for short WSN) is the product of Information Technology Development such as microelectric technique, AdHoc wireless network, Distributed Calculation and fusion.It utilizes, and low cost, low-power consumption, computable wireless sensor network node are collected, the data of the interested monitoring target of process user, and the data of collecting are sent to the user in the Network Transmission mode of organizing multi-hop certainly.It has broad application prospects in fields such as military affairs, environmental monitoring, medical treatment, agricultural and mining.
The main feature of wireless sensor network node is microminiaturization, low-power consumption, low cost.At present, the sensor node of real practicability is also few, wherein most popular sensor node is Smart dust (SMART DUST) node and the Telos series node that the DARPA of U.S. Department of Defense subsidizes exploitation, and, preside over the Mote series node of exploitation by University of California Berkeley by the US military subsidy.Secondly, the Mica series node that also has Crossbow company to produce.In addition at home, the also formally issue of GAINS series node of Chinese Academy of Sciences's research and development.
Simultaneously, these characteristics of wireless sensor network node have also limited its further development to a certain extent.Current wireless sensor network can only realize that node communicates by letter with internodal, also can't communicate with traditional IP network.Certainly, at present the someone has proposed the solution of communicating by letter between some wireless sensor networks and the internet, mainly contain following three kinds: (1) directly as the communication protocol of wireless sensor network, realizes the seamless link of wireless sensor network and any TCP/IP network with ICP/IP protocol; (2) based on agency's (Proxy) framework, promptly add an acting server between wireless sensor network and internet, it can explain the data that wireless sensor network sends, and is forwarded on the internet; (3) time-delay tolerance network (Delay Tolerant Network, DTN), promptly between wireless sensor network and internet, add gateway, similar to second kind of scheme, but gateway adopts the distinctive cladding technique of DTN to realize being connected of wireless sensor network and internet.
The inventor finds in research process, these three kinds of schemes all exist different defectives: first kind of scheme, because the internal memory and the computational resource of wireless sensor network node are limited, can't move complete ICP/IP protocol stack, though the ICP/IP protocol stack can be reduced now and satisfy resource requirement, but also exist a large amount of problems in others, be unsuitable for wireless environment, routing algorithm as: TCP/IP and be not suitable for the too big and IP address assignment more complicated of wireless sensor network, data packet head expense etc.Second kind of scheme, because wireless sensor network may be used in some unfrequented places, therefore, it is just not too realistic to place an acting server near node, and the acting server of unattended, maintenance, is easy to break down.Though the third scheme can solve the problem of second kind of scheme, but because it does not require channel reliability, adopt opportunistic mode to receive and send data, communication delay is unpredictable, simultaneously, because the gateway front end is direct and sensing node communicates, its communication distance is also quite limited, therefore makes that gateway can't be too far away from wireless sensor network.
Summary of the invention
Technical problem: the objective of the invention is at deficiency of the prior art, the jockey and the method for attachment of a kind of wireless sensor network and internet are provided, this jockey and method of attachment can be finished the conversion of remote-wireless communication protocol and the Internet communication protocol, the data that make wireless sensor network node collect can be sent to rapidly on the internet, pass to administrative center then.This gateway node is in accepting state or listening state all the time, not the time-delay that can occur communicating by letter.
Technical scheme: the present invention redesigns the aggregation node in the wireless sensor network, make it have bigger effective communication distance, data in the wireless sensor network are sent to the gateway node far away from the network area, and so just can solve gateway node can not be from wireless sensor network problem too far away.As intermediary, communicating by letter between wireless sensor network and the internet just becomes more smooth and easy with these two kinds of nodes, and the scope of application of wireless sensor network further enlarges, and practicality also is further enhanced.
Device of the present invention has comprised two kinds of nodes: a kind of is to receive wireless sensor network data, can carry out the aggregation node of remote-wireless communication again; A kind of is the gateway node that is used to enter the Internet.Aggregation node is mainly used in realizes a kind of remote-wireless communication function.Because common wireless sensor network node has all adopted lower-cost wireless near field communication chip, therefore, aggregation node also need add a remote wireless communication chips in addition and finish with the remote-wireless of gateway node and communicate by letter except this in-plant wireless communication chips will be arranged.That is to say, two communication chips of design in the aggregation node, in-plant communication chip is used to receive the data that wireless sensor network transmits, and communication chip then is responsible for data are sent to gateway node at a distance.Therefore, this aggregation node should be positioned over apart from 100 meters of the wireless sensor networks.Simultaneously, for reducing the interference to communication line, this aggregation node has been deleted the function of sensing, at utmost realizes the optimal design of this equipment.Except two communication chips, also to select suitable processor certainly.The processor of aggregation node mainly solves the conversion of two kinds of communication protocols that wireless near field communication communicates by letter with remote-wireless, because these two kinds all is radio communication, therefore agreement is simpler relatively, in conjunction with the node cost consideration, can select 8 or 16 s' processor.
The major function of gateway node enters the Internet exactly.One end of gateway node is to communicate by letter with aggregation node specially, be used to receive the data that aggregation node is sent, so it also must have a telecommunication chip.In addition, because the major function of gateway node is to enter the Internet, it also must have an Internet accessing network mouth.Selection to the processor of gateway node, requirement compares higher, because it will be realized is conversion between wireless transmission protocol and the Internet communication protocol, and the Internet communication protocol, be that TCP/IP is quite complicated, and the memory headroom that takies is also bigger, so the gateway node processor must be selected 32 and have the processor of Ethernet interface.Simultaneously, gateway node is limited by the each data that receive of remote-wireless host-host protocol, and it is very big to send to the data volume of internet by ICP/IP protocol, therefore also needs a data storage that capacity is bigger.When the data volume in the data storage reached the transmission data volume of ICP/IP protocol regulation, gateway node just sent to data in the internet.Certainly, also can send immediately for some special datas.
The performing step of two kinds of nodes is as follows:
The major function of the clear and definite node of step 1).The major function of aggregation node is: receive the data that wireless sensor network is sent, carry out protocol conversion after, give gateway node with data forwarding.The major function of gateway node is to receive the data of being sent by aggregation node, carries out protocol conversion once more, sends on the internet then.Two kinds of nodes all require to have high system reliability and high integration, real-time analysis preferably and disposal ability, transfer of data accuracy;
Step 2) the basic architecture design of node.The basic framework of two kinds of nodes is identical, all is divided into three layers, bottom-uply is: hardware platform layer, embedded system kernel and application layer;
The step 3) node module is divided.Aggregation node mainly is made up of four modules: processor module, close range wireless communication module, remote-wireless communication module and supply module; Gateway node also is made up of four modules: processor module, remote-wireless communication module, internet access module and supply module;
The design of step 4) processor module.The processor module of aggregation node mainly connects two wireless communication modules, can connect close range wireless communication module by the SPI interface of processor, and select a UART interface to connect the remote-wireless communication module.Gateway node mainly connects a remote-wireless communication module and an internet access module, can select for use a UART interface to connect the remote-wireless communication module equally, and connect the internet access module with Ethernet interface;
The design of step 5) communication module.The high-frequency wireless communication module generally comprises low noise amplifier, frequency mixer, filter circuit, frequency divider, modulator-demodulator, phase discriminator, low pass filter etc.For the remote-wireless communication module, generally between communication chip and antenna, add a power amplifier, requiring simultaneously has the higher low noise amplifier of precision, improves communication quality with this;
The design of step 6) supply module.Supply module provides the energy for above-mentioned each module, at four kinds of different mode of operations such as the sleep pattern of node, sending mode, receiving mode, battery saving modes, provides corresponding energy resource supply mode.Consider that gateway node may be very near from the internet access station, can power, therefore will design an AC-powered socket for it with 220 volts of alternating currents;
Other peripheral components of step 7) node is chosen.Be subjected to the constraint of node volume, other peripheral components is chosen the little encapsulation of trying one's best (generally being the SMD encapsulation of 0603 type).To give the design of node jtag interface simultaneously, in order to burning program and in-circuit emulation.Other device also comprises: external memory device, external crystal-controlled oscillation, omnidirectional antenna etc.;
Step 8) node power consumption management design.The power managed of node has mainly comprised the system level power consumption management, and the software code level is optimized, and register transfer optimization and rear end comprehensive wiring are optimized;
The design of step 9) node extensibility.Node has been reserved sufficient interface in design process, comprise surpassing 40 main control module input/output interfaces, so that the continuity exploitation of subsequent product is convenient in calling and expand from now on;
The design of step 10) node anti-interference.Node loads filter capacitor in the high-frequency wireless communication partial design, on IC and connect high frequency capacitance, adopts intensive wiring to reduce the high-frequency noise emission; Aspect the propagation path inhibition, design of node goes out to have the stabilized power supply of filter circuit, is isolated between I/O mouth and noise source, simultaneously, interference source is separated with Sensitive Apparatus;
Step 11) node system software design.The harmonious operation of all real-time tasks of the system software controls of node, system carries out resource management according to mission requirements, and Message Processing, task scheduling, abnormality processing, and distribute priority, system be according to the priority of each task, dynamically switches and dispatch;
The design of step 12) software reliability.Adopt digital filtering that suppresses superposition noise on signal path and the method that reduces redundant instruction in the design of node, adopt reduced instruction set, when hardware is out of order, the rapid perception of software energy is also taked corresponding remedial measure, to some emergency datas or other special data, can adopt the ciphertext form to send.
Beneficial effect: the present invention has compared following several advantage with the more existing wireless sensor network that is connected with the technology of internet:
(1) gateway node of needs just solves the transfer problem of wireless communication protocol and ICP/IP protocol, the reduction of controlling cost.Solve the communication issue between wireless sensor network and the internet, key is exactly the transfer problem that solves communication protocol.The ICP/IP protocol more complicated, 8 bit processors that general sensor node uses can't be realized this agreement at all.Even if agreement is reduced the treatable degree of 8 bit processors, phenomenons such as Out of Memory usefulness, IP address assignment complexity also can appear.Therefore, just must use 32 bit processors.If but allow all nodes all adopt 32 bit processors, and obviously can increase the cost of sensor node greatly, just unrealistic for the user who needs the widespread adoption transducer.Therefore we just adopt an aggregation node and a gateway node as intermediary, realize communicating by letter of wireless sensor network and internet through twice protocol conversion.That is to say the cost of the remote-wireless communication module of the cost that only increased a gateway node on cost and an aggregation node, this should be acceptable for the cost of whole wireless sensor network.Simultaneously, because have only a gateway node, so also only need to distribute an IP address for whole wireless sensor network.
(2) realized that wireless sensor network communicates by letter with the remote-wireless of gateway node.What used wireless sensor network inside all is short-range wireless communication protocol, if directly allow gateway node and wireless sensor network inter-node communication, gateway node just can not be far from wireless sensor network so.This may cause gateway node too far can't be connected on the internet from internet access website, though perhaps can link the internet, needs to lay very long netting twine, so both increased cost, and transmission line is damaged easily also.Increase an aggregation node now near wireless sensor network, it can carry out in-plant communication with wireless sensor network on the one hand, also can communicate by letter at a distance with gateway node on the one hand.Do intermediary by aggregation node, gateway node just can be away from wireless sensor network, and this also makes the range of application of wireless sensor network further enlarge.
(3) gateway node is in receiving mode or channel-monitoring pattern for a long time, makes the transmission of data can not be delayed.The major function of gateway node is exactly to realize the conversion of wireless communication protocol to ICP/IP protocol, promptly receives the data of being sent by aggregation node by the remote-wireless communication chip, packs the data to the form that meets ICP/IP protocol then and sends on the internet.Because the wireless communication module of gateway node does not send the demand of data, so it can be in receiving mode or channel-monitoring pattern always, can receive once there being data to send, and does not so just have the latency issue of data.
Description of drawings
Fig. 1 is the schematic diagram that wireless sensor network is connected with the internet;
Fig. 2 is the simplified structure diagram of aggregation node of the present invention;
Have among the above figure: aggregation node 1, first processor module 11, close range wireless communication module 12, the first remote-wireless communication module 13 and first supply module 14; Gateway node 2, the second processor modules 21, the second remote-wireless communication module 22, internet access module 23, second supply module 24.
Fig. 3 is the simplified structure diagram of gateway node of the present invention;
Fig. 4 is the flow chart of the method for the invention.
Embodiment
The present invention includes the design of two kinds of nodes, is respectively the design of aggregation node and the design of gateway node.These two kinds of nodes all are made of four main modular, and the composition module of aggregation node comprises: processor module, close range wireless communication module, remote-wireless communication module and supply module.Gateway node also has an internet access module except comprising processor module, remote-wireless communication module and supply module equally.Aggregation node generally is positioned over apart from 100 meters scopes of wireless sensor network, receive the data of sending by wireless sensor network by close range wireless communication module, carry out the conversion of agreement then by processor, send by the remote-wireless communication module at last.And gateway node generally is positioned in the scope apart from 100 meters of internet access stations, receives the data of being sent by aggregation node by the remote-wireless communication module, also carry out protocol conversion by processor after, send on the internet by the internet access module.
Therefore the processor module 11 of aggregation node 1, from saving cost consideration, can adopt 8 bit processors because the function of finishing is simple relatively, as: the ATmega128L single-chip microcomputer that atmel corp produces is exactly a processor that quite is fit to.The processor of gateway node is owing to need carry out protocol conversion, and therefore the function relative complex should select 32 bit processors for use, and the AT32AP7000 single-chip microcomputer of being produced by atmel corp just can be applied in the gateway node equally.Because 32 bit processors have comprised Ethernet interface, therefore only need design a socket and just can simultaneously in the internet access module.The proximity communication module of aggregation node is mainly used in wireless sensor network and communicates, communication distance is nearer, the CC2420 communication chip that can adopt Chipcon company to produce, this chip operation is the low-power consumption chip of a short haul connection in the free frequency range of 2.4GHzISM.The CC1020 communication chip that the telecommunication module of two kinds of nodes all can adopt Chipcon company to produce, this chip can be operated in the 433/868/915MHz frequency range, and the maximum distance of communication can reach more than 1000 meters, is fit to the telecommunication of two kinds of nodes.Because two kinds of nodes have all adopted the low-power consumption element, therefore as long as just can power to them with No. 5 batteries of two joints.
The present invention adopts the method for software-hardware synergism design, and promptly in hardware designs, the relevant simulation software of utilization carries out commissioning test to subprogram, so just can shorten the construction cycle.Below in conjunction with accompanying drawing the present invention is described in detail.Should be clear and definite, following content only is used for describing the present invention and not as limitation of the present invention.
The specific design method and the development procedure of aggregation node and gateway node are:
Step 1) on the basis that wireless sensor network and internet data transfer mode are separately furtherd investigate, clear and definite this internetwork access device subject matter to be solved, the i.e. transformation of the conversion of agreement and data packet format.Thereby determine the major function of two kinds of nodes, reduce some unnecessary functions, to optimize joint behavior.The major function of aggregation node is: receive the data that wireless sensor network is sent, carry out protocol conversion after, give gateway node with data forwarding.The major function of gateway node is to receive the data of being sent by aggregation node, carries out protocol conversion once more, sends on the internet then.Therefore, these two kinds of nodes can be deleted sensing function.Two kinds of nodes all require to have high system reliability and high integration, real-time analysis preferably and disposal ability, transfer of data accuracy simultaneously.
Step 2) the basic architecture design of node.The basic boom of two kinds of nodes is identical, has all followed the fundamental mode of general embedded product, simultaneously, based on the needs of practical application, all expansions to some extent on each aspect.Be divided into three layers generally, bottom-uply be: hardware platform layer, embedded system kernel and application layer.
(1) hardware platform layer.Hardware platform is the underlying platform and the hardware foundation of whole node.Comprised the set that all hardware modules of node are formed and system bottom calls.Each composition module of node is carried out comprehensive and co-ordination.Simultaneously, defined the bus unit of node, interrupt system and mode of operation etc.
(2) embedded system kernel.The embedded system kernel is operated between bottom hardware platform and the upper level applications, finish the driving of each hardware device, the methods that provide software and hardware system to call for the application layer exploitation provides interface service, make the exploitation of upper level applications can shield the bottom hardware platform fully simultaneously.System kernel at the special requirement of sensor node, has improved the interruption controls strategy, process scheduling strategy and memory management policy simultaneously based on the management and dispatching strategy of real time operating system.
(3) application layer.Application system level provides application oriented system control mode and method of work for the user.The user can be according to different separately application demands, and the exploitation different application is finished a series of application functions such as startup, operation, state transition, information processing, signal transmission, energy consumption early warning and program download of node.
The step 3) node module is divided.According to the difference in functionality demand of two kinds of nodes, can the Module Division of each node is as follows.Aggregation node mainly is made up of four modules: processor module, close range wireless communication module, remote-wireless communication module and supply module, the annexation of each intermodule as shown in Figure 2.Gateway node also is made up of four modules: processor module, remote-wireless communication module, internet access module and supply module, the annexation of each intermodule as shown in Figure 3.
The design of step 4) processor module.At first will select suitable processor, because the function of aggregation node mainly is to carry out the conversion of near radio host-host protocol to the remote-wireless host-host protocol, complexity is lower, therefore considers from the angle of controlling cost, and should select 8 or the microprocessor of 16 bit.And gateway node will be finished the conversion of remote-wireless host-host protocol to the Internet transfer protocol, and complexity is higher, therefore must select higher 32 bit processors that have Ethernet interface of price for use.
The processor module of aggregation node mainly connects two wireless communication modules, can connect close range wireless communication module by the SPI interface of processor, and select a UART interface to connect the remote-wireless communication module.Gateway node mainly connects a remote-wireless communication module and an internet access module, can select for use a UART interface to connect the remote-wireless communication module equally, and connect the internet access module with Ethernet interface.Other pin that is not used to of two kinds of nodes all can be drawn, to be used for the function expansion of later stage continuity product.
The design of step 5) communication module.The high-frequency wireless communication module generally comprises low noise amplifier, frequency mixer, filter circuit, frequency divider, modulator-demodulator, phase discriminator, low pass filter etc.For the remote-wireless communication module of aggregation node, generally between communication chip and antenna, add a power amplifier, simultaneously for gateway node, requiring has the higher low noise amplifier of sensitivity, improves two internodal communication qualities with this.Because aggregation node has two wireless communication chips, therefore when design, to consider how to reduce their mutual interference.At first in the selection of frequency range, must allow them be operated in different frequency ranges; Secondly, the cabling with them when circuit board wiring is distributed in different aspects; At last, on software design, can allow these two communication chips work in the different time periods.
The design of step 6) supply module.Supply module provides the energy for above-mentioned each module, at four kinds of different mode of operations such as the sleep pattern of node, sending mode, receiving mode, battery saving modes, provides corresponding energy resource supply mode.Because aggregation node can only adopt powered battery,, can finish real-time monitoring for self supply power voltage so must design a kind of comparatively accurate power supply early warning circuit.Consider that gateway node may be very near from the internet access station, can power,, also will design an AC-powered socket for it therefore except having the battery feed circuit with 220 volts of alternating currents.
Other peripheral components of step 7) node is chosen.Because be subjected to the constraint of node volume, other peripheral components is chosen the little encapsulation of trying one's best (generally being the SMD encapsulation of 0603 type).To give the design of node jtag interface simultaneously, in order to burning program and in-circuit emulation.Other device also comprises: external memory device, external crystal-controlled oscillation, omnidirectional antenna etc.
Step 8) node power consumption management design.We can record by experiment, the wireless communication module of wireless sensor network node is the module of power consumption maximum in all modules of whole node, and the major function of aggregation node and gateway node is carried out wireless receiving and transmission exactly, therefore is necessary for the effective power managed mechanism of these two kinds of design of node.Power managed of the present invention has mainly comprised the system level power consumption management, and the software code level is optimized, and register transfer optimization and rear end comprehensive wiring are optimized.The system level power consumption management will make it to enter sleep state when node is not operated, when Preset Time arrives, produce and interrupt waking up; The software code level is optimized, and promptly node has adopted good coding style, reduces redundancy encoding, and the code after the optimization has been saved the CPU processing time, and power consumption is greatly reduced; Aspect register transfer, the present invention has adopted hardware configuration optimization and the parallel optimisation strategy of system's pipeline processes, reduce the on-chip memory Module Division of register electric capacity simultaneously, reduce the signal gate of activity factor, reduce the propagation velocity of burr etc., the register transfer power consumption is greatly reduced with this; Aspect the comprehensive wiring of rear end, the present invention has adopted the optimization circuit, reduces operation, revises modes such as signal correction relation, has further reduced the generation probability of comprehensive burr.
The design of step 9) node extensibility.Along with integrated circuit and development of Embedded technique, the present invention also will constantly improve and be perfect.Therefore, in the design of node process, reserved sufficient interface, comprised surpassing 40 main control module input/output interface, so that the continuity exploitation of subsequent product is convenient in calling and expand from now on.
The design of step 10) node anti-interference.Because two kinds of nodes all have the high-frequency wireless communication module, and the node volume is less, it is closeer to connect up, and therefore the Anti-interference Design of node is had relatively high expectations.The present invention loads filter capacitor in the high-frequency wireless communication partial design of node, on IC and connect high frequency capacitance, adopts intensive wiring to reduce the high-frequency noise emission; Aspect the propagation path inhibition, design of node goes out to have the stabilized power supply of filter circuit, is isolated between I/O mouth and noise source, simultaneously, interference source is separated with Sensitive Apparatus.
Step 11) node system software design.The harmonious operation of all real-time tasks of the system software controls of node, system carries out resource management according to mission requirements, and Message Processing, task scheduling, abnormality processing, and distribute priority, system be according to the priority of each task, dynamically switches and dispatch.Fig. 4 has described the groundwork flow process of node.
The design of step 12) software reliability.Software reliability design among the present invention has mainly comprised Anti-interference Design and fault-tolerant design.Design of Software Anti-interference is the householder method of hardware anti-interference design.Among the present invention, adopt digital filtering that suppresses superposition noise on signal path and the method that reduces redundant instruction, adopt reduced instruction set.When hardware was out of order, the rapid perception of software energy was also taked corresponding remedial measure.To some special datas, can adopt the ciphertext form to send.