Data disaster recovery method and device, medium, electronic equipment and program product
By writing service data concurrently in multiple computer room storage services and checking data consistency, the data loss problem caused by master-slave switching is solved, and lossless disaster recovery and strong data consistency is achieved.
Patent Information
- Application Number
- CN202411849077.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-14
AI Technical Summary
The existing technology has the problem of data loss in the master-slave room disaster recovery scenario, especially in the host room island scenario. When the computer room disaster recovery is achieved through strong cutting of the slave library, some of the data in the road may be lost.
By obtaining the first service data from the service system and writing data concurrently to multiple computer room storage services, if the data in the computer room storage services exceeding the preset number, the write is determined to be successful to avoid data loss caused by master-slave handover.
Lossless disaster recovery is achieved, strong data consistency is ensured, on-the-go data loss caused by strong master-slave shutdown, and reduce the risk of fund loss of business systems when the main database is down.
Smart Images

Figure CN119621434A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data disaster recovery method, device, medium, electronic device and program product. Background Art
[0002] In related technologies, in order to avoid single point problems and capacity problems in data centers, multiple data centers are usually built in the same area. The general deployment architecture is that one main computer room carries write operations and multiple slave computer rooms carry read operations. Through master-slave synchronization, multiple copies of data are backed up to support computer room disaster recovery scenarios. However, the computer room disaster recovery supported by this architecture and deployment mode is lossy disaster recovery. If the main computer room is isolated, the computer room disaster recovery is achieved by forcibly switching the slave database, and some of the in-transit data may be lost. Summary of the invention
[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, the present disclosure provides a data disaster recovery method, including: obtaining first business data from a business system; concurrently writing the first business data to multiple computer room storage services; determining whether the first business data in more than a preset number of computer room storage services are consistent; if the first business data in more than a preset number of computer room storage services are consistent, determining that the first business data is successfully written to the multiple computer room storage services.
[0005] In a second aspect, the present disclosure provides a data disaster recovery device, including: a first acquisition module, used to acquire first business data from a business system; a writing module, used to concurrently write the first business data to multiple computer room storage services; a first determination module, used to determine whether the first business data in more than a preset number of computer room storage services are consistent; if the first business data in more than a preset number of computer room storage services are consistent, it is determined that the first business data is successfully written to the multiple computer room storage services.
[0006] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of any one of the methods described in the first aspect.
[0007] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of any one of the methods in the first aspect.
[0008] In a fifth aspect, the present disclosure provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods in the first aspect.
[0009] By adopting the above technical solution, the first business data is first obtained from the business system, and then the first business data is concurrently written to multiple computer room storage services. Then, if the first business data in more than a preset number of computer room storage services are consistent, it is determined that the first business data is successfully written to multiple computer room storage services. Therefore, in the entire data storage process, there is no master-slave switching problem in the related technology, which solves the problem of in-transit data loss caused by forced master-slave switching, thereby achieving lossless disaster recovery and ensuring strong data consistency. Moreover, it can also ensure that the business system (for example, a business system with strong consistency requirements for business data) can ensure that business data will not be lost or confused at a lower cost when the main database of the business system goes down, thereby avoiding financial losses in the business system. In addition, it can also be expanded horizontally according to the business throughput.
[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 The present invention is a flowchart of a data disaster recovery method according to an embodiment of the present invention.
[0012] Figure 2 This is another flow chart of a data disaster recovery method according to an embodiment of the present disclosure.
[0013] Figure 3 This is another flow chart of a data disaster recovery method according to an embodiment of the present disclosure.
[0014] Figure 4 It is a schematic block diagram of a data disaster recovery device according to an embodiment of the present disclosure.
[0015] Figure 5 This is another schematic block diagram of a data disaster recovery device according to an embodiment of the present disclosure.
[0016] Figure 6This is another schematic block diagram of a data disaster recovery device according to an embodiment of the present disclosure.
[0017] Figure 7 The present invention is an architectural diagram of a data disaster recovery device according to an embodiment of the present invention.
[0018] Figure 8 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0019] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0020] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0021] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0022] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0023] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0024] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0025] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0026] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0027] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0028] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0029] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0030] In related technologies, in order to avoid single-point problems and capacity problems in data centers, multiple data centers are usually built in the same area. The general deployment architecture is that one main computer room carries write operations and multiple slave computer rooms carry read operations. Multiple copies of data are backed up through master-slave synchronization to support computer room disaster recovery scenarios. However, the computer room disaster recovery supported by this architecture and deployment mode is lossy disaster recovery. If the main computer room is isolated and the computer room disaster recovery is achieved by forcibly cutting the slave database, some of the in-transit data may be lost. For e-commerce scenarios with financial transactions, the loss of transaction orders will cause losses to individuals or companies, which is unacceptable. Therefore, ensuring the strong consistency of data information in computer room disaster recovery scenarios is a problem that must be solved to ensure data security.
[0031] Figure 1 1 is a flow chart of a data disaster recovery method according to an embodiment of the present disclosure. The data disaster recovery method can be applied to various scenarios where data disaster recovery is required, such as business systems. Before the business system stores business data in the master database and slave database of the business system, the data disaster recovery method according to the embodiment of the present disclosure can be used to achieve strong consistency of the business data. Figure 1 As shown, the data disaster recovery method may include the following steps S11 to S14.
[0032] In step S11, first business data is acquired from the business system.
[0033] Business systems may include, for example, accounting systems, refund transaction systems, fund payment systems, etc.
[0034] The first business data is business data that needs to be stored to achieve data disaster recovery, for example, it can be various transaction data of the business system, including personal data, order data, payment data, logistics data, etc.
[0035] In step S12, the first business data is concurrently written to multiple computer room storage services.
[0036] The computer room storage service refers to various services used to implement storage functions, such as cache storage, persistent storage, etc. Cache storage has the characteristics of high performance and high throughput, and has minimal impact on the business system using the data disaster recovery method according to the embodiment of the present disclosure. For example, it will not affect the processing speed of the business system, and will not increase the business delay of the business system (for example, the increase in business delay does not exceed 10ms). If the computer room storage service adopts cache, the data disaster recovery method according to the embodiment of the present disclosure can be applied to short-term disaster recovery. If the computer room storage service adopts persistent storage, the data disaster recovery method according to the embodiment of the present disclosure can be applied to long-term disaster recovery.
[0037] In step S13, it is determined whether the first business data in the computer room storage service exceeding a preset amount is consistent.
[0038] For example, after writing the first business data concurrently to multiple computer room storage services, the first business data can be queried from the multiple computer room storage services to determine whether the first business data in more than a preset number of computer room storage services are consistent. The preset number is a value preset according to actual conditions, for example, half of all computer room storage services can be used as the preset number, or three quarters, three sevenths, etc. of all computer room storage services can be used as the preset number.
[0039] In step S14, if the first business data in more than a preset number of computer room storage services are consistent, it is determined that the first business data is successfully written to the multiple computer room storage services.
[0040] For example, the first business data in more than a preset number of computer room storage services being consistent may include that the first business data is queried from each computer room storage service, and more than a preset number of the queried first business data are consistent; it may also include that the first business data is not queried from every computer room storage service, but the number of computer room storage services for which the first business data is queried exceeds a preset number, and more than a preset number of the queried first business data are consistent.
[0041] By adopting the above technical solution, the first business data is first obtained from the business system, and then the first business data is concurrently written to multiple computer room storage services. Then, if the first business data in more than a preset number of computer room storage services are consistent, it is determined that the first business data is successfully written to multiple computer room storage services. Therefore, in the entire data storage process, there is no master-slave switching problem in the related technology, which solves the problem of in-transit data loss caused by forced master-slave switching, thereby achieving lossless disaster recovery and ensuring strong data consistency. Moreover, it can also ensure that the business system (for example, a business system with strong consistency requirements for business data) can ensure that business data will not be lost or confused at a lower cost when the main database of the business system goes down, thereby avoiding financial losses in the business system. In addition, it can also be expanded horizontally according to the business throughput.
[0042] In some embodiments, before the first business data is concurrently written to multiple computer room storage services as described in step S12, the data disaster recovery method according to the embodiment of the present disclosure may further include performing parameter verification on the first business data, such as verifying whether the unique business ID in the first business data is empty, whether the timestamp is empty, whether the user ID is empty, etc. If the parameter verification passes, the first business data is allowed to be concurrently written to multiple computer room storage services. If the parameter verification fails, the first business data is not allowed to be concurrently written to multiple computer room storage services, and the writing of the first business data fails, and the corresponding failure information can be written to the failure queue.
[0043] By performing parameter verification, the compliance of the first business data can be ensured.
[0044] In some embodiments, before the first business data is concurrently written to multiple computer room storage services in step S12, the data disaster recovery method according to the disclosed embodiment may further include: determining whether the business system is currently in a disaster recovery state and determining whether a preset type of user is hit according to the first business data, wherein the preset type of user is a user who has a write operation in the time period from the downtime of the main database of the business system to the completion of the switch from the main database to the slave database of the business system (hereinafter referred to as the business system disaster recovery time period); if it is determined that the business system is currently in a disaster recovery state and hits the preset type of user, the first business data is not written to the multiple computer room storage services. In addition, the corresponding failure information may also be written into the failure queue.
[0045] If at least one of the two conditions of "the business system is currently in a disaster recovery state" and "hitting a preset type of user" is not met, the first business data is concurrently written to multiple computer room storage services.
[0046] Whether the preset type of user is hit can be achieved in the following way: determine the user ID involved in the first business data based on the first business data, and then determine whether the user ID involved hits the preset type of user list. If it hits the preset type of user list, the user ID involved belongs to the preset type of user; if it does not hit the preset type of user list, the user ID involved does not belong to the preset type of user.
[0047] By adopting the above technical solution, it is possible to avoid inappropriate storage of data related to preset types of users during the disaster recovery period of the business system, thereby avoiding data inconsistency in the business system.
[0048] In some embodiments, before the first business data is concurrently written to multiple computer room storage services in step S12, the data disaster recovery method according to the embodiment of the present disclosure may further include: performing structured processing and serialization processing on the first business data. The structured processing may, for example, include constructing structured data, such as key-value data, based on the first business data and its unique business ID. The serialization processing may, for example, include compressing the constructed structured data, etc.
[0049] By adopting the above technical solution, it is possible to implement structured storage of the first business data in the computer room storage service and reduce the required storage space.
[0050] In some embodiments, the concurrent writing of the first business data to multiple computer room storage services in step S12 may include: determining a computer room storage service corresponding to a business type according to the business type of the first business data; and concurrently writing the first business data to the determined computer room storage service.
[0051] For example, different computer room storage services can be configured for different business systems, and different computer room storage services can also be configured for different types of business data of the same business system. For example, computer room storage services 1 to n are configured to business system A to store the business data of business system A, and computer room storage services n+1 to n+m are configured to business system B to store the business data of business system B. In this way, if the first business data is business data from business system A, it is determined that the first business data is stored by computer room storage services 1 to n.
[0052] By adopting the above technical solution, it is possible to configure mutually isolated computer room storage services for different business systems, for different types of business data of the same business system, etc., thereby ensuring the security of business data.
[0053] In some embodiments, the concurrent writing of the first business data to multiple computer room storage services described in step S12 may include: for each computer room storage service in the multiple computer room storage services, determining whether there is business data corresponding to the unique business ID of the first business data in the computer room storage service; if there is business data corresponding to the unique business ID of the first business data in the computer room storage service, not writing the first business data to the computer room storage service; if there is no business data corresponding to the unique business ID of the first business data in the computer room storage service, writing the first business data to the computer room storage service.
[0054] It should be noted that if different computer room storage services are configured for different business systems, or different computer room storage services are configured for different types of business data of the same business system, then the multiple computer room storage services here refer to computer room storage services determined according to the business type of the first business data.
[0055] By way of example, whether there is business data corresponding to the unique business ID of the first business data in the computer room storage service can be determined in the following manner: query the key in the computer room storage service; if there is a key in the computer room storage service that is identical to the key in the first business data, it is considered that there is business data corresponding to the unique business ID of the first business data in the computer room storage service.
[0056] By adopting the above technical solution, when there is business data corresponding to the unique business ID of the first business data in the computer room storage service, the first business data will not be written to the computer room storage service. In this way, it is possible to avoid the problem that the unique business ID in the same computer room storage service corresponds to different business data, resulting in inconsistent business data stored in the same computer room storage service.
[0057] In some embodiments, the data disaster recovery method according to the embodiment of the present disclosure may also include: determining the index data confirmation mark corresponding to the first business data, and concurrently writing the index data confirmation mark and the first business data to multiple computer room storage services, wherein the index data confirmation mark is used to indicate that the index data corresponding to the first business data has not yet been written to multiple computer room storage services.
[0058] It should be noted that if different computer room storage services are configured for different business systems, or different computer room storage services are configured for different types of business data of the same business system, then the multiple computer room storage services here refer to computer room storage services determined according to the business type of the first business data.
[0059] During concurrent writing, the index data confirmation mark can be written into the confirmation mark queue. To avoid hot spots in the confirmation mark queue, you can configure multiple confirmation mark queues and randomly select a confirmation mark queue to write the index data confirmation mark.
[0060] Since when storing the first business data in multiple computer room storage services, in addition to storing the first business data, it is also necessary to asynchronously store index data (for example, timestamp index, preset type user index, etc.), so in order to ensure that after the first business data is successfully stored, the index data can also be asynchronously stored successfully, the first business data and its corresponding index data confirmation mark are synchronously written into multiple computer room storage services in an atomic manner, so that when the index data is subsequently asynchronously written, it can be determined whether the index data has been written successfully based on the index data confirmation mark. If there is an index data confirmation mark, it means that the corresponding index data has not been written successfully. If there is no index data confirmation mark, it means that the corresponding index data has been written successfully. In addition, by asynchronously writing the index data instead of writing it into the computer room storage service at the same time as the first business data, the impact on the performance of the business system can be reduced.
[0061] In some embodiments, the expiration time of the first business data in the computer room storage service can be set according to the maximum time for the master database to switch to the slave database when a disaster occurs in the business system and the disaster recovery time of the business system. For example, the expiration time can be the sum of the maximum time for the master database of the business system to switch to the slave database and the disaster recovery time of the business system.
[0062] The expiration time can be concurrently written into multiple computer room storage services together with the first business data.
[0063] By adopting the above-mentioned technical scheme, the data disaster recovery method according to the embodiment of the present disclosure can perform data disaster recovery for the scenario where the main database of the business system goes down in a short period of time, and can perform strong consistency recovery for the synchronization difference data of the master and slave databases caused by the downtime of the main database of the business system. Moreover, there is no need to store all business data for a long time, which greatly reduces the demand for the storage capacity of the computer room storage service.
[0064] Next, asynchronous storage of index data is described. Asynchronous storage means that the index data is not written into the computer room storage service at the same time as the first business data, but is written into the computer room storage service only after the first business data is written into the computer room storage service.
[0065] Index data can be written into the computer room storage service in the following manner. First, after the first business data in multiple computer room storage services are consistent, index data is constructed based on the first business data. The index data may include a timestamp index, a preset type user index, and the like. Then, the constructed index data is concurrently written into the computer room storage service storing the first business data. Then, if the index data in more than a preset number of computer room storage services in the computer room storage service storing the first business data are consistent, it is determined that the index data is written successfully, and the corresponding index data confirmation mark is deleted.
[0066] By adopting the above technical solution, the index data can be asynchronously written into the computer room storage service. By asynchronously writing the index data instead of writing it into the computer room storage service simultaneously with the first business data, the impact on the business system performance can be reduced.
[0067] In some embodiments, the data disaster recovery method according to the embodiment of the present disclosure may further include: writing into a failure queue failure information of inconsistent first business data in less than a preset number of computer room storage services, failure information of inconsistent first business data in more than a preset number of computer room storage services, failure information of inconsistent index data in less than a preset number of computer room storage services, and failure information of inconsistent index data in more than a preset number of computer room storage services.
[0068] To avoid hot spots when writing failure information to failure queues, you can configure multiple failure queues and randomly select a failure queue to write failure information to. Depending on the estimated query per second (QPS) of failure information, the number of failure queues can be hundreds or other numbers.
[0069] At this point, the process of writing the first business data to the storage services in multiple computer rooms is completed.
[0070] In the writing process described above, due to network jitter and other reasons, when writing to multiple data center storage services concurrently, more or less failures will occur, which is the failure information described above. Therefore, it is necessary to repair data for these failure information to ensure data consistency between multiple data center storage services. Next, the process of repairing data for multiple data center storage services based on failure information is described.
[0071] Figure 2 This is another flow chart of a data disaster recovery method according to an embodiment of the present disclosure. Figure 2 The data disaster recovery method shown is used to repair data in multiple computer room storage services. Figure 2 As shown, the data disaster recovery method may include the following steps S21 to S23.
[0072] In step S21, failure information is obtained from the failure queue.
[0073] In order to avoid hot spots, when multiple failure queues are configured, all failure queues can be grouped, and data repair is performed on a group of failure queues each time. The size of the group can be preset, such as 10 or other values. By performing data repair in groups, pressure on the storage service in the computer room can be avoided.
[0074] For a group of failure queues, failure information can be randomly obtained from the group of failure queues in batches.
[0075] In step S22, based on the acquired failure information, the business data to be repaired is queried from multiple computer room storage services.
[0076] In some embodiments, the business data to be repaired can be queried in the following manner. First, the unique business ID of the business data to be repaired is parsed from the acquired failure information. Then, the business type is determined based on the unique business ID. This is applicable to situations where isolated computer room storage services are configured for different business systems, for different types of business data of the same business system, etc. Then, the computer room storage service corresponding to the business type is determined based on the business type. Then, the business data to be repaired corresponding to the unique business ID is queried from the corresponding computer room storage service. In addition, since the failure information is randomly acquired in batches from a group of failure queues, that is, the number of acquired failure information is multiple, the number of unique business IDs parsed from these multiple failure information may also be multiple. Therefore, the unique business ID can also be grouped according to the business type, so that the business data to be repaired corresponding to multiple unique business IDs under the business type can be acquired in batches from the computer room storage service corresponding to the business type to perform batch data repair.
[0077] In step S23, according to the query results, if the business data to be repaired in more than a preset number of computer room storage services are consistent, or if there is business data to be repaired in less than a preset number of computer room storage services and the business data to be repaired is consistent, the consistent business data to be repaired is used to repair the business data to be repaired and the corresponding index data in multiple computer room storage services.
[0078] The repair can be achieved in the following way: generate index data based on the consistent business data to be repaired, where the index data includes a timestamp index and a preset type user index, and then write the consistent business data to be repaired and the corresponding index data into all corresponding computer room storage services. You can also use the consistent business data to be repaired and the corresponding index data to update only the computer room storage services with inconsistent business data to be repaired in the corresponding computer room storage services. If the repair is successful, the corresponding failure information can be deleted.
[0079] In addition, in the case that there is no more than a preset number of business data to be repaired in the storage service of the computer room that are consistent, and there are differences between these business data to be repaired, an alarm can be issued so that manual data comparison and business system side can be performed to repair the data. After the data is successfully repaired, the corresponding failure information can also be deleted.
[0080] By adopting the above technical solution, the function of data repair for multiple computer room storage services is realized, ensuring the data consistency of multiple computer room storage services.
[0081] In some embodiments, the process of performing data repair may further include: after performing a preset number of repair operations, if the number of failure information in the failure queue is greater than a preset number, an alarm is issued and / or corresponding business data in the computer room storage service associated with the failure information in the failure queue is deleted. The preset number is configurable, for example, it may be 5000 or other values.
[0082] Due to some reasons, a certain computer room storage service may be unavailable for a period of time. When the QPS of the business system is large, there will be a large amount of inconsistent business data in multiple computer room storage services. By adopting the above technical solution, this situation can be identified by comparing the number of failure information in the failure queue with the preset number. In addition, it is not necessary to check whether there is a large amount of inconsistent business data for each repair operation, but to perform a check after performing a preset number of repair operations, so as to avoid false detection. In addition, when deleting the corresponding business data in the computer room storage service associated with the failure information in the failure queue, comparison and repair can be performed later by time interval repair.
[0083] At this point, the process of data repair for multiple computer room storage services has been completed.
[0084] Next, the process of data playback for the business system, that is, the process of data recovery, is described. Figure 3 FIG. 1 is another flow chart of a data disaster recovery method according to an embodiment of the present disclosure, which is used to implement data playback of a business system. Figure 3 As shown, the data disaster recovery method may include the following steps S31 to S34.
[0085] In step S31, when the business system needs to perform data playback, a data playback task is obtained.
[0086] The business system needs to replay data when the master database of the business system is unavailable and the master-slave database is switched, that is, disaster recovery occurs. In this case, the business system needs to replay data according to the disaster recovery time period of the business system to repair the data differences between the master and slave databases that may exist during the disaster recovery time period and ensure data consistency between the master and slave databases.
[0087] In step S32, a playback time interval is determined according to the data playback task.
[0088] In step S33, the business data within the playback time interval in multiple computer room storage services are queried concurrently.
[0089] In order to improve the throughput of data playback, the playback time interval can be sliced according to the set time period. Data playback can be performed in parallel with multiple threads between time slices. The maximum number of threads for executing parallel data playback can be set through configuration, for example, it can be 20 or other values.
[0090] For each time slice, the business data within the time slice in multiple data center storage services is concurrently queried based on the timestamp index.
[0091] In addition, if the computer room storage service is determined according to the business type in the business data writing process, the corresponding computer room storage service capable of data playback is also determined according to the business type during data playback.
[0092] In step S34, if the business data queried in the computer room storage services exceeding the preset number are consistent, the queried business data is used to perform data playback on the business system.
[0093] In addition, if there is no business data that is consistent with the queried business data in the storage service of the computer room exceeding the preset number, the playback failure information is recorded.
[0094] When performing data playback, the configured business playback remote procedure call (RPC) service can be queried according to the business type, and then the business playback RPC service is called to perform data playback.
[0095] After the business data in all time slices are played back, you can first aggregate the number of successful or failed data playbacks in a single time slice, and then aggregate the number of successful or failed data playbacks in all time slices in the entire playback time interval, and generate the final status of the playback task, such as success, failure, partial success, etc., update the data playback task status and the number of successful and failed data playbacks, and complete this data playback task. In addition, if there is a data playback failure, you can replay the failed data separately after the cause of the failure is fixed.
[0096] By adopting the above technical solution, data playback of the business system can be achieved, ensuring data consistency between the master and slave databases of the business system.
[0097] Figure 4 1 is a schematic block diagram of a data disaster recovery device according to an embodiment of the present disclosure. The data disaster recovery device can be applied to various scenarios where data disaster recovery is required, such as business systems. Figure 4 As shown, the data disaster recovery device 40 may include: a first acquisition module 41, used to acquire first business data from a business system; a writing module 42, used to concurrently write the first business data to multiple computer room storage services; a first determination module 43, used to determine whether the first business data in more than a preset number of computer room storage services are consistent. If the first business data in more than a preset number of computer room storage services are consistent, it is determined that the first business data is successfully written to multiple computer room storage services.
[0098] By adopting the above technical solution, the first business data is first obtained from the business system, and then the first business data is concurrently written to multiple computer room storage services. Then, if the first business data in more than a preset number of computer room storage services are consistent, it is determined that the first business data is successfully written to multiple computer room storage services. Therefore, in the entire data storage process, there is no master-slave switching problem in the related technology, which solves the problem of in-transit data loss caused by forced master-slave switching, thereby achieving lossless disaster recovery and ensuring strong data consistency. Moreover, it can also ensure that the business system (for example, a business system with strong consistency requirements for business data) can ensure that business data will not be lost or confused at a lower cost when the main database of the business system goes down, thereby avoiding financial losses in the business system. In addition, it can also be expanded horizontally according to the business throughput.
[0099] Optionally, the data disaster recovery device 40 also includes a second determination module (not shown), which is used to determine whether the business system is currently in a disaster recovery state and determine whether a preset type of user is hit based on the first business data before the write module 42 concurrently writes the first business data to multiple computer room storage services, wherein the preset type of user is a user who has a write operation within a time period from the downtime of the main database of the business system to the completion of the switching of the main database to the slave database of the business system; if it is determined that the business system is currently in a disaster recovery state and the preset type of user is hit, the first business data is not written to the multiple computer room storage services.
[0100] Optionally, the writing module 42 concurrently writes the first business data to multiple computer room storage services, including: Determining, according to the business type of the first business data, a computer room storage service corresponding to the business type; The first business data is concurrently written to the determined computer room storage service.
[0101] Optionally, the writing module 42 concurrently writes the first business data to multiple computer room storage services, including: For each of the multiple computer room storage services, determining whether there is business data corresponding to the unique business ID of the first business data in the computer room storage service; If there is business data corresponding to the unique business ID of the first business data in the computer room storage service, the first business data is not written to the computer room storage service; If the business data corresponding to the unique business ID of the first business data does not exist in the computer room storage service, the first business data is written to the computer room storage service.
[0102] Optionally, the writing module 42 is also used to determine the index data confirmation mark corresponding to the first business data, and concurrently write the index data confirmation mark and the first business data into multiple computer room storage services, wherein the index data confirmation mark is used to indicate that the index data corresponding to the first business data has not yet been written into multiple computer room storage services.
[0103] Optionally, the writing module 42 is also used to: construct index data based on the first business data after the first business data in multiple computer room storage services are consistent; concurrently write the constructed index data into the computer room storage service storing the first business data; if the index data in more than a preset number of computer room storage services storing the first business data are consistent, determine that the index data is written successfully, and delete the corresponding index data confirmation mark.
[0104] Optionally, the writing module 42 is also used to write into the failure queue the failure information of inconsistency of the first business data in less than a preset number of computer room storage services, the failure information of inconsistency of the first business data in more than a preset number of computer room storage services, the failure information of inconsistency of index data in less than a preset number of computer room storage services, and the failure information of inconsistency of index data in more than a preset number of computer room storage services.
[0105] Figure 5 FIG. 1 is another schematic block diagram of a data disaster recovery device according to an embodiment of the present disclosure. Figure 5 As shown, the data disaster recovery device 40 also includes: a second acquisition module 44, used to obtain failure information from a failure queue; a first query module 45, used to query the business data to be repaired from multiple computer room storage services based on the acquired failure information; a repair module 46, used to repair the business data to be repaired and the corresponding index data in multiple computer room storage services using the consistent business data to be repaired based on the query result, if the business data to be repaired in more than a preset number of computer room storage services are consistent, or if the business data to be repaired exists in less than a preset number of computer room storage services and the business data to be repaired are consistent.
[0106] By adopting the above technical solution, the function of data repair for multiple computer room storage services is realized, ensuring the data consistency of multiple computer room storage services.
[0107] Optionally, the first query module 45 queries the service data to be repaired from multiple computer room storage services according to the acquired failure information, including: Parsing the unique service ID of the service data to be repaired from the acquired failure information; Determine the business type based on the unique business ID; Determine the computer room storage service corresponding to the business type according to the business type; Query the business data to be repaired from the corresponding data center storage service.
[0108] Optionally, the repair module 46 is also used to alarm and / or delete the corresponding business data in the computer room storage service associated with the failure information in the failure queue if the number of failure information in the failure queue is greater than a preset number after performing a preset number of repair operations.
[0109] Figure 6 FIG. 1 is another schematic block diagram of a data disaster recovery device according to an embodiment of the present disclosure. Figure 6As shown, the data disaster recovery device 40 also includes: a third acquisition module 47, used to obtain a data playback task when the business system needs to play back data; a third determination module 48, used to determine the playback time interval according to the data playback task; a second query module 49, used to concurrently query the business data within the playback time interval in multiple computer room storage services; a playback module 50, used to use the queried business data to play back data for the business system if the business data queried in more than a preset number of computer room storage services are consistent.
[0110] By adopting the above technical solution, data playback of the business system can be achieved, ensuring data consistency between the master and slave databases of the business system.
[0111] The specific implementation methods of the operations performed by each module in the data disaster recovery device according to the embodiment of the present disclosure have been described in detail in the relevant data disaster recovery method. For example, parameter verification, concurrent writing, determination of preset user types and disaster recovery status before concurrent writing, writing of index data, setting of expiration time, implementation methods of data repair, implementation methods of data playback, etc. have all been described in detail in the relevant data disaster recovery method and will not be repeated here.
[0112] Figure 7 FIG. 7 is an architecture diagram of a data disaster recovery device 40 according to an embodiment of the present disclosure. The data disaster recovery device 40 can be connected to a business system 60 and a computer room storage service. There are multiple computer room storage services, as shown in FIG. 7 , and the computer room storage service includes computer room storage services 701 to 70 n .
[0113] The business system 60 is a user of the data disaster recovery device 40 according to the embodiment of the present disclosure. The business system 60 requires strong consistency of business data when the main database of the business system 60 goes down, especially the financial payment business systems in the field of Internet finance, including accounting systems, refund transaction systems, fund payment systems, etc. These business systems have strong consistency requirements for business data. Otherwise, once the business data is lost or confused due to the downtime of the main database, it will cause financial losses to individuals and companies.
[0114] The computer room storage service 70 is a storage service that the data disaster recovery device 40 according to the embodiment of the present disclosure relies on, and is used to store business data. The computer room storage service 70 can be distributedly deployed in multiple computer rooms, and multiple computer room storage services 70 can be deployed in each computer room.
[0115] According to the embodiment of the present disclosure, there may be multiple instances of the data disaster recovery device 40, which may be distributedly deployed in multiple computer rooms, and multiple instances may be deployed in each computer room. In addition, both instances of the data disaster recovery device 40 and computer room storage service 70 may be deployed in the same computer room.
[0116] The data disaster recovery device 40 according to the embodiment of the present disclosure may include an application program interface (API) layer 401 , a service layer 402 and a data layer 403 .
[0117] API layer 401 can be used to provide external interface services for callers (such as business system 60), including interface services exposed in the form of Hypertext Transfer Protocol (HTTP) or RPC. It can also be used to verify interface parameters (for example, the parameter verification described above), and can also provide methods for storing, reading, deleting, and querying by time interval for business data. In addition, it can also provide distributed scheduling capabilities for data repair tasks triggered by computer room dimensions. Data repair tasks include data repair due to inconsistent business data and data repair due to inconsistent index data as described above.
[0118] The service layer 402 is used to provide the specific implementation logic of each interface method, for example, the implementation logic of the business data writing process described in the previous article, including the judgment of disaster recovery status, the prohibition of writing for preset types of users, the concurrent writing of business data, the asynchronous writing of index data, etc.; another example is the implementation logic of the data repair process described in the previous article, including the repair of inconsistent business data, the repair of inconsistent index data, etc.; another example is the implementation logic of the data playback process described in the previous article, and so on.
[0119] The data layer 403 is responsible for the logic of ensuring strong data consistency storage, and is used to implement parallel access to multiple computer room storage services, ensure that the business data writing process is completed after more than a preset number of computer room storage services are successfully written, and at the same time ensure that requests are sent to all computer room storage services 70, record abnormal returns, etc. The operations of the data layer 403 on the computer room storage service 70 include parallel writing, deletion, queue writing, queue deletion, etc.
[0120] Through the API layer 401, service layer 402 and data layer 403, the strategy of successfully storing business data in most computer room storage services 70 can be implemented, and then through the data repair tasks at the computer room level, the strong consistency of the storage service copies in multiple computer rooms is ensured.
[0121] The data repair task triggered by the computer room dimension means that each computer room can independently perform the data repair task, so that it can cope with the unavailability of the computer room level and avoid the interruption of the data repair task due to the unavailability of the computer room. Each computer room only needs one instance to run the data repair task, so that the distributed scheduling task of the computer room dimension is realized. During task scheduling, each instance can obtain the IP address list of the data disaster recovery device instance of the computer room dimension through service discovery, select the preset IP address from the IP address list, and compare the preset IP address with the IP address of the current instance. If the IP address of the current instance is equal to the preset IP address, it is determined that the data repair task is performed by the current instance and the data repair task is started. If the IP address of the current instance is not equal to the preset IP address, it is determined that the data repair task is not performed by the current instance, and the data repair task is ignored. In this way, each computer room has an instance to perform the data repair task. The preset IP address can be, for example, the minimum IP address, the maximum IP address, a randomly specified IP address, etc.
[0122] In addition, for the data playback task described above, a data disaster recovery device instance can be designated to execute, so that resources can be saved.
[0123] The present disclosure also provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processing device, the steps of any method in the present disclosure are implemented.
[0124] The present disclosure also provides an electronic device, comprising: a storage device having a computer program stored thereon; A processing device is used to execute a computer program in a storage device to implement the steps of any method in the present disclosure.
[0125] The present disclosure also provides a computer program product, comprising a computer program, which implements the steps of any method in the present disclosure when executed by a processor.
[0126] Reference below Figure 8 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0127] like Figure 8As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0128] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0129] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0130] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0131] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0132] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0133] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains first business data from the business system; concurrently writes the first business data to multiple computer room storage services; determines whether the first business data in more than a preset number of computer room storage services are consistent; if the first business data in more than a preset number of computer room storage services are consistent, it is determined that the first business data is successfully written to the multiple computer room storage services.
[0134] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0135] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, the first acquisition module may also be described as a "module for acquiring first business data from a business system."
[0137] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0138] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0139] According to one or more embodiments of the present disclosure, Example 1 provides a data disaster recovery method, including: Acquire first business data from a business system; Concurrently writing the first business data to multiple computer room storage services; Determine whether the first business data in the computer room storage service exceeding a preset number is consistent; If the first business data in more than a preset number of computer room storage services are consistent, it is determined that the first business data is successfully written to the multiple computer room storage services.
[0140] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein, before concurrently writing the first business data to multiple computer room storage services, the method further includes: Determine whether the business system is currently in a disaster recovery state and determine whether a preset type of user is hit according to the first business data, wherein the preset type of user is a user who has a write operation in a time period from when a primary database of the business system goes down to when the primary database is switched to a secondary database of the business system; If it is determined that the business system is currently in the disaster recovery state and hits the preset type of user, the first business data is not written into the multiple computer room storage services.
[0141] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1 or 2, wherein the concurrently writing the first business data to multiple computer room storage services includes: Determining, according to the business type of the first business data, a computer room storage service corresponding to the business type; The first business data is concurrently written to the determined computer room storage service.
[0142] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 1 or 2, wherein the concurrently writing the first business data to multiple computer room storage services includes: For each of the plurality of computer room storage services, determining whether there is business data corresponding to the unique business ID of the first business data in the computer room storage service; If there is business data corresponding to the unique business ID of the first business data in the computer room storage service, the first business data is not written to the computer room storage service; If the business data corresponding to the unique business ID of the first business data does not exist in the computer room storage service, the first business data is written to the computer room storage service.
[0143] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 1 or 2, wherein the method further includes: Determine the index data confirmation mark corresponding to the first business data, and concurrently write the index data confirmation mark and the first business data into the multiple computer room storage services, wherein the index data confirmation mark is used to indicate that the index data corresponding to the first business data has not yet been written into the multiple computer room storage services.
[0144] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein the method further includes: After the first business data in the plurality of computer room storage services are all consistent, constructing the index data according to the first business data; Concurrently writing the constructed index data into the computer room storage service storing the first business data; If the index data in more than a preset number of computer room storage services in the computer room storage services storing the first business data are consistent, it is determined that the index data is written successfully, and the corresponding index data confirmation mark is deleted.
[0145] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 6, wherein the method further includes: The failure information of inconsistency of the first business data in less than a preset number of computer room storage services, the failure information of inconsistency of the first business data in more than a preset number of computer room storage services, the failure information of inconsistency of the index data in less than a preset number of computer room storage services, and the failure information of inconsistency of the index data in more than a preset number of computer room storage services are written into the failure queue.
[0146] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 7, wherein the method further includes: Obtaining the failure information from the failure queue; According to the acquired failure information, query the service data to be repaired from the plurality of computer room storage services; According to the query result, if the business data to be repaired in more than a preset number of computer room storage services are consistent, or if the business data to be repaired exists in less than a preset number of computer room storage services and the business data to be repaired are consistent, the consistent business data to be repaired is used to repair the business data to be repaired and the corresponding index data in the multiple computer room storage services.
[0147] According to one or more embodiments of the present disclosure, Example 9 provides the method of Example 8, wherein querying the service data to be repaired from the multiple computer room storage services according to the acquired failure information includes: Parsing the unique service ID of the service data to be repaired from the acquired failure information; Determine the service type according to the unique service ID; Determine the computer room storage service corresponding to the business type according to the business type; The service data to be repaired is queried from the corresponding computer room storage service.
[0148] According to one or more embodiments of the present disclosure, Example 10 provides the method of Example 8, wherein the method further includes: After executing a preset number of repair operations, if the number of failure information in the failure queue is greater than a preset number, an alarm is issued and / or the corresponding business data in the computer room storage service associated with the failure information in the failure queue is deleted.
[0149] According to one or more embodiments of the present disclosure, Example 11 provides the method of any one of Examples 1 to 10, wherein the method further includes: When the business system needs to perform data playback, obtain a data playback task; Determine a playback time interval according to the data playback task; Concurrently querying the business data in the multiple computer room storage services within the playback time interval; If the business data queried in the computer room storage services exceeding the preset number are consistent, the queried business data is used to perform data playback on the business system.
[0150] According to one or more embodiments of the present disclosure, Example 12 provides a data disaster recovery device, including: A first acquisition module, used to acquire first business data from a business system; A writing module, used for concurrently writing the first business data to multiple computer room storage services; The first determination module is used to determine whether the first business data in more than a preset number of computer room storage services are consistent. If the first business data in more than a preset number of computer room storage services are consistent, it is determined that the first business data is successfully written to the multiple computer room storage services.
[0151] According to one or more embodiments of the present disclosure, Example 13 provides a computer-readable medium having a computer program stored thereon, which implements the steps of any of the methods described in Examples 1-11 when executed by a processing device.
[0152] According to one or more embodiments of the present disclosure, Example 14 provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method described in any one of Examples 1-11.
[0153] According to one or more embodiments of the present disclosure, Example 15 provides a computer program product, including a computer program, which implements the steps of any one of the methods of Examples 1-11 when executed by a processor.
[0154] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0155] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0156] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A data disaster recovery method, characterized in that: include: Acquire first business data from a business system; Concurrently writing the first business data to multiple computer room storage services; Determine whether the first business data in the computer room storage service exceeding a preset number is consistent; If the first business data in more than the preset number of computer room storage services are consistent, it is determined that the first business data is successfully written to the multiple computer room storage services.
2. The method according to claim 1, characterized in that Before concurrently writing the first business data to multiple computer room storage services, the method further includes: Determine whether the business system is currently in a disaster recovery state and determine whether a preset type of user is hit according to the first business data, wherein the preset type of user is a user who has a write operation in a time period from when a primary database of the business system goes down to when the primary database is switched to a secondary database of the business system; If it is determined that the business system is currently in the disaster recovery state and hits the preset type of user, the first business data is not written into the multiple computer room storage services.
3. The method according to claim 1 or 2, characterized in that: The concurrently writing the first business data to multiple computer room storage services includes: Determining, according to the business type of the first business data, a computer room storage service corresponding to the business type; The first business data is concurrently written to the determined computer room storage service.
4. The method according to claim 1 or 2, characterized in that: The concurrently writing the first business data to multiple computer room storage services includes: For each of the plurality of computer room storage services, determining whether there is business data corresponding to the unique business ID of the first business data in the computer room storage service; If there is business data corresponding to the unique business ID of the first business data in the computer room storage service, the first business data is not written to the computer room storage service; If the business data corresponding to the unique business ID of the first business data does not exist in the computer room storage service, the first business data is written to the computer room storage service.
5. The method according to claim 1 or 2, characterized in that: The method further comprises: Determine the index data confirmation mark corresponding to the first business data, and concurrently write the index data confirmation mark and the first business data into the multiple computer room storage services, wherein the index data confirmation mark is used to indicate that the index data corresponding to the first business data has not yet been written into the multiple computer room storage services.
6. The method according to claim 5, characterized in that The method further comprises: After the first business data in the plurality of computer room storage services are all consistent, constructing the index data according to the first business data; Concurrently writing the constructed index data into the computer room storage service storing the first business data; If the index data in more than the preset number of computer room storage services in the computer room storage service storing the first business data are consistent, it is determined that the index data is written successfully, and the corresponding index data confirmation mark is deleted.
7. The method according to claim 6, characterized in that The method further comprises: The failure information of inconsistency of the first business data in less than the preset number of computer room storage services, the failure information of inconsistency of the first business data in more than the preset number of computer room storage services, the failure information of inconsistency of the index data in less than the preset number of computer room storage services, and the failure information of inconsistency of the index data in more than the preset number of computer room storage services are written into the failure queue.
8. The method according to claim 7, characterized in that The method further comprises: Obtaining the failure information from the failure queue; According to the acquired failure information, query the service data to be repaired from the plurality of computer room storage services; According to the query result, if the business data to be repaired in more than the preset number of computer room storage services are consistent, or if the business data to be repaired exists in less than the preset number of computer room storage services and the business data to be repaired are consistent, the consistent business data to be repaired is used to repair the business data to be repaired and the corresponding index data in the multiple computer room storage services.
9. The method according to claim 8, characterized in that The querying of the to-be-repaired service data from the plurality of computer room storage services according to the acquired failure information includes: Parsing the unique service ID of the service data to be repaired from the acquired failure information; Determine the service type according to the unique service ID; Determine the computer room storage service corresponding to the business type according to the business type; The service data to be repaired is queried from the corresponding computer room storage service.
10. The method according to claim 8, characterized in that The method further comprises: After executing a preset number of repair operations, if the number of failure information in the failure queue is greater than a preset number, an alarm is issued and / or the corresponding business data in the computer room storage service associated with the failure information in the failure queue is deleted.
11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: When the business system needs to perform data playback, obtain a data playback task; Determine a playback time interval according to the data playback task; Concurrently querying the business data in the multiple computer room storage services within the playback time interval; If the business data queried in the computer room storage services exceeding the preset number are consistent, the queried business data is used to perform data playback on the business system.
12. A data disaster recovery device, characterized in that: include: A first acquisition module, used to acquire first business data from a business system; A writing module, used for concurrently writing the first business data to multiple computer room storage services; The first determination module is used to determine whether the first business data in more than a preset number of computer room storage services are consistent. If the first business data in more than the preset number of computer room storage services are consistent, it is determined that the first business data is successfully written to the multiple computer room storage services.
13. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 11 are implemented.
14. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.