CN106648963A - Method and system for recovering data synchronous backup - Google Patents

Method and system for recovering data synchronous backup Download PDF

Info

Publication number
CN106648963A
CN106648963A CN201610887542.4A CN201610887542A CN106648963A CN 106648963 A CN106648963 A CN 106648963A CN 201610887542 A CN201610887542 A CN 201610887542A CN 106648963 A CN106648963 A CN 106648963A
Authority
CN
China
Prior art keywords
equipment
data
data file
video
file
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.)
Granted
Application number
CN201610887542.4A
Other languages
Chinese (zh)
Other versions
CN106648963B (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

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 data synchronous backup. The method includes the steps that after a first device faults and is restarted, all data files required to be subjected to data backup of the first device and data files conducting video storage of a second device are determined; for all the data files required to be subjected to data backup of the first device, based on judgment results of all the data files, the first device is controlled to conduct data backup operation corresponding to the judgment results to complete backup of all the data files, and the consistency of video data storage in the first device and the second device is guaranteed; for the data files conducting video storage of the second device, when the data files are completely stored, the first device is controlled, the first device and the second device are simultaneously switched to the next data file for video storage to recover the normal synchronous storage state of the first device, the second device conducting video storage cannot be required to be interrupted accordingly, and the real-time performance of video storage is guaranteed.

Description

A kind of method and system for recovering data syn-chronization backup
Technical field
The present invention relates to technical field of data storage, is to be related to a kind of side of recovery data syn-chronization backup in particular Method and system.
Background technology
At present, Video Storage System typically carries out video storage using two-node cluster hot backup technology, and two-node cluster hot backup is to be Two equipment are used during system operation, the data file of each self-configuring of two equipment is identical, wherein two equipment pair Answer and identical data file is used for synchronously receiving and store identical video data, whenever two equipment storage completely data After file, backed up immediately, i.e., two equipment compare two numbers as standard, in order with the respective video data for storing respectively According to the video data that document memory is stored up, the video data that two data files are each lacked is determined, mutually transmission is lacked each other Video data, to ensure that the video data of two device data document memory storages is identical, while two equipment are switched to down One data file then carries out video storage.
In the Video Storage System based on two-node cluster hot backup, the feelings of a wherein device fails are occurred unavoidably Condition, when wherein one equipment is the first device fails, then two equipment can stop two-node cluster hot backup, and the second equipment connects Carries out video storage, and after the first equipment for breaking down restarts, the video data that two equipment is each stored will go out Existing inconsistent and nonsynchronous problem, generally requires and interrupts the second equipment for carrying out video storage, with for breaking down One equipment completes to be not backed up after the backup again of data file, then recover simultaneously the normal video of two equipment synchronously storage with it is standby Part, but take this measure, it is impossible to guarantee the real-time that video is stored.
The content of the invention
The technical problem to be solved is to provide a kind of method of recovery data syn-chronization backup, so that first sets It is standby to carry out the second equipment of video storage without the need for interruption after failure is restarted, realize and the storage of the second equipment video data Uniformity and with the second equipment video storage it is synchronous, it is ensured that video storage real-time.
The present invention also provides a kind of system of recovery data syn-chronization backup, to ensure said method realization in practice And application.
A kind of method for recovering data syn-chronization backup, including:
It is after the first equipment fault is restarted, the first equipment and the second equipment is each self-recording current with regard to data file Status information is compared, and determines that the first equipment needs to carry out each data file of data backup, and the second equipment is Carry out the data file of video storage;
The equipment of real-time monitoring second is carrying out the data file state of video storage;For the first equipment, any one is needed The data file of data backup is carried out, judges that the data file whether there is and when the data file exists in the first equipment In the presence of in first equipment, the data file is in the corresponding initial recording time of the second equipment and the data file in the first equipment Whether the difference of corresponding initial recording time is more than default threshold value;
When the data file storage that the second equipment is carrying out video storage is completed, the first equipment of control is simultaneously with second Equipment is switched to next data file and carries out video storage, to recover the normal synchronization storage state of the first equipment;When first When equipment needs to carry out the data file of data backup and all judges to complete, based on judged result, the first equipment of control perform with The corresponding data backup operation of the judged result.
Above-mentioned method, it is preferred that described based on judged result, the first equipment of control performs relative with the judged result The data backup operation answered includes:
For any one needs to carry out the data file of data backup, at the beginning of the data file is corresponding in the second equipment Record time beginning and the data file when the difference of the corresponding initial recording time of the first equipment is more than default threshold value, control First equipment to the second equipment sends the instruction of the first data acquisition, to obtain the second equipment in the video that stored of the data file Data carry out covering backup.
Above-mentioned method, it is preferred that described based on judged result, the first equipment of control performs relative with the judged result The data backup operation answered includes:
For any one needs to carry out the data file of data backup, at the beginning of the data file is corresponding in the second equipment Record time beginning and the data file judge when the difference of the corresponding initial recording time of the first equipment is less than default threshold value The video data of the data file memory storage whether there is distortion data in first equipment;
When the video data of the data file memory storage in the first equipment does not have distortion data, then with the second equipment The video data of the data file storage is standard, and the video data that the data file in the first equipment is stored sets with second The video data that the data file is stored in standby is compared, and determines what is lacked in the corresponding data file of the first equipment Video data;Control the first equipment and send the instruction of the second data acquisition to the second equipment, to obtain the first equipment in data text The video data lacked in part is backed up;
When the video data of the data file memory storage in the first equipment has distortion data, then by the distortion data Delete, the video data of the data file storage is stored the data file in the first equipment as standard with the second equipment The video data that stored with the data file in the second equipment of video data compare, determining that the first equipment is corresponding should The video data lacked in data file;Control the first equipment and send the instruction of the 3rd data acquisition to the second equipment, to obtain The video data lacked in the data file in first equipment is backed up.
Above-mentioned method, it is preferred that described based on judged result, the first equipment of control performs relative with the judged result The data backup operation answered includes:
For any one needs to carry out the data file of data backup, when the data file does not exist in the first equipment When, control the first equipment to the second equipment send the 4th data acquisition instruction, to obtain the second equipment in the data file deposited The video data of storage carries out covering backup.
Above-mentioned method, it is preferred that also include:
When the first equipment is switched to next data file with the second equipment carries out video storage simultaneously, control first sets It is standby to send the instruction of the 5th data acquisition to the second equipment, to obtain the video data in the data file that the second equipment has just been stored Carry out covering backup.
A kind of system for recovering data syn-chronization backup, including:
Determining unit, for after the first equipment fault is restarted, by the first equipment and the second equipment it is each it is self-recording with regard to The current status information of data file is compared, and determines that the first equipment needs to carry out each data file of data backup, with And second equipment carrying out the data file of video storage;
Monitoring judging unit, for the data file state that the equipment of real-time monitoring second is carrying out video storage;For Any one needs to carry out the data file of data backup first equipment, judges that the data file whether there is in the first equipment And in the presence of the data file is in the first equipment, the data file is in the corresponding initial recording time of the second equipment and is somebody's turn to do Whether data file is more than default threshold value in the difference of the corresponding initial recording time of the first equipment;
Control unit, when the data file storage for carrying out video storage when the second equipment is completed, control first Simultaneously be switched to next data file with the second equipment carries out video storage to equipment, is normally synchronously deposited with recovering the first equipment Storage state;When the data file that the first equipment needs to carry out data backup all judges to complete, based on judged result, control the One equipment performs the data backup operation corresponding with the judged result.
Above-mentioned system, it is preferred that control unit includes:
First control subelement, for needing to carry out the data file of data backup for any one, when data text Part the corresponding initial recording time of the second equipment and the data file the corresponding initial recording time of the first equipment difference During more than default threshold value, control the first equipment to the second equipment send the first data acquisition instruction, to obtain the second equipment in The video data that the data file is stored carries out covering backup.
Above-mentioned system, it is preferred that described control unit includes:
Judgment sub-unit, for needing to carry out the data file of data backup for any one, when the data file exists The corresponding initial recording time of second equipment and the data file are less than in the difference of the corresponding initial recording time of the first equipment During default threshold value, the video data for judging the data file memory storage in the first equipment whether there is distortion data;
, there is no distortion for working as the video data of the data file memory storage in the first equipment in the second control subelement According to when, then the video data of data file storage, as standard, the data file in the first equipment is deposited with the second equipment The video data that the video data of storage is stored with the data file in the second equipment is compared, and determines the number in the first equipment According to the video data lacked in file;Control the first equipment and send the instruction of the second data acquisition to the second equipment, to obtain the The video data lacked in the data file in one equipment is backed up;
, there is distortion data for working as the video data of the data file memory storage in the first equipment in the 3rd control subelement When, then the distortion data is deleted, with the second equipment the video data of data file storage as standard, by the first equipment In the video data that stored with the data file in the second equipment of the video data that stored of the data file compare, really The video data lacked in the corresponding data file of fixed first equipment;Control the first equipment and send the 3rd number to the second equipment According to instruction is obtained, obtain the video data lacked in the data file in the first equipment and backed up.
Above-mentioned system, it is preferred that described control unit includes:
4th control subelement, for needing to carry out the data file of data backup for any one, when data text When part does not exist in the first equipment, the first equipment of control to the second equipment sends the instruction of the 4th data acquisition, to obtain second The video data that the data file is stored in equipment carries out covering backup.
Above-mentioned system, it is preferred that also include:
Acquiring unit, for simultaneously being switched to next data file with the second equipment to carry out video storage when the first equipment When, the first equipment of control to the second equipment sends the instruction of the 5th data acquisition, and to obtain the second equipment the data for completing just have been stored Video data in file carries out covering backup.
Compared with prior art, the present invention includes advantages below:
The present invention provides a kind of method for recovering data syn-chronization backup, including:After the first equipment fault is restarted, is determined One equipment needs each data file for carrying out data backup, and the second equipment carrying out the data file of video storage; For the first equipment needs to carry out each data file of data backup, based on the judged result to each data file, control Make the first equipment and perform the data backup operation corresponding with the judged result, to complete to the standby of each data file Part, it is ensured that the uniformity of video data storage in the first equipment and the second equipment;For the second equipment is carrying out video storage Data file, when the data file storage is completed, the first equipment of control is switched to next data with the second equipment simultaneously File carries out video storage, to recover the normal synchronization storage state of the first equipment, so as to after the first equipment fault is restarted, and can So that the second equipment of ongoing video storage need not be interrupted, realize uniformity with the storage of the second equipment video data and It is synchronous with the storage of the second equipment video, it is ensured that the real-time of video storage.
Certainly, the arbitrary product for implementing the present invention it is not absolutely required to while reaching all the above advantage.
Description of the drawings
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this Inventive embodiment, for those of ordinary skill in the art, on the premise of not paying creative work, can be with basis The accompanying drawing of offer obtains other accompanying drawings.
A kind of method flow diagram of recovery data syn-chronization backup method that Fig. 1 is provided for the present invention;
A kind of structural representation of recovery data syn-chronization standby system that Fig. 2 is provided for the present invention;
A kind of another structural representation of recovery data syn-chronization standby system that Fig. 3 is provided for the present invention;
A kind of structural representation of Video Storage System based on two-node cluster hot backup that Fig. 4 is provided for the present invention;
A kind of flow process of Video Storage System failure method for restarting based on two-node cluster hot backup that Fig. 5 is provided for the present invention is shown It is intended to;
Fig. 6 is not backed up the method flow diagram of file for a kind of synchronization that the present invention is provided;
The method flow diagram that Fig. 7 is just being stored for a kind of synchronization that the present invention is provided in video.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than the embodiment of whole.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made Embodiment, belongs to the scope of protection of the invention.
With reference to Fig. 1, show a kind of method for recovering data syn-chronization backup provided in an embodiment of the present invention, this method is held Row main body can be the first equipment;Methods described includes:
Step S101:It is after the first equipment fault is restarted, the first equipment and the second equipment is each self-recording with regard to data The current status information of file is compared, and determines that the first equipment needs to carry out each data file of data backup, Yi Ji Two equipment are carrying out the data file of video storage;
In the method that the present invention is provided, after the first equipment fault is restarted, the first equipment and the second equipment are each remembered The status information current with regard to data file of record is compared, and determines that the first equipment needs to carry out each data of data backup File, and the second equipment carrying out the data file of video storage;Wherein, the current status information of data file can be wrapped Include:Storage state and Status of Backups etc., storage state can be to store, do not store or store;Status of Backups can be with To back up, being not backed up or backing up;First equipment needs to carry out each data file of data backup can include the One equipment does not complete the file of data backup when failure occurs and does not carry out relative to the second equipment during failure occurs The data file of video storage.
For example, after the first equipment fault is restarted, the data file status information of its record is:
Data file 1, stores, is not backed up;Data file 2, stores, backs up;Data file 3, stores, It is not backed up.
Second equipment record data file status information be:
Data file 1, stores, is not backed up;Data file 2, stores, backs up;Data file 3, stores, not Backup;Data file 4, stores, is not backed up;Data file 5, stores, and is not backed up.
Then by comparing the first equipment and each self-recording data file status information of the second equipment, it may be determined that data text Part 1, data file 2, data file 3, data file 4 need to carry out the file of data backup, wherein data text for the first equipment Part 1, data file 2, data file 3 are the file that the first equipment does not complete data backup when failure occurs, and data file 4 is First equipment does not carry out the data file of video storage during failure generation relative to the second equipment;And can determine data File 5 is the data file that the second equipment is carrying out video storage.
Step S102:The equipment of real-time monitoring second is carrying out the data file state of video storage;For the first equipment Any one needs the data file for carrying out data backup, judges that the data file whether there is in the first equipment and work as and is somebody's turn to do In the presence of data file is in the first equipment, the data file is in the corresponding initial recording time of the second equipment and the data file Whether it is more than default threshold value in the difference of the corresponding initial recording time of the first equipment;
In the present invention, whether the equipment of real-time monitoring second is carrying out the data file of video storage and stores and complete;It is right In the first equipment, any one needs the data file for carrying out data backup, judges whether the data file deposits in the first equipment When not existing, representing that the data file is the data file that the first equipment does not carry out video storage during failure, then directly Obtain and take the video data that the data file is stored in the second equipment and carry out covering backup;When the data file is in the first equipment In in the presence of, judge that the data file is corresponding in the first equipment with the data file in the corresponding initial recording time of the second equipment The difference of initial recording time whether be more than default threshold value, if being more than default threshold value, then it represents that the first equipment occur therefore The time of barrier is long, then the video data that the data file is stored in the equipment of direct access second carries out covering backup;If Less than default threshold value, it is determined that the video data that the data file is not received during failure in the first equipment, and from second Equipment obtains the video data not received and is backed up.
Step S103:When the data file storage that the second equipment is carrying out video storage is completed, the first equipment is controlled Simultaneously being switched to next data file with the second equipment carries out video storage, and to recover the first equipment shape is normally synchronously stored State;When the first equipment needs the data file for carrying out data backup all to judge to complete, based on judged result, control first sets It is standby to perform the data backup operation corresponding with the judged result.
The recovery data syn-chronization backup method provided by the application present invention, after the first equipment fault is restarted, determines the One equipment needs each data file for carrying out data backup, and the second equipment carrying out the data file of video storage; For the first equipment needs to carry out each data file of data backup, based on the judged result to each data file, control Make the first equipment and perform the data backup operation corresponding with the judged result, to complete to the standby of each data file Part, it is ensured that the uniformity of video data storage in the first equipment and the second equipment;For the second equipment is carrying out video storage Data file, when the data file storage is completed, the first equipment of control is switched to next data with the second equipment simultaneously File carries out video storage, to recover the normal synchronization storage state of the first equipment, so as to after the first equipment fault is restarted, and can So that the second equipment of ongoing video storage need not be interrupted, realize uniformity with the storage of the second equipment video data and It is synchronous with the storage of the second equipment video, it is ensured that the real-time of video storage.
In the method that the present invention is provided, described based on judged result, the first equipment of control is performed and the judged result Corresponding data backup operation includes:
For any one needs to carry out the data file of data backup, at the beginning of the data file is corresponding in the second equipment Record time beginning and the data file when the difference of the corresponding initial recording time of the first equipment is more than default threshold value, control First equipment to the second equipment sends the instruction of the first data acquisition, to obtain the second equipment in the video that stored of the data file Data carry out covering backup.
In the method that the present invention is provided, described based on judged result, the first equipment of control is performed and the judged result Corresponding data backup operation includes:
For any one needs to carry out the data file of data backup, at the beginning of the data file is corresponding in the second equipment Record time beginning and the data file judge when the difference of the corresponding initial recording time of the first equipment is less than default threshold value The video data of the data file memory storage whether there is distortion data in first equipment;
When the video data of the data file memory storage in the first equipment does not have distortion data, then with the second equipment The video data of the data file storage is standard, and the video data that the data file in the first equipment is stored sets with second The video data that the data file is stored in standby is compared, and determines what is lacked in the corresponding data file of the first equipment Video data;Control the first equipment and send the instruction of the second data acquisition to the second equipment, to obtain the first equipment in data text The video data lacked in part is backed up;
When the video data of the data file memory storage in the first equipment has distortion data, then by the distortion data Delete, the video data of the data file storage is stored the data file in the first equipment as standard with the second equipment The video data that stored with the data file in the second equipment of video data compare, determining that the first equipment is corresponding should The video data lacked in data file;Control the first equipment and send the instruction of the 3rd data acquisition to the second equipment, to obtain The video data lacked in the data file in first equipment is backed up.
In the method that the present invention is provided, described based on judged result, the first equipment of control is performed and the judged result Corresponding data backup operation includes:
For any one needs to carry out the data file of data backup, when the data file does not exist in the first equipment When, control the first equipment to the second equipment send the 4th data acquisition instruction, to obtain the second equipment in the data file deposited The video data of storage carries out covering backup.
In the method that the present invention is provided, also include:
When the first equipment is switched to next data file with the second equipment carries out video storage simultaneously, control first sets It is standby to send the instruction of the 5th data acquisition to the second equipment, to obtain the video data in the data file that the second equipment has just been stored Carry out covering backup.
Corresponding with Fig. 1 methods describeds, present invention also offers a kind of recover data syn-chronization standby system, its structure is shown It is intended to as shown in Fig. 2 the system includes:
Determining unit 201, for after the first equipment fault is restarted, by the first equipment and each self-recording pass of the second equipment It is compared in the current status information of data file, determines that the first equipment needs to carry out each data file of data backup, And second equipment carrying out the data file of video storage;
Monitoring judging unit 202, for the data file state that the equipment of real-time monitoring second is carrying out video storage;It is right In the first equipment, any one needs the data file for carrying out data backup, judges whether the data file deposits in the first equipment And when the data file in the first equipment in the presence of, the data file the corresponding initial recording time of the second equipment with Whether the data file is more than default threshold value in the difference of the corresponding initial recording time of the first equipment;
Control unit 203, when the data file storage for carrying out video storage when the second equipment is completed, control the Simultaneously be switched to next data file with the second equipment carries out video storage to one equipment, normally synchronous to recover the first equipment Storage state;When the first equipment needs the data file for carrying out data backup all to judge to complete, based on judged result, control First equipment performs the data backup operation corresponding with the judged result.
The recovery data syn-chronization backup method provided by the application present invention, after the first equipment fault is restarted, determines the One equipment needs each data file for carrying out data backup, and the second equipment carrying out the data file of video storage; For the first equipment needs to carry out each data file of data backup, based on the judged result to each data file, control Make the first equipment and perform the data backup operation corresponding with the judged result, to complete to the standby of each data file Part, it is ensured that the uniformity of video data storage in the first equipment and the second equipment;For the second equipment is carrying out video storage Data file, when the data file storage is completed, the first equipment of control is switched to next data with the second equipment simultaneously File carries out video storage, to recover the normal synchronization storage state of the first equipment.
Fig. 3 shows the another structural representation for recovering data syn-chronization backup of present invention offer, described control unit 203 Including:
First control subelement 2031, for needing to carry out the data file of data backup for any one, when the number According to file in the corresponding initial recording time of the second equipment and the data file in the corresponding initial recording time of the first equipment When difference is more than default threshold value, the first equipment of control to the second equipment sends the instruction of the first data acquisition, is set with obtaining second The video data that the data file is stored in standby carries out covering backup.
Specifically, described control unit 203 includes:
Judgment sub-unit 2032, for needing to carry out the data file of data backup for any one, when data text Part the corresponding initial recording time of the second equipment and the data file the corresponding initial recording time of the first equipment difference During less than default threshold value, the video data for judging the data file memory storage in the first equipment whether there is distortion data;
, there is no mistake for working as the video data of the data file memory storage in the first equipment in the second control subelement 2033 During true data, then with the second equipment the video data of data file storage as standard, by the data file in the first equipment The video data that the video data for being stored is stored with the data file in the second equipment is compared, in determining the first equipment The video data lacked in the data file;Control the first equipment and send the instruction of the second data acquisition to the second equipment, to obtain Take the video data lacked in the data file in the first equipment to be backed up;
, there is distortion for working as the video data of the data file memory storage in the first equipment in the 3rd control subelement 2034 During data, then the distortion data is deleted, with the second equipment the video data of data file storage as standard, by first The video data that the video data that the data file is stored in equipment is stored with the data file in the second equipment is compared It is right, determine the video data lacked in the corresponding data file of the first equipment;Control the first equipment to send to the second equipment 3rd data acquisition is instructed, and is obtained the video data lacked in the data file in the first equipment and is backed up.
Specifically, described control unit 203 includes:
4th control subelement 2035, for needing to carry out the data file of data backup for any one, when the number When not existing in the first equipment according to file, the first equipment of control to the second equipment sends the instruction of the 4th data acquisition, to obtain The video data that the data file is stored in second equipment carries out covering backup.
Accordingly, the system also includes:
Acquiring unit 204, for simultaneously being switched to next data file with the second equipment to carry out video when the first equipment During storage, the first equipment of control to the second equipment sends the instruction of the 5th data acquisition, to obtain what the just storage of the second equipment was completed Video data in data file carries out covering backup.
With reference to Fig. 4, the structural representation of the Video Storage System based on two-node cluster hot backup of present invention offer is shown.
Wherein, two-shipper realizes Hot Spare each other, and all software and hardware configuration all sames of two equipment are (including the text of data file Part name), and while receiving same video source carries out real-time video storage.Wherein,
(1) video adopts regular length document storage mode, frame of video to store in the data file, video frame information storage In indexed file, data file information is present in general act table.
" general act table " interior information is stored with the form of regular length, including:" data file path ", " index data text Part path ", " record time started ", " record end time ", " data record size ", " index record size ", " file Using mark " (0 represent be not used, 1 represent be currently in use, 2 represent use), " backup mark " (0 represent be not backed up, 1 represents Back up, 2 represent back up) etc. 8 elementary fields.
(2) in the case of normal, two equipment are by carrying out video storage and common dual-locomotive heat under " video storage modules " Backup.
(3) letter A is used, B is distinguishing the relevant software and hardware configuration (including the filename of data file) of two equipment.
With reference to Fig. 5, a kind of Video Storage System failure side of restarting based on two-node cluster hot backup of present invention offer is shown The schematic flow sheet of method.
Step S501:After equipment B is restarted, start " synchronization module B ", search " general act table " in " be currently in use, it is not standby The information of part " file, " use, backing up " file and " use, be not backed up " file, and generate " erropr message list B " It is sent to device A.
" erropr message list " interior information is stored with the form of regular length, including:" Data Filename ", " data file road Footpath ", " record time started ", " record end time ", " file uses mark " (0 represent be not used, 1 represent be currently in use, 2 Expression is used), " backup mark " (0 represent be not backed up, 1 represents and backs up, 2 represent back up) etc. 6 elementary fields.
In this example, it is assumed that " erropr message list B " is as shown in table 1.
The erropr message list B of table 1
Step S502:Device A is received after " erropr message list B ", is started " synchronization module A ", is generated " error message Table A " and is sent out It is sent to equipment B.
In this example, it is assumed that " error message Table A " is as shown in table 2.
The error message Table A of table 2
Step S503:Equipment B is received after " error message Table A ", and device A, B proceed by synchronization.
Step S504:The data text that device A, B are not backed up by " being synchronously not backed up file module " backup during failure Part;Device A, B are by " synchronous just in storage file module " synchronous ongoing video storage.
Step S505:When device A, " being synchronously not backed up module " of B, " synchronous currently stored file module " are using simultaneously Stop, synchronously completing, failure is restarted and completed, device A, B continue normal video storage and common two-node cluster hot backup.
With reference to Fig. 6, a kind of synchronization for showing present invention offer is not backed up the method flow diagram of file, including:
Step S601:Device A contrasts " error message Table A " and " erropr message list B ", searches in " general act Table A " " Using, be not backed up " file, " use, backing up " file and " use, be not backed up " file information, generation " is backed up File information table ", and it is sent to equipment B.
" being backed up file information table " interior information is stored with the form of regular length, including:" Data Filename ", " data File is in the path of device A ", " data file is in the path of equipment B ", " action type " (0 represent normal backup, 1 represent cover Backup, 2 represent remove do not complete frame after normal backup) etc. 4 elementary fields.
Wherein, the generating process for being backed up file information table is as follows:
The data message of " using, be not backed up " in read error information Table A in order, it is assumed that the information sensing equipment Data file A of A, it is further assumed that data file A corresponding file in erropr message list B is data file B.
If there is no data file B in erropr message list B, the letter of " being backed up file information table " interpolation data file Breath, wherein " action type " is " covering backup ".
In this example, as table 2 the 4th row data file " 1 ", " being backed up file information table " information of generation is
Data Filename Data file is in the path of device A Data file is in the path of equipment B Action type
4 D:\4.txt D:\4.txt 1
If there is data file B in erropr message list B,
(1) if data file A is less than threshold value, and data file B with the difference of the beginning video time of data file B For " using, be not backed up ", then " file information table is backed up " and adds the information of the data file, wherein " action type " is " normal backup ".
In this example, as table 1 the 3rd row and table 2 the 3rd row data file " 3 ", generation " be backed up file letter Information is breath table "
Data Filename Data file is in the path of device A Data file is in the path of equipment B Action type
3 D:\3.txt D:\3.txt 0
(2) if data file A is less than threshold value, and data file B with the difference of the beginning video time of data file B State be " do not complete, be not backed up " or " complete, backing up ", then " be backed up file information table " and add data text The information of part B, wherein " action type " is " remove and do not complete normal backup after frame information ".
In this example, such as table 1 the 1st, the 1st of 2 rows and table 2 the, the data file " 1 " of 2 rows, " 2 ", generation " needs standby Part file information table " information is
Data Filename Data file is in the path of device A Data file is in the path of equipment B Action type
1 D:\1.txt D:\1.txt 2
2 D:\2.txt D:\2.txt 2
(3) if data file A is more than threshold value with the difference of the beginning video time of data file B, " it is backed up file Information table " adds the information of the data file, wherein " action type " is " covering ".
In this example, as table 1 the 4th row and table 2 the 5th row data file " 5 ", it is assumed that threshold value be " 00:00: 10 ", then " being backed up file information table " information for generating is
Data Filename Data file is in the path of device A Data file is in the path of equipment B Action type
5 D:\5.txt D:\5.txt 1
In this example, " being backed up file information table " for ultimately generating is as shown in table 3:
Table 3 is backed up file information table
Data Filename Data file is in the path of device A Data file is in the path of equipment B Action type
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:Equipment B is received after " being backed up file information table ", and device A, B proceed by the data being not backed up The synchronization of file.
Step S603:Device A, B send in order Backup Data or backup number according to " being backed up file information table " According to.
In step S603, the information of " being backed up file information table " is read in order, obtain " Data Filename ", " number According to file in the path of device A ", " data file is in the path of equipment B ", the information such as " action type ".If action type is " normal backup ", the i.e. data file to pointing to carry out the operation of the common two-node cluster hot backup of " video storage modules ";If behaviour It is " covering backup " as type, directly the content of the data file of sensing equipment A is covered the data file of sensing equipment B; If action type is " remove and do not complete normal backup after frame ", i.e., first delete not completing in the data file of sensing equipment B Frame, then carries out again the operation of the common two-node cluster hot backup of " video storage modules ".
Step S604:Synchronous " being not backed up file " completes, and terminates device A, " being synchronously not backed up file module " of B, terminates.
With reference to Fig. 7, show a kind of synchronization of present invention offer just in the method flow diagram of video storage, the method bag Include:
Step S701:Equipment B obtains the data text of " be currently in use, be not backed up " of device A according to " error message Table A " The information of part (hypothesis is data file A), to the corresponding data files of equipment B (hypothesis is data file B) video storage is carried out.
Step S702:Device A is stored to " data file A ", when " data file A " reach predetermined length it Afterwards, when preparing to be switched to next data file, to equipment B " switching command " is sent.
Step S703:Equipment B receives " switching command ", is switched to next data file, and to device A " switching is sent Successfully instruct ", then start " video storage modules B ", equipment B enters the storage of normal video and common two-node cluster hot backup.
Step S704:Device A is received after " handover success instruction ", and " data file A, B " of firm storage is entered with equipment B The operation of the common two-node cluster hot backup of row " video storage modules ".
Step S705:Synchronous " just in storage file success ", terminates device A, " synchronous just in storage file module " of B, Terminate.
It should be noted that each embodiment in this specification is described by the way of progressive, each embodiment weight Point explanation is all difference with other embodiment, between each embodiment identical similar part mutually referring to. For device class embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, related part ginseng See the part explanation of embodiment of the method.
Finally, in addition it is also necessary to explanation, herein, such as first and second or the like relational terms be used merely to by One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation Between there is any this actual relation or order.And, term " including ", "comprising" or its any other variant meaning Covering including for nonexcludability, so that a series of process, method, article or equipment including key elements not only includes that A little key elements, but also including other key elements being not expressly set out, or also include for this process, method, article or The intrinsic key element of equipment.In the absence of more restrictions, the key element for being limited by sentence "including a ...", does not arrange Except also there is other identical element in including the process of the key element, method, article or equipment.
For convenience of description, it is divided into various units with function when describing apparatus above to describe respectively.Certainly, this is being implemented The function of each unit can be realized in same or multiple softwares and/or hardware during invention.
A kind of recovery data syn-chronization backup method provided by the present invention and system are described in detail above, herein In apply specific case the principle and embodiment of the present invention be set forth, the explanation of above example is only intended to side Assistant solves the method for the present invention and its core concept;Simultaneously for one of ordinary skill in the art, according to the think of of the present invention Think, will change in specific embodiments and applications, in sum, it is right that this specification content should not be construed as The restriction of the present invention.

Claims (10)

1. it is a kind of to recover the method that data syn-chronization is backed up, it is characterised in that to include:
After the first equipment fault is restarted, by each self-recording state current with regard to data file of the first equipment and the second equipment Information is compared, and determines that the first equipment needs to carry out each data file of data backup, and the second equipment is carried out The data file of video storage;
The equipment of real-time monitoring second is carrying out the data file state of video storage;For the first equipment any one need into The data file of row data backup, judges that the data file whether there is and when the data file is first in the first equipment In the presence of in equipment, the data file is corresponding in the first equipment with the data file in the corresponding initial recording time of the second equipment The difference of initial recording time whether be more than default threshold value;
When the data file storage that the second equipment is carrying out video storage is completed, the first equipment of control simultaneously with the second equipment Being switched to next data file carries out video storage, to recover the normal synchronization storage state of the first equipment;When the first equipment When needing to carry out the data file of data backup and all judging to complete, based on judged result, the first equipment of control perform with it is described The corresponding data backup operation of judged result.
2. method according to claim 1, it is characterised in that described based on judged result, the first equipment of control perform with The corresponding data backup operation of the judged result includes:
For any one needs to carry out the data file of data backup, when the data file is in the corresponding initial note of the second equipment Record time and the data file when the difference of the corresponding initial recording time of the first equipment is more than default threshold value, control first Equipment to the second equipment sends the instruction of the first data acquisition, to obtain the second equipment in the video data that stored of the data file Carry out covering backup.
3. method according to claim 1, it is characterised in that described based on judged result, the first equipment of control perform with The corresponding data backup operation of the judged result includes:
For any one needs to carry out the data file of data backup, when the data file is in the corresponding initial note of the second equipment Record time and the data file judge first when the difference of the corresponding initial recording time of the first equipment is less than default threshold value The video data of the data file memory storage whether there is distortion data in equipment;
When the video data of the data file memory storage in the first equipment does not have distortion data, then with the number in the second equipment The video data stored according to file is standard, in the video data that the data file in the first equipment is stored and the second equipment The video data that the data file is stored is compared, and determines the video lacked in the corresponding data file of the first equipment Data;Control the first equipment and send the instruction of the second data acquisition to the second equipment, to obtain the first equipment in the data file The video data for being lacked is backed up;
When the video data of the data file memory storage in the first equipment has distortion data, then the distortion data is deleted Remove, the video data of the data file storage is stored the data file in the first equipment as standard with the second equipment The video data that video data is stored with the data file in the second equipment is compared, and determines the corresponding number of the first equipment According to the video data lacked in file;Control the first equipment and send the instruction of the 3rd data acquisition to the second equipment, to obtain the The video data lacked in the data file in one equipment is backed up.
4. method according to claim 1, it is characterised in that described based on judged result, the first equipment of control perform with The corresponding data backup operation of the judged result includes:
For any one needs to carry out the data file of data backup, when the data file does not exist in the first equipment, Control the first equipment and send the instruction of the 4th data acquisition to the second equipment, to obtain the second equipment in the data file stored Video data carries out covering backup.
5. method according to claim 1, it is characterised in that also include:
When the first equipment is switched to next data file with the second equipment to carry out video and store simultaneously, the first equipment of control to Second equipment sends the instruction of the 5th data acquisition, is carried out with obtaining the video data in the data file that the second equipment has just been stored Cover backup.
6. it is a kind of to recover the system that data syn-chronization is backed up, it is characterised in that to include:
Determining unit, it is for after the first equipment fault is restarted, the first equipment and the second equipment is each self-recording with regard to data The current status information of file is compared, and determines that the first equipment needs to carry out each data file of data backup, Yi Ji Two equipment are carrying out the data file of video storage;
Monitoring judging unit, for the data file state that the equipment of real-time monitoring second is carrying out video storage;For first Any one needs to carry out the data file of data backup equipment, judge the data file in the first equipment whether there is and In the presence of the data file is in the first equipment, the data file is in the corresponding initial recording time of the second equipment and the data Whether file is more than default threshold value in the difference of the corresponding initial recording time of the first equipment;
Control unit, when the data file storage for carrying out video storage when the second equipment is completed, controls the first equipment Simultaneously being switched to next data file with the second equipment carries out video storage, and to recover the first equipment shape is normally synchronously stored State;When the first equipment needs the data file for carrying out data backup all to judge to complete, based on judged result, control first sets It is standby to perform the data backup operation corresponding with the judged result.
7. system according to claim 6, it is characterised in that control unit includes:
First control subelement, for needing to carry out the data file of data backup for any one, when the data file exists The corresponding initial recording time of second equipment and the data file are more than in the difference of the corresponding initial recording time of the first equipment During default threshold value, control the first equipment to the second equipment send the first data acquisition instruction, to obtain the second equipment in the number The video data stored according to file carries out covering backup.
8. system according to claim 6, it is characterised in that described control unit includes:
Judgment sub-unit, for needing to carry out the data file of data backup for any one, when the data file is second The corresponding initial recording time of equipment and the data file the corresponding initial recording time of the first equipment difference less than default Threshold value when, judge the data file memory storage in the first equipment video data whether there is distortion data;
, there is no distortion data for working as the video data of the data file memory storage in the first equipment in the second control subelement When, then the video data of the data file storage, as standard, the data file in the first equipment is stored with the second equipment The video data that stored with the data file in the second equipment of video data compare, determine the data in the first equipment The video data lacked in file;Control the first equipment and send the instruction of the second data acquisition to the second equipment, to obtain first The video data lacked in the data file in equipment is backed up;
3rd control subelement, for when there is distortion data in the video data of the data file memory storage in the first equipment, Then the distortion data is deleted, with the second equipment the video data of data file storage as standard, by the first equipment The video data that the video data that the data file is stored is stored with the data file in the second equipment is compared, it is determined that The video data lacked in the corresponding data file of first equipment;Control the first equipment and send the 3rd data to the second equipment Instruction is obtained, the video data lacked in the data file in the first equipment is obtained and is backed up.
9. system according to claim 6, it is characterised in that described control unit includes:
4th control subelement, for needing to carry out the data file of data backup for any one, when the data file exists When not existing in the first equipment, the first equipment of control to the second equipment sends the instruction of the 4th data acquisition, to obtain the second equipment In the video data that stored of the data file carry out covering backup.
10. system according to claim 6, it is characterised in that also include:
Acquiring unit, for when the first equipment is switched to next data file with the second equipment and carries out video and store simultaneously, Control the first equipment and send the instruction of the 5th data acquisition to the second equipment, to obtain the second equipment the data file for completing just has been stored Interior video data carries out covering 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 true CN106648963A (en) 2017-05-10
CN106648963B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109684130A (en) * 2018-12-12 2019-04-26 网宿科技股份有限公司 The method and device of data backup between a kind of computer room
WO2019134358A1 (en) * 2018-01-02 2019-07-11 深圳市奥拓电子股份有限公司 Data transmission control method and control system and storage device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101208668A (en) * 2004-12-30 2008-06-25 伊姆西公司 Systems and methods for dynamic data backup
CN101453489A (en) * 2008-12-17 2009-06-10 上海爱数软件有限公司 Network additive storage device, data backup and data restoration method thereof
CN102325171A (en) * 2011-08-26 2012-01-18 杭州华三通信技术有限公司 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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101208668A (en) * 2004-12-30 2008-06-25 伊姆西公司 Systems and methods for dynamic data backup
CN101453489A (en) * 2008-12-17 2009-06-10 上海爱数软件有限公司 Network additive storage device, data backup and data restoration method thereof
CN102325171A (en) * 2011-08-26 2012-01-18 杭州华三通信技术有限公司 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

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨斌: "《信息安全技术发展与研究》", 31 January 2016, 电子科技大学出版社,出版日2016年1月 *

Cited By (3)

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

Also Published As

Publication number Publication date
CN106648963B (en) 2020-10-20

Similar Documents

Publication Publication Date Title
CN110209726A (en) Distributed experiment & measurement system system, method of data synchronization and storage medium
CN103546914B (en) A kind of method and device of the active and standby management of HSS
CN110807064B (en) Data recovery device in RAC distributed database cluster system
CN101763321B (en) Disaster-tolerant method, device and system
EP1325415A2 (en) Recovery of file system data in file servers with mirrored file system volumes
US20140108345A1 (en) Exchanging locations of an out of synchronization indicator and a change recording indicator via pointers
CN109799948B (en) Data storage method and device
CN108829787A (en) A kind of meta-data distribution formula system
CN103973727B (en) Method of data synchronization and device
CN103905220B (en) Data synchronizing processing method and system
CN104486387B (en) A kind of data synchronizing processing method and system
CN105589887A (en) Data processing method for distributed file system and distributed file system
CN107368485A (en) The management method and Database Systems of a kind of database
CN106648963A (en) Method and system for recovering data synchronous backup
WO2013091212A1 (en) Partition management method, device and system in distributed storage system
CN111198662A (en) Data storage method and device and computer readable storage medium
Lamport et al. Stoppable paxos
CN107704342A (en) A kind of snap copy method, system, device and readable storage medium storing program for executing
CN115481417A (en) Method for data snapshot, filing and complete recovery of uplink scheme based on chain
CN105550230B (en) The method for detecting and device of distributed memory system node failure
CN103176867A (en) Fast file differential backup method
US20120158652A1 (en) System and method for ensuring consistency in raid storage array metadata
CN108334060B (en) A kind of bus failure injection device
CN103092745A (en) Control method and control device of system log records
CN109325005A (en) A kind of data processing method and electronic equipment

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