CN111913387A - System for redundancy and load balancing of multiple acquisition devices based on soft bus - Google Patents
System for redundancy and load balancing of multiple acquisition devices based on soft bus Download PDFInfo
- Publication number
- CN111913387A CN111913387A CN202010789660.8A CN202010789660A CN111913387A CN 111913387 A CN111913387 A CN 111913387A CN 202010789660 A CN202010789660 A CN 202010789660A CN 111913387 A CN111913387 A CN 111913387A
- Authority
- CN
- China
- Prior art keywords
- fep
- communication front
- rtu
- data
- soft bus
- 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
Links
- 230000006854 communication Effects 0.000 claims abstract description 145
- 238000004891 communication Methods 0.000 claims abstract description 143
- 238000012544 monitoring process Methods 0.000 claims abstract description 10
- 229920009441 perflouroethylene propylene Polymers 0.000 claims description 280
- 238000000034 method Methods 0.000 claims description 22
- 238000004364 calculation method Methods 0.000 claims description 15
- 230000008569 process Effects 0.000 claims description 12
- 238000013507 mapping Methods 0.000 claims description 11
- 230000001174 ascending effect Effects 0.000 claims description 8
- 230000008859 change Effects 0.000 claims description 7
- 238000013480 data collection Methods 0.000 claims description 5
- 230000004044 response Effects 0.000 claims description 5
- 230000001960 triggered effect Effects 0.000 claims description 5
- 238000005192 partition Methods 0.000 claims description 4
- 230000005540 biological transmission Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 4
- 238000012423 maintenance Methods 0.000 description 4
- 230000001186 cumulative effect Effects 0.000 description 3
- 230000007613 environmental effect Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000009977 dual effect Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000004069 differentiation Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000007429 general method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B9/00—Safety arrangements
- G05B9/02—Safety arrangements electric
- G05B9/03—Safety arrangements electric with multiple-channel loop, i.e. redundant control systems
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明涉及一种基于软总线的多个采集设备冗余及负载均衡的系统,包括平台服务器、节点管理服务器、消息软总线以及各区域综合监控子系统,其中每个区域综合监控子系统包括主通信前置机和备通信前置机,平台服务器、节点管理服务器、主通信前置机和备通信前置机均通过消息软总线通信连接;节点管理服务器动态管理所有区域通信前置机的主备状态,主通信前置机根据规则将本区域所有子系统通道分配到不同通信前置机上接入,实现了通信前置机的多机冗余;运行过程中,主通信前置机根据负载均衡算法实时调整子系统通道分配。与现有技术相比,本发明解决了分布式平台异构组建间复杂的通信问题,同时减轻了单个采集设备数据接入负荷过重的问题。
The invention relates to a system for redundancy and load balancing of multiple acquisition devices based on a soft bus, including a platform server, a node management server, a message soft bus and various regional comprehensive monitoring subsystems, wherein each regional comprehensive monitoring subsystem includes a main The communication front-end computer and the standby communication front-end computer, the platform server, the node management server, the main communication front-end computer and the standby communication front-end computer are all connected through the message soft bus communication; the node management server dynamically manages the main communication front-end computers of all areas. In the standby state, the main communication front-end computer allocates all subsystem channels in this area to different communication front-end computers according to the rules, which realizes the multi-machine redundancy of the communication front-end computer; during operation, the main communication front-end computer is based on the load Equalization algorithms adjust subsystem channel assignments in real time. Compared with the prior art, the present invention solves the complex communication problem among heterogeneous components of distributed platforms, and at the same time alleviates the problem of excessive data access load of a single acquisition device.
Description
技术领域technical field
本发明涉及轨道交通综合监控领域,尤其是涉及一种基于软总线的多个采集设备冗余及负载均衡的系统。The invention relates to the field of comprehensive monitoring of rail transit, in particular to a system for redundancy and load balancing of multiple acquisition devices based on a soft bus.
背景技术Background technique
现代智慧轨交平台接入了多个子系统,如列车自动监控系统(ATS)、广播系统(PA)、乘客信息系统(PIS)、视频监控系统(CCTV)、火灾系统(FAS)、环控系统(BAS),通过分析众多子系统数据,并结合智能运维算法,为调度人员提供辅助决策,不仅提高了运维效率,而且在紧急情况下通过子系统间的联动,为轨道交通特别是无人驾驶行车安全提供了更有力的保障,然而这些子系统分散在线路各地,接入的数据量庞大,接入方式和通信协议也不尽相同,无法直接与轨交平台对接,这就需要在子系统与轨交平台间设置通信前置机,以便将子系统数据解析成平台可识别数据。The modern smart rail transit platform is connected to multiple subsystems, such as Automatic Train Monitoring System (ATS), Broadcasting System (PA), Passenger Information System (PIS), Video Monitoring System (CCTV), Fire System (FAS), Environmental Control System (BAS), by analyzing the data of many subsystems and combining with intelligent operation and maintenance algorithms, it provides auxiliary decision-making for dispatchers, which not only improves the efficiency of operation and maintenance, but also improves the efficiency of operation and maintenance through the linkage between subsystems in emergency situations. Human-driven driving safety provides a stronger guarantee. However, these subsystems are scattered all over the line, the amount of data accessed is huge, the access methods and communication protocols are also different, and they cannot be directly connected to the rail transit platform. A communication front-end machine is set between the subsystem and the rail transit platform to parse the subsystem data into platform-identifiable data.
当线路规模较小时,可在中心设置通信前置机接入所有子系统数据,并且为保证通信前置机稳定运行,通常会设置两台冗余的通信前置机,然而一般的方法是设置一台冷备的通信前置机,只有当主通信前置机故障后才会由备用通信前置机接管所有数据接入工作,该方法虽然解决了系统稳定性问题,但由于冷备的通信前置机不参与数据接入工作,所以在一定程度上造成了资源浪费,并且由于通信前置机的整机切换,以及主备通信前置机的数据不同步,在切换时会造成数据的波动,影响用户使用。When the line scale is small, the communication front-end machine can be set in the center to access all subsystem data, and to ensure the stable operation of the communication front-end machine, two redundant communication front-end machines are usually set up. However, the general method is to set A cold standby communication front-end computer, only when the main communication front-end computer fails will the backup communication front-end computer take over all data access work. Although this method solves the problem of system stability, due to the cold standby communication The built-in machine does not participate in the data access work, so it causes a waste of resources to a certain extent, and due to the whole machine switching of the communication front-end machine, and the data of the main and standby communication front-end machines are not synchronized, which will cause data fluctuations during switching. , affecting the user's use.
为解决数据波动问题,一些做法是使用两台热备的通信前置机同时进行数据接入工作,并由服务器选择性的接收其中一台通信前置机上传的数据,但该方法同样无法避免资源的浪费,并且也增加了服务器的比对工作,同时由于一些子系统接口的特殊性,无法支持两路连接,所以该方法也存在一定的局限性。In order to solve the problem of data fluctuation, some methods are to use two hot standby communication front-end computers for data access at the same time, and the server selectively receives the data uploaded by one of the communication front-end computers, but this method is also unavoidable. It wastes resources, and also increases the comparison work of the server. At the same time, due to the particularity of some subsystem interfaces, it cannot support two-way connections, so this method also has certain limitations.
随着线路规模增加,中心集中接入的方式已无法满足大数据的处理需求,因此需要引入分布式技术,通过在中心和集中站设置多组冗余服务器,并且将通信前置机下沉到车站,在车站接入和处理子系统数据后,按需求将部分数据分别上传至车站服务器和中心服务器,从而减轻通信前置机和服务器的处理压力。但分布式架构的引入导致通信前置机和服务器数量大大增加,若此时再使用传统的API编码通信方式,会使得整个平台内的网络结构异常复杂,非常不利于平台开发和维护,而且也对平台后期的扩展造成了一定困难。With the increase of the line scale, the centralized access method of the center can no longer meet the processing requirements of big data. Therefore, it is necessary to introduce distributed technology. By setting up multiple sets of redundant servers in the center and centralized station, and sinking the communication front-end to the At the station, after accessing and processing subsystem data at the station, part of the data is uploaded to the station server and the central server as required, thereby reducing the processing pressure on the communication front-end and server. However, the introduction of the distributed architecture has greatly increased the number of communication front-end computers and servers. If the traditional API coding communication method is used at this time, the network structure of the entire platform will be extremely complicated, which is very unfavorable for platform development and maintenance. It has caused some difficulties for the later expansion of the platform.
发明内容SUMMARY OF THE INVENTION
本发明的目的就是为了克服上述现有技术存在的缺陷而提供一种基于软总线的多个采集设备冗余及负载均衡的系统,适用于轨道交通综合监控平台外部子系统数据的采集,解决了分布式平台异构组建间复杂的通信问题,同时减轻了单个采集设备数据接入负荷过重的问题。The purpose of the present invention is to provide a system for redundancy and load balancing of multiple acquisition devices based on a soft bus in order to overcome the above-mentioned defects in the prior art, which is suitable for the acquisition of external subsystem data of a comprehensive monitoring platform for rail transit, and solves the problem of It solves the complex communication problems between heterogeneous components of distributed platforms, and at the same time alleviates the problem of excessive data access load of a single acquisition device.
本发明的目的可以通过以下技术方案来实现:The object of the present invention can be realized through the following technical solutions:
一种基于软总线的多个采集设备冗余及负载均衡的系统,包括平台服务器、节点管理服务器、消息软总线以及各区域综合监控子系统,其中每个区域综合监控子系统包括主通信前置机和备通信前置机,所述的平台服务器、节点管理服务器、主通信前置机和备通信前置机均通过消息软总线通信连接;A system for redundancy and load balancing of multiple acquisition devices based on a soft bus, including a platform server, a node management server, a message soft bus, and a comprehensive monitoring subsystem in each area, wherein each regional comprehensive monitoring subsystem includes a main communication front-end computer and standby communication front-end computer, the platform server, node management server, main communication front-end computer and standby communication front-end computer are all connected through message soft bus communication;
所述的节点管理服务器动态管理所有区域通信前置机的主备状态,所述的主通信前置机根据规则将本区域所有子系统通道分配到不同通信前置机上接入,实现了通信前置机的多机冗余;运行过程中,主通信前置机根据负载均衡算法实时调整子系统通道分配。The node management server dynamically manages the active and standby states of all regional communication front-end computers, and the main communication front-end computer allocates all sub-system channels in the region to different communication front-end computers for access according to rules, thereby realizing the pre-communication process. Built-in multi-machine redundancy; during operation, the main communication front-end machine adjusts the subsystem channel allocation in real time according to the load balancing algorithm.
优选地,所述的消息软总线为基于发布或订阅体系且无中心化的消息软总线。Preferably, the message soft bus is a non-centralized message soft bus based on a publish or subscribe system.
优选地,该系统配置所有接入平台的设备使用消息软总线通信,设置消息软总线为严格可靠传输。Preferably, the system configures all devices connected to the platform to communicate using the message soft bus, and sets the message soft bus to be strictly reliable transmission.
优选地,所述的通信前置机通过消息软总线提供数据采集和命令转发服务,所述的节点管理服务器通过消息软总线提供全线通信前置机主备状态管理服务,所述的平台服务器通过消息软总线订阅通信前置机数据,结合节点管理服务提供的通信前置机主备状态信息,向不同区域主通信前置机下发控制命令。Preferably, the communication front-end computer provides data collection and command forwarding services through a message soft bus, the node management server provides a full-line communication front-end computer active and standby state management service through the message soft bus, and the platform server is provided through the message soft bus. The message soft bus subscribes to the data of the communication front-end, and sends control commands to the main communication front-end in different areas in combination with the active and standby status information of the communication front-end provided by the node management service.
优选地,所述的节点管理服务器动态管理所有区域通信前置机的主备状态具体过程如下:Preferably, the specific process of dynamically managing the active and standby states of all regional communication front-end machines by the node management server is as follows:
1)通信前置机启动时首先向节点管理服务器注册本机信息;1) When the communication front-end computer is started, it first registers the local information with the node management server;
2)节点管理服务器实时监测各区域的通信前置机在线状态,当某区域通信前置机触发软总线掉线事件时,按规则重新为该区域选举主通信前置机,并将选举结果立即通过软总线发布;2) The node management server monitors the online status of the communication front-end in each area in real time. When the communication front-end in a certain area triggers the soft bus disconnection event, it will re-elect the main communication front-end for this area according to the rules, and the election result will be immediately Released via soft bus;
3)当节点管理服务器后启动或运行故障时,将导致通信前置机注册失败,若通信前置机发布注册消息后,在规定时间t内未接收到包含本节点状态的应答数据,将重新发起注册,直至注册成功。3) When the node management server fails to start or run, it will cause the communication front-end machine to fail to register. If the communication front-end machine does not receive the response data containing the status of the node within the specified time t after the registration message is issued, it will be re-registered. Initiate registration until registration is successful.
优选地,所述的通信前置机向节点管理服务器注册本机信息具体过程为:Preferably, the specific process of the communication front-end registering local information to the node management server is as follows:
a)通信前置机将本机区域号、设备编号、设备状态发布给节点管理服务器;a) The communication front-end computer publishes the local area number, device number, and device status to the node management server;
b)节点管理服务器根据区域号对通信前置机进行分组,并根据组内通信前置机信息设置通信前置机主备状态;b) The node management server groups the communication front-end machines according to the area number, and sets the main and backup status of the communication front-end machines according to the communication front-end machine information in the group;
c)若当前组内没有通信前置机注册,或不存在在线的通信前置机,则设置通信前置机为主通信前置机;c) If there is no communication front-end registration in the current group, or there is no online communication front-end, set the communication front-end as the main communication front-end;
d)若当前组内已有通信前置机注册,并且存在主通信前置机,则设置通信前置机为备用通信前置机;d) If there is a communication front-end registered in the current group, and there is a main communication front-end, then set the communication front-end as a backup communication front-end;
e)若当前组内已有通信前置机注册,但不存在主通信前置机,则根据规则选出主通信前置机:e) If there is a communication front-end registered in the current group, but there is no main communication front-end, select the main communication front-end according to the rules:
f)注册成功后,节点管理服务器立即向通信前置机返回该区域所有通信前置机的状态信息,并将该通信前置机状态加入之后周期发布的全线通信前置机状态信息中。f) After the registration is successful, the node management server immediately returns the status information of all the communication front-end machines in the area to the communication front-end machine, and adds the communication front-end machine status to the state information of the full-line communication front-end machine that is periodically released later.
优选地,所述的e)中的选举规则为Preferably, the election rule in described e) is
首先比较设备状态,设备状态最优的通信前置机优先被选为主通信前置机;First, compare the equipment status, and the communication front-end with the best equipment status is preferentially selected as the main communication front-end;
设网络状态为NS,单网在线取值0,双网在线取值1,CPU使用率为Ucpu,内存使用率为Umem,则设备状态优先级计算公式如下:Assuming that the network status is NS, the single-network online value is 0, the dual-network online value is 1, the CPU usage rate is Ucpu, and the memory usage rate is Umem, the device status priority calculation formula is as follows:
0.5×NS+0.3×(1-Ucpu)+0.2×(1-Umem)0.5×NS+0.3×(1-Ucpu)+0.2×(1-Umem)
若所有通信前置机设备状态优先级相同,则再次比较通信前置机设备编号,设备编号越大的通信前置机优先被选为主通信前置机。If all communication front-end devices have the same status priority, the device numbers of the communication front-end devices are compared again, and the communication front-end device with a larger device number is preferentially selected as the main communication front-end device.
优选地,所述的消息软总线配置通信前置机FEP数据发布和订阅规则具体为:Preferably, the described message soft bus configuration communication front-end FEP data publishing and subscription rules are specifically:
将FEP数据分为四类,分别为系统数据S、业务数据D、控制命令C和命令返校R,其中,S为FEP状态信息,包括设备运行状态、软件运行状态、系统报警以及通道状态,D为经FEP解析后的子系统数据,C为FEP控制命令或子系统控制命令,R为FEP控制命令返校或子系统控制命令返校,四类数据中,S、D、R由FEP主动发布,C由FEP订阅;Divide FEP data into four categories, namely system data S, business data D, control command C and command return R, where S is FEP status information, including equipment operation status, software operation status, system alarm and channel status, D is the subsystem data parsed by FEP, C is the FEP control command or subsystem control command, and R is the FEP control command back to school or the subsystem control command back to school. Publish, C is subscribed by FEP;
每类数据使用不同的软总线主题发布和订阅,并通过配置库修改主题参数,包括域、分区、主题名称和内容过滤条件。Each type of data is published and subscribed using different softbus topics, and topic parameters, including domain, partition, topic name, and content filter conditions, are modified through the configuration library.
优选地,将四类数据对应的所述软总线主题组合为软总线路由,FEP与不同平台服务器间根据软总线路由配置使用相同或不同的主题实现数据的发布和订阅,而FEP则通过软总线路由表,为平台不同模块提供差异化的数据采集服务。Preferably, the soft bus topics corresponding to the four types of data are combined into a soft bus route, and the FEP and different platform servers use the same or different topics to publish and subscribe data according to the soft bus routing configuration, while the FEP uses the soft bus route. The routing table provides differentiated data collection services for different modules of the platform.
优选地,所述的软总线路由表配置如下所示:Preferably, the configuration of the soft bus routing table is as follows:
{ROUTE_1(TS,TD,TC,TR),…,ROUTE_N(TS,TD,TC,TR)}{ROUTE_1(T S ,T D ,T C ,T R ),…,ROUTE_N(T S ,T D ,T C ,T R )}
TS表示系统数据主题,TD表示业务数据主题,TC表示控制命令主题,TR表示命令返校主题。T S represents the system data topic, TD represents the business data topic, TC represents the control command topic, and TR represents the command back to school topic.
优选地,所述的系统数据S为周期性发布的数据,其中设备运行状态、软件运行状态和通道状态都通过配置库配置发布周期,而系统报警则使用变化触发的方式以最快的速度发布,对于不同的软总线路由,可配置相同的系统数据主题。Preferably, the system data S is periodically released data, wherein the device operation status, software operation status and channel status are all configured through the configuration library release cycle, and the system alarm is released at the fastest speed in a change-triggered manner , the same system data topic can be configured for different soft bus routes.
优选地,所述的业务数据D分为三类,分别为数字量数据、模拟量数据和累计量数据,每类数据对应一张数据转发表,在数据转发表中配置数据与软总线路由的映射关系,当数据转发表中的数据发生变化时,FEP根据数据与软总线路由的映射关系,使用软总线路由对应的业务数据主题将变化数据发布给相应平台服务器。Preferably, the business data D is divided into three types, which are digital data, analog data and cumulative data, each type of data corresponds to a data forwarding table, and the configuration data and the soft bus routing are in the data forwarding table. Mapping relationship. When the data in the data forwarding table changes, FEP uses the business data topic corresponding to the soft bus route to publish the changed data to the corresponding platform server according to the mapping relationship between the data and the soft bus route.
优选地,所述的控制命令C只能由主FEP订阅,并由主FEP根据通道分布情况转发给主通道所在FEP;Preferably, the control command C can only be subscribed by the main FEP, and is forwarded by the main FEP to the FEP where the main channel is located according to the channel distribution;
各平台服务器向FEP发布控制命令时,首先从节点管理服务器获取相应区域主FEP信息,并在控制命令中附加主FEP编号,由于FEP在订阅控制命令时设置了基于编号的内容过滤条件,即只接收控制命令中FEP编号为本机编号的控制命令,所以控制命令只会由主FEP订阅。When each platform server issues a control command to the FEP, it first obtains the main FEP information of the corresponding area from the node management server, and appends the main FEP number to the control command. The FEP number in the received control command is the control command of the local number, so the control command will only be subscribed by the main FEP.
优选地,所述的命令返校R使用变化触发的方式发布,并且直接由执行控制命令的FEP或接收子系统命令返校的FEP发布。Preferably, the command to return to school R is issued in a change-triggered manner, and is directly issued by the FEP that executes the control command or the FEP that receives the sub-system command to return to school.
优选地,将通信前置机FEP接入的子系统虚拟为RTU通道表示,RTU通道将作为通道冗余和负载均衡的最小单位;Preferably, the subsystem accessed by the communication front-end FEP is virtualized as an RTU channel, and the RTU channel will be used as the smallest unit of channel redundancy and load balancing;
依据子系统特性,结合负载均衡规则,配置每个RTU的冗余方式,包括故障切换和负载均衡两种方式,其中,故障切换表示RTU只在链接或服务不可用时进行切换,而负载均衡则表示RTU可根据负载均衡结果动态切换。According to the characteristics of the subsystem, combined with the load balancing rules, configure the redundancy mode of each RTU, including failover and load balancing. Among them, failover means that the RTU only switches when the link or service is unavailable, while load balancing means The RTU can be dynamically switched according to the load balancing result.
优选地,所述的主通信前置机根据负载均衡算法实时调整子系统通道分配具体为:Preferably, the main communication front-end computer adjusts the subsystem channel allocation in real time according to the load balancing algorithm, specifically:
(1)FEP当选主FEP后,首先判断RTU通道是否被分配,若未分配,则根据RTU配置和当前在线的FEP信息,将RTU通道均匀分配到每台FEP上,;(1) After the FEP is elected as the main FEP, first determine whether the RTU channel is allocated, if not, then according to the RTU configuration and the current online FEP information, the RTU channel is evenly allocated to each FEP;
(2)每台FEP根据本机分配的RTU通道创建相应的服务,包括采集服务、转发服务和同步服务;(2) Each FEP creates corresponding services according to the RTU channel allocated by the machine, including collection services, forwarding services and synchronization services;
(3)备用FEP实时将本机设备状态信息和RTU通道状态信息发布给主FEP,主FEP根据负载均衡规则计算当前是否需要切换RTU通道;(3) The standby FEP publishes the local device status information and RTU channel status information to the main FEP in real time, and the main FEP calculates whether the RTU channel needs to be switched currently according to the load balancing rules;
(4)当RTU通道产生负载均衡切换时,主FEP将立即发布负载均衡后的RTU通道分配结果至其他备用FEP,若未产生通道切换,则周期发布RTU通道信息。(4) When load balancing switching occurs on the RTU channel, the master FEP will immediately publish the RTU channel allocation result after load balancing to other standby FEPs, and if no channel switching occurs, the RTU channel information will be published periodically.
优选地,所述的(1)中的RTU通道的分配规则为:Preferably, the allocation rule of the RTU channel in (1) is:
a)若Nrtu<=Nfep,则按RTU和FEP编号由小到大顺序,将RTU依次分配给FEP;a) If N rtu <= N fep , assign the RTUs to the FEPs in sequence according to the RTU and FEP numbers in ascending order;
b)若Nrtu>Nfep,则每台FEP分配的RTU数量为 按RTU和FEP编号由小到大顺序,将RTU分组分配给FEP,b) If N rtu >N fep , the number of RTUs allocated by each FEP is Assign RTU groups to FEPs in ascending order of RTU and FEP numbers.
其中RTU数量为Nrtu,FEP数量为Nfep,FEP编号为i,其中i=0,1,2…,表示向下取整。where the number of RTUs is N rtu , the number of FEPs is N fep , and the number of FEPs is i, where i=0,1,2..., Indicates rounded down.
优选地,所述的(2)中的采集服务根据RTU配置加载对应的设备驱动和采集规约与子系统建立通信;转发服务根据转发表实时发布业务数据,同步服务将RTU通道数据实时同步给其它冗余RTU通道所在FEP。Preferably, the collection service in (2) loads the corresponding device driver according to the RTU configuration and the collection protocol establishes communication with the subsystem; the forwarding service publishes business data in real time according to the forwarding table, and the synchronization service synchronizes the RTU channel data to other The FEP where the redundant RTU channel is located.
优选地,所述的(3)中的负载均衡规则具体为:Preferably, the load balancing rule in (3) is specifically:
A)若FEP某RTU通道不为运行状态,且持续时间超过Toffline,则在其它FEP中选出当前最优FEP,并将RTU通道切换至最优FEP,最优FEP的选择由FEP的CPU使用率Ucpu、内存使用率Umem和网络状态NS决定,具体计算公式为:A) If a certain RTU channel of the FEP is not in the running state and the duration exceeds T offline , the current optimal FEP is selected from other FEPs, and the RTU channel is switched to the optimal FEP. The selection of the optimal FEP is determined by the CPU of the FEP. The usage rate U cpu , the memory usage rate U mem and the network status NS are determined. The specific calculation formula is:
0.5×NS+0.3×(1-Ucpu)+0.2×(1-Umem)0.5×NS+0.3×(1-U cpu )+0.2×(1-U mem )
计算结果最大的FEP为最优FEP,若有多台FEP计算结果相同,则取编号最大的FEP为最优FEP;The FEP with the largest calculation result is the optimal FEP. If there are multiple FEPs with the same calculation result, the FEP with the largest number is taken as the optimal FEP;
B)设FEP的CPU使用率和内存使用率为U,若U大于设定值Umax,且持续时间超过Toverload,则需要将该FEP下的一些RTU通道分配给其他FEP。B) Set the CPU usage rate and memory usage rate of the FEP to U. If U is greater than the set value U max and the duration exceeds T overload , some RTU channels under the FEP need to be allocated to other FEPs.
优选地,所述的B)中的分配规则如下:Preferably, the distribution rules in described B) are as follows:
B1)将该FEP下所有配置为负载均衡的RTU通道按通道相关使用率Urtu由小到大排序;B1) All RTU channels configured as load balancing under the FEP are sorted in ascending order according to the channel-related usage rate U rtu ;
B2)依次读取Urtu,并选择当前相关使用率Ubest最低的FEP;B2) Read Urtu in turn, and select the FEP with the lowest current related usage rate U best ;
B3)若Urtu+Ubest<Umax,则将对应的RTU通道切换至最低使用率的FEP,同时置U=U-Urtu,Ubest=Ubest+Urtu;B3) If U rtu +U best <U max , switch the corresponding RTU channel to the FEP with the lowest usage rate, and set U=UU rtu and U best =U best +U rtu at the same time;
B4)若Urtu+Ubest>Umax,跳出分配过程;B4) If U rtu +U best >U max , jump out of the allocation process;
B5)若U-Urtu>Umax,重复步骤B2,否则跳出分配过程。B5) If UU rtu >U max , repeat step B2, otherwise jump out of the allocation process.
与现有技术相比,本发明具有以下优点:Compared with the prior art, the present invention has the following advantages:
1)实现了数据的无差异化分发,通过将所有FEP接入基于发布/订阅体系且无中心化的消息软总线;1) Realize non-differentiated distribution of data, by connecting all FEPs to a non-centralized message soft bus based on the publish/subscribe system;
2)实现了FEP的多机冗余,设置节点管理服务器,动态管理线路所有区域FEP的主备状态;主FEP根据规则将本区域所有子系统通道分配到不同FEP上接入;2) The multi-machine redundancy of the FEP is realized, the node management server is set, and the active and standby states of the FEPs in all areas of the line are dynamically managed; the main FEP allocates all subsystem channels in the area to different FEPs for access according to the rules;
3)充分发挥了FEP设备性能,同时也保证了子系统数据接入的稳定性,运行过程中,主FEP根据负载均衡算法实时调整子系统通道分配。3) The performance of the FEP equipment is fully utilized, and the stability of the data access of the subsystem is also ensured. During the operation, the main FEP adjusts the channel allocation of the subsystem in real time according to the load balancing algorithm.
附图说明Description of drawings
图1为本发明所述多个冗余采集设备的网络架构图;1 is a network architecture diagram of multiple redundant collection devices according to the present invention;
图2为本发明所述采集设备主要功能模块图;Fig. 2 is the main functional module diagram of the collection device according to the present invention;
图3为本发明控制命令数据流图。FIG. 3 is a data flow diagram of a control command according to the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都应属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
本发明一种适用于轨道交通领域通信前置机多机冗余和负载均衡的系统,并且为适应现代智慧轨交平台的分布式架构,提出了使用软总线的通信方法,具体解决方案为:The present invention is a system suitable for multi-machine redundancy and load balancing of communication front-end machines in the field of rail transit, and in order to adapt to the distributed architecture of a modern smart rail transit platform, a communication method using a soft bus is proposed. The specific solutions are:
1.配置平台设备使用消息软总线通信1. Configure the platform device to communicate using the message soft bus
配置所有接入平台的设备使用消息软总线通信,设置消息软总线QoS为严格可靠传输。FEP通过消息软总线提供数据采集和命令转发服务,节点管理服务器通过消息软总线提供全线FEP主备状态管理服务,平台其它模块通过消息软总线订阅FEP数据,结合节点管理服务提供的FEP主备状态信息,向不同区域主FEP下发控制命令。Configure all devices connected to the platform to communicate using the message soft bus, and set the message soft bus QoS to strict and reliable transmission. FEP provides data collection and command forwarding services through the message soft bus, the node management server provides the full-line FEP active and standby status management services through the message soft bus, and other modules of the platform subscribe to FEP data through the message soft bus, combined with the FEP active and standby status provided by the node management service. information, and issue control commands to master FEPs in different areas.
2.配置节点管理服务器,管理全线FEP主备状态2. Configure the node management server to manage the active and standby status of FEP across the board
FEP启动时首先向节点管理服务器注册本机信息,包含以下步骤:When FEP starts, it first registers the local information with the node management server, which includes the following steps:
a)FEP将本机区域号、设备编号、设备状态发布给节点管理服务器;a) FEP publishes the local area number, device number, and device status to the node management server;
b)节点管理服务器根据区域号对FEP进行分组,并根据组内FEP信息设置FEP主备状态;b) The node management server groups the FEPs according to the area number, and sets the active and standby status of the FEPs according to the FEP information in the group;
c)若当前组内没有FEP注册,或不存在在线的FEP,则设置FEP为主FEP;c) If there is no FEP registration in the current group, or there is no online FEP, set the FEP as the main FEP;
d)若当前组内已有FEP注册,并且存在主FEP,则设置FEP为备用FEP;d) If there is an FEP registered in the current group and there is a primary FEP, set the FEP as a standby FEP;
e)若当前组内已有FEP注册,但不存在主FEP,则根据规则选出主FEP,选举规则为:e) If there are FEP registrations in the current group, but there is no main FEP, the main FEP will be elected according to the rules. The election rules are:
首先比较设备状态,设备状态最优的FEP优先被选为主FEP。设网络状态为NS,单网在线取值0,双网在线取值1,CPU使用率为Ucpu,内存使用率为Umem,则设备状态优先级计算公式如下:First, the device states are compared, and the FEP with the best device state is preferentially selected as the master FEP. Assuming that the network status is NS, the single-network online value is 0, the dual-network online value is 1, the CPU usage rate is U cpu , and the memory usage rate is U mem , the device status priority calculation formula is as follows:
0.5*NS+0.3*(1-Ucpu)+0.2*(1-Umem)0.5*NS+0.3*(1-U cpu )+0.2*(1-U mem )
若所有FEP设备状态优先级相同,则再次比较FEP设备编号,设备编号越大的FEP优先被选为主FEP。If the status priorities of all FEP devices are the same, the device numbers of the FEP devices are compared again, and the FEP with a larger device number is preferentially selected as the master FEP.
f)注册成功后,节点管理服务器立即向FEP返回该区域所有FEP的状态信息,并将该FEP状态加入之后周期发布的全线FEP状态信息中。f) After the registration is successful, the node management server immediately returns the status information of all FEPs in the area to the FEP, and adds the FEP status to the status information of the entire line of FEPs periodically released later.
节点管理服务器实时监测各区域的FEP在线状态,当某区域FEP触发软总线掉线事件时,按步骤e中的规则重新为该区域选举主FEP,并将选举结果立即通过软总线发布。The node management server monitors the online status of the FEPs in each area in real time. When the FEP in a certain area triggers a soft bus disconnection event, it will re-elect the main FEP for the area according to the rules in step e, and immediately publish the election results through the soft bus.
当节点管理服务器后启动或运行故障时,将导致FEP注册失败,若FEP发布注册消息后,在规定时间t内未接收到包含本节点状态的应答数据,将重新发起注册,直至注册成功。When the node management server fails to start or run later, the FEP registration will fail. If the FEP does not receive the response data containing the status of the node within the specified time t after publishing the registration message, it will re-initiate the registration until the registration is successful.
3.配置FEP数据发布和订阅规则3. Configure FEP data publishing and subscription rules
将FEP数据分为四类,分别为系统数据S,业务数据D,控制命令C和命令返校R,其中,S为FEP状态信息,包括设备运行状态、软件运行状态、系统报警以及通道状态,D为经FEP解析后的子系统数据,C为FEP控制命令或子系统控制命令,R为FEP控制命令返校或子系统控制命令返校,四类数据中,S、D、R由FEP主动发布,C由FEP订阅。The FEP data is divided into four categories, namely system data S, business data D, control command C and command return R, where S is FEP status information, including equipment running status, software running status, system alarm and channel status, D is the subsystem data parsed by FEP, C is the FEP control command or subsystem control command, and R is the FEP control command back to school or the subsystem control command back to school. Published, C is subscribed by FEP.
为避免数据间的相互影响,保证数据发布和订阅效率,每类数据使用不同的软总线主题发布和订阅,并可通过配置库修改主题参数,包括域、分区、主题名称和内容过滤条件。In order to avoid mutual influence between data and ensure the efficiency of data publishing and subscription, each type of data is published and subscribed using different soft bus topics, and topic parameters can be modified through the configuration library, including domain, partition, topic name and content filter conditions.
将四个主题组合为软总线路由,FEP与平台不同模块间根据软总线路由配置使用相同或不同的主题实现数据的发布和订阅,而FEP则通过软总线路由表,为平台不同模块提供差异化的数据采集服务,软总线路由表配置如下所示:Combining the four topics into soft bus routing, FEP and different modules of the platform use the same or different topics to publish and subscribe data according to the soft bus routing configuration, while FEP provides differentiation for different modules of the platform through the soft bus routing table For the data acquisition service, the configuration of the soft bus routing table is as follows:
{ROUTE_1(TS,TD,TC,TR),…,ROUTE_N(TS,TD,TC,TR)}{ROUTE_1(T S ,T D ,T C ,T R ),…,ROUTE_N(T S ,T D ,T C ,T R )}
系统数据S一般为周期性发布的数据,其中设备运行状态、软件运行状态和通道状态都可通过配置库配置发布周期,而系统报警则使用变化触发的方式以最快的速度发布,对于不同的软总线路由,可配置相同的系统数据主题,以减轻FEP发布压力。The system data S is generally released periodically, in which the device operation status, software operation status and channel status can be configured with the release cycle through the configuration library, while the system alarm is released at the fastest speed in the way of change triggering. Soft bus routing, the same system data topic can be configured to reduce FEP release pressure.
业务数据D可分为三类,分别为数字量数据、模拟量数据和累计量数据,每类数据对应一张数据转发表,在转发表中配置数据与软总线路由的映射关系,当转发表中的数据发生变化时,FEP根据数据与软总线路由的映射关系,使用软总线路由对应的业务数据主题将变化数据发布给平台相应模块。Business data D can be divided into three categories, namely digital data, analog data and cumulative data. Each type of data corresponds to a data forwarding table. The mapping relationship between data and soft bus routing is configured in the forwarding table. When the data in the server changes, FEP uses the business data topic corresponding to the soft bus route to publish the changed data to the corresponding module of the platform according to the mapping relationship between the data and the soft bus route.
控制命令C只能由主FEP订阅,并由主FEP根据通道分布情况转发给主通道所在FEP,以此避免当出现双主双通道时控制命令重复下发的安全性问题。平台各模块向FEP发布控制命令时,首先从节点管理服务器获取相应区域主FEP信息,并在控制命令中附加主FEP编号,由于FEP在订阅控制命令时设置了基于编号的内容过滤条件,即只接收控制命令中FEP编号为本机编号的控制命令,所以控制命令只会由主FEP订阅。The control command C can only be subscribed by the master FEP, and the master FEP forwards it to the FEP where the master channel is located according to the channel distribution, so as to avoid the security problem of repeatedly issuing control commands when dual masters and dual channels occur. When each module of the platform issues a control command to the FEP, it first obtains the main FEP information of the corresponding area from the node management server, and appends the main FEP number to the control command. The FEP number in the received control command is the control command of the local number, so the control command will only be subscribed by the main FEP.
命令返校R使用变化触发的方式发布,并且直接由执行控制命令的FEP或接收子系统命令返校的FEP发布,不再通过主FEP转发。The command to return to school R is issued in a change-triggered manner, and is directly issued by the FEP that executes the control command or the FEP that receives the command from the subsystem to return to school, and is no longer forwarded through the main FEP.
4.通道冗余和负载均衡规则4. Channel redundancy and load balancing rules
将FEP接入的子系统虚拟为RTU通道表示,RTU通道将作为通道冗余和负载均衡的最小单位。依据子系统特性,结合负载均衡规则,配置每个RTU的冗余方式,包括故障切换和负载均衡两种方式,其中,故障切换表示RTU只在链接或服务不可用时进行切换,而负载均衡则表示RTU可根据负载均衡结果动态切换。The subsystem accessed by the FEP is virtualized as an RTU channel, and the RTU channel will be used as the smallest unit of channel redundancy and load balancing. According to the characteristics of the subsystem, combined with the load balancing rules, configure the redundancy mode of each RTU, including failover and load balancing. Among them, failover means that the RTU only switches when the link or service is unavailable, while load balancing means The RTU can be dynamically switched according to the load balancing result.
FEP当选主FEP后,首先判断RTU通道是否被分配,若未分配,则根据RTU配置和当前在线的FEP信息,将RTU通道均匀分配到每台FEP上,设RTU数量为Nrtu,FEP数量为Nfep,FEP编号为i(i=0,1,2…),分配规则为:After the FEP is elected as the master FEP, it firstly judges whether the RTU channel is allocated. If it is not allocated, the RTU channel is evenly allocated to each FEP according to the RTU configuration and the current online FEP information. Let the number of RTUs be N rtu and the number of FEPs to be N fep , the FEP number is i (i=0, 1, 2...), and the allocation rule is:
a)若Nrtu<=Nfep,则按RTU和FEP编号由小到大顺序,将RTU依次分配给FEP;a) If N rtu <= N fep , assign the RTUs to the FEPs in sequence according to the RTU and FEP numbers in ascending order;
b)若Nrtu>Nfep,则每台FEP分配的RTU数量为按RTU和FEP编号由小到大顺序,将RTU分组分配给FEP;b) If N rtu >N fep , the number of RTUs allocated by each FEP is Allocate RTU groups to FEPs in ascending order of RTU and FEP numbers;
每台FEP根据本机分配的RTU通道创建相应的服务,包括采集服务、转发服务和同步服务。采集服务根据RTU配置加载对应的设备驱动和采集规约与子系统建立通信;转发服务根据转发表实时发布业务数据,同步服务将RTU通道数据实时同步给其它冗余RTU通道所在FEP。Each FEP creates corresponding services according to the RTU channel allocated by the machine, including collection service, forwarding service and synchronization service. The collection service loads the corresponding device driver and collection protocol according to the RTU configuration to establish communication with the subsystem; the forwarding service publishes business data in real time according to the forwarding table, and the synchronization service synchronizes the RTU channel data to the FEP where other redundant RTU channels are located in real time.
备用FEP实时将本机设备状态信息和RTU通道状态信息发布给主FEP,主FEP根据负载均衡规则计算当前是否需要切换RTU通道,负载均衡规则如下:The standby FEP publishes the local device status information and RTU channel status information to the master FEP in real time. The master FEP calculates whether the RTU channel needs to be switched according to the load balancing rules. The load balancing rules are as follows:
a)若FEP某RTU通道不为运行状态,且持续时间超过Toffline,则在其它FEP中选出当前最优FEP,并将RTU通道切换至最优FEP,最优FEP的选择由FEP的CPU使用率Ucpu、内存使用率Umem和网络状态NS决定,具体计算公式为:a) If a certain RTU channel of the FEP is not in the running state and the duration exceeds T offline , select the current optimal FEP among other FEPs, and switch the RTU channel to the optimal FEP. The selection of the optimal FEP is determined by the CPU of the FEP. The usage rate U cpu , the memory usage rate U mem and the network status NS are determined. The specific calculation formula is:
0.5*NS+0.3*(1-Ucpu)+0.2*(1-Umem)0.5*NS+0.3*(1-U cpu )+0.2*(1-U mem )
计算结果最大的FEP为最优FEP,若有多台FEP计算结果相同,则取编号最大的FEP为最优FEP。The FEP with the largest calculation result is the optimal FEP. If there are multiple FEPs with the same calculation result, the FEP with the largest number is taken as the optimal FEP.
b)设FEP的CPU使用率、内存使用率为U,若U大于设定值Umax,且持续时间超过Toverload,则需要将该FEP下的一些RTU通道分配给其他FEP,分配规则如下:b) Set the CPU usage rate and memory usage rate of the FEP to U. If U is greater than the set value U max and the duration exceeds T overload , some RTU channels under the FEP need to be allocated to other FEPs. The allocation rules are as follows:
1.将该FEP下所有配置为负载均衡的RTU通道按通道相关使用率Urtu由小到大排序;1. Sort all RTU channels configured for load balancing under the FEP according to the channel-related usage U rtu from small to large;
2.依次读取Urtu,并选择当前相关使用率Ubest最低的FEP;2. Read Urtu in turn, and select the FEP with the lowest current related usage rate U best ;
3.若Urtu+Ubest<Umax,则将对应的RTU通道切换至最低使用率的FEP,同时置U=U-Urtu,Ubest=Ubest+Urtu;3. If U rtu +U best <U max , switch the corresponding RTU channel to the FEP with the lowest usage rate, and set U=UU rtu and U best =U best +U rtu at the same time;
4.若Urtu+Ubest>Umax,跳出分配过程;4. If U rtu +U best >U max , jump out of the allocation process;
5.若U-Urtu>Umax,重复步骤2,否则跳出分配过程。5. If UU rtu >U max , repeat step 2, otherwise jump out of the allocation process.
当RTU通道产生负载均衡切换时,主FEP将立即发布负载均衡后的RTU通道分配结果至其他备用FEP,若未产生通道切换,则周期发布RTU通道信息。When load balancing switching occurs on the RTU channel, the master FEP will immediately publish the RTU channel allocation result after load balancing to other standby FEPs. If no channel switching occurs, the RTU channel information will be published periodically.
具体实施例specific embodiment
图1为本发明所述多个冗余采集设备的网络结构图,在每个区域配置多台FEP,FEP与平台模块间采用软总线通信,通信规约采用软总线IDL+PROTOBUF自定义格式,FEP与子系统间通过以太网或串口通信,通信规约使用IEC-60870-5-104、Modbus TCP或自定义规约。Fig. 1 is the network structure diagram of a plurality of redundant acquisition equipment described in the present invention, in each area, disposes a plurality of FEP, adopts soft bus communication between FEP and platform module, the communication protocol adopts soft bus IDL+PROTOBUF self-defined format, FEP It communicates with subsystems through Ethernet or serial port, and the communication protocol uses IEC-60870-5-104, Modbus TCP or custom protocol.
本实施例中,为每台FEP配置区域号和编号,将每个区域需要接入的子系统用RTU通道表示,例如将供电子系统PSCADA表示为RTU 1,火灾子系统FAS表示为RTU 2,环控子系统BAS表示为RTU 3。In this embodiment, an area number and number are configured for each FEP, and the subsystems that need to be connected to each area are represented by RTU channels. For example, the power supply subsystem PSCADA is represented as RTU 1, and the fire subsystem FAS is represented as RTU 2. The environmental control subsystem BAS is denoted as RTU 3.
配置每个RTU通道的接口方式和通信规约,并为每个RTU通道选择冗余方式,对于不需要频繁切换的子系统,如PSCADA子系统,设置冗余方式为故障切换方式,而对于数据量较大,且安全等级较低的子系统,如FAS/BAS子系统,设置冗余方式为负载均衡。Configure the interface mode and communication protocol of each RTU channel, and select the redundancy mode for each RTU channel. For subsystems that do not require frequent switching, such as the PSCADA subsystem, set the redundancy mode to failover mode, while for the data volume For larger subsystems with lower security levels, such as FAS/BAS subsystems, set the redundancy mode to load balancing.
配置FEP软总线路由表,包括FEP与平台各模块通信的系统数据主题、业务数据主题、控制命令主题和命令返校主题,配置每个主题的域、分区、主题名称和内容过滤条件。例如在本实施例中,FEP可配置三条软总线路由,分别为车站服务器、中心PSCADA服务器和中心环控服务器提供数据服务。Configure the FEP soft bus routing table, including system data topics, business data topics, control command topics, and command return topics for communication between FEP and each module of the platform, and configure the domain, partition, topic name, and content filter conditions of each topic. For example, in this embodiment, the FEP can be configured with three soft bus routes to provide data services for the station server, the central PSCADA server, and the central environmental control server, respectively.
配置FEP数据转发表,包含数字量转发表、模拟量转发表和累计量转发表,转发表包含RTU数据与软总线路由的映射关系,例如将所有PSCADA子系统数据与车站服务器软总线路由建立映射,将PSCADA部分重要数据与中心PSCADA服务器软总线路由建立映射,当PSCADA数据变化时,FEP根据数据与软总线路由的映射关系使用一个或多个业务主题发布数据,从而为不同模块提供差异化的数据服务。Configure the FEP data forwarding table, including the digital forwarding table, the analog forwarding table, and the cumulative forwarding table. The forwarding table includes the mapping relationship between RTU data and soft bus routes, such as mapping all PSCADA subsystem data to station server soft bus routes. , Mapping some important data of PSCADA with the soft bus routing of the central PSCADA server. When PSCADA data changes, FEP uses one or more business topics to publish data according to the mapping relationship between the data and the soft bus routing, thereby providing differentiated services for different modules. data service.
如图2所示为本发明FEP主要功能模块,包含节点管理模块、转发模块、同步模块和采集模块,FEP启动后首先置所有RTU通道为备用态,同时节点管理模块通过软总线向节点管理服务器注册本机信息,包含以下注册步骤:Figure 2 shows the main functional modules of the FEP of the present invention, including a node management module, a forwarding module, a synchronization module and an acquisition module. After the FEP is started, all RTU channels are first set to standby state, and the node management module sends to the node management server through the soft bus. Register the machine information, including the following registration steps:
a)使用节点注册主题发布本机节点信息,包括区域号、设备编号和设备状态,并等待节点管理服务器应答;a) Use the node registration topic to publish the local node information, including the area number, device number and device status, and wait for the node management server to respond;
b)若在时间t内未接收到包含本节点状态的应答数据,重复执行步骤a;b) If the response data containing the state of the node is not received within the time t, repeat step a;
c)若在时间t内接收到包含本机节点状态的应答数据,表明节点注册成功,此时根据接收到的状态数据,设置本机的主备状态。c) If the response data containing the node status of the local machine is received within the time t, it indicates that the node registration is successful. At this time, according to the received status data, the active and standby status of the local machine is set.
若FEP当选为主FEP,首先判断当前所有RTU通道是否已分配,若未分配,则根据RTU通道配置和当前在线的FEP信息为每台FEP分配RTU通道,分配结果通过软总线发布给所有备用FEP,若RTU通道已分配,则直接进入负载均衡计算周期;If the FEP is elected as the master FEP, first determine whether all the current RTU channels have been allocated, if not, allocate the RTU channel to each FEP according to the RTU channel configuration and the current online FEP information, and the allocation result will be released to all the standby FEPs through the soft bus , if the RTU channel has been allocated, it will directly enter the load balancing calculation cycle;
若FEP当选为备用FEP,则直接通过软总线订阅主FEP发布的RTU通道分配结果,并实时将本机状态信息和RTU通道状态信息通过软总线发布给主FEP,主FEP则根据所有数据进行负载均衡计算,包含以下计算步骤:If the FEP is selected as the standby FEP, it will directly subscribe to the RTU channel allocation results published by the main FEP through the soft bus, and publish the local state information and RTU channel status information to the main FEP through the soft bus in real time, and the main FEP will load according to all data. Equilibrium calculation, including the following calculation steps:
a)首先检查每台FEP分配的RTU链路状态,若链路未建立且超过规定时间,则重新分配该RTU通道。a) First check the RTU link status allocated by each FEP, if the link is not established and exceeds the specified time, then re-allocate the RTU channel.
b)其次检查每台FEP的性能使用情况,当发现FEP性能使用超负荷时,结合该FEP的RTU通道性能使用情况,将其中一些RTU通道重新分配给其它性能最优的FEP。b) Next, check the performance usage of each FEP, when it is found that the FEP performance usage is overloaded, combine the performance usage of the RTU channel of the FEP, and reassign some of the RTU channels to other FEPs with the best performance.
注册成功后,节点管理模块实时订阅节点管理服务器发布的本区域所有FEP主备状态信息,当发现本机主备状态发生变化时,主动切换至对应状态。After the registration is successful, the node management module subscribes in real time to all the FEP active and standby status information in the local area published by the node management server, and automatically switches to the corresponding state when it finds that the active and standby status of the local machine changes.
FEP正常退出时,节点管理模块将发起退出过程,包含以下两种情况:When the FEP exits normally, the node management module will initiate the exit process, including the following two situations:
a)若本机为主FEP,首先将本机所有RTU通道重新分配给本区域其它FEP,然后通过节点注册主题发布本机注销信息。节点管理服务器接收到FEP注销信息后,置该FEP为离线状态,并重新为该区域选择主FEP;a) If the local machine is the main FEP, first reassign all the RTU channels of the local machine to other FEPs in the area, and then publish the local machine logout information through the node registration topic. After receiving the FEP deregistration information, the node management server sets the FEP to an offline state, and re-selects the primary FEP for the area;
c)若本机为备FEP,直接使用节点注册主题发布本机注销信息。主FEP接收到FEP注销信息后,重新将该FEP上的RTU通道分配给本区域其它FEP;节点管理服务器接收到FEP注销信息后,置该FEP为离线状态。c) If the local machine is the standby FEP, directly use the node registration topic to publish the local machine logout information. After the master FEP receives the FEP deregistration information, it re-allocates the RTU channel on the FEP to other FEPs in the area; after receiving the FEP deregistration information, the node management server sets the FEP to an offline state.
FEP异常退出时,退出过程包含以下两种情况:When FEP exits abnormally, the exit process includes the following two situations:
a)若本机为主FEP,节点管理服务器侦听到FEP掉线事件后,置该FEP为离线状态,并重新为该区域选择主FEP,主FEP根据节点管理服务器发布的FEP状态信息,将离线FEP上的RTU通道重新分配给本区域其它FEP;a) If the local machine is the main FEP, after the node management server detects the FEP disconnection event, it sets the FEP to the offline state, and selects the main FEP for the area again. The RTU channel on the offline FEP is reassigned to other FEPs in the area;
b)若本机为备FEP,节点管理服务器侦听到FEP掉线事件后,置该FEP为离线状态,主FEP根据节点管理服务器发布的FEP状态信息,将离线FEP上的RTU通道重新分配给本区域其它FEP;b) If the local machine is the standby FEP, after the node management server detects the FEP disconnection event, it sets the FEP to the offline state, and the master FEP reassigns the RTU channel on the offline FEP to Other FEPs in the region;
FEP根据分配至本机的RTU通道,分别启动以下服务:FEP starts the following services according to the RTU channel assigned to the machine:
1.启动相应通道的数据采集服务。采集服务主要功能包括:1. Start the data collection service of the corresponding channel. The main functions of the collection service include:
a)根据通道接口配置创建与子系统的通信链路,跟据通道规约配置加载相应的通信规约库;a) Create a communication link with the subsystem according to the channel interface configuration, and load the corresponding communication protocol library according to the channel protocol configuration;
c)接收并解析子系统数据,并将数据写入FEP实时库;c) Receive and parse the subsystem data, and write the data into the FEP real-time library;
d)解析平台控制命令,并将控制命令按通信规约结构打包后转发给子系统。d) Parse the platform control command, and package the control command according to the communication protocol structure and forward it to the subsystem.
2.启动相应通道的数据转发服务。转发服务包含以下功能:2. Start the data forwarding service of the corresponding channel. The forwarding service includes the following functions:
a)通过系统数据主题实时发布本机设备运行状态、软件运行状态、通道状态、以及系统报警;a) Real-time release of local equipment operating status, software operating status, channel status, and system alarms through system data topics;
b)实时检查转发表中相应通道数据是否有变化,当数据变化时,根据数据与软总线路由的映射关系,使用对应的业务数据主题发布变化数据;b) Check in real time whether the corresponding channel data in the forwarding table has changed. When the data changes, use the corresponding business data topic to publish the changed data according to the mapping relationship between the data and the soft bus route;
c)通过控制命令主题订阅平台各模块的控制命令;c) Subscribing the control commands of each module of the platform through the control command topic;
如图3所示,FEP在订阅控制命令时设置了基于FEP编号的内容过滤条件,即只接收控制命令中FEP编号为本机编号的控制命令,由于平台各模块发布控制命令时,会根据节点管理服务器发布的各区域FEP主备状态信息,将主FEP编号附加到控制命令中,因此,控制命令只会由相应区域的主FEP接收。As shown in Figure 3, FEP sets the content filtering condition based on the FEP number when subscribing to the control command, that is, it only receives the control command whose FEP number is the local number in the control command. The active and standby status information of each area FEP issued by the management server adds the main FEP number to the control command. Therefore, the control command can only be received by the main FEP of the corresponding area.
主FEP转发模块接收到控制命令后,首先查看控制命对应的RTU通道是否分配在本机,若是,则直接由本机采集模块转发至相应子系统,若否,则根据RTU通道分配表查询RTU通道所在FEP,然后将控制命令中FEP编号修改为RTU通道所在FEP编号,并通过控制命令主题重新发布控制命令,以此实现控制命令的一对一发送,避免了FEP出现双主或双通道时控制的安全性问题。After the main FEP forwarding module receives the control command, it first checks whether the RTU channel corresponding to the control command is allocated to the local machine. If so, it is directly forwarded by the local acquisition module to the corresponding subsystem. If not, the RTU is queried according to the RTU channel allocation table. The FEP where the channel is located, and then change the FEP number in the control command to the FEP number where the RTU channel is located, and reissue the control command through the control command topic, so as to realize the one-to-one sending of the control command and avoid the dual-master or dual-channel occurrence of the FEP. Control security issues.
d)通过命令返校主题实时发布子系统命令返校。d) Issue the subsystem command to return to school in real time through the command back to school topic.
3.启动相应通道的数据同步服务,同步服务实时检查本机实时库中相应RTU通道的数据是否有变化,当数据变化时,通过数据同步主题发布变化数据,而其它冗余RTU通道的FEP则通过数据同步主题订阅数据,实现冗余RTU通道间的数据同步。3. Start the data synchronization service of the corresponding channel. The synchronization service checks whether the data of the corresponding RTU channel in the local real-time library has changed in real time. When the data changes, the changed data is released through the data synchronization topic, while the FEP of other redundant RTU channels is Subscribe data through the data synchronization topic to realize data synchronization between redundant RTU channels.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited to this. Any person skilled in the art can easily think of various equivalents within the technical scope disclosed by the present invention. Modifications or substitutions should be included within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims (20)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010789660.8A CN111913387B (en) | 2020-08-07 | 2020-08-07 | Multiple acquisition device redundancy and load balancing system based on soft bus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010789660.8A CN111913387B (en) | 2020-08-07 | 2020-08-07 | Multiple acquisition device redundancy and load balancing system based on soft bus |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111913387A true CN111913387A (en) | 2020-11-10 |
CN111913387B CN111913387B (en) | 2025-03-25 |
Family
ID=73283283
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010789660.8A Active CN111913387B (en) | 2020-08-07 | 2020-08-07 | Multiple acquisition device redundancy and load balancing system based on soft bus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111913387B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113098747A (en) * | 2021-04-28 | 2021-07-09 | 卡斯柯信号有限公司 | A real-time soft bus implementation method for smart rail transit system |
CN115695156A (en) * | 2022-10-27 | 2023-02-03 | 宝信软件(成都)有限公司 | Communication front-end processor port management system, port fault handling method and medium |
CN116248429A (en) * | 2022-12-22 | 2023-06-09 | 亿咖通(湖北)技术有限公司 | Method, device, storage medium and electronic equipment for selecting communication channel |
CN116599830A (en) * | 2023-07-19 | 2023-08-15 | 同方泰德软件(北京)有限公司 | Communication node and link configuration method and device, storage medium and electronic equipment |
CN118626279A (en) * | 2024-08-12 | 2024-09-10 | 东方电子股份有限公司 | Path decision method for urban rail transit communication front-end |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103905537A (en) * | 2014-03-20 | 2014-07-02 | 冶金自动化研究设计院 | System for managing industry real-time data storage in distributed environment |
CN104539055A (en) * | 2015-01-07 | 2015-04-22 | 山东鲁能智能技术有限公司 | Electric system key equipment actualizing-one-prepared method and system based on network |
CN105139130A (en) * | 2015-08-27 | 2015-12-09 | 国电南瑞科技股份有限公司 | Power system distributed task management method |
CN105338028A (en) * | 2014-07-30 | 2016-02-17 | 浙江宇视科技有限公司 | Method and device for selecting master and slave nodes in distributed server cluster |
CN106254100A (en) * | 2016-07-27 | 2016-12-21 | 腾讯科技(深圳)有限公司 | A kind of data disaster tolerance methods, devices and systems |
CN106656706A (en) * | 2017-02-25 | 2017-05-10 | 华南理工大学 | Service-oriented robot open control system and method based on software bus |
US20170188280A1 (en) * | 2014-05-08 | 2017-06-29 | Interdigital Patent Holdings, Inc. | Methods and apparatus for selection of dedicated core network |
CN107707464A (en) * | 2017-07-05 | 2018-02-16 | 国网浙江省电力公司 | A kind of front-end system that mass data interaction is carried out based on Distributed Message Queue |
CN108011915A (en) * | 2017-07-05 | 2018-05-08 | 国网浙江省电力公司 | A kind of collection front-end system based on cloud communication |
CN109614228A (en) * | 2018-11-27 | 2019-04-12 | 南京轨道交通系统工程有限公司 | Comprehensively monitoring front-end system and working method based on dynamic load leveling mode |
CN109677465A (en) * | 2018-12-29 | 2019-04-26 | 卡斯柯信号有限公司 | Distributed real-time systems framework for track traffic synthetic monitoring system |
CN110225074A (en) * | 2019-01-04 | 2019-09-10 | 国网浙江省电力有限公司 | A kind of communication packet dissemination system and distribution method based on device address domain |
-
2020
- 2020-08-07 CN CN202010789660.8A patent/CN111913387B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103905537A (en) * | 2014-03-20 | 2014-07-02 | 冶金自动化研究设计院 | System for managing industry real-time data storage in distributed environment |
US20170188280A1 (en) * | 2014-05-08 | 2017-06-29 | Interdigital Patent Holdings, Inc. | Methods and apparatus for selection of dedicated core network |
CN105338028A (en) * | 2014-07-30 | 2016-02-17 | 浙江宇视科技有限公司 | Method and device for selecting master and slave nodes in distributed server cluster |
CN104539055A (en) * | 2015-01-07 | 2015-04-22 | 山东鲁能智能技术有限公司 | Electric system key equipment actualizing-one-prepared method and system based on network |
CN105139130A (en) * | 2015-08-27 | 2015-12-09 | 国电南瑞科技股份有限公司 | Power system distributed task management method |
CN106254100A (en) * | 2016-07-27 | 2016-12-21 | 腾讯科技(深圳)有限公司 | A kind of data disaster tolerance methods, devices and systems |
CN106656706A (en) * | 2017-02-25 | 2017-05-10 | 华南理工大学 | Service-oriented robot open control system and method based on software bus |
CN107707464A (en) * | 2017-07-05 | 2018-02-16 | 国网浙江省电力公司 | A kind of front-end system that mass data interaction is carried out based on Distributed Message Queue |
CN108011915A (en) * | 2017-07-05 | 2018-05-08 | 国网浙江省电力公司 | A kind of collection front-end system based on cloud communication |
CN109614228A (en) * | 2018-11-27 | 2019-04-12 | 南京轨道交通系统工程有限公司 | Comprehensively monitoring front-end system and working method based on dynamic load leveling mode |
CN109677465A (en) * | 2018-12-29 | 2019-04-26 | 卡斯柯信号有限公司 | Distributed real-time systems framework for track traffic synthetic monitoring system |
CN110225074A (en) * | 2019-01-04 | 2019-09-10 | 国网浙江省电力有限公司 | A kind of communication packet dissemination system and distribution method based on device address domain |
Non-Patent Citations (2)
Title |
---|
何绪兰, 刘学纵: "分布式实时系统网络节点管理解决方案", 铁道通信信号, vol. 54, no. 6, 17 June 2018 (2018-06-17), pages 74 - 78 * |
康承昆;刘晓洁;: "一种基于多衡量指标的HDFS负载均衡算法", 四川大学学报(自然科学版), no. 06, 28 November 2014 (2014-11-28) * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113098747A (en) * | 2021-04-28 | 2021-07-09 | 卡斯柯信号有限公司 | A real-time soft bus implementation method for smart rail transit system |
WO2022227414A1 (en) * | 2021-04-28 | 2022-11-03 | 卡斯柯信号有限公司 | Real-time soft bus implementation method oriented to intelligent rail transit system |
US12250093B2 (en) | 2021-04-28 | 2025-03-11 | Casco Signal Co., Ltd. | Method for implementing real-time soft bus oriented to intelligent rail transit system |
CN115695156A (en) * | 2022-10-27 | 2023-02-03 | 宝信软件(成都)有限公司 | Communication front-end processor port management system, port fault handling method and medium |
CN116248429A (en) * | 2022-12-22 | 2023-06-09 | 亿咖通(湖北)技术有限公司 | Method, device, storage medium and electronic equipment for selecting communication channel |
CN116599830A (en) * | 2023-07-19 | 2023-08-15 | 同方泰德软件(北京)有限公司 | Communication node and link configuration method and device, storage medium and electronic equipment |
CN116599830B (en) * | 2023-07-19 | 2023-10-10 | 同方泰德软件(北京)有限公司 | Communication node and link configuration method and device, storage medium and electronic equipment |
CN118626279A (en) * | 2024-08-12 | 2024-09-10 | 东方电子股份有限公司 | Path decision method for urban rail transit communication front-end |
Also Published As
Publication number | Publication date |
---|---|
CN111913387B (en) | 2025-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111913387A (en) | System for redundancy and load balancing of multiple acquisition devices based on soft bus | |
TWI436197B (en) | Rack level power management | |
CN112671882B (en) | Same-city double-activity system and method based on micro-service | |
US7400062B2 (en) | Rack level power management | |
US7952997B2 (en) | Congestion management groups | |
EP1489792B1 (en) | Method of quality of service-based flow control within a distributed switch fabric network | |
CN109660466A (en) | A kind of more live load balance realizing methods towards cloud data center tenant | |
JP2003186765A (en) | Network connecting device, network connecting device management system and network connecting device management method | |
CN102006226A (en) | Message cache management method and device as well as network equipment | |
CA2342091A1 (en) | Modular switch with dynamic bus | |
CN108306955A (en) | A kind of car-mounted terminal interconnects cluster method on a large scale | |
CN107682411A (en) | A kind of extensive SDN controllers cluster and network system | |
CN108600322A (en) | Integrated video monitoring cloud service system and method based on railway video technical specification | |
CN101621409B (en) | Service control method, service control device and broadband access servers | |
CN114095075A (en) | An optical network fault recovery method based on service customization demand perception | |
CN110456705A (en) | Network control device capable of dynamically expanding interface and building automatic control system | |
CN118449899A (en) | Method for constructing automatic switching based on 5G private network and traditional MPLS side network | |
CN111262723A (en) | Edge intelligent computing platform based on modularized hardware and software definition | |
US20060067335A1 (en) | Method of managing a network system for a storage system | |
WO2017063720A1 (en) | Data center network node | |
CN118678306A (en) | Short message sending method, device, equipment, storage medium and program product | |
CN109669410B (en) | Communication master supervisor election method based on multi-source information | |
CN115766614B (en) | Service access method for distribution network equipment | |
CN116743539A (en) | Multi-network redundant layered distributed programmable fault-tolerant arbitration service system | |
CN116800686A (en) | Load balancing traffic distribution methods, systems, equipment and storage media |
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 |