Main-standby switching method and device of train control system, equipment and medium

By detecting the communication quality of the main and backup system at every preset period in the train control system, if the main system is lower than the backup system, the main and backup switching will be performed, which solves the problem of switching only when the main system fails in the prior art, and improves the System performance and flexibility.

CN119058791APending Publication Date: 2024-12-03QINGDAO JIADU WEILIAN SIGNALING SYSTEM CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310654434.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-02
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The existing train control system only performs main and standby switching when the main system fails. The design is not flexible enough to flexibly switch according to the respective communication comprehensive performance of the main and standby systems, which affects the system performance.

Method used

By determining the external communication quality according to the number of data packets received by the main system and the backup system every preset period, if the communication quality of the main system is lower than that of the backup system, the main and backup switching will be performed to realize the switching operation based on the comprehensive communication performance.

Benefits of technology

There is no need to switch when the main system fails. Switching is based on the overall communication performance of the main and standby systems, improving system performance and flexibility and ensuring the stable operation of the system under different communication conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119058791A_ABST
    Figure CN119058791A_ABST
Patent Text Reader

Abstract

The invention discloses a main-standby switching method and device of a train control system, equipment and a medium, and relates to the technical field of rail transit. The method comprises the following steps: determining whether the external communication quality of a main system is lower than that of a standby system or not according to the number of first data packets sent by external equipment and received by the main and standby systems at preset time intervals; and when it is determined that the external communication quality of the main system is lower than that of the standby system, whether the communication comprehensive quality of the main system in the preset time period is lower than that of the standby system is determined according to a second data packet synchronized from the main system to the standby system, and main-standby switching is performed based on the communication comprehensive quality of the main system in the preset time period. By means of the process, the main-standby switching does not need to be carried out when the main system breaks down, when the main system does not break down, the main-standby switching can be carried out according to the advantages and disadvantages of the respective communication comprehensive performance of the main system and the standby system, and then the system performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of rail transit technology, and in particular to a method, device, equipment and medium for switching between a primary and a secondary train control system. Background Art

[0002] The Communication Based Train Control System (CBTC) is a system that uses wireless communication instead of traditional track circuits to control train operation. It is equipped with rail transit signal equipment such as zone controller (ZC) and computer interlocking (CI).

[0003] In order to reduce the impact of system failures on vehicle operations, these rail transit signal equipment mostly adopts a dual-system hot standby redundant structure. This structural deployment will start the dual systems when the equipment is powered on and compete for the master-slave relationship. When the main system link fails, the standby system is upgraded to the main system to ensure the normal operation of the equipment. However, this design method can only perform the master-slave switching operation when the main system fails, and the design is not flexible enough. Summary of the invention

[0004] The embodiments of the present application provide a method, device, equipment and medium for master-slave switching of a train control system, which are used to perform master-slave switching according to the comprehensive communication performance of each master and standby system to improve system performance.

[0005] To achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a method for switching between a primary and a secondary train control system, the method comprising:

[0007] At every preset time period, determining whether the external communication quality of the main system is lower than that of the standby system according to the number of first data packets received by the main system and the standby system respectively; wherein the first data packet is sent by an external device, and the external device distributes the same first data packet to the main system and the standby system each time;

[0008] If it is determined that the external communication quality of the primary system is lower than that of the standby system, determining whether the comprehensive communication quality of the primary system within the preset time period is lower than that of the standby system according to the second data packet synchronized by the primary system to the standby system;

[0009] The master-slave switching operation is performed based on the comprehensive communication quality of the master system within the preset time period.

[0010] In some possible embodiments, determining whether the external communication quality of the primary system is lower than that of the standby system according to the number of first data packets received by the primary system and the standby system respectively includes:

[0011] For each external device, determining whether the external communication quality between the main system and the external device is lower than that of the standby system according to the number of first data packets sent by the external device received by the main system and the standby system;

[0012] If the number of target devices is greater than a third threshold, it is determined that the external communication quality of the primary system is lower than that of the backup system; wherein the external communication quality between the primary system and the target devices is lower than that of the backup system.

[0013] In some possible embodiments, whether the external communication quality between the main system and any external device is lower than that of the standby system is determined in the following manner:

[0014] Determine respectively the number of first data packets sent by the external device received by the primary system and the backup system;

[0015] If the number of first data packets not received by the main system is greater than a first threshold, and the number of first data packets not received by the backup system is less than a second threshold, it is determined that the external communication quality of the main system for the external device is lower than that of the backup system; wherein the second threshold is less than the first threshold.

[0016] In some possible embodiments, determining whether the overall communication quality of the primary system within the preset time period is lower than that of the backup system according to the second data packet synchronized by the primary system to the backup system includes:

[0017] determining whether the synchronous communication quality of the primary system is lower than that of the backup system according to a second data packet synchronized from the primary system to the backup system;

[0018] If the synchronous communication quality of the primary system is lower than that of the backup system, it is determined that the comprehensive communication quality of the primary system within the preset time period is lower than that of the backup system.

[0019] In some possible embodiments, the number of packet losses of the second data packet is recorded in the following manner:

[0020] When the standby system receives a second data packet synchronized by the primary system, determining whether a data packet format of the second data packet satisfies a preset format;

[0021] If the preset format is satisfied, the number of packet losses is reduced by a preset value when the number of packet losses currently recorded is greater than a specified value;

[0022] If the preset format is not satisfied and the synchronous communication quality of the primary system is not lower than that of the backup system, a preset value is added to the number of packet losses currently recorded.

[0023] In some possible embodiments, the method further includes:

[0024] When the data packet format of any second data packet satisfies a preset format, verifying the specified type of data in the second data packet by the primary system and the backup system respectively;

[0025] The determining, according to the second data packet synchronized from the primary system to the backup system, whether the synchronous communication quality of the primary system is lower than that of the backup system comprises:

