CN113535469A - Switching method and switching system of disaster recovery database - Google Patents

Switching method and switching system of disaster recovery database Download PDF

Info

Publication number
CN113535469A
CN113535469A CN202110620990.9A CN202110620990A CN113535469A CN 113535469 A CN113535469 A CN 113535469A CN 202110620990 A CN202110620990 A CN 202110620990A CN 113535469 A CN113535469 A CN 113535469A
Authority
CN
China
Prior art keywords
data
connection
connection request
database
disaster recovery
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
CN202110620990.9A
Other languages
Chinese (zh)
Other versions
CN113535469B (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.)
Beijing Si Tech Information Technology Co Ltd
Original Assignee
Beijing Si Tech Information 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 Beijing Si Tech Information Technology Co Ltd filed Critical Beijing Si Tech Information Technology Co Ltd
Priority to CN202110620990.9A priority Critical patent/CN113535469B/en
Publication of CN113535469A publication Critical patent/CN113535469A/en
Application granted granted Critical
Publication of CN113535469B publication Critical patent/CN113535469B/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/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • 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

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 discloses a switching method and a switching system of a disaster recovery database, belonging to the technical field of database management, wherein the switching method comprises the following steps: intercepting a connection request when the disaster recovery database is switched; judging whether the connection request has the risk of data loss or not; if yes, returning interception information to a sender of the connection request; if not, the connection request is forwarded to the enabled database. By intercepting and analyzing the connection request, when the risk of data loss exists, the interception information is returned to the sender of the connection request, thereby avoiding wrong connection and wrong data and improving the use experience; and normal processing is carried out on the normal connection request without the risk of data loss, so that the continuity of database service is ensured.

Description

