Redundant FEP load balancing system and method for comprehensive monitoring of rail transit
By designing a redundant FEP load balancing system in the comprehensive rail transit monitoring system and using dynamic planning algorithm to manage the main and standby status of the channel, the problem of low resource utilization in the redundant hot standby mode of FEP dual-machine is solved, and efficient utilization of FEP hardware resources and long-term and stable operation of the system is achieved.
Patent Information
- Application Number
- CN202411676376.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
In the comprehensive rail transit monitoring system, FEP adopts the operating mode of dual-machine redundant hot standby. At the same time, only one FEP's resources are actually used. The other FEP is in an idle state most of the time, resulting in low hardware resource utilization and inconsistent usage frequency, which affects the long-term and stable operation of the system.
A redundant FEP load balancing system for comprehensive monitoring of rail transit is designed. Two sets of balance subsystems are respectively set on the corresponding FEP, including a communication processing module, a state management module and a channel management module. The dynamic planning algorithm is used to manage the main and standby operation status of the channel, so that the two FEPs have similar loads.
It realizes efficient utilization of FEP hardware resources, ensures load balancing of the two FEPs, improves the operating efficiency and long-term stability of the system, and can not only achieve load balancing in normal scenarios, but also provide redundant hot standby in abnormal situations.
Smart Images

