CN107943619A - A kind of method to guarantee data integrity under the conditions of database failure - Google Patents

A kind of method to guarantee data integrity under the conditions of database failure Download PDF

Info

Publication number
CN107943619A
CN107943619A CN201711296526.9A CN201711296526A CN107943619A CN 107943619 A CN107943619 A CN 107943619A CN 201711296526 A CN201711296526 A CN 201711296526A CN 107943619 A CN107943619 A CN 107943619A
Authority
CN
China
Prior art keywords
database
data
primary
standby
conditions
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.)
Withdrawn
Application number
CN201711296526.9A
Other languages
Chinese (zh)
Inventor
唐文静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Jinying Technology Co Ltd
Original Assignee
Sichuan Jinying Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Jinying Technology Co Ltd filed Critical Sichuan Jinying Technology Co Ltd
Priority to CN201711296526.9A priority Critical patent/CN107943619A/en
Publication of CN107943619A publication Critical patent/CN107943619A/en
Withdrawn legal-status Critical Current

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/1479Generic software techniques for error detection or fault masking

Abstract

The invention discloses a kind of method to guarantee data integrity under the conditions of database failure, it includes the following steps:S1:Standby database locally is being built, the backup as primary database;S2:When primary database service is broken down or when can not access, video recording service server directly writes data into standby database;S3:Check whether standby database there are data to need to migrate into primary database after primary database service recovery, if desired then directly recover record in standby database into primary database.The present invention is when primary database service is broken down or when can not access, use standby database temporal data, and recover data after primary database service recovery, it can ensure the integralities of data compared with multi-system resource and on the premise of influencing business function avoiding taking.

Description

A kind of method to guarantee data integrity under the conditions of database failure
Technical field
It is especially a kind of to guarantee data integrity under the conditions of database failure the present invention relates to video monitoring service field Method.
Background technology
With the rapid development of social economy and science and technology, requirement of the people to security precautions technology is also higher and higher, The video monitoring technological means important as one, has been more and more widely used.
Due to its particularity, its system platform run time runs without interruption video monitoring system when being all often 7*24 small To record various monitoring datas, data can be endlessly produced during system operation, these data can be roughly divided into Two classes, one kind are the multimedia audio-video data of media data, the i.e. generation such as front-end camera, the second class business datum, mainly It is made of video file index information, configuration information, facility information, business plan information etc..Ensure video recording in security protection business Data integrity is the most important thing of whole operation system, and storage video/audio is one critical function of video monitoring system; And another associated critical function is then:The video and audio Video data of storage needs can be by system normal queries tune With.Video and audio video recording will can normally be called by system and rely primarily on two kinds of data, 1. media file datas, mainly comprising audio and video Data, 2 media file index datas, equipment sources that the main position recorded comprising media file, period, data produce etc. Information.Above-mentioned secondary sources are typically all to carry out persistent storage by database service, and database service normal conditions Under be then made of independent node server or server cluster.System video recording service server utilizes Ethernet and database Service is attached interaction, and so as to write Streaming Media video file index, a typical video recording storage service flow is such as Shown in Fig. 2.
In fig. 2, normal conditions are interacted with the access of database service, generally are directly connected to count by video recording service server Serviced according to storehouse, video recording service server gets the real-time video/audio that video camera continually produces, and is produced by handling Video file and video file index data, are stored respectively in file-storage device and database.The system later stage is if desired Storage video recording is called then to need data firstly the need of the video file for needing to call by equipment and time segment acknowledgement, this process The file index data stored in storehouse can be realized.If in system operation, system database service is broken down In monitoring system in real time produce video file index data then can not normally preserve, such case can directly result in video file without Method is called by system normal queries.
The content of the invention
The purpose of the present invention is overcome the deficiencies in the prior art, there is provided one kind ensures under the conditions of database failure The method of data integrity, solves when system database service is broken down, and produces video file rope in monitoring system in real time The problem of argument evidence then can not be preserved normally, and video file can not be called by system normal queries.
The goal of the invention of the present invention is achieved through the following technical solutions, and one kind ensures number under the conditions of database failure According to the method for integrality, it includes the following steps:
S1:Standby database locally is being built, the backup as primary database;
S2:When primary database service is broken down or when can not access, video recording service server directly writes data into spare number According to storehouse;
S3:After primary database service recovery, check whether standby database there are data to need to migrate to primary database, if desired then Record in standby database is directly recovered into primary database.
Preferably, the standby database is operated on video recording service server.Certainly, standby database fortune Row is on other hardware facilities with recording a video service server independence.
Preferably, the table structure of the standby database and the table structure of primary database are consistent.
Preferably, the standby database is light-weight database.
The invention has the advantages that building standby database in recording service device, solve primary database service and occur During failure or when can not access, using standby database temporal data, and recover data after primary database service recovery, can be with Ensure the integralities of data compared with multi-system resource and on the premise of influencing business function avoiding taking.
Brief description of the drawings
The process chart of Fig. 1 present invention;
The data export structure figure of Fig. 2 present invention in normal state;
Fig. 3 present invention data export structure figure when primary database breaks down;
Data export structure figure of Fig. 4 present invention after the recovery of primary database service fault.
Embodiment
With reference to drawings and examples of the present invention, the technical solution in the embodiment of the present invention is carried out clearly and completely Description, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained without making creative work Example, belongs to the scope of protection of the invention.
The application is illustrated with reference to Figure of description.
As shown in Figure 1:A kind of method to guarantee data integrity under the conditions of database failure, includes the following steps:
Such as Fig. 2, under normal condition, video recording service server by Streaming Media video file and Streaming Media video file index data, It is stored respectively in file memory and primary database.
When primary database service is broken down or can not access, video recording service server directly writes index data Standby database, as shown in Figure 3;
Check whether standby database there are data to need to migrate into primary database after primary database service recovery, if in the presence of if Record in standby database is directly recovered into primary database, as shown in Figure 4.
When building standby database, its table structure is consistent with master data database table structure.
The standby database is operated on video recording service server, and the service server that can also operate in and record a video is only On other vertical hardware facilities.
The standby database is light-weight database.
The overall workflow of the present invention is as shown in Figure 1.
In order to implement the method to guarantee data integrity under the conditions of database failure, the present invention proposes one kind The system to guarantee data integrity under the conditions of database failure, including camera shooting terminal, video recording service server, video and audio file Memory, main database server and standby database server, video recording service server get video camera and continually produce Raw real-time video/audio, generates Streaming Media video file and Streaming Media video file index data, respectively by processing It is stored in file memory and primary database, when primary database service is broken down or can not be accessed, business service of recording a video Device is directly write data into local standby database server, and local preliminary data is reexamined after primary database service recovery Whether storehouse has data to need to migrate into primary database, if directly recovering the record in standby database to master data in the presence of if In storehouse.
The index data includes the equipment that position, period and the data that Streaming Media video file is recorded produce Source.
The standby database server shares a set of server hardware facility with video recording service server.
The only temporary Streaming Media video file index data of the standby database server, avoids taking compared with multisystem money Source and influence business function.
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly Enclose, therefore equivalent variations made according to the claims of the present invention, it is still within the scope of the present invention.