Switching method and switching system of disaster recovery database
Technical Field
The invention relates to the technical field of database management, in particular to a switching method and a switching system of a disaster recovery database.
Background
In order to ensure the continuity of the business, a main database (production database) and a standby database (disaster backup database) are usually provided. The problem of production continuity is solved through the disaster recovery database, when the production database fails, the production database is switched to the disaster recovery database to continue processing, and the disaster recovery database is usually kept in real-time replication with the production database. To improve the robustness of the system, the production database and disaster recovery database are typically located off-site.
However, in the prior art, the disaster recovery database and the production data are copied through an application layer protocol, so that the efficiency is generally low, a synchronous delay phenomenon exists, and the delay time is from several minutes to tens of minutes. Therefore, in the switching process, the disaster recovery database is caused to miss data in the delay time, and when the next production database is recovered, the data is synchronized again. This results in that the lost data in the delay time cannot be accessed or modified, resulting in abnormal services, such as incorrect services or repeated acceptance. The service exception further causes a great deal of maintenance problems such as complaints, data audit, exception handling and the like, which causes the service level to be reduced, the experience to be reduced and the operation and maintenance cost to be increased.
Disclosure of Invention
Aiming at the technical problems in the prior art, the invention provides a switching method and a switching system of a disaster recovery database, which return interception information to a sender of a connection request when data are in risk of being lost, thereby avoiding wrong connection and wrong data and improving use experience.
The invention discloses a switching method of a disaster recovery database, which comprises the following steps: intercepting a connection request when the disaster recovery database is switched; judging whether the connection request has the risk of data loss or not; if yes, returning interception information to a sender of the connection request; if not, the connection request is forwarded to the enabled database.
Preferably, the method for analyzing the risk of data loss comprises:
acquiring historical connection;
establishing analysis data according to historical connection, wherein the analysis data comprises connection data corresponding to the connection request within a certain time;
judging whether the time difference between the switching of the disaster recovery database and the last corresponding connection data is smaller than a first threshold value, wherein the first threshold value is larger than or equal to the synchronous time delay of the disaster recovery database;
if the time difference is smaller than the first threshold, the data is at risk of being lost.
Preferably, the type of the last connection data is modification data.
Preferably, the method for establishing the analysis data according to the historical connection comprises the following steps:
establishing an analysis data list, and analyzing historical connection by keying values;
judging whether the current historical connection has a corresponding record in the analysis data list;
and if the record exists, updating the time stamp of the record.
If no record exists, a new record is added, and the timestamp is saved.
Preferably, the key value includes any one or a combination of the following dimensions: user name, account, user ID, and cell phone number.
Preferably, the connection request includes a transaction request, and the handover method includes:
acquiring a user ID according to the intercepted connection request;
matching the user ID with a user ID of the analysis data;
if the matching is successful, judging whether the time difference between the switching of the disaster recovery database and the last corresponding connection data is smaller than a first threshold value;
if the time difference is smaller than the first threshold value, the data has a loss risk, and interception information is sent to a requester;
if the time difference is greater than or equal to the first threshold value, forwarding the connection request to the enabled database;
if the matching is unsuccessful, the connection request is forwarded to the enabled database.
The invention also provides a switching system for realizing the disaster recovery database switching method, which comprises an interception module and a risk evaluation module,
the intercepting module is used for intercepting a connection request when the disaster recovery database is switched;
the risk evaluation module is used for judging whether the connection request has the risk of data loss; if yes, returning interception information to a sender of the connection request; if not, the connection request is forwarded to the enabled database.
Preferably, the switching system further includes a gateway and a service management module, the interception module is disposed in the gateway, and the service management module is configured to manage the production database and the disaster recovery database.
Preferably, the switching system further comprises an acquisition module and a connection analysis module,
the acquisition module is arranged in the service management module and is used for acquiring historical connection;
the connection analysis module is used for establishing analysis data according to historical connection;
and the risk evaluation module is used for analyzing the risk of data loss according to the time difference between the switching of the disaster recovery database and the last connection of data.
Preferably, the analysis data within a certain time is loaded into the cache, and when the time difference between the switching of the disaster recovery database and the last connection data in the cache is smaller than the first threshold, the data is at risk of being lost.
Compared with the prior art, the invention has the beneficial effects that: by intercepting and analyzing the connection request, when the risk of data loss exists, the interception information is returned to the sender of the connection request, thereby avoiding wrong connection and wrong data and improving the use experience; and normal processing is carried out on the normal connection request without the risk of data loss, so that the continuity of database service is ensured.
Drawings
Fig. 1 is a flowchart of a method for switching disaster recovery databases according to the present invention;
FIG. 2 is a flow chart of a method of analyzing risk of data loss;
FIG. 3 is a logical block diagram of an analysis of risk of data loss;
FIG. 4 is a flow chart of a method of creating analytical data;
fig. 5 is a logic block diagram of the switching system of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
The invention is described in further detail below with reference to the attached drawing figures:
a method for switching a disaster recovery database, as shown in fig. 1, includes:
step 101: and intercepting the connection request when the disaster recovery database is switched. The disaster recovery database switching means that the production database is switched to the disaster recovery database, or the disaster recovery database is switched to the production database.
Step 102: and judging whether the connection request has the risk of data loss.
If yes, go to step 103: and returning the interception information to the sender of the connection request. The interception information alerts the sender of the connection request, for example, that there may be an anomaly in the data, suggesting that access be resumed for an extended period of time, etc.
If not, go to step 104: the connection request is forwarded to the enabled database.
By intercepting and analyzing the connection request, when the risk of data loss exists, the interception information is returned to the sender of the connection request, thereby avoiding wrong connection and wrong data and improving the use experience; and for the normal connection request without the risk of data loss, normal processing is carried out, and the continuity of database service is ensured.
As shown in fig. 2 and 3, in step 102, the method for analyzing the risk of data loss includes:
step 201: and acquiring historical connection. In a specific embodiment, a service management module is provided for receiving a connection request and managing a production database and a disaster recovery database, and the service management module collects historical connections when receiving and processing the connection request. The historical connection refers to a connection request processed by the service management module.
Step 202: and establishing analysis data according to historical connection, wherein the analysis data comprises connection data corresponding to the connection request within a certain time. E.g. connection data within 1 hour, the corresponding connection data refers to the connection data employed in the connection request, e.g. the connection request is used to query or modify the connection data.
Step 203: and judging whether the time difference between the switching of the disaster recovery database and the last corresponding connection data is smaller than a first threshold value, wherein the first threshold value is larger than the switching time delay of the disaster recovery database. In a specific embodiment, the synchronization time delay is 10 minutes, the first threshold is set to 30 minutes, that is, when the time difference between the last corresponding connection data and the disaster recovery database is less than 30 minutes, it is determined that there is a risk of data loss; and when the time difference is more than 30 minutes, judging that the connection is normal.
If the value is smaller than the first threshold value, go to step 204: and judging that the data is at risk of loss.
If the value is greater than or equal to the first threshold, go to step 205: and judging that the data is not lost at risk.
The switching time delay comprises synchronous delay of the disaster recovery database and the production database. In step 203, the type of the connection data may also be determined, and the last corresponding connection data is modification data, such as data addition, modification, and deletion; the connection data of the query class does not substantially influence the data in the database, so that the data can still be normally accessed.
In step 202, the method for establishing analysis data according to historical connection may include:
step 221: and analyzing the connection request according to the key value, and recording according to the time of the connection request to obtain statistical data.
Step 222: and obtaining analysis data within a certain time from the statistical data.
But not limited thereto, as shown in fig. 4, the analysis data may also be established in the following manner:
step 231: and establishing an analysis data list, and analyzing the historical connection by keying values. In a specific embodiment, the key value has any one or a combination of the following dimensions: a user name, an account, a user ID and a mobile phone number, and the connection request may be a transaction request, i.e. the method of the present invention may be applied to a transaction system. In a particular embodiment, historical connections are collected from the traffic management module.
Step 232: and judging whether the current historical connection has a corresponding record in the analysis data list.
If so, go to step 233: the timestamp of the record is updated.
If no record is recorded, go to step 234: add new records and save timestamps.
Thereby updating the analysis data list in real time.
The invention also provides a switching system for implementing the disaster recovery database switching method, as shown in fig. 5, including an interception module 11 and a risk assessment module 12,
the intercepting module 11 is configured to intercept a connection request when the disaster recovery database is switched;
the risk evaluation module 12 is configured to determine whether the connection request is at risk of data loss; if yes, returning interception information to a sender of the connection request; if not, the connection request is forwarded to the enabled database.
The switching system of the invention also comprises a gateway 1 and a service management module 2, wherein the interception module 11 is arranged in the gateway 1, and the service management module 2 is used for managing the production database 21 and the disaster recovery database 22. The service management module 2 is further provided with an acquisition module 23, the acquisition module is used for acquiring historical connection, that is, a connection request processed by the service management module is sent to the connection analysis module 3, the connection analysis module 3 is used for establishing analysis data 31 according to the historical connection, and the analysis data 31 includes connection data within a certain time. The risk evaluation module 12 is configured to analyze a risk of data loss according to a time difference between the disaster recovery database switching and the last connection data. In a specific embodiment, a matching rule is established according to the analysis data and the switching time point of the disaster recovery database, the connection request is matched with the matching rule, and when the connection request meets the matching rule, the risk of data loss is determined.
The analysis data or the matching rule can be loaded into the cache, and the risk of data loss is analyzed according to the time difference between the switching of the disaster recovery database and the last connection data in the cache.
Examples
Taking telecommunication service as an example, and user ID as a key value, when processing a transaction request, the switching method comprises the following steps:
step 301: the connection request is intercepted and the user ID is obtained from the connection request.
Step 302: and matching the user ID with the user ID of the analysis data. The analysis data is user transaction data in a certain time (such as 1 hour), and comprises a user ID, transaction time and transaction type.
If the matching is successful, go to step 303: and judging whether the time difference between the switching of the disaster recovery database and the last corresponding connection data (namely the last transaction of the user) is smaller than a first threshold value.
If the value is smaller than the first threshold, go to step 304: and (4) sending interception information to the requester when the data is at risk of loss.
If the time difference is greater than or equal to the first threshold, go to step 305: the connection request is forwarded to the enabled database. In a particular embodiment, the connection request is sent to the service management module, which distributes the connection request to the enabled database.
If the matching is not successful, go to step 305.
A business system carrying 3000 ten thousand users has about 1000 thousand daily transaction amount and is mainly concentrated in 8 hours in the day. In this scenario, the business system calculates the switching delay by 10 minutes during the disaster recovery switching process, and the traffic volume is about 20 ten thousand in 10 minutes, wherein about 2W (10%) of the non-query class is traded, which affects the normal trading demand of about 2W users. The audit and handling of such anomalous data takes at least about 3 days to complete and requires a significant amount of customer service and maintenance personnel to be invested.
After the method of the embodiment is adopted for analysis and interception, the user service within 10s to 1 minute can be accurately calculated, more than 90% of users can be accurately positioned and tracked, and service interception limitation and interception reminding can be performed in advance. The user satisfaction is improved, and the workload of system background maintenance processing is reduced.
The connection analysis module 3 may be deployed in an analysis cluster, and the production database and the disaster recovery database are deployed in an ESB cluster.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes will occur to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A switching method of a disaster recovery database is characterized in that the switching method comprises the following steps:
intercepting a connection request when the disaster recovery database is switched;
judging whether the connection request has the risk of data loss or not;
if yes, returning interception information to a sender of the connection request;
if not, the connection request is forwarded to the enabled database.
2. The handover method according to claim 1, wherein the analysis method of the risk of data loss comprises:
acquiring historical connection;
establishing analysis data according to historical connection, wherein the analysis data comprises connection data corresponding to the connection request within a certain time;
judging whether the time difference between the switching of the disaster recovery database and the last connection data is smaller than a first threshold value, wherein the first threshold value is larger than or equal to the synchronization time delay of the disaster recovery database;
if the time difference is smaller than the first threshold, the data is at risk of being lost.
3. The handover method according to claim 2, wherein the type of the last connection data is modification data.
4. The handover method according to claim 2, wherein the method of establishing analysis data based on historical connections comprises:
establishing an analysis data list, and analyzing historical connection by keying values;
judging whether the current historical connection has a corresponding record in the analysis data list;
if the record exists, updating the timestamp of the record;
if no record exists, a new record is added, and the timestamp is saved.
5. The handover method according to claim 4, wherein the key value comprises any one or a combination of the following dimensions: user name, account, user ID, and cell phone number.
6. The handover method according to claim 5, wherein the connection request comprises a transaction request, the handover method comprising:
obtaining a user ID from the intercepted connection request;
matching the user ID with a user ID of the analysis data;
if the matching is successful, judging whether the time difference between the switching of the disaster recovery database and the last corresponding connection data is smaller than a first threshold value;
if the time difference is smaller than the first threshold value, the data has a loss risk, and interception information is sent to a requester;
if the time difference is greater than or equal to the first threshold value, forwarding the connection request to the enabled database;
if the matching is unsuccessful, the connection request is forwarded to the enabled database.
7. A switching system for implementing the disaster recovery database switching method according to any one of claims 1 to 6, comprising an interception module and a risk assessment module,
the intercepting module is used for intercepting a connection request when the disaster recovery database is switched;
the risk evaluation module is used for judging whether the connection request has the risk of data loss; if yes, returning interception information to a sender of the connection request; if not, the connection request is forwarded to the enabled database.
8. The switching system according to claim 7, further comprising a gateway and a service management module, wherein the interception module is disposed in the gateway, and the service management module is configured to manage the production database and the disaster recovery database.
9. The switching system according to claim 8, further comprising an acquisition module and a connection analysis module,
the acquisition module is arranged in the service management module and is used for acquiring historical connection;
the connection analysis module is used for establishing analysis data according to historical connection;
and the risk evaluation module is used for analyzing the risk of data loss according to the time difference between the switching of the disaster recovery database and the last connection of data.
10. The switching system according to claim 9, wherein the analyzed data is loaded into the cache within a certain time, and when a time difference between the switching of the disaster recovery database and the last connection data in the cache is smaller than the first threshold, the data is at risk of being lost.
CN202110620990.9A 2021-06-03 2021-06-03 Switching method and switching system for disaster recovery database Active CN113535469B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110620990.9A CN113535469B (en) 2021-06-03 2021-06-03 Switching method and switching system for disaster recovery database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110620990.9A CN113535469B (en) 2021-06-03 2021-06-03 Switching method and switching system for disaster recovery database

