CN111294391A - Configuration synchronization method, device, equipment and readable storage medium - Google Patents

Configuration synchronization method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN111294391A
CN111294391A CN202010055405.0A CN202010055405A CN111294391A CN 111294391 A CN111294391 A CN 111294391A CN 202010055405 A CN202010055405 A CN 202010055405A CN 111294391 A CN111294391 A CN 111294391A
Authority
CN
China
Prior art keywords
file
configuration
control device
backup
synchronization
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
CN202010055405.0A
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.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies 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 Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202010055405.0A priority Critical patent/CN111294391A/en
Publication of CN111294391A publication Critical patent/CN111294391A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Abstract

The application discloses a configuration synchronization method, a configuration synchronization device, a configuration synchronization equipment and a readable storage medium. After receiving a backup file identification set sent by a standby control device, a main control device in the application compares a local file identification set with the backup file identification set, so as to determine a to-be-synchronized configuration file which is stored in the main control device but not stored in the standby control device; and the master control device only sends the part of the configuration file to be synchronized to the standby control device so that the standby control device executes the synchronization operation. According to the method and the device, the file transmission quantity and the communication flow between the master control device and the standby control device are reduced, and the heartbeat stability between the master control device and the standby control device is guaranteed; and the file processing capacity in the synchronization process and the occupation quantity of CPU resources of the master control equipment and the standby control equipment are also reduced, so that the synchronization efficiency and the equipment performance are improved. Accordingly, the configuration synchronization device, the equipment and the readable storage medium disclosed by the application also have the technical effects.

Description

Configuration synchronization method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a configuration synchronization method, apparatus, device, and readable storage medium.
Background
In a dual-computer hot standby scenario, the system comprises two devices, namely a host computer and a standby computer. The standby machine is used as a service redundancy backup, and when the host fails, the standby machine is required to undertake tasks, so that most of network configuration and security policy configuration of the standby machine are consistent with those of the host.
At present, the process of synchronous configuration between a host and a standby machine is as follows: the host packs all the configuration files to the standby machine at regular time, and then the standby machine executes the synchronous operation. The disadvantages of this approach are: the amount of files to be sent is large, so that the communication flow between the host and the standby machine is large, and the heartbeat stability between the host and the standby machine is influenced; in addition, the host and the standby need to perform a large amount of file processing, which occupies a high CPU resource, so that the synchronization efficiency is low, and the stability and performance of the device are also reduced.
Therefore, how to improve the configuration synchronization efficiency and the device performance in the dual-computer hot standby scenario is a problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, an object of the present application is to provide a configuration synchronization method, apparatus, device and readable storage medium, so as to improve configuration synchronization efficiency and device performance in a dual-computer hot standby scenario. The specific scheme is as follows:
in a first aspect, the present application provides a configuration synchronization method, applied to a master control device, including:
if the configuration synchronization condition is met, comparing a local file identification set with a recently received backup file identification set to determine a to-be-synchronized configuration file which is stored in the master control device but not stored in the slave control device;
sending the configuration file to be synchronized to the standby control equipment so that the standby control equipment can execute the synchronization operation of the configuration file to be synchronized;
the local file identifier set comprises file identifiers corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
Preferably, the configuration synchronization condition includes: and receiving the backup file identification set sent by the standby control equipment, or receiving an operation instruction for modifying the configuration file.
Preferably, before comparing the local file identifier set with the recently received backup file identifier set, the method further includes:
calculating an MD5 value corresponding to each configuration file stored in a local synchronization list of the main control equipment;
and arranging the MD5 values obtained by calculation into a list to obtain the local file identification set.
Preferably, if the local file identifier set and the backup file identifier set include comparison identifiers, comparing the local file identifier set with a recently received backup file identifier set to determine a to-be-synchronized configuration file that is stored in the master control device but not stored in the backup control device includes:
determining a target file with the same comparison identification in the local file identification set and the backup file identification set;
and if the MD5 values of the target file in the local file identification set and the backup file identification set are inconsistent, determining the target file as the configuration file to be synchronized.
Preferably, the comparison identifier comprises an MD5 value sequence number or an MD5 value corresponding path.
Preferably, the sending the configuration file to be synchronized to the standby control device so that the standby control device performs a synchronization operation of the configuration file to be synchronized includes:
packaging the configuration files to be synchronized to obtain a file package;
and sending the file packet to the standby control equipment so that the standby control equipment decompresses the file packet and then executes the synchronization operation of the configuration file to be synchronized.
Preferably, the method further comprises the following steps:
receiving a viewing instruction input by a user or a modification instruction aiming at a target configuration file;
and displaying the configuration information included in the corresponding configuration file according to the viewing instruction, or updating the target configuration file according to the modification instruction.
In a second aspect, the present application provides another configuration synchronization method, which is applied to a standby device, and includes:
if the sending condition is met, sending a backup file identifier set to a main control device, so that the main control device compares a local file identifier set with a recently received backup file identifier set to determine a to-be-synchronized configuration file which is stored in the main control device but not stored in the backup control device;
receiving the configuration file to be synchronized sent by the master control equipment, and executing the synchronization operation of the configuration file to be synchronized;
the local file identifier set comprises file identifiers corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
Preferably, the transmission condition includes every preset time or after completion of the synchronization operation.
Preferably, before sending the backup MD5 value list to the master device, the method further includes:
calculating an MD5 value corresponding to each configuration file stored in a local synchronization list of the standby control equipment;
and arranging the MD5 values obtained by calculation into a list to obtain the local file identification set.
Preferably, if the local file identifier set and the backup file identifier set include comparison identifiers, the executing the synchronization operation of the configuration file to be synchronized includes:
and determining a file to be updated according to the comparison identifier, and updating the file to be updated into the received configuration file to be synchronized.
Preferably, the method further comprises the following steps:
receiving a viewing instruction input by a user;
and displaying the configuration information included in the corresponding configuration file according to the viewing instruction.
In a third aspect, the present application provides a configuration synchronization apparatus, applied to a master control device, including:
the comparison module is used for comparing a local file identifier set with a recently received backup file identifier set if the configuration synchronization condition is met so as to determine a to-be-synchronized configuration file which is stored in the master control device but not stored in the backup control device;
a to-be-synchronized configuration file sending module, configured to send the to-be-synchronized configuration file to the standby control device, so that the standby control device executes a synchronization operation of the to-be-synchronized configuration file;
the local file identifier set comprises file identifiers corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
In a fourth aspect, the present application provides another configuration synchronization apparatus, which is applied to a standby device, and includes:
the backup file identification set sending module is used for sending a backup file identification set to the main control device if the sending condition is met, so that the main control device compares the local file identification set with the recently received backup file identification set to determine a to-be-synchronized configuration file which is stored in the main control device but not stored in the backup control device;
the synchronization module is used for receiving the configuration file to be synchronized sent by the main control equipment and executing the synchronization operation of the configuration file to be synchronized;
the local file identifier set comprises file identifiers corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
In a fifth aspect, the present application provides a configuration synchronization apparatus, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the configuration synchronization method disclosed in the foregoing.
In a sixth aspect, the present application provides a readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the configuration synchronization method disclosed in the foregoing.
According to the above scheme, the present application provides a configuration synchronization method, which is applied to a master control device, and includes: if the configuration synchronization condition is met, comparing a local file identification set with a recently received backup file identification set to determine a to-be-synchronized configuration file which is stored in the master control device but not stored in the slave control device; sending the configuration file to be synchronized to the standby control equipment so that the standby control equipment can execute the synchronization operation of the configuration file to be synchronized; the local file identifier set comprises file identifiers corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
The application also provides another configuration synchronization method, which is applied to the standby control equipment and comprises the following steps: if the sending condition is met, sending a backup file identifier set to a main control device, so that the main control device compares a local file identifier set with a recently received backup file identifier set to determine a to-be-synchronized configuration file which is stored in the main control device but not stored in the backup control device; receiving the configuration file to be synchronized sent by the master control equipment, and executing the synchronization operation of the configuration file to be synchronized; the local file identifier set comprises file identifiers corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
In the application, after receiving a backup file identifier set sent by a standby control device, a main control device compares a local file identifier set with the backup file identifier set, so as to determine a to-be-synchronized configuration file which is stored in the main control device but not stored in the standby control device; the master control device only sends the part of the configuration file to be synchronized to the standby control device so that the standby control device executes the synchronization operation. According to the method and the device, the file transmission quantity and the communication flow between the master control device and the standby control device are reduced, and the heartbeat stability between the master control device and the standby control device is guaranteed. In addition, in the synchronization process, the master control device and the standby control device process the file identifiers, so that the file processing amount in the synchronization process can be reduced, the occupation amount of CPU resources of the master control device and the standby control device can be reduced, and the synchronization efficiency and the device performance can be improved.
Accordingly, the configuration synchronization device, the equipment and the readable storage medium provided by the application also have the technical effects.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of a first configuration synchronization method disclosed herein;
FIG. 2 is a flow chart of a second configuration synchronization method disclosed herein;
FIG. 3 is a flow chart of a third configuration synchronization method disclosed herein;
FIG. 4 is a schematic diagram of a configuration synchronization apparatus disclosed herein;
FIG. 5 is a schematic view of another configuration synchronization device disclosed herein;
FIG. 6 is a schematic diagram of a configuration synchronization apparatus disclosed herein;
fig. 7 is a schematic diagram of another configuration synchronization apparatus disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
At present, when a main machine and a standby machine are synchronously configured in a hot standby scene of the two machines, the quantity of files needing to be sent is large, so that the communication flow between the main machine and the standby machine is large, and the heartbeat stability between the main machine and the standby machine is influenced; in addition, the host and the standby need to perform a large amount of file processing, which occupies a high CPU resource, so that the synchronization efficiency is low, and the stability and performance of the device are also reduced. Therefore, the configuration synchronization scheme is provided, and the configuration synchronization efficiency and the equipment performance in the dual-computer hot standby scene can be improved.
Referring to fig. 1, an embodiment of the present application discloses a first configuration synchronization method, which is applied to a master control device, and includes:
s101, if the configuration synchronization condition is met, comparing the local file identification set with the backup file identification set received recently to determine the configuration file to be synchronized, which is stored in the main control device but not stored in the backup control device.
The local file identification set comprises file identifications corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device. The configuration file may be a file regarding network configuration or a file regarding security policy.
In one embodiment, configuring the synchronization condition includes: receiving a backup file identification set sent by the backup control device, or receiving an operation instruction for modifying the configuration file.
When receiving a backup file identifier set sent by a standby control device, a master control device may perform a comparison between a local file identifier set and a recently received backup file identifier set to determine a to-be-synchronized configuration file stored in the master control device but not stored in the standby control device; and sending the configuration file to be synchronized to the standby control equipment so that the standby control equipment can execute the synchronization operation of the configuration file to be synchronized, thereby realizing configuration synchronization.
When receiving an operation instruction for modifying the configuration file, the main control device may compare the local file identifier set with the most recently received backup file identifier set to determine a configuration file to be synchronized, which is stored in the main control device but not stored in the backup control device; and sending the configuration file to be synchronized to the standby control equipment so that the standby control equipment can execute the synchronization operation of the configuration file to be synchronized, thereby realizing configuration synchronization. Therefore, when the configuration file on the main control equipment is modified, the synchronous operation is triggered, and the synchronization is finished in real time.
It should be noted that the two configuration synchronization conditions, that is, "receiving the backup file identifier set sent by the standby control device" and "receiving the operation instruction for modifying the configuration file" may exist at the same time, so that the synchronization process performed by the backup control device is equivalent to the checking operation, and the configuration files that are not synchronized in time may be checked in time.
In a specific embodiment, before comparing the local file identification set with the recently received backup file identification set, the method further includes: calculating the MD5 value corresponding to each configuration file stored in the local synchronization list of the main control equipment; and arranging the obtained MD5 values into a list to obtain a local file identification set. The MD5 values in the local file identification set and the backup file identification set are arranged in a fixed order, so each MD5 value has a fixed MD5 value sequence number. Where the MD5 value is the file identification of a certain file. Of course, other characteristic information of the file can also be used as the file identifier of the file, such as: the CRC32 value of the file, etc.
It should be noted that the configurations in the standby control device and the main control device are not exactly the same, but are mostly the same, and these same configurations only need to ensure that the standby control device and the main control device can be replaced with each other to execute the same service. Therefore, some configuration files which do not need to be synchronized to the standby control device may exist in the main control device, so that a local synchronization list is stored in the main control device, and the local synchronization list includes files which need to be synchronized. The files to be synchronized correspond to the MD5 values in the local file identification set one by one. Generally, the number of the configuration files to be synchronized currently is less than or equal to the number of the files in the local synchronization list.
In a specific embodiment, if the local file identifier set and the backup file identifier set include a comparison identifier, comparing the local file identifier set with the most recently received backup file identifier set to determine a to-be-synchronized configuration file that is stored in the master control device but not stored in the slave control device, includes: determining a target file with the same comparison identification in the local file identification set and the backup file identification set; and if the MD5 values of the target file in the local file identification set and the backup file identification set are not consistent, determining the target file as the configuration file to be synchronized. The comparison marks correspond to the files one by one.
Specifically, the object file is a configuration file (the configuration file is synchronized, but modified in the master control device) that is stored in the master control device and the slave control device at the same time but has a different MD5 value, so that the object file stored in the master control device needs to be transmitted to the slave control device based on the configuration file stored in the master control device, so that the slave control device replaces the object file stored in itself.
In one embodiment, the comparison identifier includes an MD5 value sequence number or an MD5 value corresponding path. That is, when comparing the local file identification set with the newly received backup file identification set, the master device substantially compares the MD5 value serial number or MD5 value corresponding path in the local file identification set and the backup file identification set.
It should be noted that the storage paths of the same configuration file in the master device and the backup device are the same, so that the corresponding MD5 values have the same path, and therefore, when the MD5 values representing the same file are the same in the corresponding paths in the local file identifier set and the backup file identifier set, it indicates that the related files are also the same. Because the MD5 values in the local file id set and the backup file id set are arranged in a fixed order, the MD5 value sequence numbers correspond to one another in the local file id set and the backup file id set, and therefore when the MD5 values representing the same file are the same in the local file id set and the backup file id set, it indicates that the related files are also the same.
S102, sending the configuration file to be synchronized to the standby control equipment so that the standby control equipment can execute the synchronization operation of the configuration file to be synchronized.
In a specific embodiment, sending the configuration file to be synchronized to the standby control device, so that the standby control device performs a synchronization operation of the configuration file to be synchronized, includes: packing the configuration files to be synchronized to obtain a file package; and sending the file packet to the standby control equipment so that the standby control equipment decompresses the file packet and then executes the synchronization operation of the configuration file to be synchronized. And the files are sent after being packed, so that the data transmission quantity can be reduced, and the transmission efficiency is improved.
The standby control equipment and the main control equipment communicate by using a VRRP protocol, and the master and standby machines are switched by using the VRRP protocol. The method for switching the main machine and the standby machine by utilizing the VRRP protocol specifically comprises the following steps: and determining the host and the standby according to the weight value configured by the VRRP protocol or the IP address of the two devices. Such as: the host with a large weight or IP address and the standby with a small weight or IP address. When the host fails or is manually triggered to switch, the host sends a message to the standby machine by using a VRRP protocol, the standby machine switches the host into the host after receiving the message, and the host switches the standby machine into the standby machine. The host is the main control device, and the standby device is the standby control device.
In a specific embodiment, the method further comprises the following steps: receiving a viewing instruction input by a user or a modification instruction aiming at a target configuration file; and displaying the configuration information included in the corresponding configuration file according to the viewing instruction, or updating the target configuration file according to the modification instruction. The user can add, delete, change, check and the like to the configuration file in the main control device, but the configuration file in the standby control device can only be checked, namely can only be read and cannot be modified.
As can be seen, after receiving the backup file identifier set sent by the standby control device, the main control device in the embodiment of the present application compares the local file identifier set with the backup file identifier set, thereby determining the to-be-synchronized configuration file that is stored in the main control device but not stored in the standby control device; the master control device only sends the part of the configuration file to be synchronized to the standby control device so that the standby control device executes the synchronization operation. According to the method and the device, the file transmission quantity and the communication flow between the master control device and the standby control device are reduced, and the heartbeat stability between the master control device and the standby control device is guaranteed. In addition, in the synchronization process, the master control device and the standby control device process the file identifiers, so that the file processing amount in the synchronization process can be reduced, the occupation amount of CPU resources of the master control device and the standby control device can be reduced, and the synchronization efficiency and the device performance can be improved.
Referring to fig. 2, an embodiment of the present application discloses a second configuration synchronization method, which is applied to a standby control device, and includes:
s201, if the sending condition is met, sending the backup file identification set to the main control device, so that the main control device compares the local file identification set with the recently received backup file identification set to determine the configuration file to be synchronized, which is stored in the main control device but not stored in the backup control device.
The local file identification set comprises file identifications corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device. The configuration file may be a file regarding network configuration or a file regarding security policy.
S202, receiving the configuration file to be synchronized sent by the main control equipment, and executing the synchronization operation of the configuration file to be synchronized.
In one embodiment, the transmission condition includes every preset time or after completion of the synchronization operation. That is, after every preset time period, the backup control device sends a backup file identifier set to the main control device; or after the backup control device completes the synchronous operation, the backup file identification set is sent to the master control device.
The preset time may be in milliseconds, such as 1 millisecond, 3 milliseconds, etc. Specifically, a timing task may be set, and each time the timing time is reached, the backup control device sends a backup file identifier set to the main control device.
In a specific embodiment, before sending the backup MD5 value list to the master device, the method further includes: calculating an MD5 value corresponding to each configuration file stored in a local synchronization list of the standby control equipment; and arranging the obtained MD5 values into a list to obtain a local file identification set.
In a specific embodiment, if the local file identifier set and the backup file identifier set include a comparison identifier, executing a synchronization operation of the configuration file to be synchronized includes: and determining the file to be updated according to the comparison identifier, and updating the file to be updated into the received configuration file to be synchronized. The configuration file to be synchronized sent by the master control device is the latest file of the file to be updated in the master control device, so that the synchronization can be completed by replacing the file to be updated with the configuration file to be synchronized.
Specifically, determining the file to be updated according to the comparison identifier includes: and determining files with the same comparison identification as the configuration files to be synchronized in the standby control equipment, wherein the files are the files to be updated.
In a specific embodiment, the method further comprises the following steps: receiving a viewing instruction input by a user; and displaying the configuration information included in the corresponding configuration file according to the viewing instruction. The user can only search the configuration file in the standby control equipment, namely, the configuration file can only be read and cannot be modified.
It should be noted that the implementation steps in this embodiment are the same as or similar to those in the above embodiments, and therefore, the description of this embodiment is omitted here.
As can be seen from the above, after the backup control device in this embodiment sends the backup file identifier set to the master control device, the master control device may compare the local file identifier set with the most recently received backup file identifier set to determine the to-be-synchronized configuration file that is stored in the master control device but not stored in the backup control device; and the standby control equipment receives the configuration file to be synchronized sent by the main control equipment and executes the synchronization operation of the configuration file to be synchronized, so that the file transmission quantity and the communication flow between the main control equipment and the standby control equipment are reduced, and the heartbeat stability between the main control equipment and the standby control equipment is ensured. In addition, in the synchronization process, the master control device and the standby control device process the file identifiers, so that the file processing amount in the synchronization process can be reduced, the occupation amount of CPU resources of the master control device and the standby control device can be reduced, and the synchronization efficiency and the device performance can be improved.
Referring to fig. 3, the embodiment of the present application discloses a third configuration synchronization method, which mainly includes: the host and the standby machine compare whether the files are different by exchanging the MD5 values of the files, so that the incremental synchronization of the files is realized.
It should be noted that dual-server hot-standby refers to a solution, and for important services, two servers are used to backup each other and execute the same service together. When one server fails, the other server can undertake the service task, so that the system can be automatically ensured to continuously provide the service without manual intervention.
MD5 is known as Message-Digest Algorithm 5, a widely used cryptographic hash function that generates a 128-bit (16-byte) hash value to ensure the integrity of the Message transmission. The value of MD5 is equivalent to the ID of the file, its value is unique. If the file has been modified (e.g., an embedded virus, Trojan horse, etc.), its MD5 value will change. Of course, modification of the normal contents of the file may also result in a change in the value of MD 5.
The third configuration synchronization method disclosed in this embodiment includes the following specific steps:
(1) initializing a configuration synchronization process of a host machine and a standby machine, and negotiating main control and standby control;
(2) the negotiation is a main control device, and the user can modify the configuration of the device; the negotiation is controlled equipment, and the user can only check the configuration of the equipment and cannot modify the configuration;
(3) the standby control equipment starts a cycle timing task, calculates MD5 values of all files needing to be synchronized, and sends an MD5 value list to the main control equipment;
(4) the master control equipment receives the MD5 list of the slave control equipment and calculates the MD5 values of all files needing to be synchronized; and compare out the different files of MD 5;
(5) the master control equipment packages and sends files with different MD5 values to the standby control equipment;
(6) and the standby control equipment receives the file sent by the main control equipment and executes configuration synchronization operation.
If the user makes any configuration modification on the main control device, the MD5 values of the main and standby files will be different, and the above process can implement the configuration synchronization of the main and standby devices.
It should be noted that the implementation steps in this embodiment are the same as or similar to those in the above embodiments, and therefore, the description of this embodiment is omitted here.
As can be seen, in this embodiment, the primary and secondary machines in the dual-machine hot-standby scenario perform detection of configuration file modification by comparing MD5 values of files, thereby implementing incremental synchronization of configuration files and reducing performance loss of the dual-machine device in configuration synchronization.
In the following, a configuration synchronization apparatus provided by an embodiment of the present application is introduced, and a configuration synchronization apparatus described below and a configuration synchronization method described above may be referred to with each other.
Referring to fig. 4, an embodiment of the present application discloses a configuration synchronization apparatus, which is applied to a master control device, and includes:
a comparison module 401, configured to, if the configuration synchronization condition is met, compare the local file identifier set with the recently received backup file identifier set to determine a to-be-synchronized configuration file that is stored in the master control device but not stored in the slave control device;
a to-be-synchronized configuration file sending module 402, configured to send a to-be-synchronized configuration file to the standby control device, so that the standby control device executes a synchronization operation of the to-be-synchronized configuration file;
the local file identification set comprises file identifications corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
In one embodiment, configuring the synchronization condition includes: receiving a backup file identification set sent by the backup control device, or receiving an operation instruction for modifying the configuration file.
In a specific embodiment, the method further comprises the following steps:
the first calculation module is used for calculating the MD5 value corresponding to each configuration file stored in the local synchronization list of the main control equipment;
and the second arrangement module is used for arranging the calculated MD5 values into a list to obtain a local file identification set.
In one embodiment, the comparison module comprises:
the first determining unit is used for determining a target file with the same comparison identifier in the local file identifier set and the backup file identifier set if the local file identifier set and the backup file identifier set comprise the comparison identifier;
and the second determining unit is used for determining the target file as the configuration file to be synchronized if the MD5 values of the target file in the local file identification set and the backup file identification set are inconsistent.
In one embodiment, the comparison identifier includes an MD5 value sequence number or an MD5 value corresponding path.
In a specific embodiment, the to-be-synchronized configuration file sending module includes:
the packaging unit is used for packaging the configuration files to be synchronized to obtain a file package;
and the sending unit is used for sending the file packet to the standby control equipment so that the standby control equipment decompresses the file packet and then executes the synchronization operation of the configuration files to be synchronized.
In a specific embodiment, the method further comprises the following steps:
the operation instruction receiving module is used for receiving a viewing instruction input by a user or a modification instruction aiming at the target configuration file;
and the execution module is used for displaying the configuration information included in the corresponding configuration file according to the viewing instruction or updating the target configuration file according to the modification instruction.
For more specific working processes of each module and unit in this embodiment, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not described here again.
Therefore, the embodiment provides a configuration synchronization device, which reduces file transmission amount and communication flow between a master control device and a standby control device, and ensures heartbeat stability between the master control device and the standby control device. In addition, in the synchronization process, the master control device and the standby control device process the MD5 values of the files, so that the file processing amount in the synchronization process can be reduced, the occupation amount of CPU resources of the master control device and the standby control device can be reduced, and the synchronization efficiency and the device performance can be improved.
In the following, another configuration synchronization apparatus provided in the embodiments of the present application is described, and the another configuration synchronization apparatus described below and the second configuration synchronization method described above may be referred to each other.
Referring to fig. 5, an embodiment of the present application discloses another configuration synchronization apparatus, which is applied to a standby control device, and includes:
a backup file identifier set sending module 501, configured to send a backup file identifier set to the master control device if the sending condition is met, so that the master control device compares the local file identifier set with the recently received backup file identifier set to determine a to-be-synchronized configuration file that is stored in the master control device but not stored in the backup control device;
a synchronization module 502, configured to receive a configuration file to be synchronized sent by a master control device, and execute a synchronization operation of the configuration file to be synchronized;
the local file identification set comprises file identifications corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
In one embodiment, the transmission condition includes every preset time or after completion of the synchronization operation.
In a specific embodiment, the method further comprises the following steps:
the second calculation module is used for calculating the MD5 value corresponding to each configuration file stored in the local synchronization list of the standby control equipment;
and the second arrangement module is used for arranging the calculated MD5 values into a list to obtain a local file identification set.
In a specific embodiment, the synchronization module is specifically configured to:
and if the local file identification set and the backup file identification set comprise the comparison identification, determining the file to be updated according to the comparison identification, and updating the file to be updated into the received file to be synchronized.
In a specific embodiment, the method further comprises the following steps:
the viewing instruction receiving module is used for receiving a viewing instruction input by a user;
and the display module is used for displaying the configuration information included in the corresponding configuration file according to the viewing instruction.
For more specific working processes of each module and unit in this embodiment, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not described here again.
Therefore, the embodiment provides a configuration synchronization device, which reduces file transmission amount and communication flow between a master control device and a standby control device, and ensures heartbeat stability between the master control device and the standby control device. In addition, in the synchronization process, the master control device and the standby control device process the MD5 values of the files, so that the file processing amount in the synchronization process can be reduced, the occupation amount of CPU resources of the master control device and the standby control device can be reduced, and the synchronization efficiency and the device performance can be improved.
In the following, a configuration synchronization device provided in an embodiment of the present application is introduced, and a configuration synchronization device described below and a configuration synchronization method and apparatus described above may be referred to each other.
Referring to fig. 6, an embodiment of the present application discloses a configuration synchronization apparatus, including:
a memory 601 for storing a computer program;
a processor 602 for executing the computer program to implement the method disclosed in any of the embodiments above.
Referring to fig. 7, fig. 7 is a schematic diagram of another configuration synchronization device provided in this embodiment, which may generate relatively large differences due to different configurations or performances, and may include one or more processors (CPUs) 322 (e.g., one or more processors) and a memory 332, and one or more storage media 330 (e.g., one or more mass storage devices) storing applications 342 or data 344. Memory 332 and storage media 330 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 330 may include one or more modules (not shown), each of which may include a series of instructions operating on a data processing device. Still further, the central processor 322 may be configured to communicate with the storage medium 330 to execute a series of instruction operations in the storage medium 330 on the configuration synchronization device 301.
The configuration synchronization apparatus 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input-output interfaces 358, and/or one or more operating systems 341. Such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
In fig. 6, the application 342 may be a program that performs the configuration synchronization method, and the data 344 may be data required or generated to perform the configuration synchronization method.
The steps in the configuration synchronization method described above may be implemented by the structure of the configuration synchronization apparatus.
A readable storage medium provided in the embodiments of the present application is introduced below, and a readable storage medium described below and a configuration synchronization method, apparatus, and device described above may be referred to each other.
A readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the configuration synchronization method disclosed in the foregoing embodiments. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, which are not described herein again.
References in this application to "first," "second," "third," "fourth," etc., if any, are intended to distinguish between similar elements and not necessarily to describe a particular order or sequence. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, or apparatus.
It should be noted that the descriptions in this application referring to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of readable storage medium known in the art.
The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (16)

1. A configuration synchronization method is applied to a master control device and comprises the following steps:
if the configuration synchronization condition is met, comparing a local file identification set with a recently received backup file identification set to determine a to-be-synchronized configuration file which is stored in the master control device but not stored in the slave control device;
sending the configuration file to be synchronized to the standby control equipment so that the standby control equipment can execute the synchronization operation of the configuration file to be synchronized;
the local file identifier set comprises file identifiers corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
2. The configuration synchronization method according to claim 1, wherein the configuration synchronization condition comprises: and receiving the backup file identification set sent by the standby control equipment, or receiving an operation instruction for modifying the configuration file.
3. The configuration synchronization method of claim 1, wherein comparing the local file identification set with the most recently received backup file identification set further comprises:
calculating an MD5 value corresponding to each configuration file stored in a local synchronization list of the main control equipment;
and arranging the MD5 values obtained by calculation into a list to obtain the local file identification set.
4. The configuration synchronization method according to claim 3, wherein if the local file identifier set and the backup file identifier set include a comparison identifier, the comparing the local file identifier set with the most recently received backup file identifier set to determine the to-be-synchronized configuration file that is stored in the master device but not stored in the slave device comprises:
determining a target file with the same comparison identification in the local file identification set and the backup file identification set;
and if the MD5 values of the target file in the local file identification set and the backup file identification set are inconsistent, determining the target file as the configuration file to be synchronized.
5. The configuration synchronization method according to claim 4, wherein the comparison flag comprises an MD5 value sequence number or an MD5 value corresponding path.
6. The configuration synchronization method according to claim 1, wherein the sending the configuration file to be synchronized to the standby control device, so that the standby control device performs a synchronization operation of the configuration file to be synchronized, comprises:
packaging the configuration files to be synchronized to obtain a file package;
and sending the file packet to the standby control equipment so that the standby control equipment decompresses the file packet and then executes the synchronization operation of the configuration file to be synchronized.
7. The configuration synchronization method according to any one of claims 1 to 6, further comprising:
receiving a viewing instruction input by a user or a modification instruction aiming at a target configuration file;
and displaying the configuration information included in the corresponding configuration file according to the viewing instruction, or updating the target configuration file according to the modification instruction.
8. A configuration synchronization method is applied to a standby control device and comprises the following steps:
if the sending condition is met, sending a backup file identifier set to a main control device, so that the main control device compares a local file identifier set with a recently received backup file identifier set to determine a to-be-synchronized configuration file which is stored in the main control device but not stored in the backup control device;
receiving the configuration file to be synchronized sent by the master control equipment, and executing the synchronization operation of the configuration file to be synchronized;
the local file identifier set comprises file identifiers corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
9. The configuration synchronization method according to claim 8, wherein the transmission condition comprises every preset time or after completion of a synchronization operation.
10. The configuration synchronization method according to claim 8, wherein before sending the backup MD5 value list to the master device, the method further comprises:
calculating an MD5 value corresponding to each configuration file stored in a local synchronization list of the standby control equipment;
and arranging the MD5 values obtained by calculation into a list to obtain the local file identification set.
11. The configuration synchronization method according to claim 8, wherein if the local file identifier set and the backup file identifier set include a comparison identifier, the performing the synchronization operation of the configuration file to be synchronized includes:
and determining a file to be updated according to the comparison identifier, and updating the file to be updated into the received configuration file to be synchronized.
12. The configuration synchronization method according to any one of claims 8 to 11, further comprising:
receiving a viewing instruction input by a user;
and displaying the configuration information included in the corresponding configuration file according to the viewing instruction.
13. A configuration synchronization device applied to a master control device includes:
the comparison module is used for comparing a local file identifier set with a recently received backup file identifier set if the configuration synchronization condition is met so as to determine a to-be-synchronized configuration file which is stored in the master control device but not stored in the backup control device;
a to-be-synchronized configuration file sending module, configured to send the to-be-synchronized configuration file to the standby control device, so that the standby control device executes a synchronization operation of the to-be-synchronized configuration file;
the local file identifier set comprises file identifiers corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
14. A configuration synchronization device applied to a standby device comprises:
the backup file identification set sending module is used for sending a backup file identification set to the main control device if the sending condition is met, so that the main control device compares the local file identification set with the recently received backup file identification set to determine a to-be-synchronized configuration file which is stored in the main control device but not stored in the backup control device;
the synchronization module is used for receiving the configuration file to be synchronized sent by the main control equipment and executing the synchronization operation of the configuration file to be synchronized;
the local file identifier set comprises file identifiers corresponding to at least one configuration file stored in the main control equipment; the backup file identification set comprises file identifications corresponding to at least one configuration file stored in the backup control device.
15. A configuration synchronization apparatus, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the configuration synchronization method of any of claims 1 to 7 or 8 to 12.
16. A readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the configuration synchronization method of any one of claims 1 to 7 or 8 to 12.
CN202010055405.0A 2020-01-17 2020-01-17 Configuration synchronization method, device, equipment and readable storage medium Pending CN111294391A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010055405.0A CN111294391A (en) 2020-01-17 2020-01-17 Configuration synchronization method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010055405.0A CN111294391A (en) 2020-01-17 2020-01-17 Configuration synchronization method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN111294391A true CN111294391A (en) 2020-06-16

Family

ID=71028353

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010055405.0A Pending CN111294391A (en) 2020-01-17 2020-01-17 Configuration synchronization method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111294391A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113055391A (en) * 2021-03-25 2021-06-29 建信金融科技有限责任公司 Method and device for policy configuration conversion during firewall replacement
CN114880299A (en) * 2021-02-05 2022-08-09 北京字跳网络技术有限公司 Multimedia draft file synchronization method, device, equipment and medium
WO2023241466A1 (en) * 2022-06-17 2023-12-21 中兴通讯股份有限公司 Disaster recovery system control method, disaster recovery system, electronic apparatus and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105162855A (en) * 2015-08-18 2015-12-16 浪潮(北京)电子信息产业有限公司 Incremental data synchronization method and device
CN110413441A (en) * 2019-06-18 2019-11-05 平安科技(深圳)有限公司 Active and standby storage volume synchrodata method of calibration, device, equipment and storage medium
CN110543448A (en) * 2019-07-22 2019-12-06 深圳壹账通智能科技有限公司 data synchronization method, device, equipment and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105162855A (en) * 2015-08-18 2015-12-16 浪潮(北京)电子信息产业有限公司 Incremental data synchronization method and device
CN110413441A (en) * 2019-06-18 2019-11-05 平安科技(深圳)有限公司 Active and standby storage volume synchrodata method of calibration, device, equipment and storage medium
CN110543448A (en) * 2019-07-22 2019-12-06 深圳壹账通智能科技有限公司 data synchronization method, device, equipment and computer readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114880299A (en) * 2021-02-05 2022-08-09 北京字跳网络技术有限公司 Multimedia draft file synchronization method, device, equipment and medium
CN113055391A (en) * 2021-03-25 2021-06-29 建信金融科技有限责任公司 Method and device for policy configuration conversion during firewall replacement
WO2023241466A1 (en) * 2022-06-17 2023-12-21 中兴通讯股份有限公司 Disaster recovery system control method, disaster recovery system, electronic apparatus and readable storage medium

Similar Documents

Publication Publication Date Title
CN111294391A (en) Configuration synchronization method, device, equipment and readable storage medium
CN112328435B (en) Method, device, equipment and storage medium for backing up and recovering target data
US7656894B2 (en) Offloading processing tasks to a peripheral device
US8447898B2 (en) Task offload to a peripheral device
CN106331065B (en) Proxy application and system for host system with service container
US11036535B2 (en) Data storage method and apparatus
CN104618155A (en) Virtual machine fault tolerant method, device and system
CN113961312A (en) Target service deployment method and device and electronic equipment
JP6431197B2 (en) Snapshot processing methods and associated devices
CN109525542A (en) Data reconstruction method, transmitting/receiving means and computer readable storage medium
CN111143031A (en) Method and device for changing capacity of virtual machine
CN105306566A (en) Method and system for electing master control node in cloud storage system
CN107168774B (en) Virtual machine migration method and system based on local storage
CN114489690A (en) Distributed system deployment method and device, electronic equipment and storage medium
CN111835684B (en) Network isolation monitoring method and system for haproxy equipment
US10922202B2 (en) Application service-level configuration of dataloss failover
US8898314B2 (en) Direct communication between applications in a cloud computing environment
CN114168252A (en) Information processing system and method, network scheme recommendation component and method
CN109005203B (en) Data synchronization method and device, storage medium, processor and terminal
CN113626139B (en) High-availability virtual machine storage method and device
CN108932149B (en) Data transmission method and device
CN111404820B (en) Route query method, device, equipment and readable storage medium
CN112947337A (en) Configuration synchronization method and device and electronic equipment
CN112000437A (en) Disaster recovery method and device, electronic equipment and storage medium
CN109947593B (en) Data disaster tolerance method, system, strategy arbitration device 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200616