High availability configuration synchronization method, device, electronic device and readable storage medium

By setting a preset time in a high-availability network security system to monitor the high availability status of the main and standby equipment and synchronously configure it when the conditions are met, the problems of complex data synchronization and maintenance difficulties in the prior art are solved, and a simple and stable configuration synchronization process is realized.

CN116016178BActive Publication Date: 2025-05-16BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211616571.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-15
Publication Date
2025-05-16
Estimated Expiration
2042-12-15

AI Technical Summary

Technical Problem

In the prior art, data synchronization implementation in high-availability network security systems is complex and difficult to maintain later.

Method used

By setting a preset time, the high availability status of the main device and the backup device is monitored, and the configuration of the main device to the backup device is determined based on the status.

Benefits of technology

Simplifies the configuration synchronization process, shortens the development cycle, and improves the stability of the system and the convenience of maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016178B_ABST
    Figure CN116016178B_ABST
Patent Text Reader

Abstract

The present application provides a high-availability configuration synchronization method, device, electronic device and readable storage medium. The method includes: when the first device is the host, it checks the HA status of the first device at a preset interval; and checks the HA status of the second device as a backup device; determines whether the configuration synchronization condition is met according to the HA status of the first device and the HA status of the second device; if the configuration synchronization condition is met, synchronizes the configuration of the first device to the second device. The execution logic of the HA configuration synchronization method is simple and easy to implement, and the corresponding program development cycle is short and easy to maintain, which greatly reduces the workload of the staff.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a high-availability configuration synchronization method, device, electronic device, and readable storage medium. Background Art

[0002] HA is used to describe a system that is specially designed to reduce downtime and maintain high availability while the system is running continuously. In the HA function of the network security system, data synchronization is an important factor that affects the continuous operation time or interruption time of the network security system.

[0003] In the prior art, the configuration data of the host and the standby are generally made consistent by synchronizing the shared memory of the master device. Since what needs to be synchronized is the configuration-related shared memory, the implementation process is relatively complicated and the subsequent maintenance is difficult. Summary of the invention

[0004] In view of this, the purpose of the embodiments of the present application is to provide a high-availability configuration synchronization method, device, electronic device and readable storage medium, which are simple to implement and easy to maintain.

[0005] In a first aspect, an embodiment of the present application provides a high-availability configuration synchronization method, including: when the first device is a host, checking the HA status of the first device at a preset time interval; and checking the HA status of a second device serving as a backup device; determining whether a configuration synchronization condition is met based on the HA status of the first device and the HA status of the second device; if the configuration synchronization condition is met, synchronizing the configuration of the first device to the second device.

[0006] In the above implementation process, the HA status of the first device and the HA status of the second device are monitored by setting a preset time and determining whether the configuration synchronization condition is met according to the HA status of the first device and the HA status of the second device. When the configuration synchronization condition is met, the configuration of the first device is immediately synchronized to the standby device. The judgment logic of the entire configuration synchronization method is simple, the corresponding architecture development cycle is short, maintenance is simple, easy to maintain and expand in the future, and has good stability.

[0007] In one embodiment, determining whether the configuration synchronization condition is met based on the HA state of the first device and the HA state of the second device includes: when the first device is in the HA startup state, checking whether the current HA role of the first device is consistent with the HA role at the last check; if the current HA role of the first device is inconsistent with the HA role at the last check, determining that the configuration synchronization condition is met.

[0008] In the above implementation process, when the second device is in the HA startup state, the first device can be used to check whether the current HA role of the first device is consistent with the HA role at the time of the last check to determine whether the configuration of the first device has changed, so that when the configuration of the first device changes, it is determined that the configuration synchronization condition is met and the configuration of the first device is synchronized to the second device. By immediately synchronizing the configuration of the first device to the second device when the configuration of the first device changes, the consistency of the configuration of the first device and the second device is enhanced.

[0009] In one embodiment, determining whether the configuration synchronization condition is met based on the HA state of the first device and the HA state of the second device further includes: if the current HA role of the first device is consistent with the HA role at the last check, checking whether the HA state of the second device is consistent with the HA state at the last check; if not, checking whether the HA state of the second device is started; if started, determining that the configuration synchronization condition is met.

[0010] In the above implementation process, when it is determined that the role of the first device has not changed, it is further determined whether the current state of the second device is consistent with the previous state, so as to further determine whether the first device or the second device has problems such as downtime or abnormality. When the current state of the second device is inconsistent with the previous state, it indicates that the first device or the second device has an abnormality or downtime. At this time, if the HA state of the second device is started, it is determined that the configuration synchronization condition is met, and the configuration of the first device is synchronized to the second device. By immediately synchronizing the configuration of the first device to the second device when the first device or the second device is downtime or abnormal, the consistency of the configuration of the first device and the second device is enhanced.

[0011] In one embodiment, the method of the first device further includes: if the current HA role of the first device is inconsistent with the HA role at the last check, saving the current HA role of the first device in the last check result to update the HA role at the last check.

[0012] In the above implementation process, if the current HA role of the first device is inconsistent with the HA role at the last check, the current HA role is updated to the last HA role to ensure that the last HA role is always the latest, thereby improving the accuracy of judging whether the HA role of the first device has changed.

[0013] In one embodiment, the method further includes: checking whether there is a manual configuration modification on the first device; if there is a manual configuration modification on the first device, obtaining a configuration command, and synchronizing the configuration command to the second device.

[0014] In the above implementation process, by setting up monitoring of manual configuration modifications, even after the first device manually modifies the configuration, the configuration of the second device can be synchronized with the first device, which increases the diversity of monitoring the configuration changes of the first device and increases the applicable scenarios of the high-availability configuration synchronization method.

[0015] In one embodiment, if the first device is a standby device, the configuration of the current host is synchronized to the first device.

[0016] In the above implementation process, when it is detected that the role of the first device is a backup device, the configuration of the second device is immediately synchronized to the first device to achieve configuration synchronization between the first device and the second device, so that the configurations of the first device and the second device are always synchronized, thereby enhancing the consistency of the configurations of the first device and the second device.

[0017] In one embodiment, if the first device is a standby machine, the configuration of the current host is synchronized and the host is preempted.

[0018] In the above implementation process, by setting the preemption function in the first device, after the first device crashes and restarts or is repaired, after the roles of the first device and the second device are exchanged, the first device preempts the host to reduce the time the second device bears the network system business load, and has lower requirements on the version and performance of the second device. It can not only be applicable to a variety of scenarios, but also save the cost of using the second device.

[0019] In the second aspect, an embodiment of the present application also provides a high-availability configuration synchronization device, including: a first checking module, used to check the HA status of the first device at a preset time interval when the first device is a host; a second checking module, used to check the HA status of the second device serving as a backup device; a determination module, used to determine whether a configuration synchronization condition is met based on the HA status of the first device and the HA status of the second device; if the configuration synchronization condition is met, synchronize the configuration of the first device to the second device.

[0020] In the third aspect, an embodiment of the present application also provides a high-availability configuration synchronization system, comprising: a host and a standby machine; the host is connected to the standby machine; the host is used to execute the method in the first aspect, or any possible implementation of the first aspect; the standby machine is used to execute a synchronization configuration command when receiving the configuration of the host to keep the configuration of the host and the standby machine consistent.

[0021] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of the method in the above-mentioned first aspect, or any possible implementation of the first aspect.

[0022] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the high-availability configuration synchronization method in the above-mentioned first aspect, or any possible implementation of the first aspect are executed.

[0023] In order to make the above-mentioned objects, features and advantages of the present application more obvious and understandable, embodiments are given below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 A schematic diagram of the interaction between a first device and a second device provided in an embodiment of the present application;

[0026] Figure 2 A block diagram of an electronic device provided in an embodiment of the present application;

[0027] Figure 3 A flowchart of a high-availability configuration synchronization method provided in an embodiment of the present application;

[0028] Figure 4 A schematic diagram of the functional modules of a high-availability configuration synchronization device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application.

[0030] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0031] For ease of understanding, the terms appearing in the embodiments of the present application are explained below:

[0032] HA (High Availability) refers to improving system availability by minimizing service interruption time caused by routine maintenance operations and sudden system crashes. It is often used in enterprise-level core networks.

[0033] High availability is achieved by matching redundant network devices, such as redundant switches, redundant routers, etc. In order to reduce the time of network interruption caused by the crash of the load host, real-time synchronization of the host and backup machine configurations is also crucial.

[0034] The inventor of the present application has found through long-term research that in the existing HA system, the synchronization system architecture for executing the high-availability configuration synchronization method and the high-availability configuration platform are usually coupled and designed. The high-availability configuration synchronization method and the high-availability configuration execution method are cross-designed, and when performing configuration synchronization, it is necessary to synchronize the configuration-related shared memory, which makes the implementation process more complicated and difficult to maintain.