Publications (2)

Publication Number Publication Date
CN113535469A true CN113535469A (en) 2021-10-22
CN113535469B CN113535469B (en) 2024-01-30

Family

ID=78095543

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110620990.9A Active CN113535469B (en) 2021-06-03 2021-06-03 Switching method and switching system for disaster recovery database

Country Status (1)

Country Link
CN (1) CN113535469B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090313311A1 (en) * 2008-06-12 2009-12-17 Gravic, Inc. Mixed mode synchronous and asynchronous replication system
US20100115332A1 (en) * 2008-11-06 2010-05-06 Weimin Zheng Virtual machine-based on-demand parallel disaster recovery system and the method thereof
CN105938490A (en) * 2016-04-14 2016-09-14 北京思特奇信息技术股份有限公司 Intelligent switching method and system for connecting web application system with data source
WO2018001061A1 (en) * 2016-06-28 2018-01-04 中国银联股份有限公司 Method, device and terminal for reducing system switching unavailable time of disaster recovery center
CN109117310A (en) * 2018-08-08 2019-01-01 中国建设银行股份有限公司 Realize disaster tolerance system, the method and device of data backup
CN109635039A (en) * 2018-11-23 2019-04-16 金色熊猫有限公司 Multiple data centers method of data synchronization and system
CN111506649A (en) * 2020-04-10 2020-08-07 深圳前海微众银行股份有限公司 Transaction data disaster tolerance switching method and device, computing device and storage medium
CN112817795A (en) * 2021-01-30 2021-05-18 北京奇保信安科技有限公司 Interface level database disaster recovery method and device and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090313311A1 (en) * 2008-06-12 2009-12-17 Gravic, Inc. Mixed mode synchronous and asynchronous replication system
US20100115332A1 (en) * 2008-11-06 2010-05-06 Weimin Zheng Virtual machine-based on-demand parallel disaster recovery system and the method thereof
CN105938490A (en) * 2016-04-14 2016-09-14 北京思特奇信息技术股份有限公司 Intelligent switching method and system for connecting web application system with data source
WO2018001061A1 (en) * 2016-06-28 2018-01-04 中国银联股份有限公司 Method, device and terminal for reducing system switching unavailable time of disaster recovery center
CN109117310A (en) * 2018-08-08 2019-01-01 中国建设银行股份有限公司 Realize disaster tolerance system, the method and device of data backup
CN109635039A (en) * 2018-11-23 2019-04-16 金色熊猫有限公司 Multiple data centers method of data synchronization and system
CN111506649A (en) * 2020-04-10 2020-08-07 深圳前海微众银行股份有限公司 Transaction data disaster tolerance switching method and device, computing device and storage medium
CN112817795A (en) * 2021-01-30 2021-05-18 北京奇保信安科技有限公司 Interface level database disaster recovery method and device and electronic equipment

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
XIU-JU LIU: "A brief analysis of the disaster recovery backup technology in Oracle database DataGuard", 《2010 2ND INTERNATIONAL CONFERENCE ON INDUSTRIAL AND INFORMATION SYSTEMS》, pages 234 - 236 *
孙滨: "证券行业灾难备份与恢复系统的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 11, pages 138 - 26 *
杨宗博: "文件级持续数据保护系统的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 3, pages 138 - 72 *
谭峰;孔冰;: "大连台电视播控系统中的数据库应用与维护", 《电视技术》, vol. 39, no. 04, pages 64 - 68 *