Claims (5)

1. a kind of method to guarantee data integrity under the conditions of database failure, it is characterized in that, it includes the following steps:
S1:Standby database locally is being built, the backup as primary database;
S2:When primary database service is broken down or when can not access, video recording service server directly writes data into spare number According to storehouse;
S3:After primary database service recovery, check whether standby database there are data to need to migrate to primary database, if desired then Record in standby database is directly recovered into primary database.
2. the method to guarantee data integrity as claimed in claim 1 under the conditions of database failure, it is characterized in that, it is described Standby database is operated on video recording service server.
3. the method to guarantee data integrity as claimed in claim 1 under the conditions of database failure, it is characterized in that, it is described Standby database is operated in and recorded a video on other hardware facilities of service server independence.
4. the method to guarantee data integrity as claimed in claim 1 under the conditions of database failure, it is characterized in that, it is described The table structure of standby database is consistent with the table structure of primary database.
5. the method to guarantee data integrity as claimed in claim 1 under the conditions of database failure, it is characterized in that, it is described Standby database is light-weight database.
CN201711296526.9A 2017-12-08 2017-12-08 A kind of method to guarantee data integrity under the conditions of database failure Withdrawn CN107943619A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711296526.9A CN107943619A (en) 2017-12-08 2017-12-08 A kind of method to guarantee data integrity under the conditions of database failure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711296526.9A CN107943619A (en) 2017-12-08 2017-12-08 A kind of method to guarantee data integrity under the conditions of database failure

Publications (1)

Publication Number Publication Date
CN107943619A true CN107943619A (en) 2018-04-20

Family

ID=61946292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711296526.9A Withdrawn CN107943619A (en) 2017-12-08 2017-12-08 A kind of method to guarantee data integrity under the conditions of database failure

Country Status (1)

Country Link
CN (1) CN107943619A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108762688A (en) * 2018-06-06 2018-11-06 北京世纪东方通讯设备有限公司 A kind of media stream storage method and device for video monitoring system
CN110309215A (en) * 2019-04-24 2019-10-08 厦门网宿有限公司 A kind of data processing method, system and metadata updates method, system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420577A (en) * 2008-11-07 2009-04-29 武汉烽火网络有限责任公司 Storage method for multimedia data and method for accurately positioning playback position
CN101483762A (en) * 2008-12-31 2009-07-15 中兴通讯股份有限公司 Platform video recording method, system and customer terminal
US20100318497A1 (en) * 2009-06-16 2010-12-16 Bmc Software, Inc. Unobtrusive Copies of Actively Used Compressed Indices
CN105446827A (en) * 2014-08-08 2016-03-30 阿里巴巴集团控股有限公司 Data storage method and device for database at failure
CN106919473A (en) * 2015-12-28 2017-07-04 阿里巴巴集团控股有限公司 A kind of data disaster recovery and backup systems and method for processing business
CN108089945A (en) * 2017-12-08 2018-05-29 四川金英科技有限责任公司 A kind of method and system to guarantee data integrity under the conditions of database failure

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420577A (en) * 2008-11-07 2009-04-29 武汉烽火网络有限责任公司 Storage method for multimedia data and method for accurately positioning playback position
CN101483762A (en) * 2008-12-31 2009-07-15 中兴通讯股份有限公司 Platform video recording method, system and customer terminal
US20100318497A1 (en) * 2009-06-16 2010-12-16 Bmc Software, Inc. Unobtrusive Copies of Actively Used Compressed Indices
CN105446827A (en) * 2014-08-08 2016-03-30 阿里巴巴集团控股有限公司 Data storage method and device for database at failure
CN106919473A (en) * 2015-12-28 2017-07-04 阿里巴巴集团控股有限公司 A kind of data disaster recovery and backup systems and method for processing business
CN108089945A (en) * 2017-12-08 2018-05-29 四川金英科技有限责任公司 A kind of method and system to guarantee data integrity under the conditions of database failure

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108762688A (en) * 2018-06-06 2018-11-06 北京世纪东方通讯设备有限公司 A kind of media stream storage method and device for video monitoring system
CN110309215A (en) * 2019-04-24 2019-10-08 厦门网宿有限公司 A kind of data processing method, system and metadata updates method, system

Similar Documents

Publication Publication Date Title
CN110569149B (en) Method for triggering Oracle disaster recovery automatic emergency switching based on fault detection
CN106933843A (en) database heartbeat detecting method and device
CN103995868B (en) The global transaction manager and transaction methods of Based on Distributed system
CN106777270A (en) A kind of Heterogeneous Database Replication parallel execution system and method based on submission point time line locking
CN103079061B (en) A kind of video tracking processes device and video link processes device
CN102214205A (en) Logical replication in clustered database system with adaptive cloning
CN104503863B (en) Kernel state and User space method for interchanging data for virtual container system disaster tolerance
CN105260314A (en) Memory leak monitoring method
CN107562883A (en) A kind of method and system of data syn-chronization
CN104021195A (en) Warning association analysis method based on knowledge base
CN107943619A (en) A kind of method to guarantee data integrity under the conditions of database failure
CN101415107A (en) A kind of reliable multilevel medium storage method
CN106549796A (en) Resource control method and host node that a kind of firmware space is downloaded
CN108089945A (en) A kind of method and system to guarantee data integrity under the conditions of database failure
CN109859068B (en) Power grid data real-time synchronization system based on resource pool technology
CN111427869A (en) Log system based on block chain
CN103207916B (en) The method and apparatus of metadata processing
CN114385760A (en) Method and device for real-time synchronization of incremental data, computer equipment and storage medium
CN108089944A (en) A kind of system to guarantee data integrity under the conditions of database failure
CN106897185A (en) A kind of method and device of output abnormality
US9747167B2 (en) Persistency free architecture
CN106855869A (en) A kind of methods, devices and systems for realizing database High Availabitity
CN106791932B (en) Distributed trans-coding system, method and device thereof
CN105045679B (en) A kind of DB Backup and restoration methods for financial management network system
CN115102862B (en) Automatic synchronization method and device for SDN 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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20180420