[0035] In view of this, the inventor of the present application proposes a high-availability configuration synchronization method, which checks the status of the host and the backup machine by setting up a separate high-availability configuration synchronization architecture. When the configuration of the host changes, the configuration of the host is sent to the backup machine to achieve configuration synchronization between the backup machine and the host. The entire high-availability configuration synchronization method has simple logic and is easy to implement. And because the high-availability configuration synchronization method is an independent architecture, subsequent maintenance is simple.

[0036] To facilitate understanding of this embodiment, the application scenario of the high-availability configuration synchronization method in the embodiment of the present application is first introduced.

[0037] The synchronization system used to execute the high-availability configuration synchronization method in the embodiment of the present application is independent of the high-availability configuration platform. That is, it can be understood that the synchronization system of the high-availability configuration synchronization method is an independent system, and there is no coupling relationship between the synchronization system of the high-availability configuration synchronization method and the high-availability configuration platform. It sends query commands to the high-availability configuration platforms of the host and the backup machine to query the information of the host and the backup machine. When the configuration of the host is found to have changed, the host is triggered to send the synchronization configuration name to the backup machine to achieve master-slave configuration synchronization. In other words, when establishing the architecture of the high-availability configuration synchronization method, there is no need to merge or intersperse the architecture of the high-availability configuration synchronization method with the architecture in the high-availability configuration execution system. The host and the backup machine do not need to expand their functions in order to adapt to the architecture of the high-availability configuration synchronization method. The architecture construction of the high-availability configuration synchronization method can be simplified, the initial development investment time is short, and it is easy to maintain and expand in the later stage, and the stability is good.

[0038] The following is a detailed introduction to the operating environment of a high-availability configuration synchronization method disclosed in an embodiment of the present application.

[0039] like Figure 1FIG. 1 is a schematic diagram of a first device and a second device interacting with each other in an embodiment of the present application, wherein the first device and the second device are connected in communication to perform data communication or interaction.

[0040] The host here can be a personal computer (PC), a tablet computer, a smart phone, a personal digital assistant (PDA), etc. The standby machine can also be a personal computer (PC), a tablet computer, a smart phone, a personal digital assistant (PDA), etc. The first device and the second device can be the same device or different devices. The specific setting rules of the main first device and the second device can be adjusted according to the actual situation, and this application does not make specific restrictions.

[0041] The first device mentioned above is used as a host to bear the business load of the current network system. The host is the initiator of synchronous configuration naming. When the configuration of the host is changed, the changed configuration command is immediately sent to the standby machine.

[0042] The second device serves as a backup device for the host. The backup device is the execution end of the synchronization configuration command. When receiving the synchronization configuration message sent by the host, the backup device immediately executes it to ensure the consistency of the main and backup configurations.

[0043] Specifically, the operation process between the first device and the second device may be as follows:

[0044] When HA is started, a communication connection is established between the first device and the second device, and the first device synchronizes all current configurations of the first device to the second device. After receiving the synchronization configuration command, the second device immediately executes the synchronization configuration command. When the configuration of the first device is modified, the synchronization configuration information of the first device is sent to the second device. After obtaining the synchronization configuration command, the second device immediately executes the synchronization configuration command.

[0045] To facilitate understanding of this embodiment, first, the electronic device for executing the high-availability configuration synchronization method disclosed in the embodiment of this application is described in detail. Optionally, the electronic device for executing the high-availability configuration synchronization method disclosed in the embodiment of this application can be the above-mentioned first device, or the second device, or a third-party electronic device. The selection of the electronic device can be selected according to actual conditions, and this application does not make specific restrictions.

[0046] like Figure 2 , which is a block diagram of an electronic device. The electronic device 100 may include a memory 111 and a processor 113. A person skilled in the art may understand that Figure 2The structure shown is only for illustration and does not limit the structure of the electronic device 100. For example, the electronic device 100 may further include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations are shown.

[0047] The memory 111 and the processor 113 are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, these elements can be electrically connected to each other via one or more communication buses or signal lines. The processor 113 is used to execute the executable module stored in the memory.

[0048] The memory 111 may be, but not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 111 is used to store programs, and the processor 113 executes the program after receiving the execution instruction. The method executed by the electronic device 100 defined by the process disclosed in any embodiment of the present application can be applied to the processor 113, or implemented by the processor 113.

