CN112596371A - Control card switching method and device, electronic equipment and storage medium - Google Patents

Control card switching method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112596371A
CN112596371A CN202011521047.4A CN202011521047A CN112596371A CN 112596371 A CN112596371 A CN 112596371A CN 202011521047 A CN202011521047 A CN 202011521047A CN 112596371 A CN112596371 A CN 112596371A
Authority
CN
China
Prior art keywords
control card
standby
master
state
switching
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011521047.4A
Other languages
Chinese (zh)
Inventor
张志强
万月亮
火一莽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ruian Technology Co Ltd
Original Assignee
Beijing Ruian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ruian Technology Co Ltd filed Critical Beijing Ruian Technology Co Ltd
Priority to CN202011521047.4A priority Critical patent/CN112596371A/en
Publication of CN112596371A publication Critical patent/CN112596371A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B9/00Safety arrangements
    • G05B9/02Safety arrangements electric
    • G05B9/03Safety arrangements electric with multiple-channel loop, i.e. redundant control systems

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Hardware Redundancy (AREA)

Abstract

The embodiment of the invention discloses a control card switching method, a control card switching device, electronic equipment and a storage medium, wherein the method comprises the following steps: when the master control card is detected to be in a fault state, switching the standby control card from a standby state to a working state; reading system configuration data and system operation and maintenance data in a slave database corresponding to the standby control card so that the standby control card enters a working state based on the system configuration data and the system operation and maintenance data; and the system configuration data and the system operation and maintenance data of the slave database are synchronous with the system configuration data and the system operation and maintenance data of the master database corresponding to the master control card. By the technical scheme of the embodiment of the invention, the convenience of data synchronization between the main control card and the standby control card and the switching efficiency of the main control card and the standby control card are improved, so that the technical effect of improving the reliability of the system is achieved.

Description

Control card switching method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a control card switching method and device, electronic equipment and a storage medium.
Background
The control card is used as a core component of the control equipment and is in service communication with each service module so as to complete the normal functions of each service module in the system. And when the control card receives the configuration information, storing the configuration information in a local storage space of the control card, so that when the control card is started, the configuration information is loaded and the control equipment is set according to the configuration information. In a communication system, since the network location where the control device is located is very important, the requirement for stability of the control device is very high. In order to ensure normal operation, a standby control card is usually added to switch the control card when the control card fails.
At present, one of the existing control card switching techniques is to power off the system first when the main control card fails, and then replace the failed main control card with the standby control card, so that the device cannot work during card replacement, which affects the working efficiency. In order to improve the method that the on-line switching cannot be carried out, two control cards are generally configured in the control equipment at the same time, when the main control card works, the standby control card needs to acquire all the running data of the main control card in real time and store the running data in the local storage space of the standby control card, so that the standby control card and the main control card are completely consistent in control logic and memory information, and the standby control card can replace the main control card to work when the main control card fails.
However, because the frame architecture basically adopts the ATCA platform, the control card cannot be expanded due to the limitation of the frame architecture, hardware resources and performance are relatively low, configuration information of the system can only be stored in a file mode, synchronization between the main control card and the standby control card can only adopt network data exchange, the coupling and complexity of the whole system are high, and the operation and maintenance data volume of the system is relatively large, so that synchronization cannot be realized.
Disclosure of Invention
The embodiment of the invention provides a control card switching method and device, electronic equipment and a storage medium, and aims to improve the convenience of data synchronization between a main control card and a standby control card, the switching efficiency of the main control card and the standby control card and further improve the technical effect of the reliability of a system.
In a first aspect, an embodiment of the present invention provides a control card switching method, which is applied to a standby control card, and the method includes:
when the master control card is detected to be in a fault state, switching the standby control card from a standby state to a working state;
reading system configuration data and system operation and maintenance data in a slave database corresponding to the standby control card so that the standby control card enters a working state based on the system configuration data and the system operation and maintenance data;
and the system configuration data and the system operation and maintenance data of the slave database are synchronous with the system configuration data and the system operation and maintenance data of the master database corresponding to the master control card.
In a second aspect, an embodiment of the present invention further provides a control card switching device configured on a standby control card, where the control card switching device includes:
the state switching module is used for switching the standby control card from a standby state to a working state when the main control card is detected to be in a fault state;
the data reading module is used for reading system configuration data and system operation and maintenance data in a slave database corresponding to the standby control card so that the standby control card enters a working state based on the system configuration data and the system operation and maintenance data;
and the system configuration data and the system operation and maintenance data of the slave database are synchronous with the system configuration data and the system operation and maintenance data of the master database corresponding to the master control card.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the control card switching method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are configured to perform the control card switching method according to any embodiment of the present invention when executed by a computer processor.
Compared with the technical scheme that the configuration data and all the operation data of the main control card need to be stored locally on the standby control card in the prior art, the data synchronization efficiency is low during switching of the control cards, the problem of influencing the system operation efficiency is solved, the convenience of data synchronization between the main control card and the standby control card is improved, the switching efficiency of the main control card and the standby control card is improved, and the system operation efficiency is improved, the standby control card is configured in a mode of reading system configuration data from the database, so that the selectivity of the standby control card is more flexible, the memory space of the main control card and the standby control card is released, the space limitation of the control card is greatly solved, the processing performance and the storage capacity are greatly improved, and the technical effect of improving the reliability of the system is further achieved.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a flowchart of a control card switching method according to an embodiment of the present invention;
fig. 2 is a flowchart of a control card switching method according to a second embodiment of the present invention;
fig. 3 is a flowchart of a control card switching method according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a control card switching device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a control card switching method according to an embodiment of the present invention, which is applicable to a situation where a standby control card is started when a master control card fails or is removed from a master card slot. The method may be performed by a control card switching device, which may be implemented in software and/or hardware, typically integrated in an electronic device.
As shown in fig. 1, the method specifically includes the following steps:
and S110, when the main control card is detected to be in a fault state, switching the standby control card from a standby state to a working state.
The master control card may be a control core of the device or the system, and is configured to implement communication with an external device and control the device or the system to complete functions of each module. The standby control card may be a control card for ensuring that the standby control card operates in place of the master control card when the master control card fails, so that the device or system can operate normally. The fault state may include a fault of the master control card, and may also include a non-operating state of the master control card caused by the master control card being moved out of the master slot position. The standby state may be a standby state in which the standby control card is not started and the standby control card is disconnected from both the external communication interface and the communication interface of the internal underlying service card. The operating state may be a state in which the standby control card is used to control the operation of the device or system.
Optionally, at least two card slots may be provided in the device or system. The card slot-based use logic may be divided into a master card slot position and a spare card slot position. It is to be understood that the number of the primary and spare slots may be one, two or more, and is not particularly limited thereto. The control card in the master card slot is often enabled preferentially as a main control card. In other words, the master control card is typically located in the master slot position and the standby control card is typically located in the standby slot position.
Specifically, the standby control card can detect the state of the master control card, so that when the master control card fails or is moved out of the master card slot, the standby control card can be started to ensure the normal operation of the equipment or the system. If the standby control card detects that the main control card is in a normal working state, the standby control card keeps a standby state at the moment; if the standby control card detects that the main control card is in a fault state, the standby control card is started, and the standby control card is switched to a working state.
The detection of the state of the master control card by the standby control card can be that the standby control card is in communication connection with the master control card, and if the communication connection is disconnected and the communication connection is not reestablished within a certain time, for example, if the communication connection between the master control card and the standby control card within 30s is disconnected, the master control card is judged to be in a fault state. Or the master control card sends a signal to the standby control card at intervals so that the standby control card determines that the master control card is in a working state, and if the standby control card does not receive the signal sent by the master control card within a preset number of time intervals, the master control card is judged to be in a failure state.
It should be noted that the method for detecting the state of the primary control card by the standby control card may be selected according to actual requirements, and is not specifically limited in this embodiment.
In order to clearly introduce a method for detecting the state of the master control card by the standby control card, taking the example that the master control card sends a heartbeat message to the standby control card, a specific method is as follows:
and if the heartbeat message sent by the heartbeat state sending thread of the main control card is not received within the preset time length range, determining that the main control card is detected to be in a fault state.
The heartbeat state sending thread is a thread used for sending heartbeat messages. The heartbeat message may be a message that the master control card sends a heartbeat signal to the standby control card at a certain time interval. The heartbeat signal may be a pulse signal used to determine whether the master control card is operating properly. The preset time length range is used for measuring the time length range of whether the master control card works normally, and can be 30s and the like.
Specifically, the standby control card can receive a heartbeat message sent by the main control card in real time or at regular time, and when the heartbeat message is received, the main control card can be determined to work normally; if the heartbeat message is not received within the preset time range, the main control card can be determined to be in a fault state.
Illustratively, the standby control card detects the heartbeat packet sent by the main card at regular time based on the heartbeat state sending thread, for example: every ten seconds. If 3 continuous times of not receiving the heartbeat message of the main control card exist, determining that the main control card is in a failure state, and switching the standby control card to a working state, otherwise, keeping the current standby state of the standby control card unchanged.
And S120, reading system configuration data and system operation and maintenance data in the slave database corresponding to the standby control card so that the standby control card enters a working state based on the system configuration data and the system operation and maintenance data.
Wherein the slave database is a database corresponding to the standby control card, the master database is a database corresponding to the master control card, and the master database and the slave database may be configured in the server. The master database and the slave database store system configuration data and system operation and maintenance data. The system configuration data and the system operation and maintenance data of the master database are obtained according to data generated by interaction between the master control card and external equipment and the like. Optionally, the system configuration data and the system operation and maintenance data of the slave database are synchronized with the system configuration data and the system operation and maintenance data of the master database corresponding to the master control card. The system configuration data may be data for configuring the control card so that the control card can control the device or the system, and the system operation and maintenance data may include interaction data generated by the master control card interacting with the device or the system, and may also include data generated by the master control card running.
Illustratively, the master database and the slave database may be Mysql databases. The Mysql database supports master-slave synchronization, and master-slave synchronization of system configuration data and system operation and maintenance data can be realized through real-time synchronization between the master database and the slave database.
It should be noted that, when the master control card normally works, the system configuration data required by the control card configuration and the interactive data generated in the working process of the master control card are stored in the master database. The slave database can be updated according to the data change in the master database, so that the slave database and the master database are in a data master-slave synchronization state. The data synchronization mode of the slave database and the master database may be that when the slave database detects the data change of the master database, the data in the slave database is updated according to the data in the master database, or the data in the master database is acquired from the slave database in real time and the data in the slave database is updated. The advantages of real-time synchronization of the master database and the slave database are that: the method can reduce data synchronization when the master control card and the standby control card are switched, further reduce the system recovery time, and effectively avoid the problems of data loss and low switching efficiency caused by control card switching.
Specifically, if the standby control card is switched to the working state, the standby control card needs to be configured, and the standby control card can acquire the system operation and maintenance data in the slave database to ensure that the system or the device can continuously work without being affected by the failure of the master control card. The standby control card can read the system configuration data in the slave database to configure the standby control card, so that the configured standby control card is the same as the original main control card in configuration. And when the standby control card works, the standby control card can complete the work based on the system operation and maintenance data in the slave database. When the standby control card is switched to a working state, the external communication interface and the communication interface of the internal bottom layer service card can be opened to take over all management tasks.
On the basis of the above embodiment, in order to make the standby control card distinguishable from the master control card and avoid the problem of work confusion between the standby control card and the master control card, the standby control card may be started later than the master control card for a period of time.
Optionally, the start script is called to start the control card management program.
The start script may be a script code for starting a hypervisor of the primary control card and the standby control card. The control card management program may include a control card management program of the master control card and a control card management program of the standby control card for managing start and operation of the control cards. When the system is simultaneously provided with the main control card and the standby control card, the starting time of the control card management program in the starting script of the standby control card is later than the starting time of the control card management program in the starting script of the main control card.
Specifically, when the master control card and the standby control card are installed in the system at the same time, the control card may be started by calling a start script. The starting script of the master control card can be immediately executed to start the corresponding control card management program; the start script of the standby control card can be provided with a time delay program to delay a certain time and then start the corresponding control card management program.
It should be noted that, the system configuration data and the system operation and maintenance data of the master control card and the standby control card are stored in the master database and the slave database, and the synchronization problem of the databases does not need to be concerned in the process of switching the master control card to the standby control card. The reason is that: the services of the master database and the slave database are started following the start of the system, usually prior to the start of the business system. When the service system needs to switch the master control card to the standby control card, master-slave synchronization of the master database and the slave database is completed, and the standby control card can be directly converted into a working state.
Compared with the technical scheme that the configuration data and all the operation data of the main control card need to be stored locally on the standby control card in the prior art, the data synchronization efficiency is low during switching of the control cards, the problem of influencing the system operation efficiency is solved, the convenience of data synchronization between the main control card and the standby control card is improved, the switching efficiency of the main control card and the standby control card is improved, and the system operation efficiency is improved, the standby control card is configured in a mode of reading system configuration data from the database, so that the selectivity of the standby control card is more flexible, the memory space of the main control card and the standby control card is released, the space limitation of the control card is greatly solved, the processing performance and the storage capacity are greatly improved, and the technical effect of improving the reliability of the system is further achieved.
Example two
Fig. 2 is a flowchart of a control card switching method according to a second embodiment of the present invention, and in this embodiment, on the basis of the foregoing embodiments, reference may be made to the technical solution of this embodiment for specific conditions for whether to switch a standby control card to a standby state. Optionally, if the control card switch-back mode preconfigured in the system is in the on state, the operation of switching the master control card to the working state is executed. The same or corresponding terms as those in the above embodiments are not explained in detail herein.
As shown in fig. 2, the method specifically includes the following steps:
s210, when the main control card is detected to be in the fault state, the standby control card is switched to the working state from the standby state.
S220, reading system configuration data and system operation and maintenance data in a slave database corresponding to the standby control card so that the standby control card enters a working state based on the system configuration data and the system operation and maintenance data.
And S230, if the control card switch-back mode pre-configured by the system is in the open state, executing the operation of switching the master control card to the working state.
The control card switch back mode may be a mode in which, when it is detected that the failure state of the master control card is released, the master control card is started to be in an operating state, and the standby control card is switched back to a standby state.
Specifically, if the control card switch-back mode pre-configured in the system is in the on state, when the failure state of the master control card is detected to be released, the master control card can be restarted to manage and control the system or the device, and the standby control card is switched back from the working state to the standby state. When the master control card is started, the master database can synchronize system operation and maintenance data during the fault period of the master control card from the slave database so that the master control card can work normally.
Optionally, before the master control card is switched to the working state, it may be further determined whether the master control card is placed in the master slot position, and if so, an operation of switching the master control card to the working state is performed.
Specifically, if the master control card is located in the master card slot, the master control card can be switched to a working state, and the standby control card can be switched to a standby state; if the master control card is located in the standby card slot position outside the master card slot position, the original master control card can be used as the standby control card and set to be in a standby state, and the working state of the original standby control card is kept unchanged.
Optionally, before the master control card is switched to the working state, whether the failure of the master control card is eliminated may be determined according to whether the standby control card receives the heartbeat message sent by the master control card. The specific mode can be as follows: and if receiving the heartbeat message sent by the heartbeat state sending thread of the main control card, switching the main control card to a working state and switching the standby control card from the working state to a standby state.
Specifically, the standby control card may detect the state of the main control card when in a working state, and if a heartbeat message sent by a heartbeat state sending thread of the main control card is received, it indicates that the failure state of the main control card is released, and the standby control card may be reused. At this time, the master control card may be switched to the working state and the standby control card may be switched from the working state to the standby state according to the switching mode.
On the basis of the above embodiments, three cases are described without switching the master control card to the working state and the standby control card to the standby state.
First, if the control card switch-back mode is not in the on state, the master control card is switched to the standby state.
Specifically, if the control card switch-back mode is not started, the working state of the standby control card is kept unchanged, and if the fault state of the main control card is relieved, the main control card is switched to the standby state to be used when the standby control card fails. In this case, the master database will synchronize the data according to the data in the slave database.
And secondly, if the standby control card is arranged in the main card slot position, the main control card is switched to a standby state.
Specifically, if the standby control card is placed in the master card slot, it is indicated that the original standby control card is used as a new master control card and is put into use. Even if the fault of the original master control card is removed, the back switch is not needed, the control cards in the master card slot position are kept in the working state, and the rest control cards are switched to the standby state.
And thirdly, if the master control card is not arranged in the master card slot position, switching the master control card to a standby state.
Specifically, if no control card exists in the master card slot, that is, the master control card and the standby control card are both placed in different standby card slots, the working state of the standby control card can be kept unchanged, and the master control card is switched to the standby state.
In the technical scheme of the embodiment, when the master control card is detected to be in a fault state, the standby control card is switched from the standby state to the working state, and the system configuration data and the system operation and maintenance data in the slave database corresponding to the standby control card are read, so that the standby control card enters the working state based on the system configuration data and the system operation and maintenance data, compared with the technical scheme that the configuration data and all the operation data of the master control card need to be stored locally on the standby control card in the prior art, when the fault of the master control card is relieved, if a switch-back mode of the control card configured in advance by the system is in an open state, the operation of switching the master control card to the working state is executed, the problems of low data synchronization efficiency and system working efficiency are solved, the convenience of data synchronization between the master control card and the standby control card and the switching efficiency of the master control card and the standby control card, and the standby control card is configured in a mode of reading system configuration data from the database, so that the selectivity of the standby control card is more flexible, the memory space of the main control card and the standby control card is released, the space limitation of the control card is greatly solved, the processing performance and the storage capacity are greatly improved, and the technical effect of improving the reliability of the system is further improved.
EXAMPLE III
Fig. 3 is a flowchart illustrating a control card switching method according to a third embodiment of the present invention, specifically, a cut-back mode is set to enable a master control card and a standby control card to implement smooth switching, where explanations of terms identical to or corresponding to the above embodiments are not repeated herein.
As shown in fig. 3, the method specifically includes the following steps:
and S310, respectively installing databases on the master control card and the standby control card, and calling scripts for configuring master-slave synchronization functions of the databases.
Specifically, the databases installed on the primary control card and the standby control card may be mysql _ v5.6.0 version databases, or may be other databases, which is not specifically limited in this embodiment. The master-slave function of the database can be started by calling the script for configuring the master-slave synchronization function of the database, so that the data synchronization of the master database and the slave database is realized, and the data comprises system configuration data and system operation and maintenance data.
S320, installing a service system on the control card, and configuring a communication mode and a cut-back mode of the master control card and the standby control card.
Specifically, the communication mode may be a communication mode configured by an IP (Internet Protocol). And respectively installing service systems on the main control card and the standby control card so as to ensure that the standby control card can manage and control the service systems when the main control card fails. In order to enable the standby control card to detect the state of the master control card, the communication IP between the master control card and the standby control card may be configured in advance, so that the master control card may send a heartbeat message to the standby control card. Meanwhile, a cut-back mode can be set to be in an opening or closing state so as to determine the starting logics of the main control card and the standby control card.
S330, calling the starting script to start the management program.
Specifically, the start script may be called to control the start of the hypervisor of the standby control card later than the start of the hypervisor of the master control card, for example: the hypervisor controlling the standby control card is started 30 seconds after the hypervisor controlling the primary control card is started. By the method, the problem of master robbing abnormity caused by the simultaneous starting of the management program of the master control card and the management program of the standby control card can be solved.
And S340, enabling master-slave synchronization through the command line.
Specifically, the master-slave synchronization can be enabled through a command line corresponding to the master-slave synchronization, so that the master-slave synchronization is performed between the master database and the slave database.
And S350, checking the master-slave status, the configuration information and the operation and maintenance data of the current system through a command line.
Specifically, different functions can be realized through different command lines, and the master-slave status of the current system can be viewed through the command lines, for example: the A card is a master control card, and the B card is a standby control card; the configuration information of the system and/or each control card can be viewed through a command line; the operation and maintenance data of the system and the like can be checked through a command line.
And S360, when the main control card is detected to be in the fault state, switching the standby control card from the standby state to the working state.
And S370, reading system configuration data and system operation and maintenance data in the slave database corresponding to the standby control card, so that the standby control card enters a working state based on the system configuration data and the system operation and maintenance data.
The technical scheme of the embodiment of the invention is that the databases are respectively arranged on the master control card and the standby control card, the master-slave synchronization is started to synchronize the data in the master database and the slave database, the communication mode and the cut-back mode between the control cards are configured to determine the working logic between the master control card and the standby control card, and the master-slave status, the configuration information and the operation and maintenance data of the system of the current system can be checked through a command line, compared with the technical scheme that the configuration data and all the operation data of the master control card need to be stored locally on the standby control card in the prior art, the problems of low data synchronization efficiency during switching of the control cards and influence on the working efficiency of the system are solved, the convenience of data synchronization between the master control card and the standby control card is improved, the switching efficiency of the master control card and the standby control card is improved, the standby control card is configured in a mode of reading system configuration data from the database, so that the selectivity of the standby control card is more flexible, the memory space of the main control card and the standby control card is released, the space limitation of the control card is greatly solved, the processing performance and the storage capacity are greatly improved, and the technical effect of improving the reliability of the system is further achieved.
The following is an embodiment of a control card switching device provided in an embodiment of the present invention, and the device and the control card switching method in the above embodiments belong to the same inventive concept, and details that are not described in detail in the embodiment of the control card switching device may refer to the embodiment of the control card switching method described above.
Example four
Fig. 4 is a schematic structural diagram of a control card switching device according to a fourth embodiment of the present invention, which is applicable to a situation where a standby control card is started when a master control card fails or a master card slot is removed, where the device specifically includes: a state switching module 410 and a data reading module 420.
The state switching module 410 is configured to switch the standby control card from the standby state to the working state when it is detected that the master control card is in the failure state; the data reading module 420 is configured to read system configuration data and system operation and maintenance data in the slave database corresponding to the standby control card, so that the standby control card enters a working state based on the system configuration data and the system operation and maintenance data; the system configuration data and the system operation and maintenance data of the slave database are synchronized with the system configuration data and the system operation and maintenance data of the master database corresponding to the master control card.
Optionally, the apparatus further comprises:
and the fault determining module is used for determining that the main control card is detected to be in a fault state if the heartbeat message sent by the heartbeat state sending thread of the main control card is not received within the preset time range.
Optionally, the apparatus further comprises:
and the back-cut module is used for switching the main control card to a working state and switching the standby control card from the working state to a standby state if receiving the heartbeat message sent by the heartbeat state sending thread of the main control card.
Optionally, the apparatus further comprises:
and the state determining module is used for determining whether a control card cut-back mode pre-configured by the system is in an open state, and if so, executing the operation of switching the master control card to a working state.
Optionally, the apparatus further comprises:
and the slot position determining module is used for determining whether the master control card is placed in the master card slot position, and if so, executing the operation of switching the master control card to the working state.
Optionally, the apparatus further comprises at least one of the following modules:
the first switching module is used for switching the master control card to a standby state if the control card switch-back mode is not in an open state;
the second switching module is used for switching the master control card to a standby state if the standby control card is arranged in the master card slot position;
and the third switching module is used for switching the master control card to a standby state if the master control card is not arranged in the master card slot position.
Optionally, the apparatus further comprises:
and the management program starting module is used for calling the starting script to start the control card management program, wherein when the system is simultaneously provided with the main control card and the standby control card, the starting time of the control card management program in the starting script of the standby control card is later than the starting time of the control card management program in the starting script of the main control card.
Compared with the technical scheme that the configuration data and all the operation data of the main control card need to be stored locally on the standby control card in the prior art, the data synchronization efficiency is low during switching of the control cards, the problem of influencing the system operation efficiency is solved, the convenience of data synchronization between the main control card and the standby control card is improved, the switching efficiency of the main control card and the standby control card is improved, and the system operation efficiency is improved, the standby control card is configured in a mode of reading system configuration data from the database, so that the selectivity of the standby control card is more flexible, the memory space of the main control card and the standby control card is released, the space limitation of the control card is greatly solved, the processing performance and the storage capacity are greatly improved, and the technical effect of improving the reliability of the system is further achieved.
The control card switching device provided by the embodiment of the invention can execute the control card switching method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the control card switching method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 5 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 5, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may 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 the network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system memory 28, for example, implementing steps of a control card switching method provided in the embodiment of the present invention, the method including:
when the main control card is detected to be in a fault state, switching the standby control card from a standby state to a working state;
reading system configuration data and system operation and maintenance data in a slave database corresponding to the standby control card so that the standby control card enters a working state based on the system configuration data and the system operation and maintenance data;
the system configuration data and the system operation and maintenance data of the slave database are synchronized with the system configuration data and the system operation and maintenance data of the master database corresponding to the master control card.
Of course, those skilled in the art can understand that the processor can also implement the technical solution of the target user identification method provided by any embodiment of the present invention.
EXAMPLE six
A sixth embodiment provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the control card switching method provided in any embodiment of the present invention, where the method includes:
when the main control card is detected to be in a fault state, switching the standby control card from a standby state to a working state;
reading system configuration data and system operation and maintenance data in a slave database corresponding to the standby control card so that the standby control card enters a working state based on the system configuration data and the system operation and maintenance data;
the system configuration data and the system operation and maintenance data of the slave database are synchronized with the system configuration data and the system operation and maintenance data of the master database corresponding to the master control card.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It will be understood by those skilled in the art that the modules or steps of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and optionally they may be implemented by program code executable by a computing device, such that it may be stored in a memory device and executed by a computing device, or it may be separately fabricated into various integrated circuit modules, or it may be fabricated by fabricating a plurality of modules or steps thereof into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A control card switching method is applied to a standby control card and comprises the following steps:
when the master control card is detected to be in a fault state, switching the standby control card from a standby state to a working state;
reading system configuration data and system operation and maintenance data in a slave database corresponding to the standby control card so that the standby control card enters a working state based on the system configuration data and the system operation and maintenance data;
and the system configuration data and the system operation and maintenance data of the slave database are synchronous with the system configuration data and the system operation and maintenance data of the master database corresponding to the master control card.
2. The method of claim 1, further comprising:
and if the heartbeat message sent by the heartbeat state sending thread of the main control card is not received within the preset time length range, determining that the main control card is detected to be in a fault state.
3. The method of claim 1, further comprising:
and if receiving a heartbeat message sent by a heartbeat state sending thread of the main control card, switching the main control card to a working state and switching the standby control card from the working state to a standby state.
4. The method according to claim 3, further comprising, before said switching the master control card to the active state:
and determining whether a control card cut-back mode pre-configured by the system is in an open state, and if so, executing the operation of switching the master control card to a working state.
5. The method according to claim 4, wherein after the determining whether the control card cut-back mode is in the on state and before the switching the master control card to the working state, further comprising:
and determining whether the master control card is placed in a master card slot, and if so, executing the operation of switching the master control card to a working state.
6. The method of claim 4, further comprising at least one of:
if the control card switch-back mode is not in the opening state, switching the master control card to a standby state;
if the standby control card is arranged in the main card slot position, switching the main control card to a standby state;
and if the master control card is not placed in the master card slot position, switching the master control card to a standby state.
7. The method of claim 1, further comprising:
and calling a start script to start the control card management program, wherein when the main control card and the standby control card are simultaneously installed in the system, the start time of the control card management program in the start script of the standby control card is later than the start time of the control card management program in the start script of the main control card.
8. A control card switching device, configured on a standby control card, includes:
the state switching module is used for switching the standby control card from a standby state to a working state when the main control card is detected to be in a fault state;
the data reading module is used for reading system configuration data and system operation and maintenance data in a slave database corresponding to the standby control card so that the standby control card enters a working state based on the system configuration data and the system operation and maintenance data;
and the system configuration data and the system operation and maintenance data of the slave database are synchronous with the system configuration data and the system operation and maintenance data of the master database corresponding to the master control card.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the control card switching method of any of claims 1-7.
10. A storage medium containing computer executable instructions for performing the control card switching method of any of claims 1-7 when executed by a computer processor.
CN202011521047.4A 2020-12-21 2020-12-21 Control card switching method and device, electronic equipment and storage medium Pending CN112596371A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011521047.4A CN112596371A (en) 2020-12-21 2020-12-21 Control card switching method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011521047.4A CN112596371A (en) 2020-12-21 2020-12-21 Control card switching method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112596371A true CN112596371A (en) 2021-04-02

