CN105759647A - Pig farm environment monitoring method based on patrol car and address borrowing routing algorithm - Google Patents

Pig farm environment monitoring method based on patrol car and address borrowing routing algorithm Download PDF

Info

Publication number
CN105759647A
CN105759647A CN201610095387.2A CN201610095387A CN105759647A CN 105759647 A CN105759647 A CN 105759647A CN 201610095387 A CN201610095387 A CN 201610095387A CN 105759647 A CN105759647 A CN 105759647A
Authority
CN
China
Prior art keywords
node
address
routing
network
nodes
Prior art date
Application number
CN201610095387.2A
Other languages
Chinese (zh)
Other versions
CN105759647B (en
Inventor
朱伟兴
张建飞
李新城
Original Assignee
江苏大学
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 江苏大学 filed Critical 江苏大学
Priority to CN201610095387.2A priority Critical patent/CN105759647B/en
Publication of CN105759647A publication Critical patent/CN105759647A/en
Application granted granted Critical
Publication of CN105759647B publication Critical patent/CN105759647B/en

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/70Services for machine-to-machine communication [M2M] or machine type communication [MTC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THIR OWN ENERGY USE
    • Y02D70/00Techniques for reducing energy consumption in wireless communication networks
    • Y02D70/10Techniques for reducing energy consumption in wireless communication networks according to the Radio Access Technology [RAT]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THIR OWN ENERGY USE
    • Y02D70/00Techniques for reducing energy consumption in wireless communication networks
    • Y02D70/30Power-based selection of communication route or path

Abstract

The invention discloses a pig farm environment monitoring method based on a patrol car and an address borrowing routing algorithm. First, a pig farm environment monitoring system based on a patrol car and an address borrowing routing algorithm is built, comprising a pig farm wireless sensor network with mobile coordinator nodes constructed based on a ZigBee wireless communication technology, a pig farm embedded field control center, and a user remote control center. Second, in view of isolated network points caused by limited transmission range of the ZigBee protocol, a new network address borrowing routing algorithm based on two-hop neighbors is adopted, the existing address borrowing routing algorithm is optimized, the address borrowing range of a father node is set to two-hop neighbor nodes, and addresses are borrowed from descendant nodes of the same branch first. On one hand, the problem of isolated network points is relieved, the network access rate of network nodes is improved, and the networking time and energy loss are reduced. On the other hand, efficient network access of isolated network nodes under the pig farm environment monitoring system taking coordinators as mobile nodes is realized.

Description

-种基于巡检小车与借地址路由算法的养猪场环境监控方法 - kind of pig farms based on environmental monitoring patrol car with borrowed address routing algorithm

技术领域 FIELD

[0001] 本发明设及嵌入式技术、无线传感网络技术,具体设及具有巡检小车和借地址路由算法的养猪场环境方法。 [0001] Pig Farm environment and method of the present invention is provided embedded technology, wireless sensor network technology, and having a specific inspection trolley provided by address and routing algorithms.

背景技术 Background technique

[0002] 国内养猪产业正处在快速发展阶段,并向规模化、现代化发展,W高效的生产来应对日益增长的生产成本和波动的市场行情。 [0002] the domestic pig industry is in a stage of rapid development, and to scale, modern development, W and efficient production to cope with the increasing production costs and fluctuating market conditions. 然而,对于智能养殖仍存在着饲养设备自动化水平低、劳动强度大、环境设备简陋、缺乏智能性、满足不了信息化养殖需求和生产效率低下等问题。 However, for smart farming equipment, there are still keeping a low level of automation, labor-intensive, environmental poorly equipped, lack of intelligence, can not meet the needs of poor farming information and productivity issues.

[0003] 养猪场环境监控系统是基于无线传感网络来实时监测各类环境指标,并智能化控制各类设备。 [0003] pig farm environmental monitoring system is to monitor various environmental indicators in real time, and all kinds of intelligent control device based on wireless sensor networks. 将无线传感网络应用到生猪环境监测中大大提高了生产效率,通过外界环境条件来改善生猪健康和提高生产力,利用无线网络节点对养猪场设备的控制,W及MT-A财几器人巡检小车上的声音探测器、各类环境参数传感器和摄像头对养猪场内部环境的实时监控,来智能调控养猪场环境,W达到一个适宜生猪健康快速生长的养猪场内部环境。 The wireless sensor network applications to environmental monitoring pigs greatly improved production efficiency, to improve the health of pigs by external environmental conditions and increase productivity using a wireless network node control equipment for pig farms, W, and MT-A is fiscal few people small patrol car sound detector, various types of environmental parameters sensors and cameras in real-time monitoring of the internal environment of the pig farm, pig farm environment to intelligent control, W to reach a suitable internal environment of hog farms healthy and rapid growth. 本发明将协调器节点和现场控制器安装在小车上,一方面便于安装在小车上和现场的摄像头将采集到的影音信息实时的传送到现场控制器中,同时,由于安装在小车上的协调器节点为可移动节点,提高了树型网络就地组网的灵活性。 Real-time transmission of the present invention and the coordinator node field controllers mounted on a small, easy to install on the carriage on the one hand and camera field of the collected audio-visual information to the field controller while, since the coordination of the trolley is mounted in the node is a mobile node can improve the flexibility of the network tree network in place. 并且,协调器节点可由小车上的蓄电池直接供电,它具有充足的能源,可W延长该节点的寿命。 Further, the coordinator node can be battery powered directly trolley, having sufficient energy, W can extend the life of the node. 由于Zi浊ee协议传输范围一般介于10~ IOOm之间,所W当超出传输范围时直接与协调器节点相连的路由节点将进行节点断开处理。 Zi turbidity due to routing node ee protocol transmission range typically between 10 ~ IOOm, when W exceeds the transmission range of the coordinator node will be a node connected directly to disconnection processing. 当路由节点与网络断开时,该路由节点的所有子树包含的节点都成为孤立节点。 When disconnected from the network routing node, all nodes in the subtree containing the routing nodes become isolated nodes. 为保证养猪场现场环境参数的实时采集,孤立节点需要重新加入树型网络。 In order to ensure real-time acquisition of environmental parameters pig farm field, isolated nodes need to rejoin the tree network. 然而,无线传感网络采用的ZigBee通信协议默认使用分布式地址分配机制来分配地址。 However, ZigBee communication protocol used in wireless sensor networks using distributed address allocation mechanism to allocate default address. 传统的分布式地址分配算法使得孤立节点加入网络的成功率降低。 Traditional distributed address assignment algorithm makes the success rate of isolated nodes to join the network is reduced.

[0004] 目前,对于网络孤点问题,国内外已有了相关研究。 [0004] Currently, the lone point for network problems, has been at home and abroad related research. YANG等人通过将终端设备转换成路由节点的方法,增加树路由的网络深度,该算法扩展了网络覆盖域,但增加了原终端节点的复杂度和成本,可扩展的范围有限,仅适合于少数网络深度不深的终端节点。 YANG et al., By the process of converting the terminal into routing node, to increase network depth of the tree route, the algorithm extends the coverage region, but increases the complexity and cost of the original terminal node, a limited-extended range, only suitable for few terminal node network depth is not deep. Giri等人提出一种借地址算法,即没有空闲地址的父节点可向网络协调器借址,然后父节点将借来的地址分配给子节点,减少了网络孤点,但网络协调器可借用的地址空间有限,该算法仅适合于节点较少的场合。 Giri, who proposed a borrowed address algorithm that no parent can borrow free address to the network address of the coordinator, then the parent will be borrowed address is assigned to the child nodes, reducing network solitary point, but the network coordinator can borrow the address space is limited, this method is only suitable for applications fewer nodes. 姚玉坤等人提出一种基于借地址的高效地址分配算法,把路由孤节点的借址范围首选为同枝节点来改善绕路问题,但可借址范围较小,节点加入网络的成功率降低。 Yao Yukun, who proposed allocation based on an address by address efficient algorithms, to borrow address range routing node of choice for the solitary point with minor detour to improve the problem, but by a smaller address range, network node joins the success rate is reduced. 现有的基于分布式地址分配机制的借地址路由算法默认路由节点的借址范围为一跳邻居节点,在选择借址节点时未考虑到拓扑优化问题,从而造成网络深度的浪费,而且路由节点很难找到合适的借址节点,而本发明将路由节点的借址范围设为两跳邻居节点,父节点可W获取两跳通信范围内的邻居节点的地址信息,并且会优先考虑向同枝子孙节点借址。 Existing address by routing algorithm based on distributed address allocation mechanisms by default routing node address range to hop neighbor nodes, the nodes in the choice of site, by not taking into account the topology optimization, resulting in a waste of network depth, and the routing node it is difficult to find a suitable site by node, and the present invention will take the address range of routing nodes to two-hop neighbor nodes, the parent node W may obtain the address information of neighbors within two hops communication range, and priority will be given to the same branch by descendant node address. 因此,本发明提出的借地址算法通过扩大借址范围提高了节点间地址分配的效率,有效的优化网络拓扑,避免网络深度的浪费,适用于协调器作为移动节点的养猪场无线传感网络。 Thus, the algorithm proposed by the present invention, the address by the address range expanding, by improving the efficiency of inter-node address assignment, the effective network topology optimization, to avoid wasting network depth, suitable pig wireless sensor network as the mobile node coordinator .

发明内容 SUMMARY

[0005] 针对上述现有技术出现的问题,本发明将协调器节点和现场控制器安装在小车上,一方面便于安装在小车上和现场的摄像头将采集到的影音信息实时的传送到现场控制器中,同时,由于安装在小车上的协调器节点为可移动节点,提高了树型网络就地组网的灵活性。 Real-time transmission [0005] For the above-described problems occurring in the prior art, the present invention is the coordinator node and the field controllers mounted on a small, easy to mount a camera on the one hand on the carriage and the live video will be collected to the control information to the field vessel, while the coordinator node due to the installation of a small car for the mobile node can improve the flexibility of the network tree network in place. 并且,协调器节点可由小车上的蓄电池直接供电,它具有充足的能源,可W延长该节点的寿命。 Further, the coordinator node can be battery powered directly trolley, having sufficient energy, W can extend the life of the node. 在无线传感网络的组网过程中,为了克服现有的无线传感网络会出现孤立节点入网难的不足,本发明还提出一种新的借地址路由算法。 In the process of networking wireless sensor network, in order to overcome the existing WSN network node might not have enough isolation difficult, the present invention also proposes a new address by routing algorithm. 当一个孤立节点尝试加入一个没有空闲地址空间的父节点时,该父节点就会询问它的两跳W内的邻居节点来借用地址空间,实现孤立节点的入网。 When an isolated node attempts to join a free address space is not the parent, the parent will ask its neighbors within two hops W node address space to borrow, to achieve an isolated node network. 通过将路由节点的借址范围设为两跳邻居节点,且同枝节点设为借地址的首选节点,使得养猪场内的孤立节点能够快速地实现入网,同时减少了路由节点的能耗。 By By routing node address range to two-hop neighbors, and is set by the preferred node address with the minor point that isolated nodes within the network farms can be achieved quickly, while reducing the energy consumption of routing nodes. 本系统能有效地减少网络孤立节点,提高节点入网率,延长了养猪场无线传感网络的寿命。 This network system can effectively reduce the isolated nodes, the rate of increase network node, extending the life of the pig wireless sensor network.

[0006] 本发明解决其技术问题所采取的技术方案是:一种基于巡检小车与借地址路由算法的养猪场环境监控方法,包括W下步骤: [0006] The present invention to solve the technical problem adopted technical solution is: A polling method of environmental monitoring and pig farm car by address based routing algorithm, W comprises the steps of:

[0007] 步骤1,构建基于巡检小车与借地址路由算法的养猪场环境监控系统,包括: Zi浊ee无线通信技术组建的具有移动协调器节点的养猪场无线传感网络、养猪场嵌入式现场控制中屯、和用户远程控制中屯、;具有移动协调器节点的养猪场无线传感网络包括可移动协调器节点、路由节点和终端节点;可移动协调器节点和养猪场嵌入式现场控制中屯、设置在巡检小车上;通过ZigBee协议找,将采集到的数据汇聚到可移动协调器节点,可移动协调器节点由巡检小车上的蓄电池直接供电,并通过串行通信接口与嵌入式现场控制中屯、实现数据交换;嵌入式现场控制中屯、包括现场控制器,嵌入式现场控制中屯、通过网络接入点和无线网卡与用户远程控制中屯、连接;用户远程控制中屯、包括电脑、网络接入点和无线网卡, 用户远程控制中屯、通过Internet网络协议 [0007] Step 1, by constructing the inspection car pig address routing algorithm based environment monitoring system, comprising: Zi cloud ee wireless communication technology established farms wireless sensor network having a mobile coordinator node, pig Tun embedded field control field, and the user remotely controls the village,; pig mobile wireless sensor network having a coordinator node comprises a movable coordinator node, routing nodes and end nodes; coordinator node and the movable pig Tun embedded field control field, the trolley is provided in the inspection; looking through the ZigBee protocol, converging the collected data to a removable coordinator node, the coordinator node movable powered directly by the battery inspection trolley, and by serial communication interface with an embedded field control Tun, data exchange; Tun embedded field control, comprising a site controller, an embedded field control Tun, Tun control through a network access point and a wireless card and a remote user, connection; Tun user of the remote control, comprising a computer, a network access point and the wireless card, the user of the remote control Tun, via the Internet protocol 入互联网访问现场控制器; Access to the Internet site controller;

[0008] 步骤2,针对ZigBee协议传输范围有限造成的网络孤点问题,采用一种新的基于两跳邻居的网络借地址路由算法,该算法包括两个部分: [0008] Step 2, for the ZigBee protocol network orphan problems caused by transmission range limited by a new two-hop neighbor based on a network address by the routing algorithm includes two parts:

[0009] 新的借地址路由算法,首先估算出网络孤立节点的借址空间大小,再将路由节点的借址范围设为两跳邻居节点,父节点可W获取两跳通信范围内的邻居节点的地址信息, 同时会优先考虑向同枝子孙节点借址; [0009] The new address by routing algorithm, first estimated by isolated nodes of network address space, and then routing node address range set by two-hop neighbor nodes, the parent node W can get two-hop neighbor nodes within communication range address information, and priority will be given to the descendants of the same branch node by address;

[0010] 借地址算法的路由选择,即树路由首先对目的节点的类型进行判断,再进行数据包的转发。 [0010] routing algorithm by the address, i.e., first type tree routing destination node is determined, then forwards the packet.

[0011] 进一步,所述步骤1中,养猪场无线传感网络主要是由分布在各个猪栏中的Zi浊ee 节点组成,ZigBee节点连接溫湿度及有害气体浓度传感器、红外监控摄像头W及标准通风口风机、降溫湿帘累、负压风机、热风炉、电热板等控制设备;通过节点上的溫湿度及有害气体浓度传感器和巡检小车上的音频传感器及摄像头,用户可W对猪舍的环境、母猪的临产W及幼猪的生活状态进行实时的监测,其中,巡检小车上的音频传感器、各类环境参数传感器和摄像头可在养猪场内在预设好的巡检小车磁条轨道上任意移动,通过移动巡检小车上的各类环境参数传感器,监控系统获得养猪场内部环境参数;每次信息采集后,节点向协调器发送数据信息,协调器节点通过串口与现场控制器相连,将采集到的数据传输至现场控制器中;用户远程控制中屯、通过Internet网络协议连 [0011] Further, in the step 1, the wireless sensor network pig mainly by Zi cloud ee pigsty in the respective nodes are distributed in the composition, ZigBee nodes connected to temperature, humidity and concentration of harmful gas sensor, an infrared surveillance camera and W standard vent fan, cooling wet curtain tired, suction fan, hot stove, electric panels, etc. the control device; by the temperature and humidity at the node and the harmful gas concentration sensor and the trolley inspection camera and an audio sensor, a user may porcine W homes for the environment, labor W and living conditions of young pigs sows real-time monitoring, where a small patrol car audio sensors, various types of environmental sensors and cameras parameters can be preset patrol car in good inner pig farm any mobile track magnetic stripe, the internal environment parameter is obtained by moving the pig inspection trolley various environmental parameter sensors, the monitoring system; information collection after each node sends data information to the coordinator, the coordinator node through the serial port site controller is connected, the collected data to the site controller; Tun user of the remote control, connected via the Internet protocol 互联网,远程用户通过浏览器登陆现场控制器,实时观测猪舍并可W随时调控猪舍环境。 Internet, remote users through a browser landing site controller, real-time observation of pig and pig W regulated environment at any time.

[0012]进一步,所述步骤2中,新的借地址路由算法的具体过程为: [0012] Further, in the step 2, the specific process of the new address by the routing algorithm is:

[001引步骤2.1,节点X向路由节点Y发送一个空闲地址请求,路由节点Y判断自己是否有空闲地址,若有空闲地址,则将地址分配给节点X;否则,路由节点Y进入借地址操作; [001 cited Step 2.1, the node X transmits to the routing node Y a free address request, routing node Y to determine if they have a free address, if a free address, the address assigned to the node X; Otherwise, routing node address operation by entering Y ;

[0014] 步骤2.2,路由节点Y给节点X发送一个含有网络深度dy的信息,要求节点别尋网络深度dx设置为dy+1,并作为Y的子节点加入网络; [0014] Step 2.2, the routing node Y to the node X transmits a message containing the network depth of dy, not look for the requesting node to the network depth dx dy + 1, and Y is added as a child node of the network;

[0015] 步骤2.3,路由节点Y发送一个响应给节点X,要求X计算其申请的地址空间大小,贝U 节点X需要计算其子节点地址空间大小;若节点X为全功能设备FFD,则计算出子节点地址空间为O(X),并将o(x)+x作为借址包发送给路由节点Y;若节点X为半功能设备R抑,则子节点地址空间O(X)=O,并将o(x)+x作为借址包发送给路由节点Y; [0015] Step 2.3, the routing node Y sends a response to the node X, the requirements X calculates the address space of its application, shellfish U Node X need to calculate its child node address space size; if node X is a full-function device the FFD, is calculated a child node address space O (X), and o (x) + x as a route by a node address packet to Y; if node X is semi-functional suppression apparatus R, the sub-node address space O (X) = O and o (x) + x to a node Y as the route package by site;

[0016] 步骤2.4,路由节点刊欠到节点X的借址包后,向其两跳邻居范围内的节点转发借址包,收到借址包的邻居节点根据自己的剩余地址空间做出回复;若此处没有找到符合借址要求的邻居节点,则返回步骤2.1,节点X重新向新的路由节点发送借址请求; After the [0016] Step 2.4, published owe routing node to node X by addressing the packet, its two-hop neighbor nodes within the scope of site by forwarding packets received from the peer node by addressing the packet to respond according to their remaining address space ; if not here by neighbors in line with the requirements of the site is found, the procedure returns 2.1, node X by addressing a request to re-send new routing node;

[0017] 步骤2.5,路由节点刊欠到邻居节点的借址回复包后,Y将判断符合借址条件的节点中是否有自己的同枝节点,若有,则在同枝下的子孙节点中选出剩余地址较多的节点作为借址节点;若没有,则在符合借址条件的邻居节点中选出剩余地址较多的节点作为借址节点;然后将借用的地址空间分配给节点X,再由节点别尋空闲地址分配给下面的子节点;若上述过程不能完成借址操作,则等待可移动协调器节点到达传输范围内时,再通过分布式地址分配算法完成孤立节点的入网请求。 [0017] Step 2.5, published after routing node owed to neighbor nodes by addressing reply packet, Y will determine whether its own accord with the branch node by node address condition, and if so, in the same branch of the descendants of nodes the remaining node address selected by many as the address of the node; if not, elected at the site by neighbors in line with the conditions of the remaining node address by address, as more nodes; then allocate the borrowed address space to the node X, then not look for an idle address assigned to the child node below the node; if this process can not be completed by the operation site, the waiting movable coordinator node arrival within the transmission range, then network access request allocation algorithm is completed by the isolated nodes distributed address.

[0018] 进一步,所述步骤2中,借地址算法的路由选择的具体过程为: [0018] Further, in the step 2, the specific process routing algorithm selected by the address is:

[0019] 树路由通过对目的节点的类型进行判断,若目的节点是路由节点本身,则直接接受数据包;若目的节点是路由节点的子路由节点,则计算下一跳地址后直接发送到符合条件的子路由节点;若目的节点是路由节点的子终端设备,则将数据包传送给子终端设备;若上述条件都不符合,则路由节点将此数据包传送给它的父节点,由其父节点根据上述路径选择过程继续转发该数据包。 [0019] tree routing is determined by the type of the destination node, the destination node if the routing node itself, directly accepts packets; if the destination node is a child routing node routing node is calculated directly in line with the next hop address to child routing node condition; If the destination node is a child node of the route terminal apparatus, the packet is transmitted to the sub-terminal device; if the above conditions are not met, then the routing node transmits this packet to its parent node, by continued parent node forwards the packet according to the route selection process.

[0020] 进一步,所述步骤1中,用户远程控制中屯、可用PC机作为监控平台,通过在现场控制器S3C6410开发板上移植SQLite数据库,BOA服务器W及编写CGI程序,将参数发送至Internet,通过Internet在PC机上及时显示监测养猪场的环境参数,管理员可W通过浏览器远程访问数据,同时采集的数据将被存储在SQLite数据库中,便于管理员查询历史数据。 [0020] Further, in the step 1, the user of the remote control Tun, the PC can be used as a monitoring platform,, W, and write the BOA server CGI program, the transmission parameters to the Internet via the site controller SQLite database S3C6410 development board transplantation through the Internet in a timely manner display monitor environmental parameters pig farm on the PC, the data W administrators can access data remotely through a browser, while the collection will be stored in a SQLite database, query historical data to facilitate administrator.

[0021] 本发明的有益效果是: [0021] Advantageous effects of the present invention are:

[0022] Zi浊ee无线网络技术采用一种新的基于两跳邻居的网络借地址算法,该算法通过父节点向两跳W内的邻居节点借用空闲地址的方法来缓解孤点问题。 [0022] Zi cloud ee wireless network technology based on the use of a new two-hop neighbor algorithm by network address, the algorithm method borrowed free address by the parent node to its neighbors within two hops W solitary point to alleviate the problem. 对于网络孤点问题, 现有的路由算法多适用于节点较少的树型网络,而且增加了组网耗时和能量损耗的问题。 For orphan network problems, the conventional routing algorithms suitable for multi-node tree network less, but also increases the problem of energy loss and consuming network. 针对现有路由算法的不足,本发明对原有的借地址算法和树路由算法进行了改进。 For lack of existing routing algorithms, the invention of the original address by routing algorithms and tree algorithm is improved. 新的借地址算法制定了详细的借地址步骤,即当一个网络孤立节点尝试加入一个没有空闲地址的父节点时,该节点首先估算出借址空间的大小,此时父节点向两跳邻居节点发送借址请求, 并获取两跳通信范围内的邻居节点的地址信息,同时优先考虑向同枝子孙节点借址,再将借来的地址空间分配给孤立节点。 The new algorithm developed by an address by address in detail the steps, that is, when a network node isolated attempts to join a parent is not free address, the node a first estimate of the size of the address space of the loan, when the parent node sends a two-hop neighbors by addressing request and obtain the address information of neighbors within two hops communication range, while giving priority to the descendants of the same branch node by address, and then borrowed the address space allocated to isolated nodes.

[0023] 通过将协调器节点和现场控制器安装到机器人小车上,使安装在小车上和现场的摄像头采集到的影音信息可W实时的传送到现场控制器中,同时协调器节点由蓄电池直接供电,延长了节点寿命。 [0023] By coordinator node and the site controller is mounted to the robot carriage, the trolley and the mounting field of the camera to capture video information in real time W is transferred to the field panel, while the coordinator node directly from the battery power supply, to extend the life of the node. 对于ZigBee协议传输范围有限造成的网络孤点问题,通过优化设计现有的借地址路由算法,将父节点的借址范围设为两跳邻居节点,同时优先考虑向同枝子孙节点借址,一方面使得网络孤点问题得W缓解,提高了网络节点的入网率,降低了组网耗时和能量损耗,另一方面实现了协调器作为移动节点的养猪场环境监控系统下网络孤立节点的高效入网。 For network solitary point ZigBee protocol problems caused by limited transmission range, by optimizing the design of the existing address by routing algorithm, will take the address range of the parent node to a two-hop neighbors, while giving priority to the descendants of the same branch node borrow site, a the network aspects such isolated point obtained W alleviate the problem and improve the network node of the network, reducing the energy loss and consuming network, on the other hand to achieve the pig as the coordination environment monitoring system the mobile node isolated nodes in the network efficient network.

附图说明 BRIEF DESCRIPTION

[0024] 下面结合附图和具体实施方式对本发明作进一步详细说明。 [0024] Hereinafter, the present invention is described in further detail in conjunction with accompanying drawings and specific embodiments.

[0025] 图1是系统的总体设计框图 [0025] FIG. 1 is a block diagram of the overall design of the system

[0026] 图2是机器人小车上的移动节点设计框图 [0026] FIG. 2 is a block diagram of a mobile node design robot carriages

[0027] 图3是基于两跳邻居的网络借地址路由算法框图 [0027] FIG. 3 is a block diagram of a two-hop neighbor network address routing algorithm by

[0028] 图4是养猪场无线传感网络节点分布图 [0028] FIG. 4 is a wireless sensor network nodes pig profile

[0029] 图5是路由选择框图 [0029] FIG. 5 is a block diagram illustrating routing

具体实施方式 Detailed ways

[0030] 下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。 [0030] The present invention in conjunction with the following drawings in the embodiments, the technical solutions in the embodiments of the present invention will be clearly and completely described.

[0031] W下结合附图1、2、3、4、5进一步说明本发明的技术方案。 1,2,3,4,5 aspect of the invention is further illustrated in [0031] W in conjunction with the accompanying drawings.

[0032] 基于ZigBee网络借地址分配算法的养猪场环境监控系统的总体框架由S部分组成:ZigBee无线通信技术组建的具有移动协调器节点的养猪场无线传感网络、养猪场嵌入式现场控制中屯、(巡检小车)和用户远程控制中屯、。 [0032] The overall framework pig ZigBee network environment monitoring system by the address assignment algorithm based on the S components: ZigBee wireless communication technology established pig mobile wireless sensor network having a coordinator node, embedded farms site control in Tuen, (patrol car) and user remote control in Tun. 系统的总体设计框图如图1所示。 The overall design of the system block diagram shown in Figure 1. 其中养猪场无线传感网络主要是由分布在各个猪栏中的Zi浊ee终端节点组成。 Wherein the pig is mainly composed of the wireless sensor network cloud ee Zi respective terminal nodes distributed in the composition in a pigsty. 在养殖场不同区域内放置带有各类传感器终端节点,实时监测养殖场周围环境的溫度,湿度W及有害气体浓度。 Farms in different areas with various sensors disposed terminal node, real-time monitoring the temperature of the surrounding environment farms, humidity and concentration of harmful gases W. 采集到的数据将通过Zi浊ee无线网络发送至协调器节点,再经由232串口将数据发送到现场控制器S3C6410(ARM+Linux)中。 The collected data is sent to the coordinator node through the wireless network Zi cloud ee, then sent to the site controller S3C6410 (ARM + Linux) 232 via serial data. 通过在S3C6410平台上移植的数据库和服务器,用户可W通过互联网对实时数据进行远程访问与查询。 By the S3C6410 platform migration of database and server, users can remotely access and query W for real-time data via the Internet. 一旦系统采集的数据超出计算机中设定的健康预警界限,控制系统便能自动识别出来,管理者能够及时发现。 Once the data collected by the system exceeds the set computer health warning limit, the control system can automatically identified, managers can detect. 此时养殖控制系统则通过控制养殖场中的负压风机、降溫湿帘累、负压风机、热风炉、电热板等设备的运行来自动调节出最适宜幼猪生长的环境。 At this time, by controlling the aquaculture system control suction fan farms, the cooling wet curtain tired, operation of the device suction fan, hot air oven, hot plate or the like automatically adjust the most suitable environment for the growth of young pigs. 同时在该调控系统中采用了MT-AR机器人巡检小车,巡检小车上集成了声音探测器、各类环境参数传感器和各类摄像头,同时安装了协调器节点和现场控制器,并预先在养猪场内铺设好小车行进的磁条轨道,运样管理者可W实时的观察幼猪的生活状态W判断猪只的行为是否异常,机器人巡检小车上的移动节点设计框图如图2 所示。 While using the system of regulation of MT-AR inspection robot car, car inspection integrated small sound detector, various types of environmental sensors and various camera parameters, while the coordinator node and the field controller installed in advance and whether laying a good car traveling in the pig farm track magnetic stripe, W sample transport managers can observe real-time status of young pigs live pigs to determine W behavioral abnormalities, a small robot patrol car mobile node design diagram shown in Figure 2 shows. 运种利用Zi浊ee技术将安放在保育猪舍内各个猪栏内的终端节点、路由节点、协调器节点组建成一个无线网络系统,实现了分散测控和集中管理,使得管理者可W对每个猪栏环境进行远程的精确化智能调节。 Zi cloud species transported using techniques ee nursery pig housed within each terminal node of the column pigs, routing node, the coordinator node to set up a wireless network system, centralized management and decentralized monitoring and control, so that the administrator can each W a pigsty environment remote intelligent precision adjustment.

[0033] UZi浊ee无线通信技术组建的具有移动协调器节点的养猪场无线传感网络 [0033] UZi cloud ee wireless communication technology established farms wireless sensor network having a mobile node coordinator

[0034] 在养猪场环境监控系统中,将可移动协调器节点和现场控制器安装在巡检小车上,一方面便于安装在巡检小车上和现场的的摄像头将采集到的影音信息实时的传送到现场控制器中,同时,由于安装在巡检小车上的协调器节点为可移动节点,提高了树型网络就地组网的灵活性。 Audio information [0034] In the pig environment monitoring system, the movable coordinator node controller and on-site inspection trolley mounted, on the one hand for mounting on the trolley and on-site inspection camera will be collected in real time transferred to the site controller at the same time, since the carriage is mounted in the inspection coordinator node is a mobile node may improve the flexibility of the network tree network in situ. 并且,可移动协调器节点可由巡检小车上的蓄电池直接供电,它具有充足的能源,可W延长该节点的寿命。 Further, the movable coordinator node may direct inspection trolley battery powered, it has sufficient energy, W can extend the life of the node. 在无线传感网络的组网过程中,采用Zi浊ee无线网络技术将猪栏内的终端节点和路由节点组成一个无线网络。 In the process of networking of wireless sensor networks using wireless network technologies Zi cloud ee pig column routing nodes and terminal nodes a wireless network. 通过ZigBee协议找,将采集到的数据发送至协调器节点,并通过串行通信接口,将数据传送至现场控制器中,现场控制器分析数据后将信息反馈给ZigBee网络节点,节点通过继电器的闭合来控制养猪场相关设备的运作,W上过程实现了现场控制器与无线传感网络的数据交互。 Get the ZigBee protocol, the collected data is sent to the coordinator node, and via the serial communication interface to transmit data to the field controller, the controller analyzes the data field will feedback to a ZigBee network node, the relay node closing of the operating control device associated pig, achieved during the W data exchange with the field of wireless sensor network controller. 选择适合的无线通信模块,能够缩小节点的开发周期,节省系统开销,降低系统能耗,从而提高系统整体生存时间。 Select suitable wireless communication module, the node can be reduced development cycle, saving system overhead, reduce energy consumption, thereby improving the overall survival time of the system. 基于W上要求,选用集成的CC2430忍片作为本监控系统的无线通信模块。 Based on the requirements of W, tolerance selection CC2430 chip integrated radio communication module of the monitoring system.

[0035] 通过ZigBee节点上的溫湿度及有害气体浓度传感器和巡检小车上的音频传感器及各类摄像头,用户可W对猪舍的环境、母猪的临产W及幼猪的生活状态进行实时的监测, 其中有些节点,由于ZigBee协议传输范围一般介于10~IOOm之间,所W当超出传输范围时直接与协调器节点相连的路由节点将进行节点断开处理。 [0035] The temperature and humidity by the ZigBee node and harmful gas concentration sensor and inspection trolley and various audio sensor camera, the user can piggery environment W, W and labor sows live real-time status of piglets monitoring, wherein some of the nodes, because the ZigBee protocol transmission range typically between 10 ~ IOOm, the routing node when W exceeds the transmission range of the coordinator node will be a node connected directly to disconnection processing. 当路由节点与网络断开时,该路由节点的所有子树包含的节点都成为孤立节点。 When disconnected from the network routing node, all nodes in the subtree containing the routing nodes become isolated nodes. 为保证养猪场现场环境参数的实时采集, 孤立节点需要重新加入树型网络。 In order to ensure real-time acquisition of environmental parameters pig farm field, isolated nodes need to rejoin the tree network. 运些孤立节点如果不能通过新的父节点入网,就会导致网络孤点的产生。 If you can not transport more isolated nodes by the new parent node network, the network will lead to a solitary point.

[0036] 根据DAAM算法原理,Am表示分配的最大地址,如公式(1)所示: [0036] The algorithm according to the principles DAAM, Am denotes a maximum address assignment, as shown in equation (1):

[0037] Am = Cskip(O) X Rm+Cm-Rm (1) [0037] Am = Cskip (O) X Rm + Cm-Rm (1)

[0038] 其中Cskip(O)是网络深度为0的路由节点的地址偏移量,如公式(2)所示: [0038] wherein Cskip (O) is the depth of the network routing node address offset of 0, as shown in Equation (2):

[0039] [0039]

Figure CN105759647AD00081

(2) (2)

[0040] 当Rm = 1 时,Am =( 1 +Cm X ( Lm-1 )) X Rm+Cm-Rm = Cm X Lm,由此式可知,地址空间Am与网络深度Lm成线性关系。 [0040] When Rm = 1, Am = (1 + Cm X (Lm-1)) X Rm + Cm-Rm = Cm X Lm, whereby the above equation, the network address space Am depth Lm is linear. 由于Rm=I且通信半径相同,所W每层节点数相等为Ne,所W地址使用率Ar不变即为Nc/Cm。 Since Rm = I and the same communication radius, W is equal to the number of nodes in each layer Ne, Ar usage of the W address is the same Nc / Cm.

[0041 ]当Rm辛1时, [0041] When Rm oct 1,

Figure CN105759647AD00082

,此时令LmS-Lml = l,Am2- Aml为第Lm2层的地址空间,整理得:4。 At this time so LmS-Lml = l, Am2- Aml Lm2 address space of layers, order was: 4. - 4»;二及r X馬。 --4 »; r X and two horses.

[0042] 树型网络每层节点的覆盖面积可近似看成半径为Lm,圆屯、角为a的圆环,则圆环面积文=a,。 [0042] The coverage area of ​​each tree node of the network may be regarded as approximate radius Lm, Tun circle, angle a is annular, the annular area of ​​the packet = a ,. + …ax巧,,令节点密度为y,则节点数Nc如下: + ... ax ,, so that the node density of coincidence y, the nodes Nc follows:

[0043] Nc = a(2Lm+l)Xy [0043] Nc = a (2Lm + l) Xy

[0044] 所W地址使用率 [0044] The address usage W

Figure CN105759647AD00083

因为LmS-Lml= l,Rm>l ,LmM且均为正整数,即 Because LmS-Lml = l, Rm> l, LmM and are positive integers, i.e.

Figure CN105759647AD00084

由此可知网络深度越大,地址使用率越低,即剩余地址越多。 The larger the depth of the network can be seen, the lower the usage of the address, i.e., the more the remaining addresses. 所W将同枝节点的子孙节点设为借地址的首选节点可提高借址成功率。 The W will descendant nodes in the same branch node is set by the node address of choice can improve the success rate by site.

[0045] 本发明在分析原因的基础上,提出一种新的基于两跳邻居的网络借地址算法,实现了养猪场内网络孤点的高效入网。 [0045] The present invention is based on the analysis of the reason, a new two-hop neighbor based on a network address by the algorithm, to achieve an efficient network within the network of orphans farms. 具体算法如下。 The algorithm is as follows.

[0046] 新的借地址路由算法,首先估算出网络孤立节点的借址空间大小,再将路由节点的借址范围设为两跳邻居节点,父节点可W获取两跳通信范围内的邻居节点的地址信息, 同时会优先考虑向同枝子孙节点借址; [0046] The new address by routing algorithm, first estimated by isolated nodes of network address space, and then routing node address range set by two-hop neighbor nodes, the parent node W can get two-hop neighbor nodes within communication range address information, and priority will be given to the descendants of the same branch node by address;

[0047] 借地址算法的路由选择,即树路由首先对目的节点的类型进行判断,再进行数据包的转发。 [0047] routing algorithm by the address, i.e., first type tree routing destination node is determined, then forwards the packet.

[004引(1)新的借地址算法 [004 cited (1) the new algorithm by address

[0049] 基于分布式地址分配机制的借地址路由算法默认路由节点的借址范围为一跳邻居节点,而本发明将路由节点的借址范围设为两跳W内的邻居节点,父节点可W获取两跳通信范围内的邻居节点的地址信息。 [0049] By routing algorithm addresses distributed address allocation scheme based on the default routing node address ranges by-hop neighbor nodes, while the address range of the present invention will take the routing node to neighbor nodes within two hops W, a parent node may W obtains the address information of neighbors within two hops communication range. 通过对借地址方式的改进,本文提出新的基于两跳邻居的网络借地址算法,该算法的详细步骤如下。 Through the improvement of address by the way, this paper presents a new network based on two-hop neighbor algorithm by address, detailed steps of the algorithm is as follows.

[0050] 1)节点X向路由节点Y发送一个空闲地址请求。 [0050] 1) X Y node sends a request to a free address routing node. 路由节点Y判断自己是否有空闲地址,若有空闲地址,则将地址分配给节点X;否则,路由节点Y进入借地址操作。 Y routing node to determine whether they have a free address, if a free address, the address is assigned to the node X; otherwise, routing node by entering the Y address operation.

[0051] 2)路由节点Y给节点X发送一个含有网络深度dy的信息,要求节点别尋网络深度dx 设置为dy+1,并作为Y的子节点加入网络。 [0051] 2) routing node Y transmits a message containing the network node to a depth dy X, not look for the requesting node to the network depth dx dy + 1, and Y child nodes join the network.

[0052] 3)路由节点Y发送一个响应给节点X,要求X计算其申请的地址空间大小,则节点X 需要计算其子节点地址空间大小。 [0052] 3) routing node Y sends a response to the node X, X calculated required application address space, the need to calculate its node X subnode address space. 若节点X为全功能设备FFD,则计算出子节点地址空间为O (X),并将o(x)+x作为借址包发送给路由节点Y;若节点X为半功能设备R抑,则子节点地址空间O(X)=O,并将o(x)+x作为借址包发送给路由节点Y. If node X is a full-function device the FFD, the child node is calculated as O address space (X), and o (x) + by access to a packet routing node as Y x; if node X is semi-functional R suppression device, the child node address space O (X) = O, and o (x) + x as a route by a node address packet to Y.

[0053] 4)路由节点刊欠到节点X的借址包后,向其两跳邻居范围内的节点转发借址包。 After the [0053] 4) routing node to node X owes published by addressing the packet, the packet forwarding address by its two-hop neighbor nodes within range. 收到借址包的邻居节点根据自己的剩余地址空间做出回复。 Received a package addressed to borrow a neighbor node to respond according to their own address space remaining. 若此处没有找到符合借址要求的邻居节点,则返回步骤1),节点X重新向新的路由节点发送借址请求。 If no neighbors here in line with the requirements of the find by address, return to step 1), the node X by addressing a request to re-send new routing node.

[0054] 5)路由节点刊欠到邻居节点的借址回复包后,Y将判断符合借址条件的节点中是否有自己的同枝节点,若有,则在同枝下的子孙节点中选出剩余地址较多的节点作为借址节点;若没有,则在符合借址条件的邻居节点中选出剩余地址较多的节点作为借址节点。 After the [0054] 5) routing node Journal owed to neighbor nodes by addressing reply packet, Y will determine whether its own accord with the branch node by node address condition, and if so, at selected branches of the sons of the same node the remaining node address by address, as more nodes; if not, the remaining node address selected by the address as more nodes in compliance with neighbors by site conditions. 然后将借用的地址空间分配给节点X,再由节点别尋空闲地址分配给下面的子节点。 Then borrowed address space allocated to the node X, the node then not look for an idle address assigned to the child node below. 基于两跳邻居的网络借地址路由算法框图如图3所示。 Based on two-hop neighbor network address of the routing algorithm by a block diagram shown in Fig. 若上述过程不能完成借址操作,则等待可移动协调器节点到达传输范围内时,再通过分布式地址分配算法完成孤立节点的入网请求。 If the above procedure can not be completed by the operation site, the waiting movable coordinator node arrival within the transmission range, network access request algorithm to complete re-isolated nodes through a distributed address allocation.

