WO2020103645A1 - Single board main and standby control method, apparatus, device and readable storage medium - Google Patents

Single board main and standby control method, apparatus, device and readable storage medium

Info

Publication number
WO2020103645A1
WO2020103645A1 PCT/CN2019/113438 CN2019113438W WO2020103645A1 WO 2020103645 A1 WO2020103645 A1 WO 2020103645A1 CN 2019113438 W CN2019113438 W CN 2019113438W WO 2020103645 A1 WO2020103645 A1 WO 2020103645A1
Authority
WO
WIPO (PCT)
Prior art keywords
board
standby
local
active
peer
Prior art date
Application number
PCT/CN2019/113438
Other languages
French (fr)
Chinese (zh)
Inventor
王新华
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2020103645A1 publication Critical patent/WO2020103645A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0668Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/0836Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability to enhance reliability, e.g. reduce downtime
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/55Prevention, detection or correction of errors
    • H04L49/552Prevention, detection or correction of errors by ensuring the integrity of packets received through redundant connections

Definitions

  • This article relates to the field of communication technology, and in particular, to a single-board active / standby control method, device, device, and readable storage medium.
  • the industry In the field of communication, there are often high requirements on the reliability and stability of the equipment, especially on the business side, such as how many ms the business cannot be interrupted.
  • the industry In order to meet the performance requirements of various aspects, the industry generally has two methods to decide the master and slave: one is to decide the master and slave by hardware, and the other is to decide the master and slave by software.
  • the strategy of software decision master-slave has the problem of insufficient timeliness and is rarely used; the strategy of hardware decision master-slave is that the master-slave depends entirely on the hardware-master master-slave. After the status, determine the main and standby status of the software.
  • This strategy has a drawback: when either hardware of the two boards has a problem or the hardware connection between the two has a problem, the hardware may decide the situation of the two masters; there is another case: the hardware connection is not The problem is, but the two boards start up at almost the same time. When the start time difference is within the allowable error range of the hardware, the hardware will also decide that both boards are the masters. As a result, system failures and abnormal business problems occur.
  • This article aims to provide a method, device, equipment and readable storage medium for the main and standby control of a single board.
  • the technical solutions adopted to solve the above technical problems are as follows:
  • a method for controlling the active / standby board of a board includes: acquiring the hardware / standby competition results of the local board and the peer board; when the hardware / standby competition results of the local board are active When boarding, send an inquiry message to the peer board; obtain hardware status information of the peer board; determine the active and standby status of the local board according to the hardware state information.
  • a single-board master-slave control device includes: an acquisition module for acquiring a hardware master-slave competition result of a local board and a peer board; a query module for serving as a local board When the hardware main and standby competition result of the board is the active board, it sends a query message to the peer board; obtains the hardware status information of the peer board; the control module is used to determine the local board based on the hardware status information Active and standby status of the board.
  • an electronic device including a memory, a processor, and at least one application program stored in the memory and configured to be executed by the processor, the application program being configured as It is used to implement the above-mentioned single-board active / standby control method.
  • a readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned single-board active / standby control method is realized.
  • a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer When the computer is executed the method described in the above aspects.
  • FIG. 1 is a flowchart of a method for controlling a single board in an embodiment of the present invention
  • FIG. 2 is a flowchart of the method of step S20 in FIG. 1;
  • FIG. 3 is a flowchart of the method of step S30 in FIG. 1;
  • FIG. 4 is a flow chart of a method for controlling a single board in an embodiment of the present invention.
  • FIG. 5 is a flowchart of the method of step S50 in FIG. 4;
  • FIG. 6 is an exemplary structural block diagram of a single-board active / standby control device provided by Embodiment 3 of the present invention.
  • a single-board active-standby control method includes:
  • the combination of hardware and software is used to determine the active and standby status of the board, especially when determining the active board, software will participate in the decision, avoiding the situation of dual active boards and improving the system's reliability.
  • the local board (referred to as the board in the following description) and the peer board (referred to as the board in the following description) are both a communication interface board.
  • the two are the master and the slave. Relationship, when one board is the active board and the other board is the standby board, the two boards can operate normally only with one master and one standby.
  • the signals related to the active and standby of the board are: the final active and standby signals, and the hardware active and standby signals.
  • the hardware consists of three main registers to participate in the software and hardware decision-making master-slave process: "software lock master-standby enable” register, "software lock master-standby” register, hardware master-standby register.
  • the hardware writes the final master / standby information to the final master / standby signal according to whether the software lock master / standby enable register is software locked.
  • the software does not lock the master and backup, the final value of the master and backup signals is determined by the hardware, and the final master and backup signals are equal to the hardware master and backup signals; if the software locks the master and backup, the value of the final master and backup signals is completely determined by the software.
  • the master-slave information determined by the software is written into the "software lock master-slave" register, and finally the master-slave signal is equal to the value of this register.
  • the single-board master-slave control method is applicable to the single-board startup process.
  • the hardware master-standby competition is enabled; the software locks the master-standby enable, and the default board is the standby board.
  • participate in the hardware master-slave competition when participating in the hardware master-slave competition, if the board's software is locked as a standby, its locked state will disappear, the steps are as follows: During the startup and switching process, if the board's software is locked as a standby, start Timer2, when the timer expires, get the hardware status of the board.
  • the board If the board is the standby, disable the software to lock the master and standby, stop the timer timer2; if the board is the master, but there is no software to lock the master and standby, it will not be processed ; If the board is the master, and the software locks the master and slave enable, send a message to query the status of the board.
  • the opposite board after obtaining the main-standby competition result of the local board and the opposite board further includes: S11.
  • the hardware main-standby competition result of the local board is the standby board
  • the standby board To enable the software of the local board to lock the active and standby boards, set the local board as the standby board when the power is completed, and set the opposite board as the active board.
  • This embodiment is mainly to avoid the situation of dual active, and when the hardware main and standby competition result of the local board is the standby board, the situation that the local board and the opposite board compete for the active board will not occur, so there is no need for excessive To control the process, simply set the counter to the main board.
  • the step S20 includes: S21, sending a query message to the opposite board; S22, when the sending of the query message fails, enabling the software lock of the local board to the master Standby, set the local board as the active board when the power is completed, and set the peer board as the standby board; S23, when the query message is sent successfully, start the timer; S24, if in the timer The reply message of the peer board is not received within the preset period of time, enabling the software of the local board to lock the master and backup, setting the local board as the master board when the power is completed, and setting the peer board It is a standby board; S25. If the reply message of the peer board is received within the preset time period of the timer, the hardware status information of the peer board is obtained from the reply message.
  • the main hardware competition result of the board is the main, send a message to the board to query the board hardware status information. If the query message is sent several times in succession, the board software is disabled to lock the master and backup; if If the message is sent successfully, the timer timer1 is started to check whether the board has received a reply message to the board. If the response is received within the specified time and the timer1 is stopped, the process proceeds to step S30. Answer the message to the board, stop the timer timer1, and disable the software of the board to lock the active and standby.
  • the hardware status information includes: the hardware status of the peer board, the power-on time of the peer board, and the slot number.
  • the step S30 includes: S31.
  • the hardware status of the peer board is the standby board or unknown, enable the software of the local board to lock the master and backup, and power on When finished, set the local board as the active board and the remote board as the standby board; S32.
  • the hardware status of the remote board is the active board, compare the remote board with the local board The power-on time of the board; S33. If the power-on time of the local board is earlier than the power-on time of the opposite board, enable the software of the local board to lock the master and backup, and then the local board when the power is completed Set as the active board, and set the opposite end board as the standby board; S34.
  • the power-on time of the local end board is later than the power-on time of the opposite end board, enable the software of the local end board to lock the active and standby boards.
  • the power is completed, set the local board as the standby board, and set the opposite board as the main board; S37.
  • the local board If the slot number of the local board is greater than the slot number of the opposite board, enable the local board
  • the software of the board locks the active and standby devices. When the power is completed, the local board is set as the active board, and the opposite board is set as the standby board.
  • the board software when the board receives the response message from the board, if the board hardware status is standby or unknown, the board software is disabled to lock the master and standby. If the hardware status of the board is the master, compare the power-on time of the two boards. If the power-on time of the board is early, disable the software to lock the master and backup. If the board is powered on late, continue to enable the software to lock the master and slave, and the software to lock the board as a standby. If the power-on time of the two boards is equal, compare the slot number of the board. If the slot of the board is small, disable the software lock master and slave; if the slot number of the board is large, continue to enable the software lock master and slave , The software locks the board for preparation.
  • the single-board master-standby control method is also applicable to the single-board master-standby state switching process.
  • the method further includes: S40.
  • the local single-board is The standby board, after receiving the standby master message from the system; sends an inquiry message to the peer board; obtains the hardware status information of the peer board; S50. Determines whether the local board is based on the hardware status information Perform the standby switchover.
  • the step S50 includes: S51.
  • S51 When the hardware status of the peer board is the standby board or unknown, enable the software of the local board to lock the master and backup to perform the backup transfer Master switch, switch the local board to the main board, and set the peer board to the standby board; S52.
  • S51 When the hardware status of the peer board is the master board, enable the software of the local board to lock the master board Standby, lock the local board as the standby board, and do not perform the standby to master switchover.
  • this article provides a method for the hardware and software to jointly decide the master and slave during the board startup and the master / slave switchover process.
  • the software can participate in the decision of the master and backup to ensure the normal operation of the board, one master and one backup.
  • a single-board active / standby control device includes: an obtaining module 10, configured to obtain a hardware main-standby competition result between a local board and a peer board; a query module 20, It is used to send a query message to the peer board when the hardware master-slave competition result of the local board is the master board; to obtain the hardware status information of the peer board; the control module 30 is used according to the hardware The status information determines the active and standby status of the local board.
  • the combination of hardware and software is used to determine the active and standby status of the board, especially when determining the active board, software will participate in the decision, avoiding the situation of dual active boards and improving the system's reliability.
  • the local board (referred to as the board in the following description) and the peer board (referred to as the board in the following description) are both a communication interface board.
  • the two are the master and the slave. Relationship, when one board is the active board and the other board is the standby board, the two boards can operate normally only with one master and one standby.
  • the signals related to the active and standby of the board are: the final active and standby signals, and the hardware active and standby signals.
  • the hardware consists of three main registers to participate in the software and hardware decision-making master-slave process: "software lock master-standby enable” register, "software lock master-standby” register, hardware master-standby register.
  • the hardware writes the final master / standby information to the final master / standby signal according to whether the software lock master / standby enable register is software locked.
  • the software does not lock the master and backup, the final value of the master and backup signals is determined by the hardware, and the final master and backup signals are equal to the hardware master and backup signals; if the software locks the master and backup, the final master and backup signal values are completely determined by the software
  • the master-slave information determined by the software is written into the "software lock master-slave" register, and finally the master-slave signal is equal to the value of this register.
  • the single-board master-slave control method is applicable to the single-board startup process.
  • the hardware master-standby competition is enabled; the software locks the master-standby enable, and the default board is the standby board.
  • participate in the hardware master-slave competition when participating in the hardware master-slave competition, if the board's software is locked as a standby, its locked state will disappear, the steps are as follows: During the startup and switching process, if the board's software is locked as a standby, start Timer2, when the timer expires, get the hardware status of the board.
  • the board If the board is the standby, disable the software to lock the master and standby, stop the timer timer2; if the board is the master, but there is no software to lock the master and standby, it will not be processed ; If the board is the master, and the software locks the master and slave enable, send a message to query the status of the board.
  • this article provides a method for the software and hardware to jointly decide the master and slave during the board startup and master / slave switchover process, and supports the board to correctly decide the master / slave or wrong master / slave in the hardware, resulting in dual hardware
  • the software can participate in the decision of master and backup to ensure the normal operation of one board, one master and one standby.
  • an electronic device includes a memory, a processor, and at least one application program stored in the memory and configured to be executed by the processor, and the application program is configured to execute The method for controlling the active and standby boards in the first embodiment.
  • An embodiment of the present invention provides a readable storage medium on which a computer program is stored, and when the program is executed by a processor, a method embodiment as described in any one of the above-mentioned single-board main-standby control method embodiments is implemented.
  • An embodiment of the present invention provides a computer program product.
  • the computer program product includes a computer program stored on a non-transitory computer-readable storage medium.
  • the computer program includes program instructions. When the program instructions are executed by a computer, Causing the computer to execute the method in any of the above method embodiments.
  • a method, device, equipment and readable storage medium for single-board active / standby control includes: obtaining the hardware active / standby competition result of the local end board and the opposite end board; when the local end board When the result of the hardware master-slave competition is the master board, send a query message to the peer board; obtain the hardware status information of the peer board; determine the master-standby state of the local board based on the hardware status information; through the hardware Combined with software to determine the active and standby status of the board, especially when determining the active board, software will participate in the decision, avoiding the situation of dual active boards, and improving the reliability of the system.
  • the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical
  • the components are executed in cooperation.
  • Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit .
  • Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
  • computer storage media includes both volatile and nonvolatile implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules, or other data Sex, removable and non-removable media.
  • Computer storage media include but are not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or may Any other medium for storing desired information and accessible by a computer.
  • the communication medium generally contains computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Hardware Redundancy (AREA)