[0026] If the primary system and / or the backup system fails to verify the data of the specified type, it is determined that the synchronous communication quality of the primary system is lower than that of the backup system;

[0027] If the primary system and the backup system successfully verify the specified type of data, a synchronization timeout duration is determined according to the number of packet losses currently recorded, and when the synchronization timeout duration is greater than a fourth threshold, it is determined that the synchronization communication quality of the primary system is lower than that of the backup system.

[0028] In some possible embodiments, performing the master-slave switching operation based on the comprehensive communication quality of the master system within the preset time period includes:

[0029] The master-slave switching operation is performed when the overall communication quality of the master system is lower than that of the standby system for N consecutive preset time periods, where N is a positive integer; and / or,

[0030] When the difference between the number of the first time period and the number of the second time period is greater than the fourth threshold, the master-slave switching operation is performed; wherein, the first time period is a time period in which the comprehensive communication quality of the master system is lower than the preset time period of the backup system; the second time period is a time period in which the comprehensive communication quality of the master system is not lower than the preset time period of the backup system.

[0031] In some possible embodiments, the method further includes:

[0032] If it is determined that the overall communication quality of the primary system in the preset time period is lower than that of the backup system, the number of lost packets of the second data packet currently recorded is cleared; and the number of the first data packets received by the primary system and the backup system is cleared.

[0033] In a second aspect, an embodiment of the present application provides a master-slave switching device for a train control system, the device comprising:

[0034] The system monitoring module is configured to determine whether the external communication quality of the main system is lower than that of the standby system according to the number of first data packets received by the main system and the standby system respectively at every preset time period; wherein the first data packet is sent by an external device, and the external device distributes the same first data packet to the main system and the standby system each time;

[0035] A communication quality module is configured to determine whether the overall communication quality of the main system within the preset time period is lower than that of the standby system according to a second data packet synchronized from the main system to the standby system if it is determined that the external communication quality of the main system is lower than that of the standby system;

[0036] The active-standby switching module is configured to perform an active-standby switching operation based on the comprehensive communication quality of the primary system within the preset time period.

[0037] In some possible embodiments, the method of determining whether the external communication quality of the primary system is lower than that of the standby system according to the number of first data packets received by the primary system and the standby system respectively is performed, and the system monitoring module is configured as follows:

[0038] For each external device, determining whether the external communication quality between the main system and the external device is lower than that of the standby system according to the number of first data packets sent by the external device received by the main system and the standby system;

[0039] If the number of target devices is greater than a third threshold, it is determined that the external communication quality of the primary system is lower than that of the backup system; wherein the external communication quality between the primary system and the target devices is lower than that of the backup system.

[0040] In some possible embodiments, whether the external communication quality between the main system and any external device is lower than that of the standby system is determined in the following manner:

[0041] Determine respectively the number of first data packets sent by the external device received by the primary system and the backup system;

[0042] If the number of first data packets not received by the main system is greater than a first threshold, and the number of first data packets not received by the backup system is less than a second threshold, it is determined that the external communication quality of the main system for the external device is lower than that of the backup system; wherein the second threshold is less than the first threshold.

[0043] In some possible embodiments, the step of determining whether the overall communication quality of the primary system within the preset time period is lower than that of the standby system according to the second data packet synchronized from the primary system to the standby system is performed, and the communication quality module is configured as follows:

[0044] determining whether the synchronous communication quality of the primary system is lower than that of the backup system according to a second data packet synchronized from the primary system to the backup system;

[0045] If the synchronous communication quality of the primary system is lower than that of the backup system, it is determined that the comprehensive communication quality of the primary system within the preset time period is lower than that of the backup system.

[0046] In some possible embodiments, the number of packet losses of the second data packet is recorded in the following manner:

[0047] When the standby system receives a second data packet synchronized by the primary system, determining whether a data packet format of the second data packet satisfies a preset format;

[0048] If the preset format is satisfied, the number of packet losses is reduced by a preset value when the number of packet losses currently recorded is greater than a specified value;

[0049] If the preset format is not satisfied and the synchronous communication quality of the primary system is not lower than that of the backup system, a preset value is added to the number of packet losses currently recorded.

[0050] In some possible embodiments, the communication quality module is further configured to:

[0051] When the data packet format of any second data packet satisfies a preset format, verifying the specified type of data in the second data packet by the primary system and the backup system respectively;

[0052] The determining, according to the second data packet synchronized from the primary system to the backup system, whether the synchronous communication quality of the primary system is lower than that of the backup system comprises:

[0053] If the primary system and / or the backup system fails to verify the data of the specified type, it is determined that the synchronous communication quality of the primary system is lower than that of the backup system;

[0054] If the primary system and the backup system successfully verify the specified type of data, a synchronization timeout duration is determined according to the number of packet losses currently recorded, and when the synchronization timeout duration is greater than a fourth threshold, it is determined that the synchronization communication quality of the primary system is lower than that of the backup system.

[0055] In some possible embodiments, the active-standby switching operation is performed based on the comprehensive communication quality of the primary system within the preset time period, and the active-standby switching module is configured as follows:

[0056] The master-slave switching operation is performed when the overall communication quality of the master system is lower than that of the standby system for N consecutive preset time periods, where N is a positive integer; and / or,

[0057] When the difference between the number of the first time period and the number of the second time period is greater than the fourth threshold, the master-slave switching operation is performed; wherein, the first time period is a time period in which the comprehensive communication quality of the master system is lower than the preset time period of the backup system; the second time period is a time period in which the comprehensive communication quality of the master system is not lower than the preset time period of the backup system.

[0058] In some possible embodiments, the communication quality module is further configured to:

[0059] If it is determined that the overall communication quality of the primary system in the preset time period is lower than that of the backup system, the number of lost packets of the second data packet currently recorded is cleared; and the number of the first data packets received by the primary system and the backup system is cleared.

[0060] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0061] A memory for storing program instructions;