[0055] 如图4所示,机器人小车从猪栏1处行驶至猪栏n处,猪栏1处的热风机节点与协调器节点之间超出了ZigBee传输范围,此时热风机节点将与协调器节点进行网络断开,W及热风机节点的所有子树包含的节点都成为孤立节点。 [0055] As illustrated, the robot 1 with the car from pigsty to pigsty n, the hot air exceeds 4 between node and the coordinator node 1 at the pigsty ZigBee transmission range, this time with hot air node the coordinator node disconnected from the network, all the nodes in the sub-tree node contains W and hot air have become isolated nodes. 猪栏1中的路由节点和终端节点需要就近申请入网,比如猪栏1外的电热板节点作为没有空闲地址的父节点,根据W上的借址步骤,从两跳邻居范围中,即猪栏2内的溫湿度传感器节点处借来地址并分配给热风机节点W 及它的子节点。 1 pigsty routing nodes and terminal nodes need to apply the nearest network, such as a hot plate outside the pigsty node as a parent node address is not idle, according to the index step by W, from the two-hop neighbor range, i.e. pigsty temperature and humidity sensors in the nodes 2 and borrowed address assigned to the node W and the hot air its child nodes. 孤立节点入网成功,网络孤点问题得W解决。 Success isolated node network, network solitary point problem was solved W.