[0049] The processor 113 may be an integrated circuit chip with signal processing capability. The processor 113 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0050] The electronic device 100 in this embodiment can be used to execute each step in each method provided in the embodiments of the present application. The implementation process of the high-availability configuration synchronization method is described in detail below through several embodiments.

[0051] See also Figure 3 , is a flow chart of a high-availability configuration synchronization method provided by an embodiment of the present application. Figure 3 The specific process shown is described in detail.

[0052] Step 201: The first device checks the HA status of the first device at a preset time interval when serving as a host.

[0053] The preset time here can be 1ms, 5ms, 30ms, 1s, 5s, 1min, 5min, 1h, etc. The preset time can be adjusted according to actual conditions, and this application does not make any specific restrictions.

[0054] In some embodiments, the HA status of the first device may also be checked in real time. When the HA status of the first device needs to be checked in real time, the preset time may be set to 0s.

[0055] The above-mentioned HA state may include: HA started state and HA not started state.

[0056] Generally speaking, the architecture of the high-availability configuration synchronization method is set on the first device, so that the high-availability configuration synchronization method is executed by the first device. That is, the first device here refers to the host. The second device (i.e., the standby device) is usually in a dormant or waiting state, and when the second standby device obtains the synchronization configuration command sent by the first device, it immediately executes the synchronization configuration command.

[0057] Of course, in some embodiments, the architecture of the high-availability configuration synchronization method can also be set on the second device, so that the high-availability configuration synchronization method is executed by the second device. Or, the architecture of the high-availability configuration synchronization method is set on both the first device and the second device.

[0058] Step 202: Check the HA status of the second device serving as the backup device.

[0059] Here, the first device and the second device are connected, and the first device and the second device can be connected directly or through an intermediate device. The connection method between the first device and the second device can be adjusted according to actual conditions, and this application does not make specific restrictions.

[0060] It can be understood that if the first device is a host, the second device is a backup device. If the first device is a backup device, the second device is a host.

[0061] Step 203: Determine whether a configuration synchronization condition is met according to the HA status of the first device and the HA status of the second device.

[0062] It can be understood that the configuration synchronization conditions may include: a change in the configuration of the first device, a shutdown of the first device, a failure of the first device, a failure of the second device, a shutdown of the second device, etc.

[0063] Step 204: If the configuration synchronization condition is met, synchronize the configuration of the first device to the second device.

[0064] The configuration of the first device here may be all configurations of the first device, that is, the configuration of the first device includes the HA configuration of the first device and other configurations except the HA configuration.

[0065] When it is detected that the configuration of the first device has changed, the configuration information of the first device is immediately sent to the second device. After obtaining the configuration information, the second device immediately synchronizes the configuration information to achieve configuration consistency of the master and backup devices.

[0066] It can be understood that when the configuration of the first device changes, when the first device sends a message to the second device, all configurations of the first device may be sent, or only the modified configuration of the first device may be sent.

[0067] In the above implementation process, the HA status of the first device and the HA status of the second device are monitored by setting a preset time and determining whether the configuration synchronization condition is met according to the HA status of the first device and the HA status of the second device. When the configuration synchronization condition is met, the configuration of the first device is immediately synchronized to the standby device. The judgment logic of the entire configuration synchronization method is simple, the corresponding architecture development cycle is short, maintenance is simple, easy to maintain and expand in the future, and has good stability.

[0068] In a possible implementation, step 203 includes: when the first device is in the HA startup state, checking whether the current HA role of the first device is consistent with the HA role at the last check; if the current HA role of the first device is inconsistent with the HA role at the last check, determining that the configuration synchronization condition is met.

[0069] The HA role at the last check here refers to the HA role at the last check. For example, if the preset time is 1 minute and the current time point is 10:10, the HA role at the last check is the HA role checked at 10:09. The HA role includes the master and the backup.

[0070] If the first device is in the HA startup state, it is necessary to further determine whether the current HA role of the first device is consistent with the HA role at the last check. If they are consistent, it means that the configuration of the first device has not changed. If they are inconsistent, it means that the configuration of the first device has changed, and it is determined that the configuration of the first device needs to be synchronized to the second device, that is, the configuration synchronization condition is met.

[0071] In some embodiments, if the first device is in HA unstarted state, the execution system of the high availability configuration synchronization method corresponding to the high availability configuration synchronization method sleeps to wait for the next preset time point to arrive, and then re-execute the above high availability configuration synchronization method starting from step 201.

[0072] In the above implementation process, when the second device is in the HA startup state, the first device can be used to check whether the current HA role of the first device is consistent with the HA role at the time of the last check to determine whether the configuration of the first device has changed, so that when the configuration of the first device changes, it is determined that the configuration synchronization condition is met and the configuration of the first device is synchronized to the second device. By immediately synchronizing the configuration of the first device to the second device when the configuration of the first device changes, the consistency of the configuration of the first device and the second device is enhanced.

[0073] In a possible implementation, the method further includes: if the current HA role of the first device is consistent with the HA role at the last check, checking whether the HA state of the second device is consistent with the HA state at the last check; if not, checking whether the HA state of the second device is started; if started, determining that the configuration synchronization conditions are met.

[0074] When the current HA role of the first device is consistent with the HA role at the last check, it is necessary to further check whether the HA status of the second device is consistent with the HA status at the last check. If they are consistent, it means that the first device or the second device has not failed or crashed, and there is no need to synchronize the configuration of the first device to the second device. If they are inconsistent, it means that the first device or the second device has failed or crashed, and there is no need to synchronize the configuration of the first device to the second device. At this time, if the second device is in the HA startup state, it is determined that the configuration synchronization conditions are met.

[0075] When the second device is in the HA unstarted state, the second device may be in sleep mode. When it is detected that the current HA role of the first device is inconsistent with the HA role at the last check, it means that the configuration of the first device has changed. Then the first device sends information to the second device, which can wake up the second device. After obtaining the information, the second device switches from the sleep state to the HA unstarted state, and synchronizes the configuration of the first device according to the message.

[0076] In some embodiments, if the second device is in HA unstarted state, the execution system of the high availability configuration synchronization method corresponding to the high availability configuration synchronization method sleeps to wait for the next preset time point to arrive, and then re-execute the above high availability configuration synchronization method starting from step 201.

[0077] In the above implementation process, when it is determined that the role of the first device has not changed, it is further determined whether the current state of the second device is consistent with the previous state, so as to further determine whether the first device or the second device has problems such as downtime or abnormality. When the current state of the second device is inconsistent with the previous state, it indicates that the first device or the second device has an abnormality or downtime. At this time, if the HA state of the second device is started, it is determined that the configuration synchronization condition is met, and the configuration of the first device is synchronized to the second device. By immediately synchronizing the configuration of the first device to the second device when the first device or the second device is downtime or abnormal, the consistency of the configuration of the first device and the second device is enhanced.

[0078] In a possible implementation, if the current HA role of the first device is inconsistent with the HA role at the last check, the current HA role of the first device is saved in the last check result to update the HA role at the last check.

[0079] If the current HA role of the first device is inconsistent with the HA role at the last check, in addition to synchronizing the configuration of the first device to the second device, it is also necessary to update the HA role at the last check through the current HA status of the first device, so that when the HA role of the first device is judged at the next preset time point, it can be compared with the latest HA role to ensure the accuracy of the judgment.

[0080] In some embodiments, if the current HA role of the first device is consistent with the HA role at the last check, there is no need to store the current HA role, nor to update the HA role at the last check.

[0081] In the above implementation process, if the current HA role of the first device is inconsistent with the HA role at the last check, the current HA role is updated to the last HA role to ensure that the last HA role is always the latest, thereby improving the accuracy of judging whether the HA role of the first device has changed.

[0082] In a possible implementation, the method further includes: checking whether the first device has been manually modified in configuration; if the first device has been manually modified in configuration, acquiring a configuration command, and synchronizing the configuration command to the second device.

[0083] It is understandable that the configuration of the first device can also be directly configured or modified manually. When the configuration of the first device is manually modified, the second device should also be synchronized with the configuration of the first device. Then, the judgment of manual configuration modification can be added to the high-availability configuration synchronization method. The judgment of manual configuration modification can be set after step 203 or after step 201. The setting position of the judgment of manual configuration modification can be adjusted according to actual conditions, and this application does not limit it.

[0084] Manual configuration modification here may include manually performing configuration synchronization between the first device and the second device, modifying the configuration of the first device, etc. After determining that the configuration of the first device is manually modified, the configuration of the first device is sent to the second device, and the second device immediately performs configuration synchronization after obtaining the configuration of the first device to maintain configuration consistency with the first device.

[0085] In the above implementation process, by setting up monitoring of manual configuration modifications, even after the first device manually modifies the configuration, the configuration of the second device can be synchronized with the first device, which increases the diversity of monitoring the configuration changes of the first device and increases the applicable scenarios of the high-availability configuration synchronization method.

[0086] In a possible implementation, the method further includes: if the first device is a standby device, synchronizing the configuration of the current host to the first device.

[0087] It can be understood that if the first device plays the role of a backup device in HA, it means that the first device may be in a state of downtime and restart. If the first device is downtime and the second device plays the role of the host, after the first device is downtime and restarted, the first device is a backup device, that is, the first device and the second device have exchanged roles. At this time, the configuration of the second device needs to be synchronized to the first device to maintain the consistency of the configuration of the first device and the second device.

[0088] Optionally, when the host crashes and restarts, the above high-availability configuration synchronization method can be executed by the second device, or can be executed by the first device after the configuration of the first device is synchronized with the second device.

[0089] In some embodiments, if the first device is a backup device, the first device sleeps, or the execution system of the high availability configuration synchronization method corresponding to the high availability configuration synchronization method sleeps, waiting to wait for the next preset time point to arrive, and re-monitor the role of the first device in HA until the first device becomes the host and re-executes the above-mentioned high availability configuration synchronization method starting from step 201.

[0090] In the above implementation process, when it is detected that the role of the first device is a backup device, the configuration of the second device is immediately synchronized to the first device to achieve configuration synchronization between the first device and the second device, so that the configurations of the first device and the second device are always synchronized, thereby enhancing the consistency of the configurations of the first device and the second device.

[0091] In a possible implementation, the method further includes: if the first device is a standby device, synchronizing the configuration of the current host and preempting the host.

[0092] In the HA system of the present application, the first device acts as a host to bear the business load of the network system, and the second device acts as a backup to perform configuration synchronization actions. Obviously, since the first device is mainly used to bear the business load and the working time of the first device is long, the performance and memory of the first device need to be set relatively high. The second device is usually in a sleep or waiting state, and will only be responsible for the business of the network system when the first device is down or fails. Therefore, the requirements for the performance, memory, etc. of the second device do not need to be too high. Usually, in order to save costs and reduce resource waste, the first device and the second device use different devices, the first device uses a high-performance, high-memory device, and the second device uses a lower-performance, lower-memory device.

[0093] Since the performance of the second device is relatively low, the efficiency will be affected if it is operated for a long time. By setting the preemption function in the first device, when it is determined that the first device is a backup device, after synchronizing the configuration of the second device, the first device can complete the host preemption by turning on the preemption function. At this time, the first device and the second device exchange roles again, that is, the first device becomes the host and the second device becomes the backup device. Reduce the time that the second device bears the network system business load.

[0094] In the above implementation process, when it is detected that the role of the first device is a backup device, the configuration of the second device is immediately synchronized to the first device to achieve configuration synchronization between the first device and the second device, so that the configurations of the first device and the second device are always synchronized, thereby enhancing the consistency of the configurations of the first device and the second device.

[0095] Based on the same application concept, a high-availability configuration synchronization device corresponding to the high-availability configuration synchronization method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to that in the aforementioned high-availability configuration synchronization method embodiment, the implementation of the device in this embodiment can refer to the description in the embodiment of the above method, and the repeated parts will not be repeated.

[0096] See also Figure 4, is a functional module diagram of a high-availability configuration synchronization device provided in an embodiment of the present application. Each module in the high-availability configuration synchronization device in this embodiment is used to execute each step in the above method embodiment. The high-availability configuration synchronization device includes a first inspection module 301, a second inspection module 302, a determination module 303, and a synchronization module 304; wherein,

[0097] The first checking module 301 is used for checking the HA status of the first device at preset time intervals when the first device is a host.

[0098] The second checking module 302 is used to check the HA status of the second device serving as a backup machine.

[0099] The determination module 303 is used to determine whether a configuration synchronization condition is met according to the HA state of the first device and the HA state of the second device.

[0100] The synchronization module 304 is used to synchronize the configuration of the first device to the second device.

[0101] In a possible implementation, the determination module 303 is further used to: when the first device is in the HA startup state, check whether the current HA role of the first device is consistent with the HA role at the last check; if the current HA role of the first device is inconsistent with the HA role at the last check, determine that the configuration synchronization condition is met.