Abstract

Provided are a single board main and standby control method, an apparatus, a device and a readable storage medium, which belongs to the technical field of communications, the method comprises: obtaining a hardware main and standby competition result between a local board and a peer board; when the hardware main and standby competition result of the local board is the main board, sending a query message to the peer board; obtaining hardware status information of the peer board; and determining main and standby status of the local board according to the hardware status information.

Description

一种单板主备控制方法、装置、设备及可读存储介质Single board main and standby control method, device, equipment and readable storage medium
交叉引用cross reference
本发明要求在2018年11月23日提交至中国专利局、申请号为201811408338.5、发明名称为“一种单板主备控制方法、装置、设备及可读存储介质”的中国专利申请的优先权,该申请的全部内容通过引用结合在本发明中。The present invention requires the priority of the Chinese patent application submitted to the Chinese Patent Office on November 23, 2018, with the application number 201811408338.5 and the invention titled "A single-board master and backup control method, device, equipment and readable storage medium" The entire content of this application is incorporated by reference in the present invention.
技术领域Technical field
本文涉及通信技术领域,尤其涉及一种单板主备控制方法、装置、设备及可读存储介质。This article relates to the field of communication technology, and in particular, to a single-board active / standby control method, device, device, and readable storage medium.
背景技术Background technique
在通讯领域中,往往对设备的可靠性和稳定性有很高的要求,特别是对业务方面的要求更高,比如业务不能中断多少ms等等。为了满足各方面性能要求,业界一般有两种方法决策主备:一种是通过硬件决策主备,另一种方法是软件决策主备。软件决策主备的策略存在时效性不够的问题,很少使用;硬件决策主备的策略是指主备完全取决于硬件逻辑的主备,即单板启动、主备倒换都从逻辑获取主备状态后再确定软件的主备状态。这种策略有一个弊端:当两块单板任一个硬件出现问题或两者之间的硬件连线出现问题的时候,硬件可能决策出两个主的情况;还有一种情况:硬件连线没有问题,但是两个单板几乎同时启动,启动时间差在硬件允许误差范围内时,硬件也会决策两个单板都是主。因此而导致系统故障,出现业务不正常的问题。In the field of communication, there are often high requirements on the reliability and stability of the equipment, especially on the business side, such as how many ms the business cannot be interrupted. In order to meet the performance requirements of various aspects, the industry generally has two methods to decide the master and slave: one is to decide the master and slave by hardware, and the other is to decide the master and slave by software. The strategy of software decision master-slave has the problem of insufficient timeliness and is rarely used; the strategy of hardware decision master-slave is that the master-slave depends entirely on the hardware-master master-slave. After the status, determine the main and standby status of the software. This strategy has a drawback: when either hardware of the two boards has a problem or the hardware connection between the two has a problem, the hardware may decide the situation of the two masters; there is another case: the hardware connection is not The problem is, but the two boards start up at almost the same time. When the start time difference is within the allowable error range of the hardware, the hardware will also decide that both boards are the masters. As a result, system failures and abnormal business problems occur.
发明内容Summary of the invention
本文在于提供一种单板主备控制方法、装置、设备及可读存储介质,为解决上述技术问题所采用的技术方案如下:This article aims to provide a method, device, equipment and readable storage medium for the main and standby control of a single board. The technical solutions adopted to solve the above technical problems are as follows:
根据本文的一个方面,提供的一种单板主备控制方法,包括:获取本端单板与对端单板的硬件主备竞争结果;当本端单板的硬件主备竞争结果为主用板时,向所述对端单板发送查询消息;获取对端单板的硬件状态信息;根据所述硬件状态信息确定本端单板的主备状态。According to one aspect of this article, a method for controlling the active / standby board of a board is provided, which includes: acquiring the hardware / standby competition results of the local board and the peer board; when the hardware / standby competition results of the local board are active When boarding, send an inquiry message to the peer board; obtain hardware status information of the peer board; determine the active and standby status of the local board according to the hardware state information.
根据本文的另一个方面,提供的一种单板主备控制装置,包括:获取模 块,用于获取本端单板与对端单板的硬件主备竞争结果;查询模块,用于当本端单板的硬件主备竞争结果为主用板时,向所述对端单板发送查询消息;获取对端单板的硬件状态信息;控制模块,用于根据所述硬件状态信息确定本端单板的主备状态。According to another aspect of this article, a single-board master-slave control device includes: an acquisition module for acquiring a hardware master-slave competition result of a local board and a peer board; a query module for serving as a local board When the hardware main and standby competition result of the board is the active board, it sends a query message to the peer board; obtains the hardware status information of the peer board; the control module is used to determine the local board based on the hardware status information Active and standby status of the board.
根据本文的再一个方面,提供的一种电子设备,包括存储器、处理器和至少一个被存储在所述存储器中并被配置为由所述处理器执行的应用程序,所述应用程序被配置为用于执行以上所述的单板主备控制方法。According to yet another aspect of this document, there is provided an electronic device including a memory, a processor, and at least one application program stored in the memory and configured to be executed by the processor, the application program being configured as It is used to implement the above-mentioned single-board active / standby control method.
根据本文的再一个方面,提供的一种可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现以上所述的单板主备控制方法。According to still another aspect of the present document, there is provided a readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned single-board active / standby control method is realized.
根据本文的再一个方面,提供的计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行以上各个方面所述的方法。According to yet another aspect of this document, a computer program product is provided, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer When the computer is executed the method described in the above aspects.
附图说明BRIEF DESCRIPTION
图1为本发明实施例一提供的一种单板主备控制方法流程图;FIG. 1 is a flowchart of a method for controlling a single board in an embodiment of the present invention;
图2为图1中步骤S20的方法流程图;FIG. 2 is a flowchart of the method of step S20 in FIG. 1;
图3为图1中步骤S30的方法流程图;FIG. 3 is a flowchart of the method of step S30 in FIG. 1;
图4为本发明实施例二提供的一种单板主备控制方法流程图;4 is a flow chart of a method for controlling a single board in an embodiment of the present invention;
图5为图4中步骤S50的方法流程图;FIG. 5 is a flowchart of the method of step S50 in FIG. 4;
图6为本发明实施例三提供的一种单板主备控制装置的示范性结构框图。FIG. 6 is an exemplary structural block diagram of a single-board active / standby control device provided by Embodiment 3 of the present invention.
本文目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional characteristics and advantages of the purpose of this document will be further described in conjunction with the embodiments and with reference to the drawings.
具体实施方式detailed description
为了使本文所要解决的技术问题、技术方案及有益效果更加清楚、明白,以下结合附图和实施例,对本文进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本文,并不用于限定本文。In order to make the technical problems, technical solutions and beneficial effects to be solved in this article clearer and more comprehensible, the following describes the article in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this document, but not to limit this document.
实施例一Example one
如图1所示,在本实施例中,一种单板主备控制方法,包括:As shown in FIG. 1, in this embodiment, a single-board active-standby control method includes:
S10、获取本端单板与对端单板的硬件主备竞争结果;S20、当本端单板的硬件主备竞争结果为主用板时,向所述对端单板发送查询消息;获取对端单板的硬件状态信息;S30、根据所述硬件状态信息确定本端单板的主备状态。S10. Obtain the hardware active / standby competition result of the local board and the peer board; S20. When the hardware active / standby competition result of the local board is the active board, send an inquiry message to the peer board; obtain The hardware status information of the opposite end board; S30. Determine the active and standby status of the local end board according to the hardware state information.
在本实施例中,通过硬件与软件相结合的方式确定单板的主备状态,尤其是在确定主用板时,会有软件参与决策,避免了双主用板的情况,提高了系统的可靠性。In this embodiment, the combination of hardware and software is used to determine the active and standby status of the board, especially when determining the active board, software will participate in the decision, avoiding the situation of dual active boards and improving the system's reliability.
在本实施例中,本端单板(以下描述中简称本板)和对端单板(以下描述中简称对板)都是一个通信接口板,在一个通信系统中,两者互为主备关系,当一个单板为主用板时,另一个单板为备用板,两个单板一主一备才能正常运行。In this embodiment, the local board (referred to as the board in the following description) and the peer board (referred to as the board in the following description) are both a communication interface board. In a communication system, the two are the master and the slave. Relationship, when one board is the active board and the other board is the standby board, the two boards can operate normally only with one master and one standby.
在本实施例中,单板与主备相关的信号有:最终主备信号,硬件主备信号。硬件由三个主要寄存器参与软硬件决策主备过程:“软件锁定主备使能”寄存器,”软件锁定主备“寄存器,硬件主备寄存器。硬件根据“软件锁定主备使能”寄存器是否软件锁定,将最终的主备信息写入到最终主备信号。即若软件不锁定主备时,则最终主备信号的值有硬件决定,最终主备信号与硬件主备信号值相等;若软件锁定主备时,最终主备信号的值完全由软件决定,软件决定的主备信息写入“软件锁定主备”寄存器,最终主备信号与该寄存器值相等。In this embodiment, the signals related to the active and standby of the board are: the final active and standby signals, and the hardware active and standby signals. The hardware consists of three main registers to participate in the software and hardware decision-making master-slave process: "software lock master-standby enable" register, "software lock master-standby" register, hardware master-standby register. The hardware writes the final master / standby information to the final master / standby signal according to whether the software lock master / standby enable register is software locked. That is, if the software does not lock the master and backup, the final value of the master and backup signals is determined by the hardware, and the final master and backup signals are equal to the hardware master and backup signals; if the software locks the master and backup, the value of the final master and backup signals is completely determined by the software. The master-slave information determined by the software is written into the "software lock master-slave" register, and finally the master-slave signal is equal to the value of this register.
在本实施例中,该单板主备控制方法适用于单板启动过程中,首先,单板初始化完成后,使能硬件主备竞争;软件锁定主备使能,默认本板为备用板,并参与硬件主备竞争;在参与硬件主备竞争时,若本板软件锁定为备,其锁定状态会消失,步骤如下:当在启动和切换过程中,若本板软件锁定为备,则启动定时器timer2,定时器到时,获取本板的硬件状态,若本板为备,去使能软件锁定主备,停止定时器timer2;若本板为主,但是没有软件锁定主备,不处理;若本板为主,软件锁定主备使能时,发消息查询对板状态。In this embodiment, the single-board master-slave control method is applicable to the single-board startup process. First, after the single-board initialization is complete, the hardware master-standby competition is enabled; the software locks the master-standby enable, and the default board is the standby board. And participate in the hardware master-slave competition; when participating in the hardware master-slave competition, if the board's software is locked as a standby, its locked state will disappear, the steps are as follows: During the startup and switching process, if the board's software is locked as a standby, start Timer2, when the timer expires, get the hardware status of the board. If the board is the standby, disable the software to lock the master and standby, stop the timer timer2; if the board is the master, but there is no software to lock the master and standby, it will not be processed ; If the board is the master, and the software locks the master and slave enable, send a message to query the status of the board.
如图1所示,在本实施例中,所述获取本端单板与对端单板的主备竞争结果之后还包括:S11、当本端单板的硬件主备竞争结果为备用板时,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为备用板,将对端单板设置为主用板。As shown in FIG. 1, in this embodiment, after obtaining the main-standby competition result of the local board and the opposite board further includes: S11. When the hardware main-standby competition result of the local board is the standby board To enable the software of the local board to lock the active and standby boards, set the local board as the standby board when the power is completed, and set the opposite board as the active board.
本实施例主要是避免双主情况出现,而当本端单板的硬件主备竞争结果 为备用板时,不会出现本板与对板竞争主用板的情况,因此,不需要过多的控制过程,直接将对板设置为主用板即可。This embodiment is mainly to avoid the situation of dual active, and when the hardware main and standby competition result of the local board is the standby board, the situation that the local board and the opposite board compete for the active board will not occur, so there is no need for excessive To control the process, simply set the counter to the main board.
如图2所示,在本实施例中,所述步骤S20包括:S21、向所述对端单板发送查询消息;S22、当发送查询消息失败时,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为主用板,将对端单板设置为备用板;S23、当发送查询消息成功时,启动定时器;S24、若在所述定时器的预设时间段内未收到对端单板的应答消息,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为主用板,将对端单板设置为备用板;S25、若在所述定时器的预设时间段内收到对端单板的应答消息,则从所述应答消息中获取对端单板的硬件状态信息。As shown in FIG. 2, in this embodiment, the step S20 includes: S21, sending a query message to the opposite board; S22, when the sending of the query message fails, enabling the software lock of the local board to the master Standby, set the local board as the active board when the power is completed, and set the peer board as the standby board; S23, when the query message is sent successfully, start the timer; S24, if in the timer The reply message of the peer board is not received within the preset period of time, enabling the software of the local board to lock the master and backup, setting the local board as the master board when the power is completed, and setting the peer board It is a standby board; S25. If the reply message of the peer board is received within the preset time period of the timer, the hardware status information of the peer board is obtained from the reply message.
在本实施例中,若本板硬件竞争结果为主,发消息到对板查询对板硬件状态信息,若连续发送几次查询消息均发送失败,则去使能本板软件锁定主备;若发送消息成功,则启动定时器timer1检查本板是否收到对板的应答消息,若在定时时间内收到应答,停止定时器timer1,则进入步骤S30,若几次定时到时,没有收到对板应答消息,停止定时器timer1,去使能本板软件锁定主备。In this embodiment, if the main hardware competition result of the board is the main, send a message to the board to query the board hardware status information. If the query message is sent several times in succession, the board software is disabled to lock the master and backup; if If the message is sent successfully, the timer timer1 is started to check whether the board has received a reply message to the board. If the response is received within the specified time and the timer1 is stopped, the process proceeds to step S30. Answer the message to the board, stop the timer timer1, and disable the software of the board to lock the active and standby.
在本实施例中,所述硬件状态信息包括:对端单板的硬件状态、对端单板的上电时间和槽位号。In this embodiment, the hardware status information includes: the hardware status of the peer board, the power-on time of the peer board, and the slot number.
如图3所示,在本实施例中,所述步骤S30包括:S31、当对端单板的硬件状态为备用板或未知时,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为主用板,将对端单板设置为备用板;S32、当对端单板的硬件状态为主用板时,比较所述对端单板和本端单板的上电时间;S33、若本端单板的上电时间早于对端单板的上电时间,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为主用板,将对端单板设置为备用板;S34、若本端单板的上电时间晚于对端单板的上电时间,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为备用板,将对端单板设置为主用板;S35、若本端单板的上电时间等于对端单板的上电时间,比较所述对端单板和本端单板的槽位号大小;S36、若本端单板的槽位号小于对端单板的槽位号,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为备用板,将对端单板设置为主用板;S37、若本端单板的槽位号大于对端单板的槽位号,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为主用板,将对端单板设置为备用板。As shown in FIG. 3, in this embodiment, the step S30 includes: S31. When the hardware status of the peer board is the standby board or unknown, enable the software of the local board to lock the master and backup, and power on When finished, set the local board as the active board and the remote board as the standby board; S32. When the hardware status of the remote board is the active board, compare the remote board with the local board The power-on time of the board; S33. If the power-on time of the local board is earlier than the power-on time of the opposite board, enable the software of the local board to lock the master and backup, and then the local board when the power is completed Set as the active board, and set the opposite end board as the standby board; S34. If the power-on time of the local end board is later than the power-on time of the opposite end board, enable the software of the local end board to lock the active and standby boards. When the power-on is completed, set the local board as the standby board, and set the peer board as the master board; S35. If the power-on time of the local board is equal to the power-on time of the peer board, compare Slot number of the opposite end board and the local end board; S36. If the slot number of the local end board is smaller than the slot number of the opposite end board, enable the software of the local end board to lock the master and backup. When the power is completed, set the local board as the standby board, and set the opposite board as the main board; S37. If the slot number of the local board is greater than the slot number of the opposite board, enable the local board The software of the board locks the active and standby devices. When the power is completed, the local board is set as the active board, and the opposite board is set as the standby board.
在本实施例中,当本板收到对板应答消息,若对板硬件状态为备或未知,去使能本板软件锁定主备。若对板硬件状态为主时,比较两块单板上电时间,若本板上电时间早,则去使能软件锁定主备。若本板上电时间晚,则继续使能软件锁定主备,软件锁定本板为备。若两块单板上电时间相等,比较单板槽位号大小,若本板槽位小,则去使能软件锁定主备;若本板槽位号大,则继续使能软件锁定主备,软件锁定本板为备。In this embodiment, when the board receives the response message from the board, if the board hardware status is standby or unknown, the board software is disabled to lock the master and standby. If the hardware status of the board is the master, compare the power-on time of the two boards. If the power-on time of the board is early, disable the software to lock the master and backup. If the board is powered on late, continue to enable the software to lock the master and slave, and the software to lock the board as a standby. If the power-on time of the two boards is equal, compare the slot number of the board. If the slot of the board is small, disable the software lock master and slave; if the slot number of the board is large, continue to enable the software lock master and slave , The software locks the board for preparation.
实施例二Example 2
如图4所示,在本实施例中,该单板主备控制方法还适用于单板主备状态切换过程中,此时,所述步骤S11之后还包括:S40、当本端单板为备用板,接收到系统发来的备转主消息后;向所述对端单板发送查询消息;获取对端单板的硬件状态信息;S50、根据所述硬件状态信息确定本端单板是否进行备转主切换。As shown in FIG. 4, in this embodiment, the single-board master-standby control method is also applicable to the single-board master-standby state switching process. At this time, after step S11, the method further includes: S40. When the local single-board is The standby board, after receiving the standby master message from the system; sends an inquiry message to the peer board; obtains the hardware status information of the peer board; S50. Determines whether the local board is based on the hardware status information Perform the standby switchover.
在本实施例中,单板主备状态的切换过程中,也有主备竞争,主转备时,若本板软件锁定主备使能,去使能软件锁定主备,无其它步骤。因此,本实施例中只讨论了备转主的情况,也是为了防止系统出现双主用板。In this embodiment, during the switchover between the active and standby states of the board, there is also an active-standby competition. When the active-standby is switched, if the software of the board locks the active-standby enable, the disable software locks the active-standby without any other steps. Therefore, in this embodiment, only the case of the backup-to-master is discussed, which is also to prevent the system from having dual master boards.
如图5所示,在本实施例中,所述步骤S50包括:S51、当对端单板的硬件状态为备用板或未知时,使能本端单板的软件锁定主备,进行备转主切换,将本端单板切换为主用板,将对端单板设置为备用板;S52、当对端单板的硬件状态为主用板时,使能本端单板的软件锁定主备,锁定本端单板为备用板,不进行备转主切换。As shown in FIG. 5, in this embodiment, the step S50 includes: S51. When the hardware status of the peer board is the standby board or unknown, enable the software of the local board to lock the master and backup to perform the backup transfer Master switch, switch the local board to the main board, and set the peer board to the standby board; S52. When the hardware status of the peer board is the master board, enable the software of the local board to lock the master board Standby, lock the local board as the standby board, and do not perform the standby to master switchover.
综合实施例一和实施例二,本文提供了一种在单板启动和主备切换过程中,软硬件共同决策主备的方法,支持单板在硬件正确决策主备或错误决策主备,导致硬件出现双主时,软件可以参与决策主备,保证单板一主一备正常运行。Combining the first and second embodiments, this article provides a method for the hardware and software to jointly decide the master and slave during the board startup and the master / slave switchover process. When the hardware has dual masters, the software can participate in the decision of the master and backup to ensure the normal operation of the board, one master and one backup.
实施例三Example Three
如图6所示,在本实施例中,一种单板主备控制装置,包括:获取模块10,用于获取本端单板与对端单板的硬件主备竞争结果;查询模块20,用于当本端单板的硬件主备竞争结果为主用板时,向所述对端单板发送查询消息;获取对端单板的硬件状态信息;控制模块30,用于根据所述硬件状态信息确定本端单板的主备状态。As shown in FIG. 6, in this embodiment, a single-board active / standby control device includes: an obtaining module 10, configured to obtain a hardware main-standby competition result between a local board and a peer board; a query module 20, It is used to send a query message to the peer board when the hardware master-slave competition result of the local board is the master board; to obtain the hardware status information of the peer board; the control module 30 is used according to the hardware The status information determines the active and standby status of the local board.
在本实施例中,通过硬件与软件相结合的方式确定单板的主备状态,尤其是在确定主用板时,会有软件参与决策,避免了双主用板的情况,提高了系统的可靠性。In this embodiment, the combination of hardware and software is used to determine the active and standby status of the board, especially when determining the active board, software will participate in the decision, avoiding the situation of dual active boards and improving the system's reliability.
在本实施例中,本端单板(以下描述中简称本板)和对端单板(以下描述中简称对板)都是一个通信接口板,在一个通信系统中,两者互为主备关系,当一个单板为主用板时,另一个单板为备用板,两个单板一主一备才能正常运行。In this embodiment, the local board (referred to as the board in the following description) and the peer board (referred to as the board in the following description) are both a communication interface board. In a communication system, the two are the master and the slave. Relationship, when one board is the active board and the other board is the standby board, the two boards can operate normally only with one master and one standby.
在本实施例中,单板与主备相关的信号有:最终主备信号,硬件主备信号。硬件由三个主要寄存器参与软硬件决策主备过程:“软件锁定主备使能”寄存器,”软件锁定主备“寄存器,硬件主备寄存器。硬件根据“软件锁定主备使能”寄存器是否软件锁定,将最终的主备信息写入到最终主备信号。即若软件不锁定主备时,则最终主备信号的值有硬件决定,最终主备信号与硬件主备信号值相等;若软件锁定主备时,最终主备信号的值完全由软件决定,软件决定的主备信息写入“软件锁定主备”寄存器,最终主备信号与该寄存器值相等。In this embodiment, the signals related to the active and standby of the board are: the final active and standby signals, and the hardware active and standby signals. The hardware consists of three main registers to participate in the software and hardware decision-making master-slave process: "software lock master-standby enable" register, "software lock master-standby" register, hardware master-standby register. The hardware writes the final master / standby information to the final master / standby signal according to whether the software lock master / standby enable register is software locked. That is, if the software does not lock the master and backup, the final value of the master and backup signals is determined by the hardware, and the final master and backup signals are equal to the hardware master and backup signals; if the software locks the master and backup, the final master and backup signal values are completely determined by the software The master-slave information determined by the software is written into the "software lock master-slave" register, and finally the master-slave signal is equal to the value of this register.
在本实施例中,该单板主备控制方法适用于单板启动过程中,首先,单板初始化完成后,使能硬件主备竞争;软件锁定主备使能,默认本板为备用板,并参与硬件主备竞争;在参与硬件主备竞争时,若本板软件锁定为备,其锁定状态会消失,步骤如下:当在启动和切换过程中,若本板软件锁定为备,则启动定时器timer2,定时器到时,获取本板的硬件状态,若本板为备,去使能软件锁定主备,停止定时器timer2;若本板为主,但是没有软件锁定主备,不处理;若本板为主,软件锁定主备使能时,发消息查询对板状态。In this embodiment, the single-board master-slave control method is applicable to the single-board startup process. First, after the single-board initialization is complete, the hardware master-standby competition is enabled; the software locks the master-standby enable, and the default board is the standby board. And participate in the hardware master-slave competition; when participating in the hardware master-slave competition, if the board's software is locked as a standby, its locked state will disappear, the steps are as follows: During the startup and switching process, if the board's software is locked as a standby, start Timer2, when the timer expires, get the hardware status of the board. If the board is the standby, disable the software to lock the master and standby, stop the timer timer2; if the board is the master, but there is no software to lock the master and standby, it will not be processed ; If the board is the master, and the software locks the master and slave enable, send a message to query the status of the board.
在本实施例中,本文提供了一种在单板启动和主备切换过程中,软硬件共同决策主备的方法,支持单板在硬件正确决策主备或错误决策主备,导致硬件出现双主时,软件可以参与决策主备,保证单板一主一备正常运行。In this embodiment, this article provides a method for the software and hardware to jointly decide the master and slave during the board startup and master / slave switchover process, and supports the board to correctly decide the master / slave or wrong master / slave in the hardware, resulting in dual hardware At the time of mastering, the software can participate in the decision of master and backup to ensure the normal operation of one board, one master and one standby.
实施例四Example 4
在本实施例中,一种电子设备,包括存储器、处理器和至少一个被存储在所述存储器中并被配置为由所述处理器执行的应用程序,所述应用程序被配置为用于执行实施例一所述的单板主备控制方法。In this embodiment, an electronic device includes a memory, a processor, and at least one application program stored in the memory and configured to be executed by the processor, and the application program is configured to execute The method for controlling the active and standby boards in the first embodiment.
实施例五Example 5
本发明实施例提供一种可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述单板主备控制方法实施例中任一所述的方法实施例。An embodiment of the present invention provides a readable storage medium on which a computer program is stored, and when the program is executed by a processor, a method embodiment as described in any one of the above-mentioned single-board main-standby control method embodiments is implemented.
实施例六Example Six
本发明实施例提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述任意方法实施例中的方法。An embodiment of the present invention provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, Causing the computer to execute the method in any of the above method embodiments.
需要说明的是,上述装置、设备实和可读存储介质实施例与方法实施例属于同一构思,其具体实现过程详见方法实施例,且方法实施例中的技术特征在装置实施例中均对应适用,这里不再赘述。It should be noted that the above device, device, and readable storage medium embodiments belong to the same concept as the method embodiments. For the specific implementation process, see the method embodiments, and the technical features in the method embodiments correspond to the device embodiments. Applicable, not repeated here.
本发明实施例的一种单板主备控制方法、装置、设备及可读存储介质,该方法包括:获取本端单板与对端单板的硬件主备竞争结果;当本端单板的硬件主备竞争结果为主用板时,向所述对端单板发送查询消息;获取对端单板的硬件状态信息;根据所述硬件状态信息确定本端单板的主备状态;通过硬件与软件相结合的方式确定单板的主备状态,尤其是在确定主用板时,会有软件参与决策,避免了双主用板的情况,提高了系统的可靠性。A method, device, equipment and readable storage medium for single-board active / standby control according to an embodiment of the present invention. The method includes: obtaining the hardware active / standby competition result of the local end board and the opposite end board; when the local end board When the result of the hardware master-slave competition is the master board, send a query message to the peer board; obtain the hardware status information of the peer board; determine the master-standby state of the local board based on the hardware status information; through the hardware Combined with software to determine the active and standby status of the board, especially when determining the active board, software will participate in the decision, avoiding the situation of dual active boards, and improving the reliability of the system.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。Those of ordinary skill in the art may understand that all or some of the steps, systems, and functional modules / units in the method disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof.
在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD) 或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical The components are executed in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit . Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage media includes both volatile and nonvolatile implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules, or other data Sex, removable and non-removable media. Computer storage media include but are not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or may Any other medium for storing desired information and accessible by a computer. In addition, it is well known to those of ordinary skill in the art that the communication medium generally contains computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium .
以上参照附图说明了本发明的优选实施例,并非因此局限本发明的权利范围。本领域技术人员不脱离本发明的范围和实质内所作的任何修改、等同替换和改进,均应在本发明的权利范围之内。The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, and thus do not limit the scope of the rights of the present invention. Any modification, equivalent replacement and improvement made by those skilled in the art without departing from the scope and essence of the present invention shall fall within the scope of the rights of the present invention.