[0062] The processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods in the first aspect according to the obtained program instructions.

[0063] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods described in the first aspect.

[0064] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect.

[0065] In an embodiment of the present application, whether the external communication quality of the main system is lower than that of the standby system is determined by the number of first data packets sent by the main and standby systems and received by the main and standby systems at preset time intervals. When it is determined that the external communication quality of the main system is lower than that of the standby system, it is determined whether the comprehensive communication quality of the main system in the preset time period is lower than that of the standby system based on the second data packet synchronized from the main system to the standby system, and the main and standby switching is performed based on the comprehensive communication quality of the main system in the preset time period. Through the above process, there is no need to perform the main and standby switching only when the main system fails. When the main system is not faulty, the main and standby switching can be performed based on the quality of the comprehensive communication performance of the main and standby systems, thereby improving the system performance.

[0066] Other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present disclosure. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A schematic diagram of the CBTC system structure provided in the embodiment of the present application;

[0068] Figure 2 A schematic diagram of a dual-system hot standby redundant structure provided in an embodiment of the present application;

[0069] Figure 3 An overall flow chart of the active / standby switching method of a train control system provided in an embodiment of the present application;

[0070] Figure 4 A schematic diagram of distributing a first data packet to an external device provided in an embodiment of the present application;

[0071] Figure 5 A flowchart for determining the communication quality between a system and an external device provided in an embodiment of the present application;

[0072] Figure 6 Another flow chart for determining the communication quality between the system and the external device provided in an embodiment of the present application;

[0073] Figure 7 A flowchart of external communication quality comparison of the primary and standby systems provided in an embodiment of the present application;

[0074] Figure 8 A flowchart of how to determine the synchronous communication quality of the main system provided in an embodiment of the present application;

[0075] Fig. 9 A flowchart of the comparison of the comprehensive communication quality of the primary and standby systems provided in the embodiment of the present application;

[0076] Fig.10 Another flow chart of the comparison of the comprehensive communication quality of the primary and standby systems provided in the embodiment of the present application;

[0077] Fig.11 A schematic diagram of the network structure provided for an embodiment of the present application;

[0078] Fig.12 A schematic diagram of the master-slave switching process provided in an embodiment of the present application;

[0079] Fig.13 A structural diagram of a master-slave switching device 130 of a train control system provided in an embodiment of the present application;

[0080] Fig.14 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0081] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0082] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0083] Figure 1 The overall structure of the CBTC system is shown. Figure 1 As can be seen, the highest level of the CBTC system is the automatic train monitoring system ATS, which is used to provide major functions such as train supervision, automatic scheduling and timetable adjustment. Figure 1 The data storage unit DSU shown on the left is the storage area of ​​the line database, which is used to establish communication with the train's on-board controller VOBC and perform data verification to ensure data security and real-time performance.

[0084] Figure 1 The center shows the signaling equipment in the CBTC system: the zone controller ZC and the computer interlocking CI. Among them, the ZC is the key equipment in the CBTC system, which is used to track all trains on the line in the control area according to the train position report information and calculate the movement authorization for the subsequent trains. CI is used to provide backup mode operation when the moving block function is limited, that is, the driver can rely on the trackside signal to drive the train. CI can also realize the protection function of the system point ATP according to the state of the dynamic beacon on the trackside when the function of the CBTC system is partially limited.

[0085] In order to reduce the impact of system failures on vehicle operations, the above-mentioned rail transit signal equipment often adopts a dual-system hot standby redundant structure. Figure 2The two-by-two dual-system hot standby structure commonly used in practical applications is shown. The device consists of four computers in two subsystems, one of which is used as the host to output control instructions, and the other is hot standby. The two computers in the subsystem each execute a set of programs with the same code, and then compare the calculation results, and output them if they are consistent. If they are inconsistent, it is considered that a certain computer is faulty, and the output is immediately switched to another subsystem. During the power-on process, the main system will synchronize data with the standby system to avoid the original standby system that has been upgraded to the main system from being unable to operate normally due to data errors after the main-standby switch. However, this design method can only perform the main-standby switch operation when the main system fails, and the design is not flexible enough.

[0086] In order to solve the above problems, the inventive concept of the present application is as follows: by determining whether the external communication quality of the main system is lower than that of the standby system according to the number of first data packets sent by the external device received by the main and standby systems at every preset time period. When it is determined that the external communication quality of the main system is lower than that of the standby system, it is determined whether the comprehensive communication quality of the main system in the preset time period is lower than that of the standby system according to the second data packet synchronized by the main system to the standby system, and the main and standby switching is performed based on the comprehensive communication quality of the main system in the preset time period. Through the above process, there is no need to perform the main and standby switching only when the main system fails. When the main system is not faulty, the main and standby switching can be performed according to the quality of the comprehensive communication performance of the main and standby systems, thereby improving the system performance.

[0087] Figure 3 The overall process of a method for switching between a master and a slave of a train control system provided by an embodiment of the present application is shown. Figure 3 As shown, including:

[0088] Step 301: at every preset time period, determining whether the external communication quality of the primary system is lower than that of the backup system according to the primary system and the backup system receiving first data packets respectively; wherein the first data packet is sent by an external device, and the external device distributes the same first data packet to the primary system and the backup system each time;

[0089] The main system and backup system in the embodiment of the present application are any rail transit signal equipment (such as ZC, CI, etc.) in the aforementioned CBTC system. Figure 1 Taking the ZC shown as an example, the external devices communicating with it, such as CI, ATS, train terminal, etc., are all external devices corresponding to the ZC.

[0090] Specific as Figure 4As shown, in actual applications, the external device will distribute each first data packet carrying the communication content to the main system and the backup system. That is, the content of the first data packet sent by the external device to the main and backup systems each time is the same. However, the first data packet may be missing, damaged, or otherwise damaged in the process of reaching the system end. Based on this, the embodiment of the present application monitors the communication between the main and backup systems and the external devices in real time, and obtains the number of packet losses of each of the main and backup systems at preset time intervals (wherein each signal device in the CBTC system predicts the magic weapon action of the external device, that is, the main and backup systems know how many first data packets should be received in each preset time period), and then determines whether the external communication quality of the main system is better than that of the backup system based on the number of first data packets received by each of the main and backup systems.

[0091] In addition, since there are usually multiple external devices communicating with the signal device, in the embodiment of the present application, for each external device, it is determined whether the external communication quality between the main system and the external device is lower than that of the standby system according to the number of first data packets received by the main system and the standby system from the external device;

[0092] If the number of target devices is greater than a third threshold, it is determined that the external communication quality of the primary system is lower than that of the backup system; wherein the external communication quality between the primary system and the target devices is lower than that of the backup system.

[0093] To facilitate understanding of how to determine whether the external communication quality between the main system and each external device is lower than that of the standby system in the embodiment of the present application. Figure 5 As shown, Figure 5 The overall process of taking any system as an example, how to determine whether the external communication quality of the system is lower than that of another system according to the number of first data packets sent by any external device received by the system, including:

[0094] Step 501: receiving a first data packet sent by any external device;

[0095] Step 502: Perform data verification on the first data packet to determine whether the first data packet is a correct data packet that meets the communication requirements;

[0096] Step 503: If the data packet is correct, the number of unreceived first data packets currently recorded in the system is cleared;

[0097] Step 504: If it is not a correct data packet, determining whether the number of the currently unreceived first data packets is greater than a first number threshold E;

[0098] In order to ensure the correctness of the synchronization data, the embodiment of the present application adopts a data verification algorithm such as a message digest algorithm (MD5) and a secure hash algorithm (SHA1) to encrypt the first data packet. When any system in the primary and standby systems receives the first data packet sent by an external device, a corresponding decryption method must be used to perform data verification. If the decryption fails, it indicates that the first data packet is not a correct data packet that meets the communication requirements.

[0099] Step 505: If the number is not greater than the first quantity threshold E, the number of unreceived first data packets currently recorded in the system is increased by one;

[0100] Step 506: If it is greater than the first quantity threshold E, it is determined that the external communication quality of the system is lower than that of the other system and the counting of subsequent first data packets received by the primary and standby systems from the external device is stopped.

[0101] In the embodiment of the present application, it is assumed that the external device will only send one first data packet in each preset time period. Therefore, when executing the above step 503, if the system receives the first data packet in the preset time period, the current count will be cleared. In actual applications, the above preset time period can be defined according to business needs. When the external device distributes more than one first data packet to the primary and backup systems in the preset time period, Figure 6 As shown, when the first data packet currently received is determined to be a correct data packet through the aforementioned step 502, the operations of the following steps 601 to 602 are performed;

[0102] Step 601: If it is a correct data packet, determine whether the number of first data packets that are not currently received by the system is greater than zero; otherwise, execute the aforementioned step 504;

[0103] Step 602: If it is greater than zero, then the number of the currently unreceived first data packets is reduced by one; and the aforementioned step 504 is executed; if it is zero, then no operation is executed, and the action of continuously monitoring the number of received first data packets is continued.

[0104] It should be noted that when the current count of the first data packets not received by any system is greater than the first quantity threshold E, the counting operation of the first data packets not received by the primary and standby systems is stopped, and it is directly determined that the external communication quality between the system and the external device is lower than that of the other system. Therefore, when executing the aforementioned step 301, it can be read in advance whether the external communication quality between any system and the external device is lower than that of the other system. That is, the number of first data packets sent by the external device received by any system is greater than the first quantity threshold E.

[0105] If the above situation does not occur, the count of the main and backup systems for not receiving the first data packet is read. When the number of the first data packets not received by the main system is greater than the first threshold L, and the number of the first data packets not received by the backup system is less than the second threshold R, it is determined that the quality of external communication between the main system and the external device is lower than that of the backup system; wherein the second threshold is less than the first threshold.

[0106] In the embodiment of the present application, the external device whose communication quality between the main system and the external device is lower than that of the standby system is regarded as the target device. After determining whether the external communication quality between the main system and each external device is lower than that of the standby system through the above process, the number of target devices is determined. When the number of target devices is greater than the third threshold, it is determined that the external communication quality of the main system is lower than that of the standby system.

[0107] Specific as Figure 7 As shown, Figure 7 The overall process of how to determine whether the external communication quality of the main system is lower than that of the standby system according to the external communication quality between the main and standby systems and each external device in the embodiment of the present application is shown, including:

[0108] Step 701: for any external device, determine whether the number of first data packets sent by the external device that the main system has not received is greater than a first threshold L; otherwise, determine whether the next external device is a target device;

[0109] Step 702: If it is greater than the first threshold L, determining whether the number of first data packets sent by the external device that the standby system has not received is less than the second threshold R;

[0110] Step 703: If it is less than the second threshold R, the external device is determined to be a target device; otherwise, the next external device is determined to be a target device;

[0111] Step 704: Whether the number of currently determined target devices is greater than a third threshold;

[0112] Step 705: If it is greater than the third threshold, it is determined that the external communication quality of the primary system is lower than that of the backup system; otherwise, return to the aforementioned step 701 to determine whether the next external device is the target device.

[0113] In some possible embodiments, to improve system performance, it can be set that when all external devices are target devices, that is, the external communication quality between the main system and each external device is lower than that of the backup system, it is determined that the external communication quality of the main system is lower than that of the backup system.

[0114] Step 302: if it is determined that the external communication quality of the primary system is lower than that of the backup system, determining whether the comprehensive communication quality of the primary system within the preset time period is lower than that of the backup system according to the second data packet synchronized from the primary system to the backup system;

[0115] During implementation, it is determined in advance whether the synchronization communication quality of the main system is lower than that of the backup system based on the second data packet synchronized from the main system to the backup system; if the synchronization communication quality of the main system is lower than that of the backup system, it is determined that the comprehensive communication quality of the main system within the preset time period is lower than that of the backup system.

[0116] As mentioned above, during the power-on process, the main system will synchronize data with the backup system to avoid the original backup system upgraded to the main system from being unable to operate normally due to data errors after the main-backup switch. The embodiment of the present application intends to determine from another dimension (i.e., whether the synchronous communication quality of the main system is poor) after determining that the external communication quality of the main system is lower than that of the backup system through the aforementioned step 301. If both the external communication quality and the synchronous communication quality of the main system are poor, it is determined that the comprehensive communication quality of the main system in the current preset period is lower than that of the backup system.

[0117] To facilitate understanding of the above solution, firstly, how to determine the synchronous communication quality of the main system in the embodiment of the present application is described:

[0118] When receiving the second data packet synchronized by the main system, the standby system of the embodiment of the present application predetermines whether the data packet format of the second data packet satisfies the preset format. If the preset format is satisfied, the number of packet losses is reduced by a preset value when the number of packet losses currently recorded is greater than a specified value; if the preset format is not satisfied and the synchronous communication quality of the main system is not lower than that of the standby system, the number of packet losses currently recorded is increased by a preset value.

[0119] When the data packet format of any second data packet meets the preset format, the designated type of data in the second data packet is verified by the primary system and the backup system respectively.

[0120] If the main system and / or the backup system fail to verify the specified type of data, it is determined that the synchronization communication quality of the main system is lower than that of the backup system. At this time, it is directly determined that the synchronization communication quality of the main system is low, and the process of counting the number of packet losses of the second data packet is stopped. If the main system and the backup system successfully verify the specified type of data, the synchronization timeout duration Z is determined according to the number of packet losses currently recorded, and when the synchronization timeout duration Z is greater than the fourth threshold, it is determined that the synchronization communication quality of the main system is lower than that of the backup system.

[0121] Next, Figure 8 As shown, Figure 8 The overall process of determining the synchronous communication quality of the master system is shown, including:

[0122] Step 801: The standby system receives a second data packet synchronized by the primary system;

[0123] Step 802: Perform data verification on the first data packet to determine whether the first data packet is a correct data packet that meets the communication requirements;

[0124] Step 803: If it is a correct data packet, determine whether the number of packet losses of the current second data packet is greater than zero;

[0125] Step 804: if it is greater than zero, then the number of lost packets of the second data packet currently recorded is reduced by one;

[0126] Step 805: The primary and backup systems respectively verify the data of the specified type in the second data packet;

[0127] Step 806: If any system fails to check, it is determined that the synchronous communication quality of the primary system is lower than that of the backup system, and the counting of the number of subsequent second data packets lost is stopped; otherwise, the action of continuously monitoring the number of received second data packets is continued;

[0128] To further ensure the correctness of the synchronized data, the embodiment of the present application performs CRC check on the data of each module of the application layer (i.e. the above-mentioned specified type of data) through the dual system. In addition, any application data check failure can be set to cause the system to crash, so as to ensure that erroneous data will not cause system failure.

[0129] Step 807: If it is not a correct data packet, determine whether the number of packet losses of the current second data packet is greater than a second number threshold W;

[0130] Step 808: If it is not greater than the second quantity threshold W, the number of packet losses of the second data packet is increased by one; and the process jumps to the aforementioned step 805 to perform the primary and backup system verification; otherwise, the process jumps to the aforementioned step 806;

[0131] When executing the aforementioned step 302, it can be read in advance whether the synchronous communication quality of the primary system is lower than that of the backup system, that is, any second data packet fails to pass the verification of the aforementioned step 805, or the number of lost second data packets is greater than the second number threshold W.

[0132] If the above situation does not occur, the synchronization timeout duration Z is determined according to the number of packet losses currently recorded. During implementation, a fourth threshold can be set. When the synchronization timeout duration Z is greater than the fourth threshold, it is determined that the synchronization communication quality of the primary system is lower than that of the backup system. In addition, in order to adapt to more application scenarios, a threshold S and a threshold X representing the maximum duration of the primary-backup synchronization timeout can be set according to the duration required for the primary-backup switching. When the difference between the threshold X and the synchronization timeout duration Z is greater than the threshold S, it is determined that the synchronization communication quality of the primary system is poor, that is, it is considered that the synchronization communication quality of the current primary system is lower than that of the backup system.

[0133] The above processes respectively describe how this application determines the quality of external communication and synchronous communication between the primary and standby systems. Fig. 9 As shown, Fig. 9The overall process of how to judge the quality of the comprehensive communication between the primary and standby systems in the embodiment of the present application is shown, including:

[0134] Step 901: for any external device at every preset time period, determine whether the number of first data packets sent by the external device that the main system has not received is greater than a first threshold L; otherwise, jump to the following step 909;

[0135] Step 902: if it is greater than the first threshold L, determine whether the number of first data packets sent by the external device that the standby system has not received is less than the second threshold R; otherwise, jump to the following step 909;

[0136] Step 903: If it is less than the second threshold R, determine that the external device is a target device; otherwise jump to the following step 909;

[0137] Step 904: Whether the number of currently determined target devices is greater than a third threshold;

[0138] Step 905: If it is greater than the third threshold, determine the synchronization timeout duration Z according to the number of packet losses of the second data packet currently recorded;

[0139] Step 906: Determine whether the difference between the threshold value X and the synchronization timeout duration Z is greater than the threshold value S;

[0140] Step 907: If the difference between the threshold value X and the synchronization timeout duration Z is greater than the threshold value S, it is determined that the overall communication quality of the primary system is lower than that of the backup system during the preset period;

[0141] Step 908: If the difference between the threshold value X and the synchronization timeout duration Z is not greater than the threshold value S, it is determined that the overall communication quality of the backup system is lower than that of the primary system during the preset period.

[0142] Step 909: If it is not greater than the third threshold, determining whether there is an external device that has not been judged as a target device;

[0143] If not, jump to the aforementioned step 908 to determine that the comprehensive communication quality of the backup system is lower than that of the main system during the preset period; otherwise, return to the aforementioned step 901 to determine whether any external device that has not been determined as a target device is a target device;

[0144] The above process introduces that the external communication quality of the main and backup systems needs to be determined first. Only after it is determined that the external communication quality of the main system is lower than that of the backup system, the synchronous communication quality determination will be used to further determine whether the comprehensive communication quality of the main system is lower than that of the backup system.

[0145] In some possible embodiments, the synchronous communication quality may be determined first, and after determining that the synchronous communication quality of the primary system is lower than that of the standby system, it is determined whether the external communication quality of the primary system is lower than that of the standby system according to the number of first data packets received by the primary and standby systems, and after determining that the external communication quality of the primary system is lower than that of the standby system, it is determined that the comprehensive communication quality of the primary system is lower than that of the standby system. Fig.10 As shown, including:

[0146] Step 101: Determine a synchronization timeout duration Z according to the number of lost packets of the second data packet currently recorded at every preset time period;

[0147] Step 102: Determine whether the difference between the threshold value X and the synchronization timeout duration Z is greater than the threshold value S;

[0148] Step 103: If the difference between the threshold value X and the synchronization timeout duration Z is not greater than the threshold value S, it is determined that the overall communication quality of the backup system is lower than that of the primary system during the preset period;

[0149] Step 104: if the difference between the threshold value X and the synchronization timeout duration Z is greater than the threshold value S, then for any external device, determining whether the number of first data packets sent by the external device that the main system has not received is greater than a first threshold value L;

[0150] Step 105: If the number of first data packets is greater than the first threshold L, determine whether the number of first data packets sent by the external device that the standby system has not received is less than the second threshold R; otherwise, jump to the following step 109;

[0151] Step 106: If it is less than the second threshold R, the external device is determined to be a target device; otherwise, jump to the following step 109;

[0152] Step 107: Whether the number of currently determined target devices is greater than a third threshold;

[0153] Step 108: If it is greater than the third threshold, it is determined that the overall communication quality of the primary system is lower than that of the backup system during the preset period;

[0154] Step 109: If it is not greater than the third threshold, determining whether there is an external device that has not been judged as a target device;

[0155] If not, jump to the aforementioned step 103 to determine that the comprehensive communication quality of the backup system is lower than that of the main system during the preset period; otherwise, return to the aforementioned step 104 to determine whether any external device that has not been determined as a target device is a target device.

[0156] As mentioned above, in order to ensure the correctness of the communication data of the signal device, the synchronization data of the embodiment of the present application adds data checks such as MD5, SHA1, and CRC checks on the application data. On this basis, in order to ensure the stability of the synchronization data between the two systems and the reuse of network ports, the synchronization network of the embodiment of the present application adopts a redundant two-by-two-take-two structure, specifically Fig.11 As shown, the synchronization network 1 and the synchronization network 2 in the embodiment of the present application are respectively responsible for sending and receiving synchronization data, the synchronization network 2 is connected to the switch and also serves as a maintenance network, and the synchronization network 1 is directly connected to the dual systems of the signal equipment.

[0157] Step 303: Performing a master-slave switching operation based on the comprehensive communication quality of the primary system within the preset time period.

[0158] In the embodiment of the present application, every preset time period, the process of the aforementioned steps 901 to 909 or 101 to 109 will be used to determine whether the comprehensive communication quality of the main system in the current preset time period is lower than that of the standby system. When the comprehensive communication quality of the main system is lower than that of the standby system for N consecutive preset time periods, the main-standby switching operation is performed, where N is a positive integer. In specific implementation, the quality of the comprehensive communication quality of the main and standby systems in each preset time period can be recorded separately, and the main-standby switching operation is performed when the main system is lower than the standby system for three consecutive preset time periods.

[0159] In addition, a comprehensive judgment can be made based on the quality of the overall communication of the master and standby systems in each preset time period, and the master-standby switching operation is performed when the difference between the number of the first time period and the number of the second time period is greater than the fourth threshold; wherein the first time period is a preset time period when the overall communication quality of the master system is lower than that of the standby system; and the second time period is a preset time period when the overall communication quality of the master system is not lower than that of the standby system. Fig.12 As shown, including:

[0160] Step 121: Determine whether the synchronous communication quality of the primary system is lower than that of the backup system;

[0161] Step 122: if the synchronous communication quality is lower than that of the standby system, determine whether the external communication quality of the primary system is lower than that of the standby system; otherwise, terminate the process and determine that the primary-standby switching operation will not be performed within the current preset period;

[0162] Step 123: if the external communication quality is lower than that of the standby system, then increase by one the first count indicating that the overall communication quality of the primary system is lower than that of the standby system;

[0163] Step 124: Determine whether the current first count is greater than a threshold value M;

[0164] Step 125: If it is greater than the threshold value M, the active / standby switching operation is performed and the current first count is cleared; otherwise, the process ends without performing the active / standby switching operation.

[0165] Step 126: If the external communication quality is lower than that of the standby system, determining whether the current first count is greater than zero;

[0166] Step 127: if it is greater than zero, then the current first count is reduced by one; otherwise, the process ends, and it is determined that the active / standby switching operation is not performed within the current preset period;

[0167] The master-slave switching method of the embodiment of the present application is to switch the master system offline, rather than the standby system actively upgrading to the master system. In the master-slave switching decision logic, the master system needs to determine that the neighboring system has been upgraded to the standby system, and the synchronization data between the two systems is stable. In addition, periodically determine whether the overall communication quality of the master system is lower than that of the standby system by judging the quality of external communication between the master and standby systems and each external device, as well as the quality of synchronous communication between the master and standby systems, and determine whether to perform master-slave switching based on the overall communication quality of the master and standby systems in each cycle. Through the above process, there is no need to perform master-slave switching only when the master system fails. When the master system is not faulty, master-slave switching can be performed based on the quality of the overall communication performance of the master and standby systems, thereby improving system performance.

[0168] Based on the same inventive concept, the embodiment of the present application provides a main-standby switching device 130 of a train control system, specifically as follows: Fig.13 As shown, including:

[0169] The system monitoring module 131 is configured to determine whether the external communication quality of the main system is lower than that of the standby system according to the number of first data packets received by the main system and the standby system respectively at every preset time period; wherein the first data packet is sent by an external device, and the external device distributes the same first data packet to the main system and the standby system each time;

[0170] The communication quality module 132 is configured to determine whether the overall communication quality of the main system within the preset period is lower than that of the standby system according to a second data packet synchronized from the main system to the standby system if it is determined that the external communication quality of the main system is lower than that of the standby system;

[0171] The active / standby switching module 133 is configured to perform an active / standby switching operation based on the comprehensive communication quality of the primary system within the preset time period.

[0172] In some possible embodiments, the method of determining whether the external communication quality of the primary system is lower than that of the standby system according to the number of first data packets received by the primary system and the standby system respectively is performed, and the system monitoring module is configured as follows:

[0173] For each external device, determining whether the external communication quality between the main system and the external device is lower than that of the standby system according to the number of first data packets sent by the external device received by the main system and the standby system;

[0174] If the number of target devices is greater than a third threshold, it is determined that the external communication quality of the primary system is lower than that of the backup system; wherein the external communication quality between the primary system and the target devices is lower than that of the backup system.

[0175] In some possible embodiments, whether the external communication quality between the main system and any external device is lower than that of the standby system is determined in the following manner:

[0176] Determine respectively the number of first data packets sent by the external device received by the primary system and the backup system;

[0177] If the number of first data packets not received by the main system is greater than a first threshold, and the number of first data packets not received by the backup system is less than a second threshold, it is determined that the external communication quality of the main system for the external device is lower than that of the backup system; wherein the second threshold is less than the first threshold.

[0178] In some possible embodiments, the step of determining whether the overall communication quality of the primary system within the preset time period is lower than that of the standby system according to the second data packet synchronized from the primary system to the standby system is performed, and the communication quality module is configured as follows:

[0179] determining whether the synchronous communication quality of the primary system is lower than that of the backup system according to a second data packet synchronized from the primary system to the backup system;

[0180] If the synchronous communication quality of the primary system is lower than that of the backup system, it is determined that the comprehensive communication quality of the primary system within the preset time period is lower than that of the backup system.

[0181] In some possible embodiments, the number of packet losses of the second data packet is recorded in the following manner:

[0182] When the standby system receives a second data packet synchronized by the primary system, determining whether a data packet format of the second data packet satisfies a preset format;

[0183] If the preset format is satisfied, the number of packet losses is reduced by a preset value when the number of packet losses currently recorded is greater than a specified value;

[0184] If the preset format is not satisfied and the synchronous communication quality of the primary system is not lower than that of the backup system, a preset value is added to the number of packet losses currently recorded.

[0185] In some possible embodiments, the communication quality module is further configured to:

[0186] When the data packet format of any second data packet satisfies a preset format, verifying the specified type of data in the second data packet by the primary system and the backup system respectively;

[0187] The determining, according to the second data packet synchronized from the primary system to the backup system, whether the synchronous communication quality of the primary system is lower than that of the backup system comprises:

[0188] If the primary system and / or the backup system fails to verify the data of the specified type, it is determined that the synchronous communication quality of the primary system is lower than that of the backup system;

[0189] If the primary system and the backup system successfully verify the specified type of data, a synchronization timeout duration is determined according to the number of packet losses currently recorded, and when the synchronization timeout duration is greater than a fourth threshold, it is determined that the synchronization communication quality of the primary system is lower than that of the backup system.

[0190] In some possible embodiments, the active-standby switching operation is performed based on the comprehensive communication quality of the primary system within the preset time period, and the active-standby switching module is configured as follows:

[0191] The master-slave switching operation is performed when the overall communication quality of the master system is lower than that of the standby system for N consecutive preset time periods, where N is a positive integer; and / or,

[0192] When the difference between the number of the first time period and the number of the second time period is greater than the fourth threshold, the master-slave switching operation is performed; wherein, the first time period is a time period in which the comprehensive communication quality of the master system is lower than the preset time period of the backup system; the second time period is a time period in which the comprehensive communication quality of the master system is not lower than the preset time period of the backup system.

[0193] In some possible embodiments, the communication quality module is further configured to:

[0194] If it is determined that the overall communication quality of the primary system in the preset time period is lower than that of the backup system, the number of lost packets of the second data packet currently recorded is cleared; and the number of the first data packets received by the primary system and the backup system is cleared.

[0195] Refer to the following Fig.14 The electronic device 130 according to this embodiment of the present application is described. Fig.14 The electronic device 130 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0196] like Fig.14 As shown, the electronic device 130 is in the form of a general electronic device. The components of the electronic device 130 may include but are not limited to: at least one processor 131, at least one memory 132, and a bus 133 connecting different system components (including the memory 132 and the processor 131).

[0197] Bus 133 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.

[0198] The memory 132 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 1321 and / or a cache memory 1322 , and may further include a read-only memory (ROM) 1323 .

[0199] The memory 132 may also include a program / utility 1325 having a set (at least one) of program modules 1324, such program modules 1324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0200] The electronic device 130 may also communicate with one or more external devices 134 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 130, and / or communicate with any device that enables the electronic device 130 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 135. Furthermore, the electronic device 130 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 136. As shown, the network adapter 136 communicates with other modules for the electronic device 130 via a bus 133. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0201] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 132 including instructions, and the instructions can be executed by the processor 131 of the above device to complete the above method. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0202] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, which, when executed by the processor 131, implements any one of the methods for master-slave switching of a train control system provided in the present application.

[0203] In an exemplary embodiment, various aspects of a method for master-slave switching of a train control system provided by the present application can also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of a method for master-slave switching of a train control system according to various exemplary embodiments of the present application described above in this specification.

[0204] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0205] The program product for active / standby switching of a train control system of an embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0206] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0207] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0208] The program code for performing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and also conventional procedural programming languages ​​such as language or similar programming languages. The program code can be executed entirely on the user electronic device, partially on the user device, as an independent software package, partially on the user electronic device and partially on the remote electronic device, or completely on the remote electronic device or server. In the case of a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).

[0209] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0210] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0211] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0212] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable image scaling device to produce a machine, so that the instructions executed by the processor of the computer or other programmable image scaling device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0213] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable image scaling device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instruction device being implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0214] These computer program instructions may also be loaded onto a computer or other programmable image scaling device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0215] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0216] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for switching between a master and a standby of a train control system, characterized in that: The method comprises: At every preset time period, determining whether the external communication quality of the main system is lower than that of the standby system according to the number of first data packets received by the main system and the standby system respectively; wherein the first data packet is sent by an external device, and the external device distributes the same first data packet to the main system and the standby system each time; If it is determined that the external communication quality of the primary system is lower than that of the standby system, determining whether the comprehensive communication quality of the primary system within the preset time period is lower than that of the standby system according to the second data packet synchronized by the primary system to the standby system; The master-slave switching operation is performed based on the comprehensive communication quality of the master system within the preset time period.

2. The method according to claim 1, characterized in that The determining, according to the number of first data packets received by the primary system and the backup system respectively, whether the external communication quality of the primary system is lower than that of the backup system comprises: For each external device, determining whether the external communication quality between the main system and the external device is lower than that of the standby system according to the number of first data packets sent by the external device received by the main system and the standby system; If the number of target devices is greater than a third threshold, it is determined that the external communication quality of the primary system is lower than that of the backup system; wherein the external communication quality between the primary system and the target devices is lower than that of the backup system.

3. The method according to claim 2, characterized in that Determine whether the external communication quality between the main system and any external device is lower than that of the standby system by the following method: Determine respectively the number of first data packets sent by the external device received by the primary system and the backup system; If the number of first data packets not received by the main system is greater than a first threshold, and the number of first data packets not received by the backup system is less than a second threshold, it is determined that the external communication quality of the main system for the external device is lower than that of the backup system; wherein the second threshold is less than the first threshold.

4. The method according to claim 2, characterized in that: The determining, according to the second data packet synchronized from the primary system to the backup system, whether the overall communication quality of the primary system within the preset time period is lower than that of the backup system comprises: determining whether the synchronous communication quality of the primary system is lower than that of the backup system according to a second data packet synchronized from the primary system to the backup system; If the synchronous communication quality of the primary system is lower than that of the backup system, it is determined that the comprehensive communication quality of the primary system within the preset time period is lower than that of the backup system.

5. The method according to claim 4, characterized in that The number of packet losses of the second data packet is recorded in the following manner: When the standby system receives a second data packet synchronized by the primary system, determining whether a data packet format of the second data packet satisfies a preset format; If the preset format is satisfied, the number of packet losses is reduced by a preset value when the number of packet losses currently recorded is greater than a specified value; If the preset format is not satisfied and the synchronous communication quality of the primary system is not lower than that of the backup system, a preset value is added to the number of packet losses currently recorded.

6. The method according to claim 5, characterized in that The method further comprises: When the data packet format of any second data packet satisfies a preset format, verifying the specified type of data in the second data packet by the primary system and the backup system respectively; The determining, according to the second data packet synchronized from the primary system to the backup system, whether the synchronous communication quality of the primary system is lower than that of the backup system comprises: If the primary system and / or the backup system fails to verify the data of the specified type, it is determined that the synchronous communication quality of the primary system is lower than that of the backup system; If the primary system and the backup system successfully verify the specified type of data, a synchronization timeout duration is determined according to the number of packet losses currently recorded, and when the synchronization timeout duration is greater than a fourth threshold, it is determined that the synchronization communication quality of the primary system is lower than that of the backup system.

7. The method according to claim 1, characterized in that The performing the master-slave switching operation based on the comprehensive communication quality of the master system within the preset time period includes: The master-slave switching operation is performed when the overall communication quality of the master system is lower than that of the standby system for N consecutive preset time periods, where N is a positive integer; and / or, When the difference between the number of the first time period and the number of the second time period is greater than the fourth threshold, the master-slave switching operation is performed; wherein, the first time period is a time period in which the comprehensive communication quality of the master system is lower than the preset time period of the backup system; the second time period is a time period in which the comprehensive communication quality of the master system is not lower than the preset time period of the backup system.

8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: If it is determined that the overall communication quality of the primary system in the preset time period is lower than that of the backup system, the number of lost packets of the second data packet currently recorded is cleared; and the number of the first data packets received by the primary system and the backup system is cleared.

9. A main-standby switching device for a train control system, characterized in that: The device comprises: The system monitoring module is configured to determine whether the external communication quality of the main system is lower than that of the standby system according to the number of first data packets received by the main system and the standby system respectively at every preset time period; wherein the first data packet is sent by an external device, and the external device distributes the same first data packet to the main system and the standby system each time; A communication quality module is configured to determine whether the overall communication quality of the main system within the preset time period is lower than that of the standby system according to a second data packet synchronized from the main system to the standby system if it is determined that the external communication quality of the main system is lower than that of the standby system; The active-standby switching module is configured to perform an active-standby switching operation based on the comprehensive communication quality of the primary system within the preset time period.

10. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods of claims 1-8 according to the obtained program instructions.

Citation Information

Cited By

  • Main and standby system switching method, device and system

    CN119781276A