[0056] (2)借地址算法的路由选择 [0056] (2) by the address routing algorithm

[0057] 借地址算法的路由选择的具体过程为:树路由通过对目的节点的类型进行判断, 若目的节点是路由节点本身,则直接接受数据包;若目的节点是路由节点的子路由节点,贝U 计算下一跳地址后直接发送到符合条件的子路由节点;若目的节点是路由节点的子终端设备,则将数据包传送给子终端设备;若上述条件都不符合,则路由节点将此数据包传送给它的父节点,由其父节点根据上述路径选择过程继续转发该数据包。 [0057] By specific process routing address of the algorithm is: tree routing by the type of the destination node is determined, if the destination node is a routing node itself directly receive data packets; if the destination node is a child routing node routing node, after transmitting the next hop address calculation U shell directly to the eligible child routing node; if the destination node is the child node of the route terminal apparatus, the packet is transmitted to the sub-terminal device; if the above conditions are not met, the routing node this packet to its parent node, the parent node selection process continues to forward the packet according to the route.

[0058] 养猪场监控系统无线传感网络中,路由节点Y的地址为A,网络深度为d,当节点Y接受到一个带有目的地址D的数据包时,树路由算法路径选择过程如图5所示。 [0058] The monitoring system farms in wireless sensor networks, the routing address of the node Y is A, the network depth d, when node Y receives a destination address of the packet with D, tree routing algorithm, such as the path selection process Figure 5.

[0059] 1)若目的节点是路由节点Y本身,即A = D,则节点Y直接接受该数据包,停止转发。 [0059] 1) If the destination node is a routing node Y itself, i.e., A = D, the node Y directly receives the packet, stop forwarding.

[0060] 2)若目的节点是路由节点Y的子路由节点,即A<D<A+Rmax • Cskip(dl),则节点Y 将计算A+1 + {[D-(A+1)]/Cskip(d)} • Cskip(d)作为下一跳地址,并将该数据包传送给符合下一跳地址的子路由节点。 [0060] 2) If the destination node is a child routing node routing node Y, i.e., A <D <A + Rmax • Cskip (dl), the node will calculate Y A + 1 + {[D- (A + 1)] / Cskip (d)} • Cskip (d) as the next hop address, and supplies the packet to the next-hop routing node in line with the sub-address.

[OOW] 3)若目的节点是路由节点Y的子终端设备,即A+Rmax • Cskip(d)<A<A+Cskip(dl), 则将该数据包传送给子终端设备。 [OOW] 3) If the destination node is a routing node Y of the sub-terminal device, i.e., A + Rmax • Cskip (d) <A <A + Cskip (dl), then the sub-packet to the terminal device.

[0062] 4)若上述条件都不符合,则路由节点刊尋此数据包传送给它的父节点,由其父节点根据上述路径选择过程继续转发该数据包。 [0062] 4) If the above conditions are not met, then the routing node JOURNAL find this packet to its parent node, the parent node selection process continues to forward the packet according to the route.

[0063] 基于新的借地址算法,如图4所示,猪栏1内的热风机节点是孤立节点,电热板节点作为其父节点向同枝下的子孙节点溫湿度传感器节点借址,并将借来的地址分配给热风机节点。 [0063] Based on the new address by the algorithm shown in Figure 4, nodes within a pigsty fan heater is isolated nodes, a hot plate descendant node as its parent node by temperature and humidity sensors under the same address to the branch, and assign borrowed node address to the hot air. 根据树路由算法,无线传感器网络中任意位置上的某源节点要发送数据包给猪栏1内的热风机节点,数据包传送路径必须先经过借址节点再传送至目的节点,所W优先选择向同枝下的两跳子孙节点借址避免了路径迂回问题。 The tree routing algorithm, a wireless sensor network in an arbitrary position on the source node to send data packets to a node within the hot air pigsty, the packet transfer path must first access node longer be sent by the destination node, the preferred W to avoid the path to the two-hop node by addressing children and grandchildren under the same branch circuitous problem. 新的算法不但实现了树路由路径选择过程,而且通过在借址过程中进行网络拓扑优化,减少了路由节点的能耗,所W新的借地址算法与树路由算法相兼容。 The new algorithm has not only made the tree routing path selection process, but also through the network topology optimization by addressing the process of reducing the energy consumption of routing nodes, the new address by routing algorithms and tree algorithm is compatible with the W.

[0064] 实验结果表明,本发明的监控系统中安装在小车上的协调器节点为可移动节点, 同时协调器节点由小车上的蓄电池直接供电,延长了该节点的寿命,再通过新的借地址路由算法,提高了树型网络就地组网的灵活性,降低了组网耗时和能量损耗。 [0064] The results show that the monitoring system of the present invention mounted coordinator node trolley is movable node, while the coordinator node power from a small car battery, prolonging the life of the node, then the new borrow address routing algorithm to improve the flexibility of the tree network place network, reducing network time-consuming and energy loss. 该系统能够准确及时地获取养猪场的环境参数,并能对生猪的生活状态进行实时的观察,具有实时性、稳定性和高效性等特点,有效实现了养猪场环境的监测和控制,对养猪场环境监控系统起到了较好的作用。 The system can accurately and timely access to environmental parameters pig farm, and to real-time observation of the state of life of pigs, with real-time, stability and efficiency, etc., to achieve effective monitoring and control of environmental pig, environmental monitoring system for pig farms played a good role.

[0065] 2、养猪场嵌入式现场控制中屯、 [0065] 2, pig embedded field control Tun,

[0066] 微控制器是整个系统的核屯、,采集并处理数据,与无线通信模块进行通讯并判断何时发送和接受运些数据。 [0066] Microcontroller nuclear Tun entire system ,, collect and process data, communicate with a wireless communication module and determines when to send and receive such data transportation. S3C6410处理器是32位微控制器,支持ARM、可执行java字节码和一些DSP指令集,采用32/64位内部总线架构。 S3C6410 processor is a 32-bit microcontroller, support ARM, java bytecode executable instruction set and a number of DSP, using 32/64 bit internal bus architecture. S3C6410可通过内置2个外部存储器端口来扩展多种外部存储器,内部集成许多设备接口,运样大大的减少整体设计成本,省去了配置额外的开销,提高整个系统功能。 S3C6410 external memory can be extended by a variety of built-in external memory port 2 within the integrated interface to many devices, the sample transport costs greatly reduced overall design, eliminating the need for additional configuration overhead, and improving the overall system functionality. S3C6410处理器价格低廉,且自身功耗低。 S3C6410 processor inexpensive, and its low power consumption. 综合W上优点,本监控系统数据处理模块选用S3C6410。 Comprehensive advantages W, the monitoring system of the present data processing module selects S3C6410.

[0067] 养猪场现场嵌入式控制器S3C6410通过串口获取Zi浊ee无线传感网络采集的环境信息,保存后并自动分析数据。 [0067] The embedded controller pig scene environment information acquired through the serial port S3C6410 Zi wireless sensor network cloud ee collected, and automatically analyzes the data after storage. 通过分析结果自动控制养猪场各设备的运作。 By analyzing the results of operations for the automatic control of pig farms each device. 为了实现养猪场环境的远程实时监控,系统具备数据采集、图像采集、存储管理、分析处理、自动控制、网络发布等功能。 In order to achieve real-time remote monitoring of pig farms environment, system with data acquisition, image acquisition, storage, management, analysis and processing, automatic control, web publishing and other functions. 采用轻量级嵌入式Linux操作系统,并移植嵌入式数据库、WEB服务器等。 The use of lightweight embedded Linux operating system and embedded database migration, WEB servers. 其中嵌入式数据库采用针对嵌入式的轻量级SQLite数据库,WEB服务器采用嵌入式BOA服务器。 Which uses a lightweight embedded database SQLite database for embedded, WEB server embedded BOA server. 采用CGI(通用网关接口)使网页具有交互功能,解释处理来自表单的输入信息,并在服务器产生相应的处理,或将相应的信息反馈给浏览器。 Using CGI (Common Gateway Interface) with interactivity of web pages, from the form interpretation process input information and generates corresponding processing on the server, or the corresponding information back to the browser. 控制中屯、可预先设定溫湿度等环境参数的范围,超过范围自动发出控制命令给相应设备经行调节。 Tun control, environmental parameters can be pre-set range of temperature and humidity, over a range automatically send control commands to the respective devices through the line regulator.

[0068] 3、用户远程控制中屯、 [0068] 3, Tun user remote control,

[0069] 用户远程控制中屯、可用PC机作为监控平台。 [0069] the user to remotely control the village, the PC can be used as a monitoring platform. 通过在S3C6410开发板上移植SQLite 数据库,BOA服务器W及编写CGI程序,将参数发送至Internet,通过Internet在PC机上及时显示监测养猪场的环境参数,管理员可W通过浏览器远程访问数据,同时采集的数据将被存储在SQLite数据库中,便于管理员查询历史数据。 By S3C6410 development board transplantation SQLite database, BOA server W and write CGI programs, send parameters to the Internet, display timely environmental parameters monitoring of pig farms, W administrators can remotely through a browser to access data on a PC through the Internet, while the data collected will be stored in a SQLite database, query historical data to facilitate administrator. 如果系统采集的实时环境数据超过设定值,控制系统能够及时自动识别,管理员也能够及时发现,此时控制系统则通过控制养猪场中负压风机等设备的运行来自动调节出最适宜生猪生长的环境。 If the real-time environmental data collected by the system exceeds the set value, the control system can automatically identify in time, it is possible to detect the administrator, then the control system will be automatically adjusted by the operation of the suction fan pig farm equipment such as optimum control pig growth environment.

[0070] 采用BOA架构WEB服务器,设计B/S远程管理模式,B/S结构是一种浏览器/服务器结构,即只安装维护一个服务器,而客户端采用浏览器运行软件。 [0070] The WEB server BOA architecture, design B / S Remote management mode, B / S is a structure of browser / server configuration, installation and maintenance, i.e., only one server, and the client uses a browser to run the software. 在B/S结构中,用户通过浏览器W超文本形式向分布在网络上的服务器提出请求,服务器接受请求后,利用CGI程序进行处理。 In the B / S structure, the user makes a request to the server over a network by the distribution of W hypertext browser, the server after receiving the request, using a CGI program for processing. 通用网关接口CGI使页面具有交互功能,设计CGI程序处理用户浏览器提交的命令信息,并通过HTML格式进行结果的反馈。 Common Gateway Interface CGI to make the page with interactivity, design CGI program processing command information submitted by the user's browser, and the results fed back through HTML format. 采用WIFI无线通信技术,实现养猪场现场控制器的Internet连接,使得远程用户可使用电脑、智能手机等设备随时随地获取养猪场实时数据信息并管理养猪场。 Using WIFI wireless communication technology, pig farm field controller of Internet connection so that remote users can use computers, smart phones and other devices to obtain real-time data anywhere, anytime and pig farm pig farm management.

[0071] 在本说明书的描述中,参考术语"一个实施例"、"一些实施例"、"示意性实施例"、 "示例"、"具体示例"、或"一些示例"等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。 [0071] In the description of the present specification, reference to the term "one embodiment," "some embodiments," "exemplary embodiment", "an example", "a specific example", or "some examples" means that describe a particular feature of the embodiment or example described, structure, material, or characteristic is included in at least one embodiment of the present invention, embodiments or examples. 在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。 In the present specification, a schematic representation of the above terms necessarily referring to the same embodiment or example. 而且,描述的具体特征、结构、材料或者特点可W在任何的一个或多个实施例或示例中W合适的方式结合。 Furthermore, the particular features, structures, materials, or characteristics may be combined W embodiments or examples of W in any suitable manner one or more.

[0072] 尽管已经示出和描述了本发明的实施例,本领域的普通技术人员可W理解:在不脱离本发明的原理和宗旨的情况下可W对运些实施例进行多种变化、修改、替换和变型,本发明的范围由权利要求及其等同物限定。 [0072] While there has been illustrated and described embodiments of the present invention, those of ordinary skill in the art may be appreciated W: without departing from the principles and spirit of the invention W may be transported to some embodiments various changes, modifications, substitutions and modifications, the scope of the invention as defined by the appended claims and their equivalents.

Claims (5)

1. 一种基于巡检小车与借地址路由算法的养猪场环境监控方法,其特征在于,包括以下步骤: 步骤1,构建基于巡检小车与借地址路由算法的养猪场环境监控系统,包括:ZigBee无线通信技术组建的具有移动协调器节点的养猪场无线传感网络、养猪场嵌入式现场控制中心和用户远程控制中心;具有移动协调器节点的养猪场无线传感网络包括可移动协调器节点、路由节点和终端节点;可移动协调器节点和养猪场嵌入式现场控制中心设置在巡检小车上;通过ZigBee协议栈,将采集到的数据汇聚到可移动协调器节点,可移动协调器节点由巡检小车上的蓄电池直接供电,并通过串行通信接口与嵌入式现场控制中心实现数据交换;嵌入式现场控制中心包括现场控制器,嵌入式现场控制中心通过网络接入点和无线网卡与用户远程控制中心连接;用户远程控制中心包括电脑、 An inspection pig trolley and environmental monitoring by a method based on address routing algorithm, characterized by comprising the following steps: Step 1 Construction patrol car and pig farm environment monitoring system by address routing algorithm, comprising: ZigBee wireless communication technology established pig mobile wireless sensor network having a coordinator node, pig embedded field control center and a user remote control center; pig mobile wireless sensor network having a coordinator node comprises movable coordinator node, routing nodes and end nodes; coordinator node and the movable pig embedded field control center provided inspection trolley; ZigBee protocol stack data, the collected converged movable coordinator node movable coordinator node is powered by direct inspection trolley battery, and to exchange data via a serial communications interface with the embedded field control center; embedded field control comprises a central site controller, an embedded field control center through the network interface point and the wireless LAN connection with the user of the remote control center; remote control center includes a user computer, 网络接入点和无线网卡,用户远程控制中心通过Internet网络协议连入互联网访问现场控制器; 步骤2,针对ZigBee协议传输范围有限造成的网络孤点问题,采用一种新的基于两跳邻居的网络借地址路由算法,该算法包括两个部分: 新的借地址路由算法,首先估算出网络孤立节点的借址空间大小,再将路由节点的借址范围设为两跳邻居节点,父节点可以获取两跳通信范围内的邻居节点的地址信息,同时会优先考虑向同枝子孙节点借址; 借地址算法的路由选择,即树路由首先对目的节点的类型进行判断,再进行数据包的转发。 Network access point and wireless card, the user remote control center connected to the Internet through Internet protocol network access control field; Step 2, solitary point for network transmission problems caused by the limited scope of the ZigBee protocol, based on the use of a new two-hop neighbors network address by routing algorithm, which consists of two parts: the new address by routing algorithm, first estimated by isolated nodes of network address space, and then routing node address range set by two-hop neighbor nodes, the parent node can acquiring two-hop neighboring nodes within the communication range of the address information, and priority will be given to the same branch descendant nodes by address; by routing address algorithm, i.e., tree routing first type destination node is determined, then forwards the data packet .
2. 根据权利要求1所述的基于巡检小车与借地址路由算法的养猪场环境监控方法,其特征在于,所述步骤1中,养猪场无线传感网络主要是由分布在各个猪栏中的ZigBee节点组成,ZigBee节点连接温湿度及有害气体浓度传感器、红外监控摄像头以及标准通风口风机、 降温湿帘栗、负压风机、热风炉、电热板等控制设备;通过节点上的温湿度及有害气体浓度传感器和巡检小车上的音频传感器及摄像头,用户可以对猪舍的环境、母猪的临产以及幼猪的生活状态进行实时的监测,其中,巡检小车上的音频传感器、各类环境参数传感器和摄像头可在养猪场内在预设好的巡检小车磁条轨道上任意移动,通过移动巡检小车上的各类环境参数传感器,监控系统获得养猪场内部环境参数;每次信息采集后,节点向协调器发送数据信息,协调器节点通过串口与现场控制器相连 Trolley according to claim inspection pig and method for monitoring the environment by address routing algorithm, wherein said 1, step 1, the wireless sensor network pig is mainly distributed in various porcine ZigBee node bar composition, temperature, humidity and ZigBee nodes connected to the harmful gas concentration sensor, an infrared surveillance camera and a standard vent fan, cooling wet curtain Li, suction fan, hot stove, electric panels, etc. the control device; by the temperature at node humidity and harmful gas concentration sensor and inspection trolley audio sensor and the camera, the user can perform real-time monitoring of the environment of the pig, and the living conditions labor sow piglets, wherein the inspection trolley audio sensor, various types of environmental parameter sensors and cameras can be preset on any internal inspection pig moves good trolley track magnetic stripe, various types of environmental parameter sensor by moving the trolley inspection, internal environment monitoring system parameters obtained farms; after each information collection, the node sends data information to the coordinator, the coordinator node through the serial port to the site controller 将采集到的数据传输至现场控制器中; 用户远程控制中心通过Internet网络协议连入互联网,远程用户通过浏览器登陆现场控制器,实时观测猪舍并可以随时调控猪舍环境。 The collected data to a site controller; remote user control center via the Internet protocol connected to the Internet, remote users through a browser landing site controller, real-time observation and pig barn can always regulated environment.
3. 根据权利要求1所述的基于巡检小车与借地址路由算法的养猪场环境监控方法,其特征在于,所述步骤2中,新的借地址路由算法的具体过程为: 步骤2.1,节点X向路由节点Y发送一个空闲地址请求,路由节点Y判断自己是否有空闲地址,若有空闲地址,则将地址分配给节点X;否则,路由节点Y进入借地址操作; 步骤2.2,路由节点Y给节点X发送一个含有网络深度dy的信息,要求节点X将网络深度dx设置为dy+Ι,并作为Y的子节点加入网络; 步骤2.3,路由节点Y发送一个响应给节点X,要求X计算其申请的地址空间大小,则节点X需要计算其子节点地址空间大小;若节点X为全功能设备FFD,则计算出子节点地址空间为〇(x),并将〇(x)+x作为借址包发送给路由节点Y;若节点X为半功能设备RFD,则子节点地址空间o(x)=0,并将o(x)+x作为借址包发送给路由节点Y; 步骤2.4,路由节点Y收到节 The patrol car based on the method of environmental monitoring pig address by the routing algorithm as claimed in claim 1, wherein, in the step 2, the specific process of the new address by the routing algorithm: Step 2.1, routing node X to node Y transmits an idle request address, the routing node Y to determine whether they have a free address, if a free address, the address assigned to the node X; otherwise, routing node address operation by entering Y; step 2.2, routing node Y is sent to the node X a containing information network depth of dy, the requesting node X to network depth dx to dy + Ι, and as a child node Y to join the network; step 2.3, the routing node Y sends a response to the node X, the requirements X calculated application address space, then node X need to calculate the size of the address space of its child nodes; if node X is a full-function device the FFD, the child node address is calculated as the square space (X), and square (x) + x as addressed by routing packets to the node Y; if node X is a semi-function device RFD, the child node address space o (x) = 0, and o (x) + x by the node Y as the route to a packet addressed; step 2.4, section receives routing node Y 点X的借址包后,向其两跳邻居范围内的节点转发借址包, 收到借址包的邻居节点根据自己的剩余地址空间做出回复;若此处没有找到符合借址要求的邻居节点,贝返回步骤2.1,节点X重新向新的路由节点发送借址请求; 步骤2.5,路由节点Y收到邻居节点的借址回复包后,Y将判断符合借址条件的节点中是否有自己的同枝节点,若有,则在同枝下的子孙节点中选出剩余地址较多的节点作为借址节点;若没有,则在符合借址条件的邻居节点中选出剩余地址较多的节点作为借址节点;然后将借用的地址空间分配给节点X,再由节点X将空闲地址分配给下面的子节点;若上述过程不能完成借址操作,则等待可移动协调器节点到达传输范围内时,再通过分布式地址分配算法完成孤立节点的入网请求。 After point X by addressing the packet, the packet forwarding address by its two-hop neighbor nodes within range of the received packet addressed by neighbors respond according to their remaining address space; if not found here in line with the requirements of the site by neighbor node, Tony returns to step 2.1, the node X by resend request access to a new routing node; step 2.5, after receiving routing node Y by reply packet access neighboring nodes, node Y will determine whether there is compliance with the conditions of access by with their minor point, and if so, to select a node address remaining descendants in more nodes under the same branch as the borrow site node; if not, the remaining addresses elect more in line with neighboring nodes by site conditions in node as by access node; then borrowed address space allocated to the node X, then the node X to assign the free address to the following sub-node; if the above process can not be completed by addressing operation, waiting movable coordinator node arrives at the transport when the range, then the assignment algorithm completed isolated nodes through a distributed network access request address.
4. 根据权利要求1所述的基于巡检小车与借地址路由算法的养猪场环境监控方法,其特征在于,所述步骤2中,借地址算法的路由选择的具体过程为: 树路由通过对目的节点的类型进行判断,若目的节点是路由节点本身,则直接接受数据包;若目的节点是路由节点的子路由节点,则计算下一跳地址后直接发送到符合条件的子路由节点;若目的节点是路由节点的子终端设备,则将数据包传送给子终端设备;若上述条件都不符合,则路由节点将此数据包传送给它的父节点,由其父节点根据上述路径选择过程继续转发该数据包。 4. patrol car and pig farm environment monitoring method by address based routing algorithm, wherein according to claim 1, in the step 2, by the specific process routing algorithm to the selected address: routing tree by the destination node type is determined, if the destination node is a routing node itself directly receive data packets; if the destination node is a child routing node routing node, the calculation of the direct transmission to the next hop address eligible child routing node; If the destination node is the child node of the route terminal apparatus, the packet is transmitted to the sub-terminal device; if the above conditions are not met, then the routing node transmits this packet to its parent node, a parent node based on the path selection the process continues to forward the packet.
5. 根据权利要求1所述的基于巡检小车与借地址路由算法的养猪场环境监控方法,其特征在于,所述步骤1中,用户远程控制中心可用PC机作为监控平台,通过在现场控制器S3C6410开发板上移植SQLite数据库,BOA服务器以及编写CGI程序,将参数发送至Internet,通过Internet在PC机上及时显示监测养猪场的环境参数,管理员可以通过浏览器远程访问数据,同时采集的数据将被存储在SQLite数据库中,便于管理员查询历史数据。 Trolley according to claim inspection pig and method for monitoring the environment by address routing algorithm, wherein said 1, step 1, the user of the remote control center can be used as a PC monitor platform, the site the controller S3C6410 development board transplantation SQLite database, BOA server and write CGI programs, send parameters to the Internet, through the Internet in a timely manner display monitor environmental parameters pig farm on a PC, an administrator can remotely access the data through a browser, simultaneous acquisition the data will be stored in a SQLite database, query historical data to facilitate administrator.
CN201610095387.2A 2016-02-22 2016-02-22 It is a kind of based on routing inspection trolley with borrow address routing algorithm pig farm environment control method CN105759647B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610095387.2A CN105759647B (en) 2016-02-22 2016-02-22 It is a kind of based on routing inspection trolley with borrow address routing algorithm pig farm environment control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610095387.2A CN105759647B (en) 2016-02-22 2016-02-22 It is a kind of based on routing inspection trolley with borrow address routing algorithm pig farm environment control method

Publications (2)

Publication Number Publication Date
CN105759647A true CN105759647A (en) 2016-07-13
CN105759647B CN105759647B (en) 2019-03-05

Family

ID=56330907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610095387.2A CN105759647B (en) 2016-02-22 2016-02-22 It is a kind of based on routing inspection trolley with borrow address routing algorithm pig farm environment control method

Country Status (1)

Country Link
CN (1) CN105759647B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6963582B1 (en) * 1997-07-03 2005-11-08 Utstarcom, Incorporated Applying modified mobile internet protocol (IP) in a wireless mobile data network interface
CN102497390A (en) * 2011-11-18 2012-06-13 江苏大学 Visualized regulation and control system for pigsty nursing environment based on internet of things
CN103995509A (en) * 2014-05-13 2014-08-20 北京华科数能科技发展有限公司 Robot for poultry house environment monitoring and monitoring method and system thereof
CN104049602A (en) * 2014-05-12 2014-09-17 江苏大学 Nursing hog house monitoring system of multi-path routing algorithm

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6963582B1 (en) * 1997-07-03 2005-11-08 Utstarcom, Incorporated Applying modified mobile internet protocol (IP) in a wireless mobile data network interface
CN102497390A (en) * 2011-11-18 2012-06-13 江苏大学 Visualized regulation and control system for pigsty nursing environment based on internet of things
CN104049602A (en) * 2014-05-12 2014-09-17 江苏大学 Nursing hog house monitoring system of multi-path routing algorithm
CN103995509A (en) * 2014-05-13 2014-08-20 北京华科数能科技发展有限公司 Robot for poultry house environment monitoring and monitoring method and system thereof

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
刘阳春 等: "畜禽养殖环境远程监控系统研究", 《机器人技术与应用》 *
吴许俊 等: "基于两跳邻居的ZigBee网络借地址分配算法", 《科学技术与工程》 *
朱伟兴 等: "基于物联网的保育猪舍环境监控系统", 《农业工程学报》 *

Also Published As

Publication number Publication date
CN105759647B (en) 2019-03-05

Similar Documents

Publication Publication Date Title
CN102736599B (en) Real-time interaction intelligent terminal control system based on internet of things technology
CN202886979U (en) Agricultural production remote monitoring and intelligent decision making system based on Internet of Things
CN103023681B (en) Intelligent home control devices, update method
CN103262041B (en) Between the thermostat and the thermostat and the thermostat management server data communication method
CN102355390B (en) Intelligent home system
Byun et al. Development of a self-adapting intelligent system for building energy saving and context-aware smart services
JP2012514415A (en) Control apparatus and method for environmental conditions in the data center using wireless mesh network
CN101959295B (en) Energy-saving management method, system and remote management server of wireless sensor network
CN202218258U (en) Intelligent home gateway and system thereof
CN101883455B (en) Lighting power-saving measurement and control system based on wireless sensor network
CN101140695A (en) Greenhouse surroundings monitoring system based on ZigBee wireless sensor network
CN101968649B (en) Network type control system for live pig culturing environment and intelligent environment factor control method
CN101188444B (en) A method for distributed section networking in wireless sensing network
CN103345214B (en) Linkage control method based on smart appliances middleware
US20060200542A1 (en) Apparatus and method for network-aware power management
CN102566558B (en) System and method for managing intelligent greenhouse based on Android platform
CN101001186A (en) Monitoring system based on sensor-based network technology
CN203178784U (en) Intelligent household control system based on Internet of Things
CN102176149A (en) Intelligent building energy consumption monitoring system based on wireless sensor network
JP2001145174A (en) Method and system for controlling cooperation between equipment
CN101286911A (en) Networking method of wireless sensor network based on combination of cluster and Mesh
CN102624925A (en) IOT sensing family cloud platform system
Colistra et al. The problem of task allocation in the Internet of Things and the consensus-based approach
CN102865647B (en) Cloud air conditioner with cloud adaption function based on cloud computing technology and cloud adaption method thereof
CN201796269U (en) Building electric equipment networking system

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
GR01