Figure CN119621311A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of rail transit integrated monitoring, and in particular to a redundant FEP load balancing system and method for rail transit integrated monitoring. Background Art
[0002] FEP (Front End Processor) represents the front end communication processor in the rail transit integrated monitoring system. It is usually used as a medium for data exchange between the integrated monitoring system and the external interconnected system, and is responsible for protocol parsing and data forwarding. FEP can separate the tedious data collection tasks from the main server, reduce the network bandwidth usage and IO throughput of the main server, so that the main server can concentrate on processing business logic and improve the performance and efficiency of the main service. Due to the need for frequent data interaction with external systems, FEP is usually dual-machine redundant hot standby to prevent the problem of communication interruption with external systems caused by a single device failure, thereby improving the reliability of the system.
[0003] Currently, the dual-machine redundancy of FEP is usually in active-standby mode, that is, one FEP runs as the master machine and the other FEP runs as the standby machine. When the master machine fails, the standby machine switches to work.
[0004] However, in the above operating mode, only the resources of one FEP are actually used at the same time, and the other FEP is idle most of the time and only performs data synchronization, which leads to low utilization of the FEP hardware resources. In addition, the inconsistent usage frequency may also lead to different degrees of wear and tear of the two FEPs, which is not conducive to the long-term stable operation of the system. Summary of the invention
[0005] The purpose of the present invention is to provide a redundant FEP load balancing system and method for comprehensive monitoring of rail transit, aiming to solve the technical problem in the prior art that, in the operation mode of FEP adopting dual-machine redundant hot standby, only the resources of one FEP are actually used at the same time, and the other FEP is in an idle state most of the time and only performs data synchronization, which leads to low utilization of the hardware resources of the FEP, and the inconsistency in the frequency of use may also cause differences in the degree of loss of the two FEPs, which is not conducive to the long-term stable operation of the system.
[0006] To achieve the above-mentioned object, the present invention adopts a redundant FEP load balancing system for comprehensive monitoring of rail transit, comprising two groups of balancing subsystems, the two groups of balancing subsystems are respectively arranged on corresponding FEPs, the balancing subsystems include a communication processing module, a state management module and a channel management module, the two communication processing modules are connected to each other, and the state management module and the channel management module are both connected to the communication interface of the corresponding communication processing module;
[0007] The communication processing module communicates based on the TCP / IP protocol and is mainly used to establish a network connection between two FEPs and exchange data;
[0008] The state management module manages the state switching process of the FEP, and the state management module has a state machine, which is used by the FEP to determine the operating state of the machine and the operating state to be switched by the machine;
[0009] The channel management module manages the master and standby states of the acquisition channels. When a channel runs in the master state on the local machine, the channel is in the standby state on the opposite machine.
[0010] The present invention also provides a redundant FEP load balancing method for rail transit comprehensive monitoring, using the redundant FEP load balancing system for rail transit comprehensive monitoring as described above,
[0011] The steps include:
[0012] Step 1: The two communication processing modules are connected to each other so that the two FEPs are connected;
[0013] Step 2: The communication processing module periodically checks the connection status between the local device and the peer device, sends heartbeat and local status data to the peer device, and receives periodic information from the peer device;
[0014] Step 3: The state management module checks the current state in real time based on the data received by the communication processing module, and determines whether state switching is required through the state machine according to the real-time state of the local machine and the real-time state of the other machine. If switching is required, the local state is modified to the main mode, standby mode or load balancing mode and the state information is sent to the other machine, and then the channel management module is notified;
[0015] Step 4: When a mode change occurs, the channel management module switches the local channel between the main and backup modes according to the mode. If it is the main mode, all channels are switched to the main channel; if it is the backup mode, all channels are switched to the backup channels; if it is the load balancing mode, a dynamic programming algorithm is used to switch all channels to the main channel and the backup channel.
[0016] Among them, in step 1, the two communication processing modules communicate based on the TCP / IP protocol, and each includes a TcpClient and a TcpServer; when the system starts, the communication processing module starts the TcpServer, and then uses the TcpClient to connect to the TcpServer of the other machine, and uses the TcpServer to connect to the TcpClient of the other machine; when the two FEPs successfully establish a connection, the sending and receiving of data between the two machines can be realized.
[0017] Among them, in step 2, when the communication processing module does not receive the heartbeat of the other machine exceeding the threshold, it is determined that the connection to the machine is invalid, and the state of the other machine is set to "connection invalid" for the state management module to perform mode judgment.
[0018] Among them, in step 2, the local status data sent includes the current operating mode of the local machine and the master / slave status of all channels of the local machine, and this status is also used by the status management module to perform mode judgment.
[0019] Among them, in step three, except for the startup and stop stages, the status of FEP is in load balancing mode, master mode and backup mode; when the two FEPs are operating normally, both FEPs will be in load balancing mode, and when an abnormality or exit is detected on the machine, the local machine will switch to the master mode, and the local backup mode will only appear when the machine is in master mode after startup and the request to switch to load balancing mode fails.
[0020] Among them, in step 4, the channel management module switches the local channel between master and slave according to the mode. If it is the master mode, the channel connects to the external system and interacts with data when running in the master state; if it is the slave mode, the channel only synchronizes and caches the data of the master channel when running in the slave state.
[0021] Among them, in the master mode, all channels are switched to the master state, at this time the other machine is in a communication interruption or stop state, and the load is concentrated on this machine; in the backup mode, all channels are switched to the backup state, at this time the other machine must be in the master mode, and the load is concentrated on the other machine.
[0022] Among them, in the load balancing mode, the channel management modules of the two FEPs use a dynamic programming algorithm to divide the channels into two groups according to the load conditions of each channel. The two FEPs are marked as FEP1 and FEP2. FEP1 runs the channels of group 1 as the main channels and the channels of group 2 as the backup channels. FEP2 runs the channels of group 1 as the backup channels and the channels of group 2 as the main channels. Since the configurations of FEP1 and FEP2 are consistent, the calculated groups are consistent, and the sequence numbers of FEP1 and FEP2 are configured in advance, so it can ensure that the main and backup channels of the two machines are complementary.
[0023] The process of applying the dynamic programming algorithm to load balancing distribution is as follows:
[0024] Assume that each channel (channel1, channel2, ..., channel i ) are processed at (n1,b2,…,n i ), the average values of the two groups are
[0025]
[0026] Assume that the two groups are g1 and g2;
[0027] Arrange these numbers in order from large to small, starting with the largest number. The largest number is recorded as max. If max ≥ avg, add max directly to g1, and the others to g2, and the grouping ends.
[0028] Otherwise, add max to a group g1, take delta0 = avg-max, and then loop the following steps:
[0029] Find and delta i The closest number, denoted as num i Add g1, if the sum of g1 ≥ avg, stop the loop, otherwise calculate delta i+1 =delta i -num i , continue the cycle;
[0030] After the loop is completed, add all the remaining numbers to g2, and you can get the two loads grouped as evenly as possible;
[0031] According to the grouping, the channel of group g1 i The main channel runs on FEP1 and the backup channel runs on FEP2. i It runs on FEP2 as the primary channel and on FEP1 as the backup channel.
[0032] Among them, in the search for i The closest number, when with delta i If there are two closest numbers, take the larger one.
[0033] The present invention discloses a redundant FEP load balancing system and method for comprehensive monitoring of rail transit. The present invention mainly improves the traditional active-standby architecture of dual-machine redundant FEP and supports channel-level redundancy. On the one hand, the state (mode) management is performed through the state machine to ensure the redundancy capability of the system and the real-time response capability to external environmental changes. On the other hand, the dynamic programming algorithm is used to manage the active-standby operation status of the channel so that the two FEPs have similar loads, which can fully utilize the system resources and improve the operation efficiency. The state machine designed by the present invention ensures that the two machines run in load balancing mode when the two machines run smoothly and the communication is normal, and switches to active-standby mode only when the connection is interrupted or the device is abnormal. It can not only ensure load balancing in normal scenarios, but also ensure redundant hot standby in abnormal situations. The group calculation based on the dynamic programming algorithm can effectively distribute each channel to the two FEP machines according to the load size to achieve load balancing. This method can effectively solve the problem in the prior art that in the operation mode of dual-machine redundant hot standby of FEP, only the resources of one FEP are actually used at the same time, and the other FEP is idle most of the time and only performs data synchronization, which leads to low utilization of the hardware resources of FEP. In addition, the inconsistent frequency of use may also lead to different degrees of wear and tear of the two FEPs, which is not conducive to the long-term stable operation of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 It is a principle block diagram of the redundant FEP load balancing system for rail transit comprehensive monitoring of the present invention.
[0036] Figure 2 It is a flow chart of the redundant FEP load balancing method for rail transit comprehensive monitoring of the present invention.
[0037] Figure 3 It is a schematic diagram of channel status under different operation modes of two FEPs of the present invention.
[0038] Figure 4 It is a schematic diagram of the state machine operation of the present invention.
[0039] 1-Communication processing module, 2-Status management module, 3-Channel management module. DETAILED DESCRIPTION
[0040] Embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, but should not be construed as limiting the present invention.
[0041] See also Figure 1 , Figure 1 It is a principle block diagram of the redundant FEP load balancing system for rail transit comprehensive monitoring of the present invention.
[0042] The present invention provides a redundant FEP load balancing system for rail transit comprehensive monitoring, comprising two groups of balancing subsystems, the two groups of balancing subsystems are respectively arranged on corresponding FEPs, the balancing subsystems include a communication processing module 1, a state management module 2 and a channel management module 3, the two communication processing modules 1 are connected to each other, the state management module 2 and the channel management module 3 are both connected to the communication interface of the corresponding communication processing module 1;
[0043] The communication processing module 1 communicates based on the TCP / IP protocol and is mainly used to establish a network connection between two FEPs and exchange data;
[0044] The state management module 2 manages the state switching process of the FEP, and the state management module 2 has a state machine, which is used by the FEP to determine the operating state of the machine and the operating state to be switched by the machine;
[0045] The channel management module 3 manages the master and slave states of the acquisition channels. When a channel runs in the master state on the local machine, the channel is in the slave state on the opposite machine.
[0046] For this specific implementation, the present invention mainly improves the traditional active-standby architecture of dual-machine redundant FEP, supports channel-level redundancy, and manages the state (mode) through the state machine, thereby ensuring the redundancy capability of the system and the real-time response capability to changes in the external environment. The state machine designed by the present invention ensures that the dual machines run in load balancing mode when the dual machines run smoothly and the communication is normal, and switches to active-standby mode only when the connection is interrupted or the device is abnormal. It can ensure both load balancing in normal scenarios and redundant hot standby in abnormal situations.
[0047] See also Figures 2 to 4 , Figure 2 is a flow chart of a redundant FEP load balancing method for rail transit integrated monitoring of the present invention, Figure 3 is a schematic diagram of the channel status of two FEPs in different operating modes of the present invention, Figure 4 It is a schematic diagram of the state machine operation of the present invention.
[0048] The present invention also provides a redundant FEP load balancing method for rail transit comprehensive monitoring, using the redundant FEP load balancing system for rail transit comprehensive monitoring as described above,
[0049] The steps include:
[0050] S101, the two communication processing modules 1 are connected to each other in communication, so that the two FEPs are connected;
[0051] According to this specific implementation, the two communication processing modules 1 communicate based on the TCP / IP protocol, and each includes a TcpClient and a TcpServer; when the system starts, the communication processing module 1 starts the TcpServer, and then uses the TcpClient to connect to the TcpServer of the other machine, and uses the TcpServer to connect to the TcpClient of the other machine; when the two FEPs successfully establish a connection, the sending and receiving of data between the two machines can be realized.
[0052] S102, the communication processing module 1 periodically checks the connection status between the local machine and the peer machine, sends heartbeat and local status data to the peer machine, and receives periodic information from the peer machine;
[0053] According to this specific implementation, when the communication processing module 1 does not receive a heartbeat exceeding a threshold value from the peer machine, it is determined that the peer machine connection is invalid, and the peer machine state is set to "connection invalid" for the state management module 2 to perform mode judgment;
[0054] The local status data sent includes the current operation mode of the local machine and the master / slave status of all channels of the local machine, and this status is also used by the status management module 2 to perform mode judgment.
[0055] S103, the state management module 2 checks the current state in real time based on the data received by the communication processing module 1, and determines whether state switching is required through the state machine according to the real-time state of the local machine and the real-time state of the other machine. If switching is required, the local state is modified to the main mode, standby mode or load balancing mode and the state information is sent to the other machine, and then the channel management module 3 is notified;
[0056] For this specific implementation, except for the startup and stop stages, the FEP status is in load balancing mode, master mode and backup mode; when the two FEPs are operating normally, both FEPs will be in load balancing mode, and when an abnormality or exit of the machine is detected, the local machine will switch to the master mode, and the local backup mode will only appear when the machine is in master mode after startup and the request to switch to load balancing mode fails.
[0057] S104. When a mode change occurs, the channel management module 3 switches the local channel between the main and backup modes according to the mode. If it is the main mode, all channels are switched to the main channel; if it is the backup mode, all channels are switched to the backup channels; if it is the load balancing mode, a dynamic programming algorithm is used to switch all channels to the main channel and the backup channel.
[0058] According to this specific implementation, the channel management module 3 switches the local channel between master and slave according to the mode. If it is the master mode, the channel connects to the external system and performs data interaction when running in the master state; if it is the slave mode, the channel only synchronizes and caches the data of the master channel when running in the slave state.
[0059] In the master mode, all channels are switched to the master state, at which point the communication with the other machine is interrupted or stopped, and the load is concentrated on the local machine; in the backup mode, all channels are switched to the backup state, at which point the other machine must be in the master mode, and the load is concentrated on the other machine.
[0060] Among them, in the load balancing mode, the channel management modules 3 of the two FEPs use a dynamic programming algorithm to divide the channels into two groups according to the load conditions of each channel. The two FEPs are marked as FEP1 and FEP2. FEP1 runs the channels of group 1 as the main channel and the channels of group 2 as the backup channels. FEP2 runs the channels of group 1 as the backup channels and the channels of group 2 as the main channels. Since the configurations of FEP1 and FEP2 are consistent, the calculated groups are consistent, and the sequence numbers of FEP1 and FEP2 are configured in advance, so it can be ensured that the main and backup channels of the two machines are complementary.
[0061] The process of applying the dynamic programming algorithm to load balancing distribution is as follows:
[0062] Assume that each channel (channel1, channel2, ..., channel i ) are processed at (n1,n2,…,n i ), the average values of the two groups are
[0063]
[0064] Assume that the two groups are g1 and g2;
[0065] Arrange these numbers in order from large to small, starting with the largest number. The largest number is recorded as max. If max ≥ avg, add max directly to g1, and the others to g2, and the grouping ends.
[0066] Otherwise, add max to a group g1, take delta0 = avg-max, and then loop the following steps:
[0067] Find and delta i The closest number, denoted as num i Add g1, if the sum of g1 ≥ avg, stop the loop, otherwise calculate delta i+1 =delta i -num i , continue the cycle;
[0068] After the loop is completed, add all the remaining numbers to g2, and you can get the two loads grouped as evenly as possible;
[0069] According to the grouping, the channel of group g1 i The main channel runs on FEP1 and the backup channel runs on FEP2. i It runs on FEP2 as the primary channel and on FEP1 as the backup channel.
[0070] Among them, in the search for i The closest number, when with delta i If there are two closest numbers, take the larger one.
[0071] A redundant FEP load balancing system and method for comprehensive rail transit monitoring of the present invention is used. When it is used specifically, the present invention mainly improves the traditional active-standby architecture of dual-machine redundant FEP and supports channel-level redundancy. On the one hand, the state (mode) management is performed through the state machine to ensure the redundancy capability of the system and the real-time response capability to changes in the external environment; on the other hand, the active-standby operation status of the channel is managed by a dynamic programming algorithm, so that the two FEPs have similar loads, the system resources can be fully utilized, and the operation efficiency is improved. The state machine designed by the present invention ensures that the two machines run in load balancing mode when the two machines run smoothly and the communication is normal, and switches to active-standby mode only when the connection is interrupted or the device is abnormal. It can not only ensure load balancing in normal scenarios, but also ensure redundant hot standby in abnormal situations. The group calculation based on the dynamic programming algorithm can effectively distribute each channel to the two FEP machines according to the load size to achieve load balancing. This method can effectively solve the problem in the prior art that in the operation mode of dual-machine redundant hot standby of FEP, only the resources of one FEP are actually used at the same time, and the other FEP is idle most of the time and only performs data synchronization, which leads to low utilization of the hardware resources of FEP. In addition, the inconsistent frequency of use may also lead to different degrees of wear and tear of the two FEPs, which is not conducive to the long-term stable operation of the system.
[0072] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A redundant FEP load balancing system for comprehensive rail transit monitoring, characterized in that: It comprises two groups of balancing subsystems, which are respectively arranged on corresponding FEPs, and the balancing subsystems comprise a communication processing module, a state management module and a channel management module, the two communication processing modules are connected to each other, and the state management module and the channel management module are both connected to the communication interface of the corresponding communication processing module; The communication processing module communicates based on the TCP / IP protocol and is mainly used to establish a network connection between two FEPs and exchange data; The state management module manages the state switching process of the FEP, and the state management module has a state machine, which is used by the FEP to determine the operating state of the machine and the operating state to be switched by the machine; The channel management module manages the master and standby states of the acquisition channels. When a channel runs in the master state on the local machine, the channel is in the standby state on the opposite machine.
2. A redundant FEP load balancing method for rail transit integrated monitoring, using the redundant FEP load balancing system for rail transit integrated monitoring as claimed in claim 1, characterized in that: The steps include: Step 1: The two communication processing modules are connected to each other so that the two FEPs are connected; Step 2: The communication processing module periodically checks the connection status between the local device and the peer device, sends heartbeat and local status data to the peer device, and receives periodic information from the peer device; Step 3: The state management module checks the current state in real time based on the data received by the communication processing module, and determines whether state switching is required through the state machine according to the real-time state of the local machine and the real-time state of the other machine. If switching is required, the local state is modified to the main mode, standby mode or load balancing mode and the state information is sent to the other machine, and then the channel management module is notified; Step 4: When a mode change occurs, the channel management module switches the local channel between the master and the slave according to the mode. If it is the master mode, all channels are switched to the master channel; if it is the slave mode, all channels are switched to the slave channel; If it is load balancing mode, a dynamic programming algorithm is used to switch all channels to the main channel and the backup channel.
3. The redundant FEP load balancing method for rail transit integrated monitoring as claimed in claim 2, characterized in that: In step 1, the two communication processing modules communicate based on the TCP / IP protocol, and each includes a TcpClient and a TcpServer; when the system starts, the communication processing module starts the TcpServer, and then uses the TcpClient to connect to the TcpServer of the other machine, and uses the TcpServer to connect to the TcpClient of the other machine; when the two FEPs successfully establish a connection, the sending and receiving of data between the two machines can be realized.
4. The redundant FEP load balancing system and method for rail transit integrated monitoring as claimed in claim 3, characterized in that: In step 2, when the communication processing module does not receive a heartbeat from the peer device that exceeds a threshold, it determines that the peer device connection is invalid, and sets the peer device status to connection invalid, which is used by the status management module to perform mode judgment.
5. The redundant FEP load balancing method for rail transit integrated monitoring as claimed in claim 4, characterized in that: In step 2, the local status data sent includes the current operating mode of the local machine and the master / slave status of all channels of the local machine, and the status is also used by the status management module to perform mode judgment.
6. The redundant FEP load balancing method for rail transit integrated monitoring as claimed in claim 5, characterized in that: In step three, except for the startup and stop stages, the FEP status is in load balancing mode, master mode and backup mode; when the two FEPs are operating normally, both FEPs are in load balancing mode. When an abnormality or exit is detected on the machine, the local machine switches to the master mode, and the local backup mode only appears when the machine is in master mode after startup and the request to switch to load balancing mode fails.
7. The redundant FEP load balancing method for rail transit integrated monitoring as claimed in claim 6, characterized in that: In step 4, the channel management module switches the local channel between master and slave modes. If it is the master mode, the channel connects to the external system and performs data interaction when running in the master state; if it is the slave mode, the channel only synchronizes and caches the data of the master channel when running in the slave state.
8. The redundant FEP load balancing method for rail transit integrated monitoring as claimed in claim 7, characterized in that: In the master mode, all channels are switched to the master state, at which point the communication with the other machine is interrupted or stopped, and the load is concentrated on the local machine; in the backup mode, all channels are switched to the backup state, at which point the other machine must be in the master mode, and the load is concentrated on the other machine.
9. The redundant FEP load balancing method for rail transit integrated monitoring as claimed in claim 8, characterized in that: In load balancing mode, the channel management modules of the two FEPs use a dynamic programming algorithm to divide the channels into two groups according to the load conditions of each channel. The two FEPs are marked as FEP1 and FEP2. FEP1 runs the channels of group 1 as the main channels and the channels of group 2 as the backup channels. FEP2 runs the channels of group 1 as the backup channels and the channels of group 2 as the main channels. Since the configurations of FEP1 and FEP2 are the same, the calculated groups are the same, and the sequence numbers of FEP1 and FEP2 are configured in advance, so the main and backup channels of the two machines can be complementary. The process of applying the dynamic programming algorithm to load balancing distribution is as follows: Assume that each channel (channel1, channel2, ..., channel i ) are processed at (n1, n2, ..., n i ), the average values of the two groups are Assume that the two groups are g1 and g2; Arrange these numbers in order from large to small, starting with the largest number. The largest number is recorded as max. If max ≥ avg, add max directly to g1, and the others to g2, and the grouping ends. Otherwise, add max to a group g1, take delta0 = avg-max, and then loop the following steps: Find and delta i The closest number, denoted as num i Add g1, if the sum of g1 ≥ avg, stop the loop, otherwise calculate delta i+1 =delta i -num i , continue the cycle; After the loop is completed, add all the remaining numbers to g2, and you can get the two loads grouped as evenly as possible; According to the grouping, the channel of group g1 i The main channel runs on FEP1 and the backup channel runs on FEP2. i It runs on FEP2 as the primary channel and on FEP1 as the backup channel.
10. The redundant FEP load balancing method for rail transit integrated monitoring as claimed in claim 9, characterized in that: In search of i The closest number, when with delta i If there are two closest numbers, take the larger one.