Also Published As

Publication number Publication date
CN113535469B (en) 2024-01-30

Similar Documents

Publication Publication Date Title
CN110765091B (en) Account checking method and system
US8559607B2 (en) Network assurance analytic system
EP3489877A1 (en) Risk identification method, client device, and risk identification system
CN110232565B (en) Resource clearing method, device, computer equipment and storage medium
US20210058509A1 (en) System and method for utilizing customer data in a communication system
US7912932B2 (en) Service request common object
CN114048217A (en) Incremental data synchronization method and device, electronic equipment and storage medium
CN115080546B (en) Enterprise data diagnosis system based on big data
CN111404737B (en) Disaster recovery processing method and related device
CN113535469B (en) Switching method and switching system for disaster recovery database
CN111061793A (en) Data processing system and method
CN115185710A (en) Transaction interface time consumption counting and early warning method
CN111274255B (en) Service data monitoring method and system, monitoring architecture, equipment and storage medium
CN105205168A (en) Exposure system based on Redis database and operation method thereof
CN115134213B (en) Disaster recovery method, device, equipment and storage medium
CN117764455B (en) Universal index management method and system for data
CN114637786B (en) Off-line calculation method for vehicle working hours and storage medium
CN117688055B (en) Insurance black product identification and response system based on correlation network analysis technology
CN113567721B (en) Power failure statistics method for intelligent ammeter
CN118069455A (en) Data real-time processing method and system
CN114647555B (en) Data early warning method, device, equipment and medium based on multi-service system
CN117112656A (en) Integrated information intelligent management system and method for scientific and technological volunteer service management
CN116881240A (en) Database-based data cleaning method and device, storage medium and electronic equipment
CN117333051A (en) Real-time performance computing system based on consumption Kafka+ offline compensation mechanism
CN117459467A (en) Flow analysis method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant