CN114627633A - Ad hoc network water meter centralized reading system and method based on multi-agent construction - Google Patents

Ad hoc network water meter centralized reading system and method based on multi-agent construction Download PDF

Info

Publication number
CN114627633A
CN114627633A CN202011453758.2A CN202011453758A CN114627633A CN 114627633 A CN114627633 A CN 114627633A CN 202011453758 A CN202011453758 A CN 202011453758A CN 114627633 A CN114627633 A CN 114627633A
Authority
CN
China
Prior art keywords
agent
concentrator
node
collector
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011453758.2A
Other languages
Chinese (zh)
Other versions
CN114627633B (en
Inventor
武永华
羊富贵
张�浩
张禹
颜峰坡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Jiangxia University
Original Assignee
Fujian Jiangxia University
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 Fujian Jiangxia University filed Critical Fujian Jiangxia University
Priority to CN202011453758.2A priority Critical patent/CN114627633B/en
Publication of CN114627633A publication Critical patent/CN114627633A/en
Application granted granted Critical
Publication of CN114627633B publication Critical patent/CN114627633B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/38Services specially adapted for particular environments, situations or purposes for collecting sensor information

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention relates to a system and a method for centralized reading of Ad hoc network water meters constructed based on multiple agents, wherein the system is divided into three stages, and comprises three different agents, namely a collector Agent, a concentrator Agent and a management center Agent; the collector Agent is connected with the water meter sensor and collects the reading of the water meter in real time; the concentrator Agent is responsible for managing the work of a plurality of collector agents and is used for summarizing the data of the collector agents or issuing instructions to the collectors to control the running states of the collectors; the management center Agent manages a plurality of concentrator Agent nodes, collects data of each concentrator Agent node, and issues commands to the collector agents under the concentrator Agent nodes. The invention provides a basic Internet of things perception layer for intelligent water affairs, provides accurate water affair data for water affair management, quickly acquires all available information such as water quality and the like at any time, realizes the aims of water saving and energy saving, better manages water supply and drainage facilities distributed all over, and improves the operation and maintenance management efficiency.

Description

基于多Agent构建的Ad hoc网络水表集抄系统及方法Ad hoc network water meter centralized reading system and method based on multi-agent construction

技术领域technical field

本发明涉及水表集抄领域,具体涉及一种基于多Agent构建的Ad hoc网络水表集抄系统及方法。The invention relates to the field of centralized reading of water meters, in particular to an Ad hoc network centralized reading system and method based on multi-agent construction.

背景技术Background technique

微功率无线抄表,从20世纪90年代后期应用到水电行业,在10多年的技术发展中们、经历了星型网、树型网,固定频点格型网传输,到目前已经部分发展到第四代技术,自动跳频、自组网的Ad-Hoc网络数据传输方式。Ad hoc网络应用在抄表行业的关注不多,目前国内余剑探讨了Ad hoc网络协议及其在无线抄表系统中的应用,牛彤欣等设计并实现了基于Ad-hoc网络无线抄表系统,无线通信模块采用的是CC1101,调制方式为GFSK。刘磊等做的居民微功率无线抄表应用方案,基于Ad-hoc网络,无线通信模块调制方式为GFSK。这些研究主要侧重降低节点发送功率,异常节点的检测等,而节点本身的智能性、协调性没有考虑,接收灵敏度不好,抄表速度慢。Micro-power wireless meter reading has been applied to the hydropower industry since the late 1990s. In more than 10 years of technological development, it has experienced star network, tree network, fixed frequency grid network transmission, and has now partially developed to The fourth generation technology, automatic frequency hopping, Ad-Hoc network data transmission mode of ad hoc network. Ad hoc network application has not received much attention in the meter reading industry. At present, domestic Yu Jian discussed the Ad hoc network protocol and its application in wireless meter reading system. Niu Tongxin and others designed and implemented a wireless meter reading system based on Ad-hoc network. The wireless communication module adopts CC1101, and the modulation method is GFSK. The residential micro-power wireless meter reading application scheme developed by Liu Lei et al. is based on the Ad-hoc network, and the modulation method of the wireless communication module is GFSK. These studies mainly focus on reducing the transmission power of nodes, detecting abnormal nodes, etc., but the intelligence and coordination of the nodes themselves are not considered, the receiving sensitivity is not good, and the meter reading speed is slow.

目前,国内外的无线水表抄表网络技术有WIFI,HomeRF,蓝牙BLE4.0, Zigbee,GPRS,微功率无线网、低功耗广域网络(LPWAN)。WIFI,HomeRF,蓝牙等在国内水表集抄方面应用不是很多。国际上更多采用的是Zigbee的通信技术。2007年瑞典哥德堡27万居民实现了Zigbee技术的自动抄表系统,而Zigbee的实现成本、低功耗、联盟协议等特点不完全适应国内的需求,在国内几乎没有部署在应用场合。基于GPRS抄表技术的方案国内很多,应用也比较广泛,会局限在运营商的基站和流量费用等方面。微功率无线网国内水表抄收应用很多,相关文献也很多,像李东的基于si4432的无线自组网抄表系统设计、熊邦毛的基于433M路由算法在抄表系统中的应用与研究等等,主要采用FSK,GFSK两种调制方式。随着物联网的兴起,低功耗广域网络(LPWAN) 应运而生,NB-IoT、LoRa是里面的佼佼者。NB-IoT目前没有商业化,国内研究热度很高。LoRa网络已经在国外多地进行试点或部署,但Lora在国内应用较少,在水表集抄方面更少,国内相关文献只有王瑞的基于SX1278的水表端无线抄表控制器。At present, domestic and foreign wireless water meter reading network technologies include WIFI, HomeRF, Bluetooth BLE4.0, Zigbee, GPRS, micro-power wireless network, and low-power wide-area network (LPWAN). WIFI, HomeRF, Bluetooth, etc. are not widely used in domestic water meter collection. Internationally, Zigbee communication technology is more widely used. In 2007, 270,000 residents of Gothenburg, Sweden realized the automatic meter reading system of Zigbee technology. However, Zigbee's implementation cost, low power consumption, alliance agreement and other characteristics are not fully suitable for domestic needs, and are hardly deployed in domestic applications. There are many solutions based on GPRS meter reading technology in China, and the applications are also relatively extensive, which will be limited to the operator's base station and traffic costs. There are many applications of domestic water meter reading and collection of micro-power wireless network, and there are many related documents, such as Li Dong's design of wireless ad hoc network meter reading system based on si4432, Xiong Bangmao's application and research based on 433M routing algorithm in meter reading system, etc. Using FSK, GFSK two modulation methods. With the rise of the Internet of Things, low-power wide-area networks (LPWAN) have emerged, and NB-IoT and LoRa are among the best. NB-IoT is currently not commercialized, and domestic research is very hot. The LoRa network has been piloted or deployed in many places abroad, but LoRa is rarely used in China, and even less in the centralized reading of water meters. Only Wang Rui's SX1278-based wireless meter reading controller for water meters is the only relevant domestic literature.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明的目的在于提供一种基于多Agent构建的Ad hoc网络水表集抄系统及方法,为智慧水务提供基础的物联网感知层,为水务管理提供准确的水务数据,敏捷的随时获取水质等可用信息,实现节水和节能。In view of this, the purpose of the present invention is to provide an Ad hoc network water meter centralized reading system and method based on multi-agent construction, provide a basic Internet of Things perception layer for smart water affairs, and provide accurate water affairs data for water affairs management. Obtain available information such as water quality to achieve water and energy savings.

为实现上述目的,本发明采用如下技术方案:To achieve the above object, the present invention adopts the following technical solutions:

一种基于多Agent构建的Ad hoc网络水表集抄系统,所述系统分为三级,包括采集器Agent,集中器Agent,管理中心Agent三种不同Agent;所述采集器Agent与水表传感器相连,实时采集水表的读数;所述集中器Agent负责管理多个采集器Agent的工作,用于对采集器Agent的数据进行汇总或对采集器下发指令控制其运行状态;所述管理中心Agent管理若干个集中器Agent节点,汇总每个集中器Agent节点的数据,并经由集中器Agent节点将命令下达给隶属其下的采集器Agent。An Ad hoc network water meter centralized reading system based on multi-agent construction. The system is divided into three levels, including three different agents: a collector agent, a concentrator agent, and a management center agent; the collector agent is connected to a water meter sensor, The readings of the water meters are collected in real time; the concentrator Agent is responsible for managing the work of a plurality of collector agents, and is used for summarizing the data of the collector agents or issuing instructions to the collectors to control their running states; the management center agent manages several A concentrator agent node, summarizes the data of each concentrator agent node, and issues commands to the collector agent under it through the concentrator agent node.

进一步的,所述集中器Agent与其管理的若干采集器Agent之间组成Ad hoc网络,网络内的任何节点都可以为其他节点作为路由转发报文。Further, an Ad hoc network is formed between the concentrator Agent and several collector Agents it manages, and any node in the network can forward packets as a route for other nodes.

进一步的,所述Ad hoc网络协议基于按需协议设计,包括四种基本报文:集中器Agent广播报文,路由请求广播报文,路由响应广播报文,路由错误报文Further, the Ad hoc network protocol is designed based on an on-demand protocol, and includes four basic messages: concentrator Agent broadcast message, route request broadcast message, route response broadcast message, and route error message.

进一步的,所述集中器Agent与其管理的若干采集器Agent之间还具有感知网络拓扑,并决定数据发送路径的能力。Further, the concentrator Agent and several collector agents managed by it also have the ability to perceive the network topology and determine the data transmission path.

进一步的,所述采集器Agent包括PIC单片机,电源模块、LoRa无线通信模组、FMCOS-SE安全模块,脉冲计量传感器模块;所述PIC单片机与LoRa无线通信模组、FMCOS-SE安全模块,脉冲计量传感器模块分别连接;所述电源模块与Agent包括PIC单片机,LoRa无线通信模组、FMCOS-SE安全模块分别连接。Further, the collector Agent includes a PIC microcontroller, a power supply module, a LoRa wireless communication module, an FMCOS-SE safety module, and a pulse measurement sensor module; the PIC microcontroller, the LoRa wireless communication module, the FMCOS-SE safety module, and the pulse measurement sensor module. The metering sensor modules are respectively connected; the power supply module and the Agent include a PIC microcontroller, a LoRa wireless communication module, and an FMCOS-SE security module, which are respectively connected.

进一步的,所述集中器Agent包括主板模块、LoRa无线通信模组、4G通信模块、电源模块和FMCOS-SE安全模块;所述主板模块与LoRa无线通信模组、4G通信模块、FMCOS-SE安全模块分别连接;所述电源模块与主板模块与LoRa无线通信模组、4G通信模块分别连接。Further, described concentrator Agent comprises mainboard module, LoRa wireless communication module, 4G communication module, power supply module and FMCOS-SE security module; Described mainboard module and LoRa wireless communication module, 4G communication module, FMCOS-SE security module. The modules are respectively connected; the power module and the motherboard module are respectively connected with the LoRa wireless communication module and the 4G communication module.

一种基于多Agent构建的Ad hoc网络水表集抄系统的多Agent网络的组建方法,包括以下步骤:A method for building a multi-Agent network of an Ad hoc network water meter centralized reading system based on multi-Agent construction, comprising the following steps:

步骤1:未入网的集中器Agent主动向集中器Agent发起入网请求;Step 1: The concentrator Agent that is not connected to the network actively initiates a network access request to the concentrator Agent;

步骤2:请求直接到达集中器节点或是经由网络中多个节点路由到达集中器Agent;Step 2: The request reaches the concentrator node directly or routes to the concentrator agent through multiple nodes in the network;

步骤3:集中器Agent在确认入网请求后,对其下发基本系统参数;Step 3: After confirming the network access request, the concentrator Agent sends basic system parameters to it;

步骤4:采集器Agent在收到系统基本参数后,将更新自身节点的配置,并对集中器做出响应,完成入网;Step 4: After receiving the basic parameters of the system, the collector Agent will update the configuration of its own node, respond to the concentrator, and complete the network access;

步骤5:集中器Agent在首次启动时接入管理中心Agent进行注册并获取系统配置。Step 5: The concentrator agent accesses the management center agent to register and obtain the system configuration when it is started for the first time.

进一步的,所述基本系统参数包括分配给该节点发起数据上传的时间点以及间隔。Further, the basic system parameters include a time point and an interval allocated to the node to initiate data uploading.

一种基于多Agent构建的Ad hoc网络水表集抄系统的多Agent间通信协调方法,包括以下步骤:A multi-agent communication coordination method for an Ad hoc network water meter centralized reading system constructed based on multiple agents, comprising the following steps:

步骤1:采集器Agent以入网时确定的上传时间点为基准,按照确定的时间间隔向集中器Agent上传数据;Step 1: The collector agent uploads data to the concentrator agent according to the determined time interval based on the upload time point determined when accessing the network;

步骤2:集中器Agent将采集器Agent传来的数据缓存在本地存储中;Step 2: The concentrator agent caches the data sent by the collector agent in the local storage;

步骤3:集中器Agent对管理中心Agent发送通信请求;Step 3: The concentrator Agent sends a communication request to the management center Agent;

步骤4:管理中心Agent在收到集中器Agent的请求时,会检查任务队列中是否有未指派给该Agent的任务;如果有,则在响应中下发相应的任务;Step 4: When the management center agent receives the request of the concentrator agent, it will check whether there is a task not assigned to the agent in the task queue; if there is, it will issue the corresponding task in the response;

步骤5:集中器Agent在接收到任务时,会主动联系实际应执行该任务的采集器Agent节点,下达任务。Step 5: When the concentrator Agent receives the task, it will actively contact the collector Agent node that should actually execute the task, and issue the task.

进一步的,所述集中器Agent与管理中心Agent间的通信有实时与非实时两种模式;在实时模式下,集中器Agent在收到采集器Agent发来的数据或满足一定时间间隔时会立即发起与管理中心的通信,将数据提交给管理中心;在非实时模式下,集中器Agent仅以固定的时间间隔发起通信。Further, the communication between the concentrator Agent and the management center agent has two modes: real-time and non-real-time; in the real-time mode, the concentrator agent will immediately receive the data sent by the collector agent or meet a certain time interval. Initiate communication with the management center and submit the data to the management center; in non-real-time mode, the concentrator Agent only initiates communication at fixed time intervals.

本发明与现有技术相比具有以下有益效果:Compared with the prior art, the present invention has the following beneficial effects:

本发明为智慧水务提供基础的物联网感知层,为水务管理提供准确的水务数据,敏捷的随时获取水质等可用所有信息,实现节水和节能目标,更好的管理遍布各处的给排水设施,提升运维管理效率。The present invention provides a basic IoT perception layer for smart water affairs, provides accurate water affairs data for water affairs management, quickly obtains all available information such as water quality at any time, achieves water-saving and energy-saving goals, and better manages water supply and drainage facilities all over the place , to improve the efficiency of operation and maintenance management.

附图说明Description of drawings

图1是本发明系统示意图;Fig. 1 is the system schematic diagram of the present invention;

图2是本发明一实施例中采集器Agent结构示意图;2 is a schematic structural diagram of a collector Agent in an embodiment of the present invention;

图3是本发明一实施例中集中器Agent结构示意图;3 is a schematic structural diagram of a concentrator Agent in an embodiment of the present invention;

图4是本发明一实施例中安全模块结构示意图;4 is a schematic structural diagram of a security module in an embodiment of the present invention;

图5是本发明一实施例中多Agent间通信协调流程示意图;5 is a schematic diagram of a communication coordination flow between multiple agents in an embodiment of the present invention;

图6是本发明一实施例中地址广播方式示意图;FIG. 6 is a schematic diagram of an address broadcasting method in an embodiment of the present invention;

图7是本发明一实施例中新节点E加入已有网络示意图;7 is a schematic diagram of a new node E joining an existing network in an embodiment of the present invention;

图8是本发明一实施例中路由响应示意图。FIG. 8 is a schematic diagram of a routing response in an embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图及实施例对本发明做进一步说明。The present invention will be further described below with reference to the accompanying drawings and embodiments.

请参照图1,本发明提供一种基于多Agent构建的Ad hoc网络水表集抄系统,所述系统分为三级,包括采集器Agent,集中器Agent,管理中心Agent三种不同Agent;所述采集器Agent与水表传感器相连,实时采集水表的读数;所述集中器Agent负责管理多个采集器Agent的工作,用于对采集器Agent的数据进行汇总或对采集器下发指令控制其运行状态;所述管理中心Agent管理若干个集中器Agent节点,汇总每个集中器Agent节点的数据,并经由集中器Agent节点将命令下达给隶属其下的采集器Agent。 Referring to FIG. 1, the present invention provides an Ad hoc network water meter centralized reading system based on multi-agent construction. The system is divided into three levels, including three different agents: collector agent, concentrator agent, and management center agent; The collector Agent is connected with the water meter sensor, and collects the readings of the water meter in real time; the concentrator Agent is responsible for managing the work of multiple collector agents, and is used for summarizing the data of the collector agent or issuing instructions to the collector to control its running state The management center Agent manages several concentrator Agent nodes, summarizes the data of each concentrator Agent node, and issues commands to the collector Agent under it via the concentrator Agent node.

在本实施例中,采集器Agent与集中器Agent之间组成Ad hoc网络。虽然集中器Agent在逻辑上是若干个采集器Agent的中心节点,但是集中器Agent与采集器Agent并非必须要进行直接的通信。网络内的任何节点都可以为其他节点作为路由转发报文。采集器Agent采集的水表数据可以经由多跳传输到相应的集中器Agent,同样集中器Agent的控制指令可以通过多跳的方式下达到某一采集器Agent。In this embodiment, an Ad hoc network is formed between the collector Agent and the concentrator Agent. Although the concentrator agent is logically the central node of several collector agents, it is not necessary for the concentrator agent to communicate directly with the collector agent. Any node in the network can forward packets as a route for other nodes. The water meter data collected by the collector agent can be transmitted to the corresponding concentrator agent through multi-hop, and the control instructions of the concentrator agent can also reach a collector agent through multi-hop.

优选的,所述Ad hoc网络协议基于按需协议设计,包括四种基本报文:集中器Agent广播报文,路由请求广播报文,路由响应广播报文,路由错误报文Preferably, the Ad hoc network protocol is designed based on an on-demand protocol, and includes four basic messages: concentrator Agent broadcast message, route request broadcast message, route response broadcast message, and route error message

如表1所示为集中器Agent的广播报文格式。集中器Agent使用该类型报文向采集器Agent节点广播地址。报文的字段说明如下:Table 1 shows the broadcast message format of the concentrator Agent. The concentrator agent uses this type of message to broadcast the address to the collector agent node. The fields of the message are described as follows:

表1Table 1

Figure 222012DEST_PATH_IMAGE002
Figure 222012DEST_PATH_IMAGE002

①版本号: 当前使用协议的版本号①Version number: The version number of the currently used protocol

②类型: 报文类型②Type: message type

③TTL: 报文存活跳数。报文每经过一次路由转发,TTL-1,当TTL为0时,报文失效。③TTL: The number of hops that the packet survives. Each time a packet is forwarded by a route, the TTL is -1. When the TTL is 0, the packet is invalid.

④跳数:报文经过的跳数④ Hop count: The number of hops the packet passes through

⑤经由节点地址:广播报文当前经由节点的地址⑤ Via node address: the address of the current node via which the broadcast message is passed

⑥集中器Agent源节点地址:发出广播的集中器Agent节点地址⑥Concentrator Agent source node address: the address of the concentrator Agent node that sends out the broadcast

⑦广播序号:由信源维护的广播序号⑦Broadcast serial number: broadcast serial number maintained by the source

如表2所示为路由请求协议报文。通信中,源节点在路由表中无法查到目的节点时,向相邻节点广播路由请求报文来建立到目标转发路径。路由请求报文的字段说明如下:Table 2 shows the routing request protocol message. During communication, when the source node cannot find the destination node in the routing table, it broadcasts a routing request message to the adjacent nodes to establish a forwarding path to the destination. The fields of the routing request message are described as follows:

表2Table 2

Figure 60524DEST_PATH_IMAGE004
Figure 60524DEST_PATH_IMAGE004

①经由节点地址: 路由请求报文当前经由节点地址① Via node address: The routing request message is currently via the node address

②源节点地址: 路由请求发起节点的地址②Source node address: The address of the node that initiates the routing request

③源节点序号: 由于源节点维护的序号,表示了请求的新旧③ Source node serial number: Because of the serial number maintained by the source node, it indicates the new and old of the request

④目的节点地址: 目的节点的地址④Destination node address: The address of the destination node

⑤目的节点序号: 由目的节点维护的序号,表示响应的新旧。⑤Destination node serial number: The serial number maintained by the destination node, indicating the new and old of the response.

如表3所示为路由响应报文。 路由请求中的目的节点使用路由响应报文回应路由请求。路由请求报文的字段说明如下:Table 3 shows the route response message. The destination node in the routing request responds to the routing request with a routing response message. The fields of the routing request message are described as follows:

表3table 3

Figure 840261DEST_PATH_IMAGE006
Figure 840261DEST_PATH_IMAGE006

②经由节点地址: 路由响应报文当前经由节点地址② Via node address: The route response message is currently via the node address

③转发节点地址: 指定该报文要由哪个节点转发③ Forwarding node address: Specify which node the message is to be forwarded by

④源节点地址: 发出路由响应报文的节点的地址④Source node address: The address of the node sending the routing response message

⑤源节点序号: 由源节点维护的序号,表示响应的新旧。⑤ Source node serial number: The serial number maintained by the source node, indicating the new and old of the response.

⑥目的节点地址: 路由响应报文的目的节点地址⑥Destination node address: The destination node address of the routing response message

如表4所示为路由错误报文。路由错误报文用来向网络广播连接异常节点。路由错误报文的字段说明如下:Table 4 shows the routing error message. The route error message is used to broadcast the connection abnormal node to the network. The field descriptions of the routing error message are as follows:

表4Table 4

Figure 438732DEST_PATH_IMAGE008
Figure 438732DEST_PATH_IMAGE008

①经由节点地址: 路由错误报文当前经由节点的地址① Via node address: The address of the node that the routing error message is currently passing through

②错误节点数:报文中包含错误节点的数量②Number of error nodes: the number of error nodes contained in the message

③ 错误节点地址n: 第n个发生连接错误节点的地址③ Error node address n: the address of the nth node with a connection error

④ 错误节点序号n:出现错误时,路由表缓存里发生错误节点的序号。④ Error node sequence number n: When an error occurs, the sequence number of the error node in the routing table cache.

在本实施例中,采集器Agent与集中器Agent还具有感知网络拓扑,并决定数据发送路径的能力。集中器Agent与管理中心Agent之间的通信经由4G网络,使用HTTP协议进行。集中器Agent在提交数据请求时,会将数据提交给管理中心相应的HTTP API。In this embodiment, the collector agent and the concentrator agent also have the ability to perceive the network topology and determine the data transmission path. The communication between the concentrator Agent and the management center Agent is carried out via the 4G network using the HTTP protocol. When the concentrator agent submits a data request, it will submit the data to the corresponding HTTP API of the management center.

参考图2,在本实施例中采集器Agent包括PIC单片机,电源模块、LoRa无线通信模组、FMCOS-SE安全模块,脉冲计量传感器模块;所述PIC单片机与LoRa无线通信模组、FMCOS-SE安全模块,脉冲计量传感器模块分别连接;所述电源模块与Agent包括PIC单片机,LoRa无线通信模组、FMCOS-SE安全模块分别连接。Referring to FIG. 2, in this embodiment, the collector Agent includes a PIC microcontroller, a power supply module, a LoRa wireless communication module, an FMCOS-SE security module, and a pulse measurement sensor module; the PIC microcontroller and the LoRa wireless communication module, FMCOS-SE The security module and the pulse metering sensor module are respectively connected; the power supply module and the Agent include a PIC microcontroller, a LoRa wireless communication module, and an FMCOS-SE security module, which are respectively connected.

优选的,采集器Agent的微控制器采用Microchip公司的PIC24FJ128GA308 16位低功耗微控制器。该硬件模块负责传感器数据读取,控制信号的输出,数据的存储以及通信。该微控制器具有16x16硬件乘法器以及32x16硬件除法器,有利于水表数据的处理。同时该微控制器睡眠时电流功耗为400nA,可以在电池供电下长期运行。Preferably, the microcontroller of the collector Agent is a PIC24FJ128GA308 16-bit low-power microcontroller from Microchip. The hardware module is responsible for sensor data reading, control signal output, data storage and communication. The microcontroller has a 16x16 hardware multiplier and a 32x16 hardware divider, which facilitates the processing of water meter data. At the same time, the current consumption of the microcontroller during sleep is 400nA, and it can run for a long time under battery power.

电源切换电路支持直流电源与干电池两路分别供电。在直流电源与电池同时接入时,优先选择直流电源供电。存储模块与无线通信模块分别由两个单独的HT7333低压差线性稳压器提供3.3V电源输入。控制电路的通断经由一个MOS场效应管开关控制。The power switching circuit supports the DC power supply and the dry battery to supply power separately. When the DC power supply and the battery are connected at the same time, the DC power supply is preferred. The storage module and wireless communication module are provided with 3.3V power input by two separate HT7333 low dropout linear regulators. The on-off of the control circuit is controlled by a MOS field effect transistor switch.

LoRa无线通信模组使用Semtech 公司的SX1278 LoRa无线模块。该模块是一种长距离低功耗无线通信模块,采用扩频技术,具有通信距离远,接收灵敏度高,功耗低的特点。休眠时典型电流功耗为0.2uA,接收时典型电流功耗为10mA,在使用7dm发射功率传输时,典型电流功耗为2mA。在城市中最大传输距离约为3千米,适合远距离低功耗数据传输。The LoRa wireless communication module uses Semtech's SX1278 LoRa wireless module. This module is a long-distance low-power wireless communication module. It adopts spread spectrum technology and has the characteristics of long communication distance, high receiving sensitivity and low power consumption. The typical current consumption is 0.2uA when sleeping, 10mA when receiving, and 2mA when transmitting with 7dm transmit power. The maximum transmission distance in the city is about 3 kilometers, which is suitable for long-distance low-power data transmission.

FMCOS-SE 安全模块是基于 FM1280 芯片开发的安全模块,采用 ARM 32 位安全CPU,同时搭载了专用的操作系统。FMSE安全模块对水表相关一些敏感数据如用户密码、用户 ID、卡片鉴权数据、阶梯水价、水表读数、阀控状况、设备根密钥等数据进行加密,使用的加密算法是FMSE支持的SM4安全加密算法。FMCOS-SE security module is a security module developed based on FM1280 chip, using ARM 32-bit security CPU, and equipped with a dedicated operating system. The FMSE security module encrypts some sensitive data related to the water meter, such as user password, user ID, card authentication data, stepped water price, water meter reading, valve control status, device root key and other data. The encryption algorithm used is SM4 security supported by FMSE. Encryption Algorithm.

参考图3,在本实施例中,所述集中器Agent硬件主要基于S3C6410开发板,发板分别使用SPI接口和USB接口无线通信模块与4G通信模块相连。集中器Agent通过LoRa无线模组获得采集器Agent的传输过来的经过FMCOS-SE加密的系统信息、水表信息、阀门等,并通过4G通信模块上传到服务器。由服务器完成对数据的加解密操作。Referring to FIG. 3 , in this embodiment, the concentrator Agent hardware is mainly based on the S3C6410 development board, and the development board is connected to the 4G communication module using the SPI interface and the USB interface wireless communication module respectively. The concentrator Agent obtains the FMCOS-SE encrypted system information, water meter information, valves, etc. transmitted by the collector Agent through the LoRa wireless module, and uploads it to the server through the 4G communication module. Encryption and decryption of data is performed by the server.

优选的,本实施中,集中器Agent处理器使用三星S3C6410处理器。是一种基于ARM1176JZF-S的核心,包含有16KB的指令数据缓存和16KB的指令数据TCM。集中器Agent板上的供电由直流电源提供。Preferably, in this implementation, the concentrator Agent processor uses Samsung S3C6410 processor. It is a core based on ARM1176JZF-S, including 16KB instruction data cache and 16KB instruction data TCM. The power supply on the agent board of the concentrator is provided by the DC power supply.

本实施中,集中器Agent采用U8300C 4G 无线模块,适用于FDD-LTE/TDD-LTE/TD-SCDMA/UMTS/EVDO/EDGE/GPRS/GSM/CDMA 多种网络制式和GPS 定位服务的无线终端产品,在FDD-LTE 网路下,U8300C 接入速度下行可达100Mbps,上行可达50Mbps,在TDD-LTE 网络下,U8300C接入速度下行可达61Mbps,上行可达18Mbps,在没有LTE 网络覆盖的情况下,U8300C还可以通过TD-SCDMA 接入,速率可达下行4.2Mbps 和上行2.2Mbps,通过UMTS 接入,速率可达下行42Mbps 和上行5.76Mbps,通过EVDO 接入,速率可达下行14.7 Mbps和上行5.4Mbps ,EGDE 接入速率可达237kbps,GPRS 接入速率可达85.6kbps。GPS可支持55 通道,跟踪导航接收灵敏度达到-161dBm,冷启动时间32S 内,热启动时间1S 以内。U8300C 在提供高速数据接入和GPS 定位服务的同时,可提供短信、通讯簿等功能,可广泛应用于移动宽带接入、视频监控、手持终端、车载设备等产品。系统采用ARM嵌入式系统S3C6410的串口UART完成对U8300C 4G模组的控制。通过S3C6410 GPIO管脚驱动三极管S8050对4G模组进行复位操作。集中器Agent 通过U8300C 4G 无线模块把用户信息、信道信息、水表表盘数据、阀门控制数据等相关数据远传到后台数据库,实现多台集中器Agent的集中管理和监测。In this implementation, the concentrator Agent adopts U8300C 4G wireless module, which is suitable for wireless terminal products of FDD-LTE/TDD-LTE/TD-SCDMA/UMTS/EVDO/EDGE/GPRS/GSM/CDMA various network standards and GPS positioning services , Under the FDD-LTE network, the access speed of U8300C can reach 100Mbps downlink and 50Mbps uplink. Under the TDD-LTE network, the access speed of U8300C can reach 61Mbps downlink and 18Mbps uplink. In this case, U8300C can also be accessed through TD-SCDMA, with a rate of 4.2Mbps downlink and 2.2Mbps uplink, through UMTS access, the rate can reach 42Mbps downlink and 5.76Mbps uplink, and through EVDO access, the rate can reach 14.7Mbps downlink And uplink 5.4Mbps, EGDE access rate can reach 237kbps, GPRS access rate can reach 85.6kbps. GPS can support 55 channels, the tracking and navigation receiving sensitivity reaches -161dBm, the cold start time is within 32S, and the hot start time is within 1S. While providing high-speed data access and GPS positioning services, U8300C can provide functions such as SMS and address book, and can be widely used in mobile broadband access, video surveillance, handheld terminals, vehicle-mounted equipment and other products. The system uses the serial port UART of the ARM embedded system S3C6410 to complete the control of the U8300C 4G module. The 4G module is reset by driving the transistor S8050 through the S3C6410 GPIO pin. The concentrator Agent transmits user information, channel information, water meter dial data, valve control data and other related data to the background database through the U8300C 4G wireless module to realize the centralized management and monitoring of multiple concentrator agents.

在本实施例中,根据LoRa硬件上的特点与实际应用场景,设计了采集器Agent与集中器Agent之间的通信协议。采集器Agent、集中器Agent与服务器/手持终端之间的通信以数据包形式进行交互。一个完整的命令包由起始标识单元、包长、命令1、命令2、命令3、命令单元及校验单元结束符组成,见表5In this embodiment, according to the characteristics of LoRa hardware and the actual application scenario, the communication protocol between the collector Agent and the concentrator Agent is designed. The communication between the collector Agent, the concentrator Agent and the server/handheld terminal is in the form of data packets. A complete command packet consists of the start identification unit, packet length, command 1, command 2, command 3, command unit and check unit terminator, see Table 5

表格 1 服务器、集中器、采集器信息交互命令包通用格式Table 1 General format of server, concentrator and collector information exchange command package

Figure 174476DEST_PATH_IMAGE010
Figure 174476DEST_PATH_IMAGE010

命令1command 1

代表源端设备 53H(V)代表服务器端On behalf of the source device 53H (V) on behalf of the server

57H(W)代表手持终端/蓝牙 57H(W) stands for Handheld Terminal/Bluetooth

55H(U)代表串口调试器 55H (U) stands for serial debugger

52H(R)代表采集器 52H(R) stands for collector

4DH(M)代表集中器 4DH(M) stands for Concentrator

命令2command 2

代表终端设备 53H(V)代表服务器端On behalf of the terminal equipment 53H (V) on behalf of the server side

57H(W)代表手持终端/蓝牙 57H(W) stands for Handheld Terminal/Bluetooth

55H(U)代表串口调试器 55H (U) stands for serial debugger

52H(R)代表采集器 52H(R) stands for collector

4DH(M)代表集中器 4DH(M) stands for Concentrator

命令3Command 3

该命令包括查询采集器Agent信息、串口设置、水表信息和阀门信息设置、Ad-Hoc网络频道类型和频率设置等多达100条命令。This command includes up to 100 commands including querying the collector agent information, serial port setting, water meter information and valve information setting, Ad-Hoc network channel type and frequency setting.

校验单元Check unit

a)对协议中的“命令数据”进行校验。从“命令1”的第1个字节到数据区最后一个字节;a) Check the "command data" in the protocol. From the first byte of "command 1" to the last byte of the data area;

b)采用16位的CRC校验多项式x16+x2+1(0x8005),生成2字节的CRC校验和(高字节在后,低字节在前);b) Using a 16-bit CRC check polynomial x 16 +x 2 +1 (0x8005), generate a 2-byte CRC checksum (high byte in the back, low byte in the front);

c)发送方应根据“命令单元”生成两字节的CRC校验和,接收方收到完整的数据包后,根据“命令单元”生成新的CRC检验和;c) The sender shall generate a two-byte CRC checksum according to the "command unit", and the receiver shall generate a new CRC checksum according to the "command unit" after receiving the complete data packet;

d)新的CRC校验和与收到的校验和相等,说明该数据包有效。d) The new CRC checksum is equal to the received checksum, indicating that the packet is valid.

参考图4,在本实施例中安全模块是基于ISO7816规范要求而设计的专用安全加密芯片,支持表具实现对敏感数据的安全保护;安全模块中含有水表应用,应用目录为MF,如下图为采集器Agent和集中器Agent安全模块文件结构。Referring to Figure 4, in this embodiment, the security module is a dedicated security encryption chip designed based on the requirements of the ISO7816 specification, which supports the meter to realize the security protection of sensitive data; the security module contains a water meter application, and the application directory is MF. The file structure of the security module of the agent agent and the concentrator agent.

在本实施中,还提供一种基于多Agent构建的Ad hoc网络水表集抄系统的多Agent网络的组建方法,包括以下步骤:In this implementation, a method for forming a multi-Agent network of an Ad hoc network water meter centralized reading system based on a multi-Agent construction is also provided, comprising the following steps:

步骤1:未入网的集中器Agent主动向集中器Agent发起入网请求;Step 1: The concentrator Agent that is not connected to the network actively initiates a network access request to the concentrator Agent;

步骤2:请求直接到达集中器节点或是经由网络中多个节点路由到达集中器Agent;Step 2: The request reaches the concentrator node directly or routes to the concentrator agent through multiple nodes in the network;

步骤3:集中器Agent在确认入网请求后,对其下发基本系统参数;Step 3: After confirming the network access request, the concentrator Agent sends basic system parameters to it;

步骤4:采集器Agent在收到系统基本参数后,将更新自身节点的配置,并对集中器做出响应,完成入网;Step 4: After receiving the basic parameters of the system, the collector Agent will update the configuration of its own node, respond to the concentrator, and complete the network access;

步骤5:集中器Agent在首次启动时接入管理中心Agent进行注册并获取系统配置。Step 5: The concentrator agent accesses the management center agent to register and obtain the system configuration when it is started for the first time.

优选的,所述基本系统参数包括分配给该节点发起数据上传的时间点以及间隔。不同的上传时间点用于避免多个采集器Agent同时发起上传导致网络拥塞,不同的时间间隔影响数据的实时性与功耗。数据上传的时间间隔越短,数据的实时性越好,但是通信频率越高,平均功耗越高,电池使用寿命也就越短;相反,数据上传的时间间隔越长,数据的实时性越差,但平均功耗越低,电池寿命越长。Preferably, the basic system parameters include a time point and an interval allocated to the node to initiate data uploading. Different upload time points are used to avoid network congestion caused by simultaneous uploading by multiple collector agents, and different time intervals affect the real-time performance and power consumption of data. The shorter the data upload time interval, the better the real-time performance of the data, but the higher the communication frequency, the higher the average power consumption, and the shorter the battery life; on the contrary, the longer the data upload time interval, the more real-time data. Poor, but the lower the average power consumption, the longer the battery life.

参考图5,在本实施中,还提供一种基于多Agent构建的Ad hoc网络水表集抄系统的多Agent间通信协调方法,包括以下步骤:Referring to FIG. 5, in this implementation, a multi-agent communication coordination method based on an Ad hoc network water meter centralized reading system constructed by multiple agents is also provided, including the following steps:

步骤1:采集器Agent以入网时确定的上传时间点为基准,按照确定的时间间隔向集中器Agent上传数据;Step 1: The collector agent uploads data to the concentrator agent according to the determined time interval based on the upload time point determined when accessing the network;

步骤2:集中器Agent将采集器Agent传来的数据缓存在本地存储中;Step 2: The concentrator agent caches the data sent by the collector agent in the local storage;

步骤3:集中器Agent对管理中心Agent发送通信请求;Step 3: The concentrator Agent sends a communication request to the management center Agent;

步骤4:管理中心Agent在收到集中器Agent的请求时,会检查任务队列中是否有未指派给该Agent的任务;如果有,则在响应中下发相应的任务;Step 4: When the management center agent receives the request of the concentrator agent, it will check whether there is a task not assigned to the agent in the task queue; if there is, it will issue the corresponding task in the response;

步骤5:集中器Agent在接收到任务时,会主动联系实际应执行该任务的采集器Agent节点,下达任务。Step 5: When the concentrator Agent receives the task, it will actively contact the collector Agent node that should actually execute the task, and issue the task.

优选的,所述集中器Agent与管理中心Agent间的通信有实时与非实时两种模式;在实时模式下,集中器Agent在收到采集器Agent发来的数据或满足一定时间间隔时会立即发起与管理中心的通信,将数据提交给管理中心;在非实时模式下,集中器Agent仅以固定的时间间隔发起通信。Preferably, the communication between the agent of the concentrator and the agent of the management center has two modes of real-time and non-real-time; in the real-time mode, the agent of the concentrator will immediately receive the data sent by the agent of the collector or meet a certain time interval. Initiate communication with the management center and submit the data to the management center; in non-real-time mode, the concentrator Agent only initiates communication at fixed time intervals.

在本实施例中,每个节点都维护一张如表6所示的路由表。路由表中包含了到达一个节点所要经过的下一个节点地址以及到达该节点所需的跳数。序号字段代表了这条数据的新旧程度,主要用于路由更新与环路避免。一个节点发现到达其他节点的路由的方式有地址广播、被动获取、按需请求三种。其中地址广播方式方式只能由集中器Agent发起,主要用于网路建立初期将自己的路由传达给网络内可达的节点。在使用地址广播时,集中器Agent会向相邻节点广播自己的地址,收到广播的节点会更新自己的路由表,并将广播包报文转发给它的相邻节点,以泛洪的形式将集中器Agent的路由信息传达给网络内所有可达节点。完成地址广播之后,网络建立时的初期节点都将建立一个到达集中器Agent节点的路由条目。被动获取方式指的是在通信过程中节点反向获取到达某个节点的路由。假设一个新入网的采集器Agent节点A使用按需请求的方式获得了到达集中器Agent节点C的路由,而此时节点C不知道节点A的路由。当节点A经由节点B路由向节点C发送数据报文时,节点C会将节点B加入通往A节点的路由条目。任意节点在将数据发往一个路由表中没有记录的节点前,会使用按需请求的方式来向相邻节点请求到达目标的路由。这种方式通常用于新入网节点向集中器Agent发起通信以及某个节点发生网络故障不可达,其他节点需要更新路由表的情况。下文将就地址广播方式以及按需请求方式详细步骤进行描述。In this embodiment, each node maintains a routing table as shown in Table 6. The routing table contains the address of the next node to pass through to reach a node and the number of hops required to reach the node. The serial number field represents the newness of the data, and is mainly used for route update and loop avoidance. There are three ways for a node to discover routes to other nodes: address broadcast, passive acquisition, and on-demand request. Among them, the address broadcast mode can only be initiated by the concentrator Agent, which is mainly used to convey its own route to the reachable nodes in the network in the early stage of network establishment. When using address broadcast, the concentrator Agent will broadcast its own address to adjacent nodes, and the node receiving the broadcast will update its routing table and forward the broadcast packet to its adjacent nodes in the form of flooding The routing information of the concentrator Agent is communicated to all reachable nodes in the network. After the address broadcast is completed, the initial node when the network is established will establish a routing entry to reach the concentrator Agent node. Passive acquisition means that a node acquires a route to a node in the reverse direction during the communication process. Suppose a new collector Agent node A obtains the route to the concentrator Agent node C by requesting on demand, but at this time, node C does not know the route of node A. When node A sends a data packet to node C via node B routing, node C adds node B to the routing entry leading to node A. Before any node sends data to a node that is not recorded in the routing table, it will use the request-on-demand method to request the route to the destination from the adjacent node. This method is usually used when a new network node initiates communication with the concentrator agent and a node is unreachable due to a network failure, and other nodes need to update the routing table. The detailed steps of the address broadcast mode and the on-demand request mode will be described below.

表6Table 6

目的节点地址destination node address 下一跳地址next hop address 跳数Hop count 目的节点序号destination node number 0x000000010x00000001 0x000000040x00000004 33 33

1.1.1 地址广播方式1.1.1 Address broadcast mode

(1) 广播发起(1) Broadcast initiation

集中器Agent发起的广播报文中包含<经由地址,源地址,源序号>三要素。其中,经由地址与源地址填入集中器Agent的地址,源序号填入由发起广播的集中器维护的一组递增的序号,用以标识广播报文的新旧。根据需要广播的规模填入TTL,并将跳数置0。The broadcast message initiated by the concentrator Agent contains three elements of <via address, source address, source sequence number>. The address of the concentrator Agent is filled in via the address and the source address, and the source serial number is filled in a group of incremental serial numbers maintained by the concentrator that initiates the broadcast to identify the new and old of the broadcast message. Fill in the TTL according to the scale of the broadcast, and set the hop count to 0.

(2) 广播接收(2) Broadcast reception

相邻节点接收到集中器Agent广播报文后,先检查TTL是否大于0, 若大于0,则继续检查广播报文中的集中器Agent节点地址与自己所隶属的集中器地址是否相等。若相等,则检查路由表中是否已有通往该集中器节点的路由。如果路由表满足以下条件之一: ①不包含该节点的路由 ②路由表中该节点的序号小于报文中的序号 ③路由表中该节点的序号等于报文中的序号,且跳数大于报文中的跳数,则更新路由表,并转发该报文。After the adjacent node receives the concentrator Agent broadcast message, it first checks whether the TTL is greater than 0. If it is greater than 0, it continues to check whether the concentrator Agent node address in the broadcast message is equal to the address of the concentrator to which it belongs. If they are equal, check whether there is a route to the concentrator node in the routing table. If the routing table satisfies one of the following conditions: ① It does not contain the route of the node ② The sequence number of the node in the routing table is smaller than the sequence number in the packet ③ The sequence number of the node in the routing table is equal to the sequence number in the packet, and the hop count is greater than that in the packet If the number of hops in the message is reached, the routing table is updated and the message is forwarded.

(3) 路由表更新:(3) Routing table update:

将收到报文中的源节点地址与源节点序号分别填入目的节点地址与目的节点序号字段,将报文中经由节点字段填入下一跳地址字段,将报文中跳数加一,填入跳数字段。Fill the source node address and source node serial number in the received message into the destination node address and destination node serial number fields respectively, fill in the next hop address field in the message via the node field, and add one hop count in the message, Fill in the Jump Number field.

(4) 报文转发:(4) Message forwarding:

转发报文时,将节点的地址填入经由节点字段,并将TTL减去1, 跳数加上1。When forwarding a packet, fill in the address of the node into the via node field, subtract 1 from the TTL, and add 1 to the hop count.

如图6所示,其中实心节点为集中器Agent,地址为D,空心节点为采集器Agent,地址分别为A,B,C。以实线直接相连的节点为相邻可达节点。如图中A,B,C三个节点相邻,C与D相邻,而A,B与D不相邻。由集中器Agent节点D发起地址广播,广播的序号为1。图中箭头表示的是地址广播的传播路径,图中省略了A,B发出的地址广播。当广播传达到网络中所有可达节点时,每个节点都在路由表中缓存了到达D的下一跳路径。其中C节点可以直接将数据传输给D节点,而A,B两个节点则会将数据交给C节点,由C节点转交给D节点。广播完成后,D节点并不知道其他节点的存在,只有当其他节点向D节点发起通信时,D节点才能用被动获取的方式建立反向路由。As shown in Figure 6, the solid node is the concentrator Agent, and the address is D, and the hollow node is the collector agent, and the addresses are A, B, and C, respectively. Nodes directly connected by solid lines are adjacent reachable nodes. In the figure, the three nodes A, B, and C are adjacent, C and D are adjacent, and A, B and D are not adjacent. The address broadcast is initiated by the concentrator Agent node D, and the broadcast sequence number is 1. The arrow in the figure represents the propagation path of the address broadcast, and the address broadcast sent by A and B is omitted in the figure. When the broadcast is communicated to all reachable nodes in the network, each node caches the next-hop path to D in the routing table. The C node can directly transmit the data to the D node, while the A and B nodes will transfer the data to the C node, and the C node transfers it to the D node. After the broadcast is completed, node D does not know the existence of other nodes. Only when other nodes initiate communication to node D, node D can establish a reverse route by passive acquisition.

在本实施例中,按需请求方式,具体包括如下:In this embodiment, the on-demand request mode specifically includes the following:

(1) 发起路由请求(1) Initiate a routing request

路由请求报文包含<经由节点地址,源节点地址,源节点序号,目的节点地址,目的节点序号>五要素。发起路由请求的节点将本节点的地址填入源节点地址与经由节点地址字段,将目的节点地址填入目的节点地址字段,将该节点维护的自增序号填入源节点序号字段。目的节点字段填入已知的目的节点最新序号。若目的节点从未被该节点发现,则填入-1。The routing request message contains five elements of <via node address, source node address, source node sequence number, destination node address, destination node sequence number>. The node that initiates the routing request fills in the source node address and via node address fields with the address of this node, the destination node address in the destination node address field, and the self-incrementing sequence number maintained by the node in the source node sequence number field. The destination node field is filled with the latest sequence number of the known destination node. If the destination node has never been found by this node, fill in -1.

(2) 对路由请求的处理(2) Processing of routing requests

收到路由请求报文的节点先判断该报文的TTL是否为0,若不为0,继续判断该报文是否由本节点发出;若不是,则检查一定时间内是否收到过包含相同<源节点地址,源节点序号>的请求,若没有则检查该节点路由表内是否有序号大于报文中目的节点序号的记录,若有,则发出路由响应报文,若没有则启动定时器,并在路由表中建立一条以报文中源节点作为目的节点的路由记录,将经由节点地址填入下一跳地址字段,将报文中跳数字段加1,填入跳数字段,将源节点序号填入目的节点序号字段。完成路由表后,节点将自身的序号填入收到报文的经由节点字段,将TTL减去1,跳数加上1之后转发报文。The node that receives the routing request message first judges whether the TTL of the message is 0. If it is not 0, it continues to judge whether the message is sent by this node; Node address, source node sequence number> request, if not, check whether there is a record in the node routing table with the sequence number greater than the destination node sequence number in the message, if so, send a routing response message, if not, start the timer, and Create a routing record in the routing table with the source node in the packet as the destination node, fill in the next hop address field with the via node address, add 1 to the hop number field in the packet, fill in the hop number field, and set the source node The serial number is filled in the serial number field of the destination node. After completing the routing table, the node fills its own sequence number into the via node field of the received message, subtracts 1 from the TTL, adds 1 to the hop count, and forwards the message.

(3) 发起路由响应(3) Initiate a routing response

节点收到有效路由请求报文时,若该节点为请求的目的或该节点路由表中有请求节点的路由记录,并且记录中节点序号大于请求报文中序号,则发出路由响应报文。发出响应的节点将请求报文中的目的地址、序号填入路由响应报文中的源节点地址与序号字段,将节点自身的地址填入经由节点地址字段,跳数填入跳数字段,将路由请求报文的发起节点地址填入目的节点地址字段,经由节点地址填入转发节点字段,将源节点地址填入目的节点地址字段并重置TTL值。When a node receives a valid routing request message, if the node is the destination of the request or there is a routing record of the requesting node in the routing table of the node, and the node serial number in the record is greater than the serial number in the request message, it will send a routing response message. The node that sends the response fills the destination address and sequence number in the request message into the source node address and sequence number fields in the routing response message, fills in the node's own address in the via node address field, and fills in the hop count into the hop number field. The originating node address of the routing request message is filled in the destination node address field, the via node address is filled in the forwarding node field, the source node address is filled in the destination node address field, and the TTL value is reset.

(4) 对路由响应的处理(4) Processing of routing responses

收到路由响应报文的节点检查报文中的TTL值是否为0,若不为0,继续检查当前节点与报文中的目的节点是否相符。若相符,并且报文中源节点的序号大于路由表中该节点的序号,则将响应报文中的源节点地址、源节点序号、经由节点地址分别更新进路由表的目的节点地址、目的节点序号、下一跳地址字段, 并将跳数加1,填入跳数字段。若收到的报文的目的节点地址与当前节点地址不相符,则检查节点自身的地址与报文中的转发节点字段是否相符,如果相符,则更新路由表,并将路由表中符合目的地址路由项的下一跳节点地址填入转发节点地址字段,将自身地址填入经由节点字段,并将跳数与TTL减去1,然后转发该响应报文。The node that receives the routing response message checks whether the TTL value in the message is 0. If it is not 0, it continues to check whether the current node matches the destination node in the message. If it matches, and the sequence number of the source node in the message is greater than the sequence number of the node in the routing table, the source node address, source node sequence number, and via node address in the response message are respectively updated into the destination node address and destination node of the routing table. Serial number, next hop address field, and add 1 to the hop number to fill in the hop number field. If the destination node address of the received message does not match the current node address, check whether the node's own address matches the forwarding node field in the message. If it matches, update the routing table and match the destination address in the routing table. The next hop node address of the routing item is filled in the forwarding node address field, the self address is filled in the via node field, the hop count and the TTL are subtracted by 1, and then the response message is forwarded.

如图7所示为新节点E加入已有网络。其中A,B,C,D为已有的Agent网络中的节点。经由一定时间的运行,A,B,C,D均已习得到达网络中其他节点的下一跳路由。图中仅列出与E直接相连的A,B节点的路由表。E节点向相邻节点广播对节点D的路由请求。由于E节点对D节点一无所知,所以发出的请求报文中的目的节点序号为-1。As shown in Figure 7, the new node E joins the existing network. Among them, A, B, C, D are the nodes in the existing Agent network. After a certain period of operation, A, B, C, and D have all learned the next hop routes to other nodes in the network. In the figure, only the routing tables of nodes A and B directly connected to E are listed. Node E broadcasts a routing request for Node D to neighboring nodes. Since node E does not know anything about node D, the sequence number of the destination node in the sent request message is -1.

如图8所示,由于A与B的路由表中都有到达D的路由条目,且序号都大于-1,所以A与B都会对E发起路由响应。由于A,B路由表中到达D的跳数都是2,且路由表中保存的最后已知的D节点需要也相同,所以节点E会将先到达的响应报文中的信息更新进路由表,忽略后到达的报文中的信息。As shown in Figure 8, since both the routing tables of A and B have routing entries reaching D, and the sequence numbers are both greater than -1, both A and B will initiate routing responses to E. Since the number of hops to reach D in the routing tables of A and B is 2, and the last known node D stored in the routing table needs to be the same, node E will update the information in the response packet that arrives first into the routing table , ignoring information in later arriving packets.

以上所述仅为本发明的较佳实施例,凡依本发明申请专利范围所做的均等变化与修饰,皆应属本发明的涵盖范围。The above descriptions are only preferred embodiments of the present invention, and all equivalent changes and modifications made according to the scope of the patent application of the present invention shall fall within the scope of the present invention.

Claims (10)

1. A system for centralized reading of Ad hoc network water meters constructed based on multiple agents is characterized by being divided into three levels, wherein the system comprises three different agents, namely a collector Agent, a concentrator Agent and a management center Agent; the collector Agent is connected with the water meter sensor and collects the reading of the water meter in real time; the concentrator Agent is responsible for managing the work of a plurality of collector agents and is used for summarizing the data of the collector agents or issuing instructions to the collectors to control the running state of the collectors; the management center Agent manages a plurality of concentrator Agent nodes, collects data of each concentrator Agent node, and issues commands to the collector agents under the concentrator Agent nodes.
2. The Ad hoc network water meter centralized meter reading system constructed based on multiple agents according to claim 1, wherein an Ad hoc network is formed between the concentrator Agent and a plurality of collector agents managed by the concentrator Agent, and any node in the network can forward messages as a route for other nodes.
3. The Ad hoc network water meter centralized meter reading system constructed based on multiple agents according to claim 2, wherein the Ad hoc network protocol is designed based on an on-demand protocol, and comprises four basic messages: the concentrator Agent broadcasts messages, routing request broadcast messages, routing response broadcast messages and routing error messages.
4. The Ad hoc network water meter centralized meter reading system constructed based on multiple agents according to claim 1, wherein a sensing network topology is further provided between the concentrator Agent and a plurality of collector agents managed by the concentrator Agent, and the ability of determining a data transmission path is determined.
5. The Ad hoc network water meter centralized meter reading system constructed based on multiple agents according to claim 1, wherein the collector Agent comprises a PIC single chip microcomputer, a power module, a LoRa wireless communication module, a FMCOS-SE safety module and a pulse metering sensor module; the PIC singlechip is connected with the LoRa wireless communication module, the FMCOS-SE safety module and the pulse metering sensor module respectively; the power module and the Agent comprise a PIC single chip microcomputer, and the LoRa wireless communication module and the FMCOS-SE safety module are respectively connected.
6. The Ad hoc network water meter centralized meter reading system constructed based on multiple agents according to claim 1, wherein the concentrator Agent comprises a mainboard module, a LoRa wireless communication module, a 4G communication module, a power module and a FMCOS-SE security module; the main board module is respectively connected with the LoRa wireless communication module, the 4G communication module and the FMCOS-SE safety module; the power module is connected with the main board module, the LoRa wireless communication module and the 4G communication module respectively.
7. A multi-Agent network construction method of an Ad hoc network water meter centralized reading system based on multi-Agent construction is characterized by comprising the following steps:
step 1: the concentrator Agent which is not accessed to the network actively initiates a network access request to the concentrator Agent;
step 2: the request directly reaches the concentrator node or reaches the concentrator Agent through a plurality of node routes in the network;
and step 3: after confirming the network access request, the concentrator Agent issues basic system parameters to the network access request;
and 4, step 4: after receiving the basic parameters of the system, the collector Agent updates the configuration of the node per se, responds to the concentrator and completes network access;
and 5: the concentrator Agent is accessed to the management center Agent for registration and system configuration acquisition when the concentrator Agent is started for the first time.
8. The method for establishing the multi-Agent network of the Ad hoc network water meter centralized meter reading system based on the multi-Agent construction of claim 7, wherein the basic system parameters comprise time points and intervals allocated to the nodes to initiate data uploading.
9. A multi-Agent communication coordination method of an Ad hoc network water meter centralized reading system constructed based on multiple agents is characterized by comprising the following steps:
step 1: the collector Agent uploads data to the concentrator Agent according to a determined time interval by taking an uploading time point determined during network access as a reference;
step 2: the concentrator Agent caches the data transmitted by the collector Agent in a local storage;
and step 3: the concentrator Agent sends a communication request to the management center Agent;
and 4, step 4: when receiving a request of a concentrator Agent, a management center Agent checks whether a task which is not assigned to the Agent exists in a task queue; if yes, issuing corresponding tasks in the response;
and 5: when receiving the task, the concentrator Agent actively contacts the collector Agent node which actually executes the task and issues the task.
10. The method for coordinating communication among the agents of the Ad hoc network water meter centralized reading system constructed based on the agents as claimed in claim 9, wherein the communication between the concentrator Agent and the Agent of the management center has two modes of real time and non-real time; in a real-time mode, the concentrator Agent immediately initiates communication with the management center when receiving data sent by the collector Agent or meeting a certain time interval, and submits the data to the management center; in non-real time mode, the concentrator Agent initiates communication only at fixed time intervals.
CN202011453758.2A 2020-12-12 2020-12-12 Ad hoc network water meter centralized reading system and method based on multi-agent construction Active CN114627633B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011453758.2A CN114627633B (en) 2020-12-12 2020-12-12 Ad hoc network water meter centralized reading system and method based on multi-agent construction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011453758.2A CN114627633B (en) 2020-12-12 2020-12-12 Ad hoc network water meter centralized reading system and method based on multi-agent construction

Publications (2)

Publication Number Publication Date
CN114627633A true CN114627633A (en) 2022-06-14
CN114627633B CN114627633B (en) 2024-07-12

Family

ID=81895415

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011453758.2A Active CN114627633B (en) 2020-12-12 2020-12-12 Ad hoc network water meter centralized reading system and method based on multi-agent construction

Country Status (1)

Country Link
CN (1) CN114627633B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115392904A (en) * 2022-08-24 2022-11-25 广州市兆基仪表仪器制造有限公司 Centralized meter reading management method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001087279A2 (en) * 2000-05-15 2001-11-22 Smartsynch Ltd. Self-organizing network architecture
CN103337142A (en) * 2013-07-22 2013-10-02 长沙威胜信息技术有限公司 Wireless networking method for electric energy meter management system
CN106249073A (en) * 2016-07-18 2016-12-21 湖南长高思瑞自动化有限公司 Distribution network failure based on LoRa communication technology instruction system
CN206610423U (en) * 2016-12-30 2017-11-03 智恒科技股份有限公司 Secondary groups net wireless long-distance meter-reading system
CN107396418A (en) * 2017-07-10 2017-11-24 西安电子科技大学 The implementation method of non-stop layer self-organizing network based on LoRa
CN108151890A (en) * 2017-08-24 2018-06-12 广州莲雾科技有限公司 A kind of bus duct temperature collecting device based on LoRa and Contiki systems
CN110349397A (en) * 2019-08-06 2019-10-18 陕西科技大学 A kind of rural area water meter intelligent meter data recording system based on LoRa Yu the 4G network integration
CN111432370A (en) * 2020-04-27 2020-07-17 皖西学院 Data collection method of modern farm environment control system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001087279A2 (en) * 2000-05-15 2001-11-22 Smartsynch Ltd. Self-organizing network architecture
CN103337142A (en) * 2013-07-22 2013-10-02 长沙威胜信息技术有限公司 Wireless networking method for electric energy meter management system
CN106249073A (en) * 2016-07-18 2016-12-21 湖南长高思瑞自动化有限公司 Distribution network failure based on LoRa communication technology instruction system
CN206610423U (en) * 2016-12-30 2017-11-03 智恒科技股份有限公司 Secondary groups net wireless long-distance meter-reading system
CN107396418A (en) * 2017-07-10 2017-11-24 西安电子科技大学 The implementation method of non-stop layer self-organizing network based on LoRa
CN108151890A (en) * 2017-08-24 2018-06-12 广州莲雾科技有限公司 A kind of bus duct temperature collecting device based on LoRa and Contiki systems
CN110349397A (en) * 2019-08-06 2019-10-18 陕西科技大学 A kind of rural area water meter intelligent meter data recording system based on LoRa Yu the 4G network integration
CN111432370A (en) * 2020-04-27 2020-07-17 皖西学院 Data collection method of modern farm environment control system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115392904A (en) * 2022-08-24 2022-11-25 广州市兆基仪表仪器制造有限公司 Centralized meter reading management method and system

Also Published As

Publication number Publication date
CN114627633B (en) 2024-07-12

Similar Documents

Publication Publication Date Title
CN103021154B (en) Wireless meter reading system based on Ad Hoc
CN106792973B (en) Cluster head election and rotation method in energy heterogeneous wireless sensor network
CN102480770B (en) Autonomous networking method for wireless meter-reading system of electric energy meter
CN203118198U (en) Remote meter reading system based on ZigBee wireless communication function
CN101909239A (en) Method, equipment and system for determining position information
CN104219789B (en) A kind of WSN information Perception system and methods for water level monitoring
CN103402277A (en) Greenhouse crop planting environment monitoring and control information system
CN105007587A (en) Multi-network coverage apparatus and method having network selection function
CN104967969A (en) Multi-rate anti-jamming adaptive wireless communication platform and its decision-making method
CN107018549B (en) Wireless temperature measurement sensor network for substation and its network working method
Wang et al. Research on agricultural environment information collection system based on lora
CN114627633B (en) Ad hoc network water meter centralized reading system and method based on multi-agent construction
Song et al. Research on SMAC protocol for WSN
CN103415065B (en) Transmission power control method of mobile nodes in sensor network and node apparatus
CN204759722U (en) Local communication system and concentrated system of checking meter that micropower is wireless
CN201589614U (en) Multi-carrier channel access wireless communication networked hydrological multi-parameter measuring instrument
CN104483936A (en) Wireless network information collection platform of wireless data access system
CN100407673C (en) Wireless Transmission Network System Based on Embedded Platform
CN107426633B (en) Meter reading system, communication method and communication forwarding device
CN104574896A (en) Self-organizing networking method of wireless data information collection system
Ji et al. Indoor environment remote monitoring system based on NB-IOT
CN211671724U (en) Intelligent water-saving irrigation system based on LoRa technology and based on Internet of things
CN102831762A (en) Ad hoc multi-hop network-based wireless remote meter reading system
CN103687080A (en) A Zigbee dynamic networking method
CN103259883A (en) Self-organizing low-power-consumption wireless network IP address administration method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant