CN106648963B - Method and system for recovering synchronous backup of data - Google Patents

Method and system for recovering synchronous backup of data Download PDF

Info

Publication number
CN106648963B
CN106648963B CN201610887542.4A CN201610887542A CN106648963B CN 106648963 B CN106648963 B CN 106648963B CN 201610887542 A CN201610887542 A CN 201610887542A CN 106648963 B CN106648963 B CN 106648963B
Authority
CN
China
Prior art keywords
data
data file
equipment
backup
video
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.)
Active
Application number
CN201610887542.4A
Other languages
Chinese (zh)
Other versions
CN106648963A (en
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.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
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 Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN201610887542.4A priority Critical patent/CN106648963B/en
Publication of CN106648963A publication Critical patent/CN106648963A/en
Application granted granted Critical
Publication of CN106648963B publication Critical patent/CN106648963B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method for recovering synchronous backup of data, which comprises the following steps: after the first equipment is restarted due to a fault, determining each data file which needs to be subjected to data backup by the first equipment and the data file which is subjected to video storage by the second equipment; for each data file of which the first device needs to perform data backup, controlling the first device to execute data backup operation corresponding to a judgment result based on the judgment result of each data file so as to complete the backup of each data file and ensure the consistency of video data storage in the first device and the second device; for the data file of the second device which is performing video storage, when the data file is completely stored, the first device and the second device are controlled to be switched to the next data file for performing video storage at the same time, so that the normal synchronous storage state of the first device is recovered, the second device which is performing video storage does not need to be interrupted, and the real-time performance of video storage is ensured.

Description

Method and system for recovering synchronous backup of data
Technical Field
The invention relates to the technical field of data storage, in particular to a method and a system for recovering synchronous backup of data.
Background
At present, a video storage system generally adopts a dual-computer hot backup technology to store videos, the dual-computer hot backup technology uses two devices in the running process of the system, data files configured by the two devices are completely the same, wherein the two devices correspond to and store the same video data synchronously, and the backup is performed immediately after the two devices store a data file, that is, the two devices respectively use the video data stored in the two data files as a standard, compare the video data stored in the two data files in sequence, determine the video data missing from the two data files, and transmit the video data missing from each other, so as to ensure that the video data stored in the data files of the two devices are the same, and simultaneously, the two devices are switched to the next data file to perform video storage.
In a video storage system based on dual-computer hot backup, a failure of one device occurs inevitably, when one device, namely a first device, fails, the two devices stop dual-computer hot backup, a second device performs video storage subsequently, after the failed first device is restarted, video data stored by the two devices are inconsistent and asynchronous, the second device performing video storage generally needs to be interrupted, and after the failed first device completes the re-backup of an un-backed up data file, normal video synchronous storage and backup of the two devices are recovered simultaneously, but by adopting the measure, the real-time performance of video storage cannot be ensured.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method for recovering data synchronous backup, so that after a failure restart, a first device does not need to interrupt a second device performing video storage, consistency with video data storage of the second device and synchronization with video storage of the second device are achieved, and instantaneity of video storage is ensured.
The invention also provides a system for recovering the synchronous backup of the data, which is used for ensuring the realization and the application of the method in practice.
A method of restoring a synchronized backup of data, comprising:
after the first device is restarted due to a fault, comparing the current state information of the data files recorded by the first device and the second device respectively, and determining the data files of the first device, which need to be subjected to data backup, and the data files of the second device, which are subjected to video storage;
monitoring the state of a data file of the second equipment in video storage in real time; for any data file of the first device, which needs to be subjected to data backup, judging whether the data file exists in the first device or not, and when the data file exists in the first device, judging whether the difference value between the initial recording time of the data file corresponding to the second device and the initial recording time of the data file corresponding to the first device is larger than a preset threshold value or not;
when the data file of the video storage of the second device is stored, controlling the first device and the second device to switch to the next data file for video storage at the same time so as to recover the normal synchronous storage state of the first device; and when all the data files needing to be subjected to data backup by the first equipment are judged to be finished, controlling the first equipment to execute data backup operation corresponding to the judgment result based on the judgment result.
In the foregoing method, preferably, the controlling, based on the determination result, the first device to perform the data backup operation corresponding to the determination result includes:
and for any data file needing data backup, when the difference value between the initial recording time of the data file corresponding to the second equipment and the initial recording time of the data file corresponding to the first equipment is greater than a preset threshold value, controlling the first equipment to send a first data acquisition instruction to the second equipment so as to acquire video data stored in the data file in the second equipment for overlay backup.
In the foregoing method, preferably, the controlling, based on the determination result, the first device to perform the data backup operation corresponding to the determination result includes:
for any data file needing data backup, when the difference value between the initial recording time of the data file in the second device and the initial recording time of the data file in the first device is smaller than a preset threshold value, judging whether distortion data exist in video data stored in the data file in the first device;
when the video data stored in the data file in the first device does not have distortion data, comparing the video data stored in the data file in the first device with the video data stored in the data file in the second device by taking the video data stored in the data file in the second device as a standard, and determining the video data which is missing in the data file and corresponds to the first device; controlling the first equipment to send a second data acquisition instruction to the second equipment so as to acquire video data missing in the data file in the first equipment for backup;
when the video data stored in the data file in the first device has distortion data, deleting the distortion data, comparing the video data stored in the data file in the first device with the video data stored in the data file in the second device by taking the video data stored in the data file in the second device as a standard, and determining the video data which is missing in the data file corresponding to the first device; and controlling the first equipment to send a third data acquisition instruction to the second equipment so as to acquire the video data missing in the data file in the first equipment for backup.
In the foregoing method, preferably, the controlling, based on the determination result, the first device to perform the data backup operation corresponding to the determination result includes:
and for any data file needing data backup, when the data file does not exist in the first equipment, controlling the first equipment to send a fourth data acquisition instruction to the second equipment so as to acquire video data stored in the data file in the second equipment for overlay backup.
The method preferably further comprises:
and when the first device and the second device are switched to the next data file for video storage at the same time, controlling the first device to send a fifth data acquisition instruction to the second device so as to acquire video data in the data file which is just stored by the second device for overlay backup.
A system for restoring synchronized backups of data, comprising:
the determining unit is used for comparing the current state information of the data files recorded by the first equipment and the second equipment after the first equipment is restarted due to a fault, and determining each data file which needs to be subjected to data backup by the first equipment and the data file which is subjected to video storage by the second equipment;
the monitoring and judging unit is used for monitoring the state of the data file of the second equipment in video storage in real time; for any data file of the first device, which needs to be subjected to data backup, judging whether the data file exists in the first device or not, and when the data file exists in the first device, judging whether the difference value between the initial recording time of the data file corresponding to the second device and the initial recording time of the data file corresponding to the first device is larger than a preset threshold value or not;
the control unit is used for controlling the first equipment and the second equipment to switch to the next data file for video storage simultaneously when the storage of the data file in the video storage of the second equipment is finished so as to recover the normal synchronous storage state of the first equipment; and when all the data files needing to be subjected to data backup by the first equipment are judged to be finished, controlling the first equipment to execute data backup operation corresponding to the judgment result based on the judgment result.
In the above system, preferably, the control unit includes:
the first control subunit is configured to, for any data file that needs to be subjected to data backup, control the first device to send a first data acquisition instruction to the second device when a difference between initial recording time of the data file corresponding to the second device and initial recording time of the data file corresponding to the first device is greater than a preset threshold, so as to acquire video data stored in the data file in the second device for overlay backup.
In the above system, preferably, the control unit includes:
the judgment subunit is configured to, for any data file requiring data backup, judge whether distortion data exists in video data stored in the data file in the first device when a difference between initial recording time of the data file in the second device and initial recording time of the data file in the first device is smaller than a preset threshold;
the second control subunit is configured to, when there is no distortion data in the video data stored in the data file in the first device, compare the video data stored in the data file in the first device with the video data stored in the data file in the second device using the video data stored in the data file in the second device as a standard, and determine the video data missing in the data file in the first device; controlling the first equipment to send a second data acquisition instruction to the second equipment so as to acquire video data missing in the data file in the first equipment for backup;
a third control subunit, configured to delete distorted data when video data stored in the data file in the first device has the distorted data, compare the video data stored in the data file in the first device with the video data stored in the data file in the second device using the video data stored in the data file in the second device as a standard, and determine video data missing in the data file corresponding to the first device; and controlling the first equipment to send a third data acquisition instruction to the second equipment, and acquiring the video data missing in the data file in the first equipment for backup.
In the above system, preferably, the control unit includes:
and the fourth control subunit is configured to, for any data file that needs to be subjected to data backup, control the first device to send a fourth data acquisition instruction to the second device when the data file does not exist in the first device, so as to acquire video data stored in the data file in the second device for overlay backup.
The above system, preferably, further comprises:
and the acquisition unit is used for controlling the first equipment to send a fifth data acquisition instruction to the second equipment when the first equipment and the second equipment are switched to a next data file for video storage at the same time so as to acquire the video data in the data file which is just stored by the second equipment for overlay backup.
Compared with the prior art, the invention has the following advantages:
the invention provides a method for recovering synchronous backup of data, which comprises the following steps: after the first equipment is restarted due to a fault, determining each data file which needs to be subjected to data backup by the first equipment and the data file which is subjected to video storage by the second equipment; for each data file of which the first device needs to perform data backup, controlling the first device to execute data backup operation corresponding to a judgment result based on the judgment result of each data file so as to complete the backup of each data file and ensure the consistency of video data storage in the first device and the second device; for the data file of the second device which is performing video storage, when the data file is completely stored, the first device and the second device are controlled to be switched to the next data file for performing video storage simultaneously so as to recover the normal synchronous storage state of the first device, therefore, after the first device is restarted due to a fault, the second device which is performing video storage does not need to be interrupted, the consistency of video data storage with the second device and the synchronization of video storage with the second device are realized, and the real-time performance of video storage is ensured.
Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of a method for recovering a synchronous backup of data according to the present invention;
FIG. 2 is a schematic structural diagram of a system for recovering synchronous data backup according to the present invention;
FIG. 3 is a schematic diagram of another structure of a system for recovering synchronous data backup according to the present invention;
fig. 4 is a schematic structural diagram of a video storage system based on dual-computer hot backup according to the present invention;
fig. 5 is a schematic flowchart of a method for restarting a video storage system in a failure based on dual-computer hot backup according to the present invention;
FIG. 6 is a flowchart of a method for synchronizing files that are not backed up according to the present invention;
fig. 7 is a flowchart of a method for synchronizing video storage according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
Referring to fig. 1, a method for restoring a synchronous backup of data according to an embodiment of the present invention is shown, where an execution subject of the method may be a first device; the method comprises the following steps:
step S101: after the first device is restarted due to a fault, comparing the current state information of the data files recorded by the first device and the second device respectively, and determining the data files of the first device, which need to be subjected to data backup, and the data files of the second device, which are subjected to video storage;
in the method provided by the invention, after the first device is restarted due to a fault, the current state information of the data files recorded by the first device and the second device are compared, and the data files of which the data backup is required by the first device and the data files of which the video storage is in progress by the second device are determined; wherein, the current status information of the data file may include: a storage state, a backup state and the like, wherein the storage state can be stored, not stored or being stored; the backup state may be backed up, not backed up, or backing up; each data file that the first device needs to perform data backup may include a file in which the first device does not complete data backup when a failure occurs and a data file in which video storage is not performed with respect to the second device during the failure occurrence.
For example, after the first device is restarted due to a failure, the recorded data file status information is as follows:
data file 1, stored, not backed up; data file 2, stored, being backed up; data file 3, being stored, is not backed up.
The data file state information recorded by the second device is:
data file 1, stored, not backed up; data file 2, stored, being backed up; data file 3, stored, not backed up; data file 4, stored, not backed up; data file 5, being stored, is not backed up.
Comparing the data file state information recorded by the first device and the second device respectively, and determining that the data file 1, the data file 2, the data file 3 and the data file 4 are files for which data backup needs to be performed by the first device, wherein the data file 1, the data file 2 and the data file 3 are files for which data backup is not completed by the first device when a fault occurs, and the data file 4 is a data file for which video storage is not performed by the first device relative to the second device during the fault occurrence period; and may determine that data file 5 is a data file for which the second device is video storing.
Step S102: monitoring the state of a data file of the second equipment in video storage in real time; for any data file of the first device, which needs to be subjected to data backup, judging whether the data file exists in the first device or not, and when the data file exists in the first device, judging whether the difference value between the initial recording time of the data file corresponding to the second device and the initial recording time of the data file corresponding to the first device is larger than a preset threshold value or not;
in the invention, whether the data file of the second device which is storing the video is stored is monitored in real time; for any data file of the first equipment, which needs data backup, judging whether the data file exists in the first equipment, if not, indicating that the data file is the data file of the first equipment, which does not perform video storage during the fault period, and directly acquiring video data stored in the data file in the second equipment for overlay backup; when the data file exists in the first device, judging whether the difference value between the initial recording time of the data file corresponding to the second device and the initial recording time of the data file corresponding to the first device is larger than a preset threshold value or not, if so, indicating that the first device has a longer fault time, and directly acquiring the video data stored in the data file in the second device for overlay backup; and if the data file is smaller than the preset threshold, determining the video data which is not received by the data file in the first equipment during the fault period, and acquiring the video data which is not received from the second equipment for backup.
Step S103: when the data file of the video storage of the second device is stored, controlling the first device and the second device to switch to the next data file for video storage at the same time so as to recover the normal synchronous storage state of the first device; and when all the data files needing to be subjected to data backup by the first equipment are judged to be finished, controlling the first equipment to execute data backup operation corresponding to the judgment result based on the judgment result.
By applying the method for synchronously backing up the recovery data, after the first equipment is restarted due to a fault, determining each data file which needs to be backed up by the first equipment and the data file which is stored in a video by the second equipment; for each data file of which the first device needs to perform data backup, controlling the first device to execute data backup operation corresponding to a judgment result based on the judgment result of each data file so as to complete the backup of each data file and ensure the consistency of video data storage in the first device and the second device; for the data file of the second device which is performing video storage, when the data file is completely stored, the first device and the second device are controlled to be switched to the next data file for performing video storage simultaneously so as to recover the normal synchronous storage state of the first device, therefore, after the first device is restarted due to a fault, the second device which is performing video storage does not need to be interrupted, the consistency of video data storage with the second device and the synchronization of video storage with the second device are realized, and the real-time performance of video storage is ensured.
In the method provided by the present invention, the controlling, based on the determination result, the first device to perform the data backup operation corresponding to the determination result includes:
and for any data file needing data backup, when the difference value between the initial recording time of the data file corresponding to the second equipment and the initial recording time of the data file corresponding to the first equipment is greater than a preset threshold value, controlling the first equipment to send a first data acquisition instruction to the second equipment so as to acquire video data stored in the data file in the second equipment for overlay backup.
In the method provided by the present invention, the controlling, based on the determination result, the first device to perform the data backup operation corresponding to the determination result includes:
for any data file needing data backup, when the difference value between the initial recording time of the data file in the second device and the initial recording time of the data file in the first device is smaller than a preset threshold value, judging whether distortion data exist in video data stored in the data file in the first device;
when the video data stored in the data file in the first device does not have distortion data, comparing the video data stored in the data file in the first device with the video data stored in the data file in the second device by taking the video data stored in the data file in the second device as a standard, and determining the video data which is missing in the data file and corresponds to the first device; controlling the first equipment to send a second data acquisition instruction to the second equipment so as to acquire video data missing in the data file in the first equipment for backup;
when the video data stored in the data file in the first device has distortion data, deleting the distortion data, comparing the video data stored in the data file in the first device with the video data stored in the data file in the second device by taking the video data stored in the data file in the second device as a standard, and determining the video data which is missing in the data file corresponding to the first device; and controlling the first equipment to send a third data acquisition instruction to the second equipment so as to acquire the video data missing in the data file in the first equipment for backup.
In the method provided by the present invention, the controlling, based on the determination result, the first device to perform the data backup operation corresponding to the determination result includes:
and for any data file needing data backup, when the data file does not exist in the first equipment, controlling the first equipment to send a fourth data acquisition instruction to the second equipment so as to acquire video data stored in the data file in the second equipment for overlay backup.
The method provided by the invention further comprises the following steps:
and when the first device and the second device are switched to the next data file for video storage at the same time, controlling the first device to send a fifth data acquisition instruction to the second device so as to acquire video data in the data file which is just stored by the second device for overlay backup.
Corresponding to the method shown in fig. 1, the present invention further provides a synchronous backup system for restoring data, a schematic structural diagram of which is shown in fig. 2, and the system includes:
a determining unit 201, configured to compare current state information about data files recorded by the first device and the second device after the first device is restarted due to a failure, and determine each data file that the first device needs to perform data backup and a data file that the second device is performing video storage;
the monitoring and judging unit 202 is used for monitoring the state of the data file of the second device in video storage in real time; for any data file of the first device, which needs to be subjected to data backup, judging whether the data file exists in the first device or not, and when the data file exists in the first device, judging whether the difference value between the initial recording time of the data file corresponding to the second device and the initial recording time of the data file corresponding to the first device is larger than a preset threshold value or not;
the control unit 203 is used for controlling the first device and the second device to switch to the next data file for video storage simultaneously when the storage of the data file in the video storage of the second device is finished so as to recover the normal synchronous storage state of the first device; and when all the data files needing to be subjected to data backup by the first equipment are judged to be finished, controlling the first equipment to execute data backup operation corresponding to the judgment result based on the judgment result.
By applying the method for synchronously backing up the recovery data, after the first equipment is restarted due to a fault, determining each data file which needs to be backed up by the first equipment and the data file which is stored in a video by the second equipment; for each data file of which the first device needs to perform data backup, controlling the first device to execute data backup operation corresponding to a judgment result based on the judgment result of each data file so as to complete the backup of each data file and ensure the consistency of video data storage in the first device and the second device; and for the data file of which the second equipment is performing video storage, when the data file is completely stored, controlling the first equipment and the second equipment to switch to the next data file for performing video storage simultaneously so as to recover the normal synchronous storage state of the first equipment.
Fig. 3 shows another schematic structural diagram of the synchronous backup of recovery data provided by the present invention, where the control unit 203 includes:
the first control subunit 2031 is configured to, for any data file that needs to be subjected to data backup, control the first device to send a first data obtaining instruction to the second device when a difference between an initial recording time of the data file corresponding to the second device and an initial recording time of the data file corresponding to the first device is greater than a preset threshold, so as to obtain video data stored in the data file in the second device for overlay backup.
Specifically, the control unit 203 includes:
a determining subunit 2032, configured to, for any data file that needs to be backed up, determine whether distortion data exists in video data stored in the data file in the first device when a difference between an initial recording time of the data file in the second device and an initial recording time of the data file in the first device is smaller than a preset threshold;
a second control subunit 2033, configured to, when there is no distortion data in the video data stored in the data file in the first device, compare the video data stored in the data file in the first device with the video data stored in the data file in the second device by using the video data stored in the data file in the second device as a standard, and determine the video data missing in the data file in the first device; controlling the first equipment to send a second data acquisition instruction to the second equipment so as to acquire video data missing in the data file in the first equipment for backup;
a third control subunit 2034, configured to delete distorted data when video data stored in the data file in the first device has the distorted data, compare the video data stored in the data file in the first device with the video data stored in the data file in the second device using the video data stored in the data file in the second device as a standard, and determine video data missing in the data file corresponding to the first device; and controlling the first equipment to send a third data acquisition instruction to the second equipment, and acquiring the video data missing in the data file in the first equipment for backup.
Specifically, the control unit 203 includes:
a fourth control subunit 2035, configured to, for any data file that needs to be subjected to data backup, control the first device to send a fourth data obtaining instruction to the second device when the data file does not exist in the first device, so as to obtain video data stored in the data file in the second device for overlay backup.
Correspondingly, the system further comprises:
the obtaining unit 204 is configured to, when the first device and the second device are simultaneously switched to a next data file for video storage, control the first device to send a fifth data obtaining instruction to the second device, so as to obtain video data in a data file that has just been stored by the second device for overlay backup.
Referring to fig. 4, a schematic structural diagram of a video storage system based on dual-computer hot backup provided in the present invention is shown.
The two machines realize mutual hot backup, all software and hardware configurations of the two devices are the same (including file names of data files), and simultaneously receive the same video source to store the real-time video. Wherein,
(1) the video adopts a fixed-length file storage mode, video frames are stored in a data file, video frame information is stored in an index file, and data file information is stored in a total file table.
The information in the 'total file table' is stored in a format with a fixed length, and comprises the following steps: "data file path", "index data file path", "recording start time", "recording end time", "data recorded size", "index recorded size", "file use flag" (0 means unused, 1 means in use, 2 means used), "backup flag" (0 means not backed up, 1 means backing up, 2 means backed up), and other 8 basic fields.
(2) Under normal conditions, the two devices perform video storage and ordinary dual-computer hot backup through a video storage module.
(3) The letters a, B are used to distinguish the relevant software and hardware configurations (including the file names of the data files) of the two devices.
Referring to fig. 5, a schematic flow chart of a method for restarting a video storage system in a failure based on dual-computer hot backup according to the present invention is shown.
Step S501: after the device B is restarted, the 'synchronization module B' is started, the information of the 'used and non-backed up' file, the 'used and non-backed up' file and the 'used and non-backed up' file in the 'total file table' is searched, and the 'error information table B' is generated and sent to the device A.
The information in the error information table is stored in a format with fixed length, and comprises the following steps: "data file name", "data file path", "recording start time", "recording end time", "file use flag" (0 means unused, 1 means in use, 2 means used), "backup flag" (0 means not backed up, 1 means backing up, 2 means backed up), and so on.
In the present example, it is assumed that "error information table B" is as shown in table 1.
TABLE 1 error information TABLE B
Figure BDA0001128516290000121
Step S502: after receiving the error information table B, the equipment A starts the synchronization module A, generates an error information table A and sends the error information table A to the equipment B.
In the present example, it is assumed that "error information table a" is as shown in table 2.
Table 2 error information table a
Figure BDA0001128516290000131
Step S503: upon receiving the error information table a, the device B A, B starts synchronizing.
Step S504: device A, B backs up data files not backed up during the failure by the "synchronize un-backed up file module"; the device A, B synchronizes the ongoing video storage by the "synchronize storing files module".
Step S505: when the "synchronous un-backed up module" and the "synchronous current file storage module" of the device A, B are used and stopped, synchronization is completed, and the fault restart is completed, the device A, B continues normal video storage and normal dual-computer hot backup.
Referring to fig. 6, a flowchart of a method for synchronizing an un-backed up file according to the present invention is shown, including:
step S601: the device A compares the error information table A with the error information table B, searches the information of the files which are used and not backed up, the files which are used and backed up and the files which are used and not backed up in the total file table A, generates a file information table which needs to be backed up and sends the file information table to the device B.
The information in the 'file information table to be backed up' is stored in a format with a fixed length, and comprises the following steps: "data file name", "path of data file on device a", "path of data file on device B", "operation type" (0 means normal backup, 1 means overwrite backup, 2 means normal backup after removing frame is not completed), etc. 4 basic fields.
The generation process of the file information table to be backed up is as follows:
and sequentially reading the data information of the used data and the data information of the non-backed data in the error information table A, assuming that the information points to the data file A of the equipment A, and then assuming that the file corresponding to the data file A in the error information table B is the data file B.
If the error information table B does not have the data file B, adding the information of the data file to the file information table needing to be backed up, wherein the operation type is 'coverage backup'.
In this example, as shown in the data file "1" in the 4 th row of Table 2, the information of the "file information table to be backed up" is generated as
Data file name Path of data file at device A Path of data file at device B Type of operation
4 D:\4.txt D:\4.txt 1
If the error information table B has the data file B, then
(1) And if the difference value of the video recording starting time of the data file A and the video recording starting time of the data file B is less than the threshold value and the data file B is used and not backed up, adding the information of the data file into the file information table needing to be backed up, wherein the operation type is common backup.
In this example, as shown in the data file "3" in the 3 rd row of table 1 and the 3 rd row of table 2, the information of the "file information table to be backed up" is generated as
Data file name Path of data file at device A Path of data file at device B Type of operation
3 D:\3.txt D:\3.txt 0
(2) If the difference value of the video recording starting time of the data file A and the video recording starting time of the data file B is smaller than the threshold value, and the state of the data file B is ' unfinished, not backed up ' or ' finished and backing up ', adding the information of the data file B into the file information table needing to be backed up ', wherein the ' operation type ' is ' ordinary backup after the unfinished frame information is removed '.
In this example, the "information table of file information to be backed up" is generated as the data files "1" and "2" in the 1 st and 2 nd rows of table 1 and table 2, respectively
Data file name Path of data file at device A Path of data file at device B Type of operation
1 D:\1.txt D:\1.txt 2
2 D:\2.txt D:\2.txt 2
(3) And if the difference value of the video recording starting time of the data file A and the video recording starting time of the data file B is larger than the threshold value, adding the information of the data file into the file information table needing to be backed up, wherein the operation type is 'covered'.
In this example, if the threshold value is "00: 00: 10" as the data file "5" in the 4 th row of table 1 and the 5 th row of table 2, the "file information table to be backed up" information is generated as
Data file name Path of data file at device A Path of data file at device B Type of operation
5 D:\5.txt D:\5.txt 1
In this example, the "file information table to be backed up" finally generated is shown in table 3:
table 3 file information table to be backed up
Data file name Path of data file at device A Path of data file at device B Type of operation
1 D:\1.txt D:\1.txt 2
2 D:\2.txt D:\2.txt 2
3 D:\3.txt D:\3.txt 0
4 D:\4.txt D:\4.txt 1
5 D:\5.txt D:\5.txt 1
Step S602: after the device B receives the "file information table to be backed up", the device A, B starts synchronizing the data files not to be backed up.
Step S603: the device A, B transmits the backup data or the backup data in order according to the "file information table to be backed up".
In step S603, the information of the "file information table to be backed up" is sequentially read, and information such as "data file name", "path of data file on device a", "path of data file on device B", and "operation type" is acquired. If the operation type is 'ordinary backup', the operation of 'ordinary dual-computer hot backup of a video storage module' is carried out on the pointed data file; if the operation type is "overlay backup", directly overlaying the contents of the data file of the pointing device A to the data file of the pointing device B; if the operation type is 'remove the frame without completion and then back up normally', namely delete the frame without completion in the data file of the pointing device B first, and then perform the normal double-computer hot backup operation of the 'video storage module'.
Step S604: the synchronization of "un-backed up files" is completed and the "synchronized un-backed up files module" of the end device A, B is ended.
Referring to fig. 7, a flow chart of a method for synchronizing the video storage is shown, the method includes:
step S701: the device B acquires information of the "in-use, non-backed up" data file (assumed to be the data file a) of the device a based on the "error information table a", and video-stores the data file (assumed to be the data file B) corresponding to the device B.
Step S702: device a is storing "data file a" and, when "data file a" reaches a predetermined length and is ready to switch to the next data file, "switch instruction" is sent to device B.
Step S703: and the device B receives the switching instruction, switches to the next data file, sends a switching success instruction to the device A, then starts the video storage module B, and enters normal video storage and ordinary dual-computer hot backup.
Step S704: after receiving the "switching success instruction", the device a and the device B perform the ordinary dual-computer hot backup operation of the "video storage module" on the "data file A, B" which is just stored.
Step S705: the synchronization "file being stored is successful", and the "synchronization file module being stored" of the end device A, B ends.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
The method and the system for synchronous backup of recovery data provided by the invention are described in detail above, and a specific example is applied in the text to explain the principle and the implementation of the invention, and the description of the above embodiment is only used to help understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, 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 invention.

Claims (10)

1. A method for restoring a synchronized backup of data, comprising:
when the first equipment is restarted due to faults, the first equipment starts a first synchronization module, generates a first error information table and sends the first error information table to second equipment; the first error information table at least comprises a file name, a storage state and a backup state;
after the second equipment receives the first error information table, a second synchronization module is started to generate a second error information table and send the second error information table to the first equipment; the second error information table at least comprises a file name, a storage state and a backup state;
comparing the current state information about the data files recorded by the first equipment and the second equipment respectively based on the first error information table and the second error information table, and determining each data file which needs to be subjected to data backup by the first equipment and the data file which is subjected to video storage by the second equipment;
monitoring the state of a data file of the second equipment in video storage in real time; for any data file of the first device, which needs to be subjected to data backup, judging whether the data file exists in the first device or not, and when the data file exists in the first device, judging whether the difference value between the initial recording time of the data file corresponding to the second device and the initial recording time of the data file corresponding to the first device is larger than a preset threshold value or not;
when the data file of the video storage of the second device is stored, controlling the first device and the second device to switch to the next data file for video storage at the same time so as to recover the normal synchronous storage state of the first device; and when all the data files needing to be subjected to data backup by the first equipment are judged to be finished, controlling the first equipment to execute data backup operation corresponding to the judgment result based on the judgment result.
2. The method of claim 1, wherein controlling the first device to perform the data backup operation corresponding to the determination result based on the determination result comprises:
and for any data file needing data backup, when the difference value between the initial recording time of the data file corresponding to the second equipment and the initial recording time of the data file corresponding to the first equipment is greater than a preset threshold value, controlling the first equipment to send a first data acquisition instruction to the second equipment so as to acquire video data stored in the data file in the second equipment for overlay backup.
3. The method of claim 1, wherein controlling the first device to perform the data backup operation corresponding to the determination result based on the determination result comprises:
for any data file needing data backup, when the difference value between the initial recording time of the data file in the second device and the initial recording time of the data file in the first device is smaller than a preset threshold value, judging whether distortion data exist in video data stored in the data file in the first device;
when the video data stored in the data file in the first device does not have distortion data, comparing the video data stored in the data file in the first device with the video data stored in the data file in the second device by taking the video data stored in the data file in the second device as a standard, and determining the video data which is missing in the data file and corresponds to the first device; controlling the first equipment to send a second data acquisition instruction to the second equipment so as to acquire video data missing in the data file in the first equipment for backup;
when the video data stored in the data file in the first device has distortion data, deleting the distortion data, comparing the video data stored in the data file in the first device with the video data stored in the data file in the second device by taking the video data stored in the data file in the second device as a standard, and determining the video data which is missing in the data file corresponding to the first device; and controlling the first equipment to send a third data acquisition instruction to the second equipment so as to acquire the video data missing in the data file in the first equipment for backup.
4. The method of claim 1, wherein controlling the first device to perform the data backup operation corresponding to the determination result based on the determination result comprises:
and for any data file needing data backup, when the data file does not exist in the first equipment, controlling the first equipment to send a fourth data acquisition instruction to the second equipment so as to acquire video data stored in the data file in the second equipment for overlay backup.
5. The method of claim 1, further comprising:
and when the first device and the second device are switched to the next data file for video storage at the same time, controlling the first device to send a fifth data acquisition instruction to the second device so as to acquire video data in the data file which is just stored by the second device for overlay backup.
6. A system for restoring synchronized backups of data, comprising:
the determining unit is used for comparing the current state information of the data files recorded by the first equipment and the second equipment respectively based on the first error information table and the second error information table after the first equipment is restarted due to faults, and determining each data file which needs to be subjected to data backup by the first equipment and the data file which is subjected to video storage by the second equipment; the first error information table is an error information table which is generated by starting a first synchronization module for the first equipment and is sent to the second equipment; the first error information table at least comprises a file name, a storage state and a backup state; the second error information table is an error information table which is generated and sent to the first equipment by starting the second synchronization module after the second equipment receives the first error information table; the second error information table at least comprises a file name, a storage state and a backup state;
the monitoring and judging unit is used for monitoring the state of the data file of the second equipment in video storage in real time; for any data file of the first device, which needs to be subjected to data backup, judging whether the data file exists in the first device or not, and when the data file exists in the first device, judging whether the difference value between the initial recording time of the data file corresponding to the second device and the initial recording time of the data file corresponding to the first device is larger than a preset threshold value or not;
the control unit is used for controlling the first equipment and the second equipment to switch to the next data file for video storage simultaneously when the storage of the data file in the video storage of the second equipment is finished so as to recover the normal synchronous storage state of the first equipment; and when all the data files needing to be subjected to data backup by the first equipment are judged to be finished, controlling the first equipment to execute data backup operation corresponding to the judgment result based on the judgment result.
7. The system of claim 6, wherein the control unit comprises:
the first control subunit is configured to, for any data file that needs to be subjected to data backup, control the first device to send a first data acquisition instruction to the second device when a difference between initial recording time of the data file corresponding to the second device and initial recording time of the data file corresponding to the first device is greater than a preset threshold, so as to acquire video data stored in the data file in the second device for overlay backup.
8. The system of claim 6, wherein the control unit comprises:
the judgment subunit is configured to, for any data file requiring data backup, judge whether distortion data exists in video data stored in the data file in the first device when a difference between initial recording time of the data file in the second device and initial recording time of the data file in the first device is smaller than a preset threshold;
the second control subunit is configured to, when there is no distortion data in the video data stored in the data file in the first device, compare the video data stored in the data file in the first device with the video data stored in the data file in the second device using the video data stored in the data file in the second device as a standard, and determine the video data missing in the data file in the first device; controlling the first equipment to send a second data acquisition instruction to the second equipment so as to acquire video data missing in the data file in the first equipment for backup;
a third control subunit, configured to delete distorted data when video data stored in the data file in the first device has the distorted data, compare the video data stored in the data file in the first device with the video data stored in the data file in the second device using the video data stored in the data file in the second device as a standard, and determine video data missing in the data file corresponding to the first device; and controlling the first equipment to send a third data acquisition instruction to the second equipment, and acquiring the video data missing in the data file in the first equipment for backup.
9. The system of claim 6, wherein the control unit comprises:
and the fourth control subunit is configured to, for any data file that needs to be subjected to data backup, control the first device to send a fourth data acquisition instruction to the second device when the data file does not exist in the first device, so as to acquire video data stored in the data file in the second device for overlay backup.
10. The system of claim 6, further comprising:
and the acquisition unit is used for controlling the first equipment to send a fifth data acquisition instruction to the second equipment when the first equipment and the second equipment are switched to a next data file for video storage at the same time so as to acquire the video data in the data file which is just stored by the second equipment for overlay backup.
CN201610887542.4A 2016-10-11 2016-10-11 Method and system for recovering synchronous backup of data Active CN106648963B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610887542.4A CN106648963B (en) 2016-10-11 2016-10-11 Method and system for recovering synchronous backup of data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610887542.4A CN106648963B (en) 2016-10-11 2016-10-11 Method and system for recovering synchronous backup of data

Publications (2)

Publication Number Publication Date
CN106648963A CN106648963A (en) 2017-05-10
CN106648963B true CN106648963B (en) 2020-10-20

Family

ID=58856275

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610887542.4A Active CN106648963B (en) 2016-10-11 2016-10-11 Method and system for recovering synchronous backup of data

Country Status (1)

Country Link
CN (1) CN106648963B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108462602B (en) * 2018-01-02 2021-07-27 深圳市奥拓电子股份有限公司 Data transmission control method, control system and storage device
CN109684130B (en) * 2018-12-12 2020-12-22 网宿科技股份有限公司 Method and device for backing up data of computer room

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7526514B2 (en) * 2004-12-30 2009-04-28 Emc Corporation Systems and methods for dynamic data backup
CN101453489B (en) * 2008-12-17 2012-12-19 上海爱数软件有限公司 Network additive storage device, data backup and data restoration method thereof
CN102325171B (en) * 2011-08-26 2014-06-25 杭州华三通信技术有限公司 Data storage method in monitoring system and system
US9234942B2 (en) * 2012-09-21 2016-01-12 Apple Inc. Transition fault testing of source synchronous interface

Also Published As

Publication number Publication date
CN106648963A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN108874593B (en) Two-place three-center disaster recovery method, device, equipment and system
CN102891849B (en) Service data synchronization method, data recovery method, data recovery device and network device
CN101316184B (en) Disaster tolerance switching method, system and device
CN108415793B (en) Modifying membership of a replica group via a log operation
US20170255529A1 (en) Smart data replication recoverer
CN104679614B (en) A kind of Database Disaster Backup/Recover
CN103077242A (en) Method for hot standby of dual database servers
CN103905220B (en) Data synchronizing processing method and system
CN106817387B (en) Data synchronization method, device and system
CN105554130A (en) Distributed storage system-based NameNode switching method and switching device
CN106648963B (en) Method and system for recovering synchronous backup of data
CN105677673A (en) Business processing method, device and system
CN103973727A (en) Data synchronizing method and device
CN112153134A (en) Disaster tolerance drilling method, device, equipment and storage medium of disaster tolerance cloud host
US10007567B2 (en) Method and device for recovering data replication between storage devices
CN112948484A (en) Distributed database system and data disaster recovery drilling method
US20120158652A1 (en) System and method for ensuring consistency in raid storage array metadata
CN103581262A (en) Master-and-backup data synchronizing method, device and system
CN110532134B (en) NAS data backup disaster recovery method and device
CN107526652B (en) Data synchronization method and storage device
CN109005246B (en) Data synchronization method, device and system
CN107621994A (en) The method and device that a kind of data snapshot creates
CN102841840B (en) The message logging restoration methods that Effect-based operation reorders and message number is checked
CN108984346B (en) Method, system and storage medium for producing data disaster tolerance
CN111984474A (en) Method, system and equipment for recovering double-control cluster fault

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
GR01 Patent grant
GR01 Patent grant