WO2018153127A1 - 一种基于485分时通信的设备资源采集方法 - Google Patents

一种基于485分时通信的设备资源采集方法 Download PDF

Info

Publication number
WO2018153127A1
WO2018153127A1 PCT/CN2017/111558 CN2017111558W WO2018153127A1 WO 2018153127 A1 WO2018153127 A1 WO 2018153127A1 CN 2017111558 W CN2017111558 W CN 2017111558W WO 2018153127 A1 WO2018153127 A1 WO 2018153127A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
master device
slave device
time
slave
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.)
Ceased
Application number
PCT/CN2017/111558
Other languages
English (en)
French (fr)
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.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
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 Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Publication of WO2018153127A1 publication Critical patent/WO2018153127A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/127Avoiding congestion; Recovering from congestion by using congestion prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • H04L1/0063Single parity check
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/22Arrangements for detecting or preventing errors in the information received using redundant apparatus to increase reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40169Flexible bus arrangements
    • H04L12/40176Flexible bus arrangements involving redundancy
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/403Bus networks with centralised control, e.g. polling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • H04L67/5651Reducing the amount or size of exchanged application data

Definitions

  • the present invention relates to the field of communications, and in particular, to a device resource collection method based on 485 time-sharing communication.
  • Half-duplex 485 communication mode when applied to multiple master-slave nodes, can only send data by one node at a time. If multiple nodes send data at the same time, communication conflict will occur.
  • the traditional method of collecting resources for communication devices generally utilizes this half-duplex 485 communication method, including the following two methods:
  • the first one is to use the master device polling method.
  • the master device is always the master, the slave device is always the slave, and each time the master device initiates the communication and the slave device responds, so the communication conflict is not easy, but the master device Since the polling method is queried at a certain interval, the efficiency of collecting resources is relatively low.
  • the master device also sends an acquisition command to the slave device for resource collection. The interval between each acquisition is short, and the consumption of the MCU of the master device itself is too large, causing other tasks to be affected.
  • the second method is to use the device to report resource changes to the master device. Because it is a half-duplex 485 communication method, communication conflicts may occur, and finally the device needs to be repeatedly sent from the device to report the resource changes to the master device. The efficiency of the method is also relatively low, and it is easy to generate communication conflicts.
  • the existing method for collecting resources of a communication device by using the half-duplex 485 communication method has the following disadvantages:
  • the technical problem to be solved by the present invention is to solve the problem that the existing method for collecting resources of a communication device by using the half-duplex 485 communication method is low in efficiency and prone to communication conflict.
  • the technical solution adopted by the present invention is to provide a device resource collection method based on 485 time-sharing communication, which includes the following steps:
  • the resource data is transmitted to the master device in its time slot according to the resource acquisition request received from the device.
  • determining, according to the conflict detection method, whether the resource data sent by the slave device conflicts specifically:
  • the parity bit, the data length, the stop bit, and the data frame of the resource data sent by the slave device are sequentially detected. If all are correct, it is determined that the resource data sent by the slave device does not collide.
  • the configuration parameters of the RS485 communication interface of the master device are obtained, and parameters are configured on the RS485 communication interface of the slave device according to the configuration parameter, and the master device and the slave device respectively call each The RS485 communication interface communicates.
  • the configuration parameters include a baud rate, a data bit, a stop bit, and a parity bit.
  • the slave device when the slave device receives the resource acquisition request, compressing the current resource data, and transmitting the compressed resource data to the master device in the time slot of the slave device, The master device performs decompression.
  • the resource data received by the master device is decompressed, and the resource information table of the master device is updated by using the decompressed resource data.
  • the invention realizes that the master device and the slave device send data in respective time slots. Since the master device can send the resource acquisition request to the slave device concurrently, the slave device returns the resource data to the master device in a time-sharing manner, so that the master device pair can be completed quickly and accurately.
  • the collection of resources from the device avoids communication conflicts, has concurrency, high efficiency, security and redundancy, is easy to manage, and can meet the data collection requirements of large quantities of communication devices.
  • FIG. 1 is a flowchart of a device resource collection method based on 485 time-sharing communication according to the present invention.
  • the embodiment of the invention provides a device resource collection method based on 485 time-sharing communication, as shown in FIG. 1 , which includes the following steps:
  • S2 Obtain configuration parameters of the RS485 communication interface of the master device, and perform parameter configuration on the RS485 communication interface of the slave device according to the configuration parameter.
  • the above configuration parameters include baud rate, data bits, stop bits, and parity bits.
  • each slave device In the time slot of each slave device, call its RS485 communication interface to send resource changes. The message is sent to the master device.
  • This scheme adopts the time-sharing communication of RS485 communication interface.
  • Each slave device can call its own RS485 communication interface to send data to the master device in its respective time slot. Therefore, each slave device does not generate communication conflicts, and can be accurately and quickly The resource change message is reported to the master device, and the master device can accurately and quickly receive the resource change message of each slave device without generating a communication conflict.
  • This solution adopts the time-sharing communication of the RS485 communication interface, which enables the master device to send data in its own time slot. Since the master device can send the resource acquisition request to the slave device concurrently, the resource collection of the master device and the slave device can be completed quickly. .
  • the current resource data of the slave device is compressed according to the resource acquisition request received from the device, and the RS485 communication interface is invoked in the time slot of the slave device, and the compressed resource data is sent to the master device.
  • Determining, according to the conflict detection method, whether the resource data sent by the device conflicts specifically: sequentially detecting parity bits, data lengths, stop bits, and data frames of the resource data sent by the device, and if they are all correct, determining The resource data sent by the device does not conflict.
  • S6 Decompress the resource data received by the master device, and update the resource information table of the master device by using the decompressed resource data.
  • the invention realizes that the master device and the slave device send data in respective time slots. Since the master device can send the resource acquisition request to the slave device concurrently, the slave device returns the resource data to the master device in a time-sharing manner, so that the master device pair can be completed quickly and accurately.
  • the collection of resources from the device avoids communication conflicts, has concurrency, high efficiency, security and redundancy, is easy to manage, and can meet the data collection requirements of large quantities of communication devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Time-Division Multiplex Systems (AREA)

Abstract

本发明公开了一种基于485分时通信的设备资源采集方法,包括以下步骤:确定主设备和其通过RS485总线连接的每个从设备的时隙;在每个从设备的时隙内,发送资源变化消息给主设备;在主设备的时隙内,根据接收到的资源变化消息同时向对应的从设备返回资源获取请求;根据从设备接收到的资源获取请求,在其时隙内将资源数据发送给主设备。本发明实现了主设备和从设备在各自的时隙发送数据,由于主设备可以并发发送资源获取请求到从设备,从设备分时向主设备返回资源数据,因此可以快速准确地完成主设备对从设备的资源采集,避免了通信冲突,具有并发性、高效率、安全性和冗余性,便于管理,能满足通信设备大批量的数据采集需求。

Description

一种基于485分时通信的设备资源采集方法 技术领域
本发明涉及通信领域,具体涉及一种基于485分时通信的设备资源采集方法。
背景技术
半双工的485通信方式,应用于多个主从节点时,一次只能由一个节点发送数据,如果多个节点同时发送数据,则会出现通信冲突。传统的对通信设备进行资源采集的方法一般是利用这种半双工的485通信方式,包括以下两种方法:
第一种是采用主设备轮询的方式,主设备永远为主,从设备永远为从,每次都是由主设备发起通信,由从设备响应,如此便不容易出现通信冲突,但是主设备的轮询方式由于是间隔一定时间才去查询的,因此会导致采集资源的效率比较低。特别是当从设备没有资源变化时,主设备也会发送采集命令到从设备进行资源采集,每次采集的间隔时间较短,对主设备本身的MCU的消耗过大,导致其它任务受影响;第二种是采用从设备上报资源变化给主设备的方式,由于是半双工的485通信方式,因此会导致通信冲突,最终需要从设备重复发送多次才能将资源变化上报给主设备,这种方法效率也比较低,很容易产生通信冲突。
综上所述,现有的利用半双工的485通信方式对通信设备进行资源采集的方法存在以下缺点:
(1)采集资源的效率较低;
(2)容易产生通信冲突。
发明内容
本发明所要解决的技术问题是解决现有的利用半双工的485通信方式对通信设备进行资源采集的方法效率较低且容易产生通信冲突的问题。
为了解决上述技术问题,本发明所采用的技术方案是提供一种基于485分时通信的设备资源采集方法,包括以下步骤:
确定主设备和其通过RS485总线连接的每个从设备的时隙;
在每个从设备的时隙内,发送资源变化消息给主设备;
在主设备的时隙内,根据接收到的资源变化消息同时向对应的从设备返回资源获取请求;
根据从设备接收到的资源获取请求,在其时隙内将资源数据发送给主设备。
在上述技术方案中,根据冲突检测方法确定所述从设备发送的资源数据是否发生冲突,具体为:
依次检测所述从设备发送的资源数据的奇偶校验位、数据长度、停止位以及数据帧是否正确,若均正确,则确定所述从设备发送的资源数据未发生冲突。
在上述技术方案中,获取所述主设备的RS485通信接口的配置参数,并根据所述配置参数对所述从设备的RS485通信接口进行参数配置,所述主设备与所述从设备通过调用各自的RS485通信接口进行通信。
在上述技术方案中,所述配置参数包括波特率、数据位、停止位和奇偶校验位。
在上述技术方案中,当所述从设备接收到资源获取请求时,对当前的资源数据进行压缩,并在所述从设备的时隙内将压缩后的资源数据发送给所述主设备,由所述主设备进行解压。
在上述技术方案中,对所述主设备接收到的资源数据进行解压,并采用解压后的资源数据更新所述主设备的资源信息表。
本发明实现了主设备和从设备在各自的时隙发送数据,由于主设备可以并发发送资源获取请求到从设备,从设备分时向主设备返回资源数据,因此可以快速准确地完成主设备对从设备的资源采集,避免了通信冲突,具有并发性、高效率、安全性和冗余性,便于管理,能满足通信设备大批量的数据采集需求。
附图说明
图1为本发明中一种基于485分时通信的设备资源采集方法流程图。
具体实施方式
下面结合说明书附图和具体实施方式对本发明做出详细的说明。
本发明实施例提供了一种基于485分时通信的设备资源采集方法,如图1所示,包括以下步骤:
S1、通过RS485总线建立主设备与每个从设备的电连接,确定主设备以及每个从设备的时隙。
S2、获取主设备的RS485通信接口的配置参数,并根据配置参数对从设备的RS485通信接口进行参数配置。
上述配置参数包括波特率、数据位、停止位和奇偶校验位。
S3、在每个从设备的时隙内,调用其RS485通信接口发送资源变 化消息给主设备。
本方案采用了RS485通信接口的分时通信,各个从设备可以在各自的时隙内调用各自的RS485通信接口向主设备发送数据,因此各个从设备不会产生通信冲突,能够准度、快速地将资源变化消息上报给主设备,同时,主设备能够准确、快速的接收到各个从设备的资源变化消息而不产生通信冲突。
S4、在主设备的时隙内,根据主设备接收到的资源变化消息调用其RS485通信接口,同时向对应的从设备返回资源获取请求。
本方案采用了RS485通信接口的分时通信,可以实现主设备在自己的时隙内发送数据,由于主设备可以并发发送资源获取请求到从设备,因此可以快速完成主设备对从设备的资源采集。
S5、根据从设备接收到的资源获取请求,对从设备当前的资源数据进行压缩,并在从设备的时隙内调用RS485通信接口,将压缩后的资源数据发送给主设备。
根据冲突检测方法确定从设备发送的资源数据是否发生冲突,具体为:依次检测从设备发送的资源数据的奇偶校验位、数据长度、停止位以及数据帧是否正确,若均正确,则确定从设备发送的资源数据未发生冲突。
S6、对主设备接收到的资源数据进行解压,并采用解压后的资源数据更新主设备的资源信息表。
本发明实现了主设备和从设备在各自的时隙发送数据,由于主设备可以并发发送资源获取请求到从设备,从设备分时向主设备返回资源数据,因此可以快速准确地完成主设备对从设备的资源采集,避免了通信冲突,具有并发性、高效率、安全性和冗余性,便于管理,能满足通信设备大批量的数据采集需求。
本发明不局限于上述最佳实施方式,任何人在本发明的启示下作出的结构变化,凡是与本发明具有相同或相近的技术方案,均落入本发明的保护范围之内。

Claims (6)

  1. 一种基于485分时通信的设备资源采集方法,其特征在于,包括以下步骤:
    确定主设备和其通过RS485总线连接的每个从设备的时隙;
    在每个从设备的时隙内,发送资源变化消息给主设备;
    在主设备的时隙内,根据接收到的资源变化消息同时向对应的从设备返回资源获取请求;
    根据从设备接收到的资源获取请求,在其时隙内将资源数据发送给主设备。
  2. 如权利要求1所述的基于485分时通信的设备资源采集方法,其特征在于,根据冲突检测方法确定所述从设备发送的资源数据是否发生冲突,具体为:
    依次检测所述从设备发送的资源数据的奇偶校验位、数据长度、停止位以及数据帧是否正确,若均正确,则确定所述从设备发送的资源数据未发生冲突。
  3. 如权利要求1所述的基于485分时通信的设备资源采集方法,其特征在于,获取所述主设备的RS485通信接口的配置参数,并根据所述配置参数对所述从设备的RS485通信接口进行参数配置,所述主设备与所述从设备通过调用各自的RS485通信接口进行通信。
  4. 如权利要求3所述的基于485分时通信的设备资源采集方法,其特征在于,所述配置参数包括波特率、数据位、停止位和奇偶校验位。
  5. 如权利要求1所述的基于485分时通信的设备资源采集方法,其特征在于,当所述从设备接收到资源获取请求时,对当前的资源数据进行压缩,并在所述从设备的时隙内将压缩后的资源数据发送给所 述主设备。
  6. 如权利要求5所述的基于485分时通信的设备资源采集方法,其特征在于,对所述主设备接收到的资源数据进行解压,并采用解压后的资源数据更新所述主设备的资源信息表。
PCT/CN2017/111558 2017-02-24 2017-11-17 一种基于485分时通信的设备资源采集方法 Ceased WO2018153127A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710103780.6A CN106953809B (zh) 2017-02-24 2017-02-24 一种基于485分时通信的设备资源采集方法
CN201710103780.6 2017-02-24

Publications (1)

Publication Number Publication Date
WO2018153127A1 true WO2018153127A1 (zh) 2018-08-30

Family

ID=59466490

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/111558 Ceased WO2018153127A1 (zh) 2017-02-24 2017-11-17 一种基于485分时通信的设备资源采集方法

Country Status (2)

Country Link
CN (1) CN106953809B (zh)
WO (1) WO2018153127A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116248612A (zh) * 2023-02-24 2023-06-09 上海繁易信息科技股份有限公司 一种多对一的总线扩展方法与装置

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106953809B (zh) * 2017-02-24 2020-04-14 烽火通信科技股份有限公司 一种基于485分时通信的设备资源采集方法
CN108039993A (zh) * 2017-12-15 2018-05-15 广东雅达电子股份有限公司 一种在集中抄表系统中快速收集分支设备信息的方法
CN111464407B (zh) * 2020-02-28 2021-11-09 湖北三江航天红峰控制有限公司 一种基于半双工总线的通信装置及方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120093203A1 (en) * 2009-07-29 2012-04-19 Qingyin Fang Data communication method, communication device, and communication system
CN103001722A (zh) * 2012-11-23 2013-03-27 北京东土科技股份有限公司 一种基于时间触发以太网的数据传输方法及节点设备
CN105608037A (zh) * 2015-09-25 2016-05-25 杭州威力克通信系统有限公司 一种基于rs485总线的通信方法及装置
CN106953809A (zh) * 2017-02-24 2017-07-14 烽火通信科技股份有限公司 一种基于485分时通信的设备资源采集方法
CN107294827A (zh) * 2017-05-27 2017-10-24 烽火通信科技股份有限公司 避免主从设备冲突的rs485通信系统及方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080273527A1 (en) * 2007-05-03 2008-11-06 The University Of Leicester Distributed system
JP4999006B2 (ja) * 2008-04-21 2012-08-15 独立行政法人産業技術総合研究所 シリアルバス伝送システム
CN102546141B (zh) * 2012-02-20 2015-02-18 杭州海康威视系统技术有限公司 485总线系统及其异步半双工通信方法
CN104283749B (zh) * 2014-09-25 2017-12-01 烽火通信科技股份有限公司 基于rs‑485半双工总线的业务盘升级方法
CN105978779B (zh) * 2016-06-23 2019-03-19 北京东土科技股份有限公司 基于工业互联网的实时通信方法、装置及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120093203A1 (en) * 2009-07-29 2012-04-19 Qingyin Fang Data communication method, communication device, and communication system
CN103001722A (zh) * 2012-11-23 2013-03-27 北京东土科技股份有限公司 一种基于时间触发以太网的数据传输方法及节点设备
CN105608037A (zh) * 2015-09-25 2016-05-25 杭州威力克通信系统有限公司 一种基于rs485总线的通信方法及装置
CN106953809A (zh) * 2017-02-24 2017-07-14 烽火通信科技股份有限公司 一种基于485分时通信的设备资源采集方法
CN107294827A (zh) * 2017-05-27 2017-10-24 烽火通信科技股份有限公司 避免主从设备冲突的rs485通信系统及方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116248612A (zh) * 2023-02-24 2023-06-09 上海繁易信息科技股份有限公司 一种多对一的总线扩展方法与装置

Also Published As

Publication number Publication date
CN106953809B (zh) 2020-04-14
CN106953809A (zh) 2017-07-14

Similar Documents

Publication Publication Date Title
CN101232425B (zh) 一种总线式分布控制系统主从站对端控制方法
WO2018153127A1 (zh) 一种基于485分时通信的设备资源采集方法
CN106358276B (zh) 基于id包的通信方法
CN107147467A (zh) 一种tte终端系统内部时间同步系统及方法
CN102984042A (zh) 一种实现总线通信的确定性调度方法及系统
CN107580085B (zh) 一种物联网组网方法
CN107528747B (zh) 主从站通信状态的诊断方法和装置及计算机可读存储介质
CN109996325B (zh) 一种无线传感器网络的时钟同步系统及方法
CN105306544A (zh) 一种远程更新方法
US10716162B2 (en) Reconstructing a personal area network or system after a failure in the network or system
CN103414771A (zh) 一种云计算环境下节点间长任务操作的监测方法
CN106717068B (zh) 一种nan设备之间的距离测量方法及nan设备
CN106888431A (zh) 一种智能手表上添加好友的方法及系统
CN106856624B (zh) Wifi设备及其时间同步方法
CN107425935A (zh) 一种实现lte专网基站时间同步的方法
Machado et al. An iot approach to an ECG online monitor system in an android application
CN106550437B (zh) 降低ZigBee网络系统耗能的装置及方法
CN106878348B (zh) 基于源端点表模型维护的主站间纵向数据传输方法
CN102497399B (zh) 基于ZigBee协议获取节点丢失信息的方法和系统
CN107172582B (zh) 一种基于NodeJS的M2M通信设备及方法
CN103369666A (zh) 一种无线传感器网络系统及其时钟同步方法
KR20160130622A (ko) 저전력 무선 센서네트워크에서의 명령어 처리 방법
US12081283B2 (en) Optimization of a multiple-input synchronous transfer network
CN107995681A (zh) 一种无线传感网时间同步方法及装置
CN104901986B (zh) 多实例消息的同步方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17897849

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17897849

Country of ref document: EP

Kind code of ref document: A1