Family

ID=75199744

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011521047.4A Pending CN112596371A (en) 2020-12-21 2020-12-21 Control card switching method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112596371A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114384793A (en) * 2022-03-24 2022-04-22 成都万创科技股份有限公司 Monitoring system of multiple intelligent devices and control method thereof
CN115031348A (en) * 2022-07-08 2022-09-09 贵州汇通华城股份有限公司 Control system and method of central air conditioner

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1946058A (en) * 2006-10-28 2007-04-11 武汉市中光通信公司 Soft exchange device allopatric disaster recovery solution system and its method for software exchange network
CN101197651A (en) * 2007-12-19 2008-06-11 华为技术有限公司 Method, equipment, master control board and interface plate of communication between plates
CN103067206A (en) * 2012-12-28 2013-04-24 无锡博欧节能科技有限公司 Internet of things across-machine room distributed type full automatic hot standby server switching system
CN103533560A (en) * 2013-10-24 2014-01-22 迈普通信技术股份有限公司 Control method and system for switching between master access controller (AC) and standby AC
CN105550076A (en) * 2015-12-03 2016-05-04 北京小鸟科技发展有限责任公司 Image splicing control system and redundant hot backup method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1946058A (en) * 2006-10-28 2007-04-11 武汉市中光通信公司 Soft exchange device allopatric disaster recovery solution system and its method for software exchange network
CN101197651A (en) * 2007-12-19 2008-06-11 华为技术有限公司 Method, equipment, master control board and interface plate of communication between plates
CN103067206A (en) * 2012-12-28 2013-04-24 无锡博欧节能科技有限公司 Internet of things across-machine room distributed type full automatic hot standby server switching system
CN103533560A (en) * 2013-10-24 2014-01-22 迈普通信技术股份有限公司 Control method and system for switching between master access controller (AC) and standby AC
CN105550076A (en) * 2015-12-03 2016-05-04 北京小鸟科技发展有限责任公司 Image splicing control system and redundant hot backup method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114384793A (en) * 2022-03-24 2022-04-22 成都万创科技股份有限公司 Monitoring system of multiple intelligent devices and control method thereof
CN115031348A (en) * 2022-07-08 2022-09-09 贵州汇通华城股份有限公司 Control system and method of central air conditioner