Claims (10)

  1. 一种单板主备控制方法,包括:A single-board active and standby control method, including:
    获取本端单板与对端单板的硬件主备竞争结果;Obtain the results of the hardware master-slave competition between the local board and the peer board;
    当本端单板的硬件主备竞争结果为主用板时,向所述对端单板发送查询消息;获取对端单板的硬件状态信息;When the result of the hardware-standby competition of the local board is the active board, send a query message to the peer board; obtain the hardware status information of the peer board;
    根据所述硬件状态信息确定本端单板的主备状态。Determine the active and standby status of the local board based on the hardware status information.
  2. 根据权利要求1所述的一种单板主备控制方法,其中,所述获取本端单板与对端单板的主备竞争结果之后还包括:The method for controlling the active and standby boards according to claim 1, wherein after obtaining the result of the main and standby competition between the local board and the opposite board, the method further comprises:
    当本端单板的硬件主备竞争结果为备用板时,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为备用板,将对端单板设置为主用板。When the result of the competition between the hardware and standby of the local board is the standby board, enable the software of the local board to lock the active and standby boards, and set the local board as the standby board and the peer board as the Main board.
  3. 根据权利要求1所述的一种单板主备控制方法,其中,所述根据所述硬件状态信息确定本端单板的主备状态之后还包括:The method for controlling the active and standby boards according to claim 1, wherein after determining the active and standby states of the local board according to the hardware status information, the method further comprises:
    当本端单板为备用板,接收到系统发来的备转主消息后;向所述对端单板发送查询消息;获取对端单板的硬件状态信息;When the local board is the standby board, after receiving the standby master message sent by the system; sending an inquiry message to the peer board; obtaining the hardware status information of the peer board;
    根据所述硬件状态信息确定本端单板是否进行备转主切换。According to the hardware status information, it is determined whether the local end board performs the backup-to-main switch.
  4. 根据权利要求3所述的一种单板主备控制方法,其中,所述向所述对端单板发送查询消息;获取对端单板的硬件状态信息包括:An active and standby control method of a board according to claim 3, wherein the sending of an inquiry message to the peer board; obtaining hardware status information of the peer board includes:
    当发送查询消息失败时,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为主用板,将对端单板设置为备用板;When the query message fails to be sent, the software of the local board is enabled to lock the master and backup, and the local board is set as the master board when the power is completed, and the peer board is set as the standby board;
    当发送查询消息成功时,启动定时器,若在所述定时器的预设时间段内未收到对端单板的应答消息,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为主用板,将对端单板设置为备用板;When the query message is sent successfully, a timer is started. If no reply message is received from the peer board within the preset time period of the timer, the software of the local board is locked to the master and backup and completed at power-on When setting the local board as the active board, and the opposite board as the standby board;
    若在所述定时器的预设时间段内收到对端单板的应答消息,则从所述应答消息中获取对端单板的硬件状态信息。If the reply message of the peer board is received within the preset time period of the timer, the hardware status information of the peer board is obtained from the reply message.
  5. 根据权利要求4所述的一种单板主备控制方法,其中,所述硬件状态信息包括:对端单板的硬件状态、对端单板的上电时间和槽位号。The method for controlling the active and standby boards according to claim 4, wherein the hardware status information includes: the hardware status of the peer board, the power-on time of the peer board, and the slot number.
  6. 根据权利要求5所述的一种单板主备控制方法,其中,所述根据所述硬件状态信息确定本端单板的主备状态包括:The method for controlling the active and standby boards according to claim 5, wherein the determining the active and standby states of the local board based on the hardware state information includes:
    当对端单板的硬件状态为备用板或未知时,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为主用板,将对端单板设置为备用板;When the hardware status of the peer board is the standby board or unknown, enable the software of the local board to lock the master and backup, set the local board as the master board after power-on, and set the peer board to Spare board
    当对端单板的硬件状态为主用板时,比较所述对端单板和本端单板的上电时间,若本端单板的上电时间早于对端单板的上电时间,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为主用板,将对端单板设置为备用板;When the hardware status of the peer board is the active board, compare the power-on time of the peer board and the local board, if the power-on time of the local board is earlier than the power-on time of the peer board To enable the software of the local board to lock the active and standby boards, set the local board as the active board, and set the remote board as the standby board when the power is completed;
    若本端单板的上电时间晚于对端单板的上电时间,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为备用板,将对端单板设置为主用板;If the power-on time of the local end board is later than the power-on time of the opposite end board, enable the software of the local end board to lock the active and standby devices, and set the local end board as the standby board when the power is completed. The board is set as the main board;
    若本端单板的上电时间等于对端单板的上电时间,比较所述对端单板和本端单板的槽位号大小,若本端单板的槽位号小于对端单板的槽位号,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为备用板,将对端单板设置为主用板;If the power-on time of the local board is equal to the power-on time of the remote board, compare the slot numbers of the remote board and the local board. If the slot number of the local board is less than the remote board The slot number of the board enables the software of the local board to lock the active and standby boards, set the local board as the standby board when the power is completed, and set the opposite board as the active board;
    若本端单板的槽位号大于对端单板的槽位号,使能本端单板的软件锁定主备,在上电完成时将本端单板设置为主用板,将对端单板设置为备用板。If the slot number of the local end board is greater than the slot number of the opposite end board, enable the software of the local end board to lock the active and standby devices, and set the local end board as the active board after power-on is completed. The board is set as the standby board.
  7. 根据权利要求5所述的一种单板主备控制方法,其中,所述根据所述硬件状态信息确定本端单板是否进行备转主切换包括:The method for controlling the active / standby board of a board according to claim 5, wherein the determining whether the local board performs a standby-to-main switch according to the hardware status information includes:
    当对端单板的硬件状态为备用板或未知时,使能本端单板的软件锁定主备,进行备转主切换,将本端单板切换为主用板,将对端单板设置为备用板;When the hardware status of the peer board is the standby board or unknown, enable the software of the local board to lock the master and backup, perform backup to master switching, switch the local board to the active board, and set the peer board As a spare board;
    当对端单板的硬件状态为主用板时,使能本端单板的软件锁定主备,锁定本端单板为备用板,不进行备转主切换。When the hardware status of the peer board is the master board, enable the software of the local board to lock the master and slave boards, and lock the local board as a slave board, and do not switch from master to slave.
  8. 一种单板主备控制装置,其中,包括:A single-board main-standby control device, which includes:
    获取模块,用于获取本端单板与对端单板的硬件主备竞争结果;Obtaining module, used to obtain the hardware main and standby competition results of the local end board and the opposite end board;
    查询模块,用于当本端单板的硬件主备竞争结果为主用板时,向所述对端单板发送查询消息;获取对端单板的硬件状态信息;The query module is used to send a query message to the opposite end board when the hardware main and standby competition result of the local end board is the active board; to obtain the hardware status information of the opposite end board;
    控制模块,用于根据所述硬件状态信息确定本端单板的主备状态。The control module is used to determine the active and standby status of the local board according to the hardware status information.
  9. 一种电子设备,包括存储器、处理器和至少一个被存储在所述存储器中并被配置为由所述处理器执行的应用程序,其中,所述应用程序被配置为用于 执行权利要求1-7任一项所述的单板主备控制方法。An electronic device including a memory, a processor, and at least one application program stored in the memory and configured to be executed by the processor, wherein the application program is configured to execute claim 1- 7. Any one of the main and standby control methods of a single board.
  10. 一种可读存储介质,其中,其上存储有计算机程序,该程序被处理器执行时实现如权利要求1-7任一所述的单板主备控制方法。A readable storage medium, wherein a computer program is stored thereon, and when the program is executed by a processor, the single-board main / standby control method according to any one of claims 1-7 is implemented.
PCT/CN2019/113438 2018-11-23 2019-10-25 Single board main and standby control method, apparatus, device and readable storage medium WO2020103645A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811408338.5 2018-11-23
CN201811408338.5A CN111224799B (en) 2018-11-23 2018-11-23 Single board master/slave control method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
WO2020103645A1 true WO2020103645A1 (en) 2020-05-28

Family

ID=70774478

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/113438 WO2020103645A1 (en) 2018-11-23 2019-10-25 Single board main and standby control method, apparatus, device and readable storage medium

Country Status (2)

Country Link
CN (1) CN111224799B (en)
WO (1) WO2020103645A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1972142A (en) * 2006-12-08 2007-05-30 中兴通讯股份有限公司 Communications device single board active/standby changeover apparatus and implementation method
CN101106442A (en) * 2007-08-11 2008-01-16 中兴通讯股份有限公司 A preprocessing method of switching master and backup
CN101378267A (en) * 2007-08-31 2009-03-04 中兴通讯股份有限公司 Primary and secondary switching device, and switching method using the same
WO2012028013A1 (en) * 2010-09-01 2012-03-08 中兴通讯股份有限公司 Implementing method for main/standby configuration of board cards, and board card
CN102710466A (en) * 2012-06-11 2012-10-03 烽火通信科技股份有限公司 Master and backup board card changeover protection system, and bidirectional forwarding detection seamless handover method and device
WO2017124577A1 (en) * 2016-01-20 2017-07-27 邦彦技术股份有限公司 Fgpa-based in-position automatic detection and switching system and method for main and standby boards

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100375402C (en) * 2004-07-08 2008-03-12 中兴通讯股份有限公司 Method for preventing monolithic board from fault operation of master-slave back-up inverse circuit
US9049256B1 (en) * 2011-03-18 2015-06-02 Juniper Networks, Inc. Fabric switchover for systems with control plane and fabric plane on same board
CN102291303B (en) * 2011-08-12 2014-07-23 大唐移动通信设备有限公司 Single board and method for determining primary and standby states for the same

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1972142A (en) * 2006-12-08 2007-05-30 中兴通讯股份有限公司 Communications device single board active/standby changeover apparatus and implementation method
CN101106442A (en) * 2007-08-11 2008-01-16 中兴通讯股份有限公司 A preprocessing method of switching master and backup
CN101378267A (en) * 2007-08-31 2009-03-04 中兴通讯股份有限公司 Primary and secondary switching device, and switching method using the same
WO2012028013A1 (en) * 2010-09-01 2012-03-08 中兴通讯股份有限公司 Implementing method for main/standby configuration of board cards, and board card
CN102710466A (en) * 2012-06-11 2012-10-03 烽火通信科技股份有限公司 Master and backup board card changeover protection system, and bidirectional forwarding detection seamless handover method and device
WO2017124577A1 (en) * 2016-01-20 2017-07-27 邦彦技术股份有限公司 Fgpa-based in-position automatic detection and switching system and method for main and standby boards

Also Published As

Publication number Publication date
CN111224799A (en) 2020-06-02
CN111224799B (en) 2022-10-25

Similar Documents

Publication Publication Date Title
US10560315B2 (en) Method and device for processing failure in at least one distributed cluster, and system
US20200233762A1 (en) Method and Apparatus for Redundancy in Active-Active Cluster System
US7490264B2 (en) Method for error handling in a dual adaptor system where one adaptor is a master
US7774424B1 (en) Method of rate snooping in a SAS/SATA environment
CN110890980A (en) Method, device, server and system for switching main terminal and standby terminal
WO2020232859A1 (en) Distributed storage system, data writing method, device, and storage medium
CN106797370B (en) SAS system and traversal method and device thereof
US11483383B2 (en) Data reporting method and system
WO2016107443A1 (en) Snapshot processing method and related device
CN106230622B (en) Cluster implementation method and device
TW201626134A (en) Rack having multi-RMMs and firmware updating method for the rack
CN111585835B (en) Control method and device for out-of-band management system and storage medium
CN106331081B (en) Information synchronization method and device
JP2021121971A (en) File resource processing method, apparatus, facility, medium, and program
WO2020103645A1 (en) Single board main and standby control method, apparatus, device and readable storage medium
CN113625540A (en) Dual-computer hot standby control method and device and dual-computer hot standby system
CN110053650B (en) Automatic train operation system, automatic train operation system architecture and module management method of automatic train operation system
CN116232893A (en) Consensus method and device of distributed system, electronic equipment and storage medium
CN112433968B (en) Controller sharing synchronization method and device
US20230126682A1 (en) Fault tolerance method and apparatus of network device system, computer device, and storage medium
TWI704464B (en) Data redundancy system
WO2011134255A1 (en) Method for processing service board switch and framework control apparatus
CN107133186B (en) Method for simultaneously communicating master TMC (remote control message), slave TMC (remote control message) and BMC (baseboard management controller)
CN113407369B (en) Intelligent platform management system supporting main and standby system management and implementation method
CN114598643B (en) Data backup method and device

Legal Events

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

Ref document number: 19887733

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19887733

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 06/10/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19887733

Country of ref document: EP

Kind code of ref document: A1