[0102] In a possible implementation, the synchronization module 303 is also used to: if the current HA role of the first device is consistent with the HA role at the last check, check whether the HA state of the second device is consistent with the HA state at the last check; if not, check whether the HA state of the second device is started; if started, determine that the configuration synchronization conditions are met.

[0103] In a possible implementation, the high-availability configuration synchronization apparatus further includes an updating module, which saves the current HA role of the first device to the last check result to update the HA role at the last check if the current HA role of the first device is inconsistent with the HA role at the last check.

[0104] In a possible implementation, the synchronization module 304 is further used to: check whether there is any manual configuration modification on the first device; if there is any manual configuration modification on the first device, obtain a configuration command, and synchronize the configuration command to the second device.

[0105] In a possible implementation manner, the synchronization module 304 is further configured to: if the first device is a backup device, synchronize the configuration of the current host to the first device.

[0106] In a possible implementation manner, the update module is further configured to: if the first device is a backup device, synchronize the configuration of the current host and preempt the host.

[0107] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the high-availability configuration synchronization method described in the above method embodiment are executed.

[0108] The computer program product of the high-availability configuration synchronization method provided in the embodiment of the present application includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the steps of the high-availability configuration synchronization method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0109] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0110] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0111] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk. It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or apparatus. In the absence of more restrictions, the elements defined by the sentence "includes..." do not exclude the presence of other identical elements in the process, method, article or apparatus that includes the elements.

[0112] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the present application.

[0113] It should be noted that similar reference numerals and letters refer to similar items in the following figures, so once an item is defined in one figure, it does not need to be defined in subsequent figures.

[0114] It is further defined and explained.

[0115] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can

[0116] Any changes or substitutions that can be easily thought of should be included in the protection scope of this application. Therefore, the protection scope of this application should be based on the protection scope of the claims.

Claims

1. A high-availability configuration synchronization method, characterized in that: include: When the first device is a host, checking the HA status of the first device at a preset interval; and Check the HA status of the second device that serves as the backup machine; determining whether a configuration synchronization condition is met according to the HA state of the first device and the HA state of the second device; If the configuration synchronization condition is met, synchronizing the configuration of the first device to the second device; The determining whether a configuration synchronization condition is met according to the HA state of the first device and the HA state of the second device includes: When the first device is in the HA startup state, checking whether the current HA role of the first device is consistent with the HA role at the last check; If the current HA role of the first device is inconsistent with the HA role at the time of the last check, it is determined that the configuration synchronization condition is met.

2. The method according to claim 1, characterized in that The determining whether the configuration synchronization condition is met according to the HA state of the first device and the HA state of the second device further includes: If the current HA role of the first device is consistent with the HA role at the last check, check whether the HA status of the second device is consistent with the HA status at the last check; If they are inconsistent, checking whether the HA status of the second device is started; If enabled, make sure that the configuration synchronization conditions are met.

3. The method according to claim 1, characterized in that The method further comprises: If the current HA role of the first device is inconsistent with the HA role at the last check, the current HA role of the first device is saved in the last check result to update the HA role at the last check.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Checking whether there is manual configuration modification on the first device; If there is a manual configuration modification on the first device, a configuration command is obtained and the configuration command is synchronized to the second device.

5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: If the first device is a standby device, the configuration of the current host is synchronized to the first device.

6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: If the first device is a backup device, synchronize the configuration of the current host and preempt the host.

7. A high-availability configuration synchronization device, characterized in that: A first checking module, configured to check the HA status of the first device at a preset interval when the first device is a host; A second checking module is used to check the HA status of the second device serving as a standby machine; a determination module, configured to determine whether a configuration synchronization condition is met according to the HA state of the first device and the HA state of the second device; a synchronization module, configured to synchronize the configuration of the first device to the second device if a configuration synchronization condition is met; The determination module is also used to: when the first device is in the HA startup state, check whether the current HA role of the first device is consistent with the HA role at the last check; if the current HA role of the first device is inconsistent with the HA role at the last check, determine that the configuration synchronization condition is met.

8. A high-availability configuration synchronization system, characterized in that: include: Master and backup machines; The host machine is connected to the standby machine; The host is used to execute the method described in any one of claims 1 to 6; The standby machine is used to execute a synchronization configuration command when receiving the configuration of the master machine, so as to keep the configurations of the master machine and the standby machine consistent.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the methods described in claims 1 to 6 are executed.

Citation Information

Patent Citations

  • Method and device for keeping service configuration consistency of high-availability device group

    CN114328033A