Similar Documents

Publication Publication Date Title
US8621283B2 (en) Systems, methods, and apparatus to debug a network application by utilizing a cloned network and an interactive debugging technique
CN110166355B (en) Message forwarding method and device
CN108984349B (en) Method and device for electing master node, medium and computing equipment
US20150067387A1 (en) Method and apparatus for data storage
CN111190766A (en) HBase database-based cross-machine-room cluster disaster recovery method, device and system
CN112596371A (en) Control card switching method and device, electronic equipment and storage medium
CN108833164B (en) Server control method, device, electronic equipment and storage medium
CN110740145A (en) Message consumption method, device, storage medium and electronic equipment
CN113467873A (en) Virtual machine scheduling method and device, electronic equipment and storage medium
CN113658351B (en) Method and device for producing product, electronic equipment and storage medium
CN109343955B (en) Recommendation service calling method, medium, device and computing equipment
CN104683486A (en) Method and device for processing synchronous messages in distributed system and distributed system
CN110286852A (en) Dual control framework distributed memory system, method for reading data, device and storage medium
US8260821B2 (en) Global, dynamic, remote and central system for database driver configuration
JP2001022599A (en) Fault tolerant system, fault tolerant processing method and recording medium for fault tolerant control program
CN113660123B (en) Virtual switch upgrading method, device, electronic equipment and storage medium
CN106972963B (en) Service module starting control method and starting control method after crash restart
CN115168141A (en) Optical interface management system, method, device, programmable logic device and storage medium
CN116074187A (en) Main-standby link switching method and device, electronic equipment and storage medium
US20210019186A1 (en) Information processing system, information processing apparatus, and method of controlling an information processing system
CN113206760B (en) Interface configuration updating method and device for VRF resource allocation and electronic equipment
CN111083719A (en) Method, device and storage medium for flexibly adjusting network element capacity
CN112463514A (en) Monitoring method and device for distributed cache cluster
US20240111579A1 (en) Termination of sidecar containers
CN115767448B (en) Message sending method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination