Method, device, electronic equipment and storage medium for testing a disaster recovery system

CN115599665BActive Publication Date: 2026-09-22CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211192516.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2026-09-22
Estimated Expiration
2042-09-28

AI Technical Summary

Technical Problem

[0003]有鉴于此,本发明实施例提供一种灾备系统测试的方法、装置、电子设备和存储介质,能够解决很多场景中业务处理类型复杂、繁琐,所以人工测试的方式成本较高、效率较低的问题

Benefits of technology

[0045]上述发明中的一个实施例具有如下优点或有益效果:本发明实施例中,通过业务场景模拟程序对各业务场景进行模拟,并在系统切换后,可以向第二系统中的业务数据表写入业务数据,以比较第二系统和第一业务系统中对应的业务数据表的相似性,以通过相似性确定测试结果,从而对灾备系统测试无需通过人工执行,不仅提高测试效率,还可以降低测试成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115599665B_ABST
    Figure CN115599665B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for testing a disaster recovery system, electronic equipment and a storage medium, and relates to the technical field of computers. A specific embodiment of the method comprises: in response to a switching test instruction, calling a business scenario simulation program and sending business simulation data; obtaining a second system corresponding to a first system to trigger a system switching instruction, the second system and the first system being disaster recovery systems for each other; querying a first business data table associated with a business scenario in the second system to write business data into the first business data table and store the business data; obtaining a second business data table corresponding to the first business data table in the first system to call a preset computing component and calculate the similarity between the first business data table and the second business data table; and determining a switching test result of the first system and the second system based on the similarity. The embodiment can solve the problem that the cost of manual testing is high and the efficiency is low due to the complexity and tediousness of business processing in many scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for testing disaster recovery systems. Background Technology

[0002] In large-scale business processes, to ensure data security and normal business operation, a disaster recovery system is typically set up for the business processing system to perform disaster backup. To ensure the availability of the disaster recovery system and the effectiveness of disaster recovery failover, it needs to be tested. Current technology usually involves manually testing each scenario in the business processing sequentially. However, due to the complexity and cumbersome nature of many business processing scenarios, manual testing is costly and inefficient. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a method, apparatus, electronic device and storage medium for testing disaster recovery systems, which can solve the problem that manual testing is costly and inefficient in many scenarios due to the complexity and cumbersome nature of business processing.

[0004] To achieve the above objectives, according to one aspect of the present invention, a method for testing a disaster recovery system is provided.

[0005] A method for testing a disaster recovery system according to an embodiment of the present invention includes: responding to a switch test command, invoking a business scenario simulation program, and sending business simulation data so that a first system processes the business simulation data;

[0006] Obtain the second system corresponding to the first system to trigger a system switching command, so that the first system is switched to the second system, and the second system and the first system are disaster recovery systems for each other;

[0007] Query the first business data table in the second system that is associated with the business scenario, so as to write business data into the first business data table and store it;

[0008] Obtain the second business data table in the first system that corresponds to the first business data table, and call a preset calculation component to calculate the similarity between the first business data table and the second business data table;

[0009] The switching test results of the first system and the second system are determined based on the similarity.

[0010] In one embodiment, after the trigger device switching command, the method further includes:

[0011] Obtain the processing efficiency of the second system for business simulation data within a preset time period;

[0012] In response to the processing efficiency being greater than a preset threshold, the first result data of the business simulation data in the second system is obtained;

[0013] The second result data in the first system is queried, and the computing component is invoked to calculate the similarity between the first result data and the second result data, so as to determine the switching test result between the first system and the second system.

[0014] In yet another embodiment, after determining the handover test results of the first system and the second system, the method further includes:

[0015] Send an application instance stop command to the second system to trigger a switchback command, causing the second system to switch back to the first system;

[0016] Write business data into the second business data table, query the first business data table, and call a preset calculation component to calculate the similarity between the first business data table and the second business data table.

[0017] The switching test results of the first system and the second system are determined based on the similarity.

[0018] In yet another embodiment, before querying the first business data table associated with the business scenario in the second system, the method further includes:

[0019] A setup instruction is sent to the second system to enable the second system to create a first business data table associated with the business scenario.

[0020] In yet another embodiment, it further includes:

[0021] In response to an abnormal test command, a business scenario simulation program is invoked to send business simulation data so that the first system can process the simulated business data;

[0022] A stop command is sent to the first system, triggering a system switching command, causing the first system to be switched to the second system;

[0023] Send a recovery command to the first system, and obtain log data of the first system and the second system within a preset time period to determine the number of successful business processes in the first system and the number of records of business processes in the second system;

[0024] Based on the number of successes and the number of records, the abnormal test results of the first system and the second system are determined.

[0025] In yet another embodiment, before sending a stop command to the first system, the method further includes:

[0026] Query the preset data table in the first system to write the first data into the preset data table;

[0027] After sending the recovery command to the first system, the process also includes:

[0028] The second data in the preset data table is obtained and compared with the first data to obtain a comparison result, so as to determine the abnormal test results of the first system and the second system based on the comparison result.

[0029] In yet another embodiment, after sending the recovery command to the first system, the method further includes:

[0030] Send a database repair command to the second system to restore the data synchronization relationship between the first system and the second system;

[0031] Trigger the device switchback command to switch the second system to the first system and write the third data into the preset data table in the first system;

[0032] Obtain the fourth data from the preset data table in the second system, and determine the abnormal test results of the first system and the second system based on the third data and the fourth data.

[0033] To achieve the above objectives, according to another aspect of the present invention, an apparatus for testing a disaster recovery system is provided.

[0034] An apparatus for testing a disaster recovery system according to an embodiment of the present invention includes: a sending unit, configured to respond to a switching test command, invoke a business scenario simulation program, and send business simulation data so that a first system processes the simulated business data;

[0035] The triggering unit is used to obtain the second system corresponding to the first system, so as to trigger the device switching command, so that the first system is switched to the second system, and the second system and the first system are disaster recovery systems for each other;

[0036] The writing unit is used to query the first business data table in the second system that is associated with the business scenario, so as to write business data into the business data table and store it.

[0037] The calculation unit is used to obtain the second business data table in the first system that corresponds to the first business data table, and to call a preset calculation component to calculate the similarity between the first business data table and the second business data table.

[0038] A determining unit is used to determine the switching test results of the first system and the second system based on the similarity.

[0039] To achieve the above objectives, according to another aspect of the present invention, an electronic device is provided.

[0040] An electronic device according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the disaster recovery system testing method provided in the embodiment of the present invention.

[0041] To achieve the above objectives, according to another aspect of the present invention, a computer-readable medium is provided.

[0042] An embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method for testing a disaster recovery system provided in the embodiment of the present invention.

[0043] To achieve the above objectives, according to another aspect of the present invention, a computer program product is provided.

[0044] A computer program product according to an embodiment of the present invention includes a computer program that, when executed by a processor, implements the disaster recovery system testing method provided in an embodiment of the present invention.

[0045] One embodiment of the above invention has the following advantages or beneficial effects: In this embodiment of the invention, various business scenarios are simulated by a business scenario simulation program, and after system switching, business data can be written into the business data table in the second system to compare the similarity between the corresponding business data tables in the second system and the first business system, so as to determine the test results through similarity. Thus, the disaster recovery system test does not need to be performed manually, which not only improves the testing efficiency, but also reduces the testing cost.

[0046] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0047] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0048] Figure 1 This is a schematic diagram of a system architecture for a production business system and a disaster recovery system according to an embodiment of the present invention;

[0049] Figure 2 This is a schematic diagram of the main process of a disaster recovery system testing method according to an embodiment of the present invention;

[0050] Figure 3 This is a schematic diagram of another main process of a disaster recovery system testing method according to an embodiment of the present invention;

[0051] Figure 4 This is a schematic diagram of another main process of a disaster recovery system testing method according to an embodiment of the present invention;

[0052] Figure 5 This is a schematic diagram of another main process of a disaster recovery system testing method according to an embodiment of the present invention;

[0053] Figure 6 This is a schematic diagram of the main units of a disaster recovery system testing apparatus according to an embodiment of the present invention;

[0054] Figure 7 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0055] Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing embodiments of the present invention. Detailed Implementation

[0056] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0057] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The acquisition, storage, use, and processing of data in the technical solutions of this application all comply with the relevant provisions of national laws and regulations.

[0058] This invention provides a disaster recovery system testing system, which can be used in disaster recovery system testing scenarios, specifically for non-functional testing scenarios of databases in dual-cluster disaster recovery systems.

[0059] In various business processing scenarios, in order to ensure normal and secure business processing, production business systems and off-site disaster recovery systems are usually deployed independently. Both systems are configured with database clusters, such as GoldenDB database clusters. Apart from data synchronization, the two clusters do not affect each other and can achieve fault isolation.

[0060] Figure 1 The diagram shown illustrates the structure of the production business system and the off-site disaster recovery system. Figure 1As shown, GDB1 is the database cluster in the production business system, and GDB2 is the database cluster in the disaster recovery system. The production business system and the disaster recovery system are deployed in different locations. The production business system deploys a production database cluster (i.e., the production database), and the disaster recovery system deploys a disaster recovery database cluster (i.e., the disaster recovery database). In this embodiment of the invention, [the following can be done / implemented]: Figure 1 The system is subjected to non-functional database testing, and the test results are used to verify the maximum tolerance time for business continuity assurance and fault emergency handling of the business system.

[0061] It should be noted that non-functional characteristics may include the effectiveness of the production database cluster in the production business system, the effectiveness of the disaster recovery database cluster in the disaster recovery business system, the effectiveness of planned disaster recovery switchover, and the effectiveness of unplanned disaster recovery switchover.

[0062] In this embodiment of the invention, Figure 1 The production business system shown can process business data, store business data in the production database cluster and synchronize it to the disaster recovery database cluster. In the event of a failure in the production business system, the system can be switched to the disaster recovery system for business processing, while simultaneously storing business data in the disaster recovery database cluster and synchronizing it to the production database cluster. Taking bank transaction processing as an example, the transaction path can include: direct access to the existing core: user account A data is distributed in a database of a system in location A, and the user initiates a non-downgraded transaction involving account A in location B; distributed across existing cores: user account A data is distributed in a database of a system in location A, and the user initiates a downgraded transaction involving account A in location B, which also involves calling the non-downgraded core transaction; existing core across distributed: user account A data is located in the existing core, and account B data is located in the distributed core of a system in location B, and the user initiates a transfer transaction from account A to account B in location A; existing database access to the existing core system: user data is located in the existing core system. Based on the existing database, a user initiates a transaction in location B, accessing the existing database and subsequently calling the existing core transaction database. Direct access to the distributed database: User account A's data is distributed across a system's database in location A; the user initiates a distributed, migrated transaction for account A in location A. Distributed cross-regional / center database: User account A's data is distributed across a system in location B, and account B's data is also distributed across a system in location B; the user initiates a transfer transaction from account A to account B in location A (all transactions involved have been migrated). Distributed cross-existing database database: User account A's data is distributed across a system in location A; the user initiates a migrated transaction involving account A in Wuhan, which also calls the existing database to query the transaction. Based on the above transaction path analysis, the testing process for the production business system and disaster recovery system can be determined.

[0063] This invention provides a method for testing a disaster recovery system, which can be executed by a disaster recovery system testing system, such as... Figure 2 As shown, the method includes:

[0064] S201: In response to the switch test command, the business scenario simulation program is invoked and business simulation data is sent so that the first system can process the business simulation data.

[0065] In order to facilitate testing, various business scenarios can be simulated in this embodiment of the invention. Specifically, the proportion and average response time of each business under normal business scenarios can be obtained to generate a business scenario simulation program. The business scenario simulation program can send normal business data, that is, simulate normal business processing scenarios, so that the first system can process business simulation data in the simulated normal business processing scenarios.

[0066] It should be noted that, in this embodiment of the invention, corresponding business scenario simulation programs can be generated based on different business type requirements and called as needed for testing. Taking bank transactions as an example, business types can include non-functional tests such as ordinary queries, complex queries, online payment transactions, online cash withdrawal transactions, consumption transactions, withdrawal transactions, transfer transactions, and maintenance transactions.

[0067] This invention may involve switching tests between a production business system and a disaster recovery system. The first system can be either a production business system or a disaster recovery system. In this invention, the production business system is used as an example for illustration.

[0068] S202: Obtain the second system corresponding to the first system to trigger a system switching command, so that the first system is switched to the second system.

[0069] In this system, the second system and the first system serve as disaster recovery systems for each other. After the first system processes the simulated business data for a period of time, it can switch to the disaster recovery system. The length of this period can be set based on the scenario, such as 5 minutes or 30 minutes. To ensure proper simulation of the switchover test, in this embodiment of the invention, the application instances in the first system (i.e., the scenario of processing business data in the first system) can be stopped before the system switchover command is triggered. However, the database in the first system can still operate normally, meaning that data synchronization can be performed using the second system.

[0070] It should be noted that, in this embodiment of the invention, before system switching, a pre-switching check can be performed on the database in the second system, that is, the database's serviceability and synchronization status can be checked to ensure that the data volume in the second system operates normally. Similarly, after executing the system switching command, the second system can be checked again to ensure that the second system begins to replace the first system for service.

[0071] S203: Query the first business data table in the second system that is associated with the business scenario, so as to write business data into the first business data table and store it.

[0072] Both the first system and the second system include data tables related to business scenarios. In this step, business data can be written into the first data table and stored.

[0073] It should be noted that, in this embodiment of the invention, for ease of testing, a new data table can be created in the second system. Specifically, a creation command is sent to the second system to enable it to create a first business data table associated with the business scenario. The business data written into the first business data table is not limited and can be pre-set according to the specific scenario. After creating the first business data table in the product information department, this step allows for the writing of business data into the first business data table by sending a command.

[0074] S204: Obtain the second business data table in the first system that corresponds to the first business data table, and call the preset calculation component to calculate the similarity between the first business data table and the second business data table.

[0075] In this embodiment, after the business data is written into the first business data table in the second system, if the system operates normally, it needs to synchronize the data back to the first system. Therefore, in this embodiment, the second business data table corresponding to the first business data table in the first system can be obtained, and the similarity between the first and second business data tables can be calculated. The preset calculation component is pre-configured.

[0076] S205: Determine the switching test results of the first system and the second system based on similarity.

[0077] The handover test results can include whether the handover is normal or abnormal. If the similarity is 100%, it indicates that the first and second business data tables are consistent, and that the handover between the first and second systems is normal, meaning that the synchronization of business data can be handled normally when the first system fails or other issues occur during the handover. If the similarity is not 100%, it indicates that the first and second business data tables are inconsistent, and that the handover between the first and second systems is abnormal.

[0078] In some embodiments, in order to further test the business processing capability of the second system after the first system is switched to the second system, the following can also be performed after the switch: obtain the processing efficiency of the business simulation data of the second system within a preset time period; in response to the processing efficiency being greater than a preset threshold, obtain the first result data of the business simulation data in the second system; query the second result data in the first system, call the calculation component, calculate the similarity between the first result data and the second result data, so as to determine the switch test result of the first system and the second system.

[0079] After the first system is switched to the second system, the second system needs to start its application instances to process business data. This step obtains the processing efficiency (TPS) of the second system's simulated business data within a preset time period to determine whether the second system has reached a normal business processing state. Therefore, a processing efficiency greater than a preset threshold indicates that the second system has reached a normal business processing state. Further, the first result data of the simulated business data in the second system can be obtained; the second result data in the first system is queried, and the calculation component is invoked to calculate the similarity between the first and second result data to determine the switchover test result between the first and second systems. In other words, this step determines the switchover test result between the first and second systems by verifying whether the first and second result data are consistent (similarity of 100%). If the similarity reaches 100%, the switchover test result is normal; if the similarity does not reach 100%, the switchover test result is abnormal.

[0080] After completing the above tests, a scenario of the second system switching back to the first system will also be tested. Specifically, the following steps can be taken: send an application instance stop command to the second system to trigger the switchback command, causing the second system to switch back to the first system; write business data to the first business data table, query the second business data table, and call a preset computing component to calculate the similarity between the first and second business data tables; determine the switching test result between the first and second systems based on the similarity.

[0081] Sending a stop command to the application instance in the second system simulates a failure in the second system, triggering a switchback command to revert business processing from the second system to the first system. This allows for writing business data to the first business data table, indicating data insertion, and querying the second business data table from the second system. The similarity between the first and second business data tables is used to test whether the database data in the first system has been synchronized to the database in the second system. If the similarity reaches 100%, the switchback test result is normal; if the similarity is less than 100%, the switchback test result is abnormal.

[0082] It should be noted that during the above process, the database in the first system can be checked before and after triggering the rollback command to ensure normal operation. Additionally, after the TPS of the first system is normal, a second check can be performed to verify the consistency of business processing results between the first and second systems.

[0083] The business scenario simulation program called in step S201 can send business simulation data based on requirements, that is, the duration or stop time of sending business simulation data can be determined based on requirements.

[0084] In this embodiment of the invention, various business scenarios are simulated through a business scenario simulation program. After system switching, business data can be written to the business data table in the second system to compare the similarity between the corresponding business data tables in the second system and the first business system. The test results are determined by the similarity, so that the disaster recovery system test does not need to be performed manually, which not only improves the testing efficiency but also reduces the testing cost.

[0085] The following is combined Figure 1 The illustrated embodiments provide a detailed description of the disaster recovery system testing method in this invention. Figure 3 As shown, the method includes:

[0086] S301: Call the business scenario simulation program and send business simulation data.

[0087] S302: Trigger system switching command to write business data into the first business data table in the second system.

[0088] S303: Obtain the first system summary second business data table to calculate the similarity with the first business data table and determine the handover test result.

[0089] S304: Send an application instance start command to the second system to obtain the processing efficiency of business simulation data.

[0090] S305: In response to the fact that the processing efficiency of the business simulation data is greater than a preset threshold, the first result data in the second system and the second result data in the first system are obtained to determine the switching test result.

[0091] S306: Send an application instance stop command to the second system to trigger a switchback command.

[0092] S307: Write business data to the first business data table, query the second business data table to calculate the similarity, and determine the switching test result.

[0093] S308: Start the application instance in the first system and obtain the processing efficiency of business simulation data.

[0094] S309: In response to the fact that the processing efficiency of the business simulation data is greater than a preset threshold, the first result data in the second system and the second result data in the first system are obtained to determine the switching test result.

[0095] It should be noted that the data processing principle in the embodiments of the present invention is the same as... Figure 2 The corresponding data processing principle is the same, so it will not be repeated here.

[0096] This invention provides yet another method for testing a disaster recovery system, which can be executed by a disaster recovery system testing system, such as... Figure 4As shown, the method includes:

[0097] S401: In response to an exception test command, the business scenario simulation program is invoked to send business simulation data so that the first system can process the simulated business data.

[0098] The abnormal test command represents a scenario of complete system failure. The second system and the first system serve as disaster recovery systems for each other. After the first system processes the business simulation data for a period of time, it can switch to the disaster recovery system. The length of this period can be set based on the scenario, such as 5 minutes or 30 minutes.

[0099] S402: Send a stop command to the first system to trigger a device switching command, causing the first system to be switched to the second system.

[0100] The stop command indicates the cessation of management takeover, GTM, and data nodes in the first system, simulating a power outage scenario for the first system.

[0101] It should be noted that, in this embodiment of the invention, before system switching, a pre-switching check can be performed on the database in the second system, that is, the database's serviceability and synchronization status can be checked to ensure that the data volume in the second system operates normally. Similarly, after executing the system switching command, the second system can be checked again to ensure that the second system begins to replace the first system for service.

[0102] S403: Send a recovery command to the first system, obtain log data of the first and second systems within a preset time period, in order to determine the number of successful business processes in the first system and the number of records of business processes in the second system.

[0103] After the first system is restored, data synchronization with the second system can be resumed. All successful business processing records before the first system stopped can be synchronized to the second system. Therefore, in this step, log data of the first and second systems within a preset time period can be obtained to determine the number of successful business processing records in the first system and the number of records in the second system to verify whether they are consistent.

[0104] S404: Determine the abnormal test results of the first and second systems based on the number of successes and the number of records.

[0105] If the number of successful tests and the number of records are the same, it means that the data synchronization before and after the first system failure is consistent, so the abnormal test result is normal; if the number of successful tests and the number of records are different, it means that the data synchronization before and after the first system failure is inconsistent, so the abnormal test result is abnormal.

[0106] In some embodiments, data can be inserted into the first system before step S402 to determine the abnormal test result. Specifically, this can be performed as follows: before step S402, a preset data table is queried in the first system to write first data into the preset data table; after sending a recovery command to the first system, second data is obtained from the preset data table, compared with the first data, and a comparison result is obtained to determine the abnormal test result of the first and second systems based on the comparison result. If the comparison result is consistent, the abnormal test result can be determined to be normal; if the comparison result is consistent, the abnormal test result can be determined to be abnormal.

[0107] After executing step S404, the second system can perform business simulation data processing. Further, a test can be performed to switch back from the second system to the first system. Specifically, this can be executed as follows: a database repair command is sent to the second system to restore the data synchronization relationship between the first and second systems; a device switchback command is triggered, causing the second system to be switched to the first system, and third data is written to a preset data table in the first system; fourth data is obtained from the preset data table in the second system, and the abnormal test results of the first and second systems are determined based on the third and fourth data.

[0108] The database repair command is used to repair the database synchronization relationship between the second system and the first system. Specifically, it can be executed as follows: roll back data in the first system, repair the database, and connect the first system to the second system for reverse data synchronization. If the third and fourth data are consistent, the abnormal test result can be determined to be normal; if the third and fourth data are inconsistent, the abnormal test result can be determined to be abnormal.

[0109] It should be noted that in the embodiments of the present invention, abnormal test results can also be determined by processing business simulation data. For example, taking bank transaction data as the business simulation data, an identifier can be added to the message of the transaction data so that it can be viewed in the current account details table. Then, the current account details table data in the production business system and the disaster recovery system can be compared before and after the disaster recovery system switchover to determine whether the abnormal test results are consistent.

[0110] In this embodiment of the invention, various business scenarios are simulated through a business scenario simulation program. After system switching, business data can be written to the business data table in the second system to compare the similarity between the corresponding business data tables in the second system and the first business system. The test results are determined by the similarity, so that the disaster recovery system test does not need to be performed manually, which not only improves the testing efficiency but also reduces the testing cost.

[0111] The following is combined Figure 4 The illustrated embodiments provide a detailed description of the disaster recovery system testing method in this invention. Figure 5 As shown, the method includes:

[0112] S501: In response to an exception test command, invoke the business scenario simulation program and send business simulation data.

[0113] S502: Query the preset data table in the first system to write the first data into the preset data table, send a stop command to the first system, and trigger the system switching command.

[0114] S503: Send a recovery command to the first system, obtain log data of the first and second systems within a preset time period, and determine the number of successful business processes in the first system and the number of records of business processes in the second system.

[0115] S504: Obtain the second data from the preset data table, compare it with the first data, and obtain the comparison result. Determine the abnormal test results of the first system and the second system.

[0116] S505: Based on the number of successes and records, and the comparison results, determine the abnormal test results of the first system and the second system respectively.

[0117] S506: Sends a database repair command to the second system, triggering a device switchback command.

[0118] S507: Write third data into a preset data table in the first system, and obtain fourth data from a preset data table in the second system, so as to determine the abnormal test results of the first system and the second system based on the third data and the fourth data.

[0119] It should be noted that the data processing principle in the embodiments of the present invention is the same as... Figure 2 and Figure 4 The corresponding data processing principle is the same, so it will not be repeated here.

[0120] To address the problems existing in the prior art, embodiments of the present invention provide a disaster recovery system testing apparatus 600, such as... Figure 6 As shown, the device 600 includes:

[0121] The sending unit 601 is used to respond to the switching test command, call the business scenario simulation program, and send business simulation data so that the first system can process the simulated business data;

[0122] Triggering unit 602 is used to obtain the second system corresponding to the first system, so as to trigger a device switching command to switch the first system to the second system, wherein the second system and the first system are disaster recovery systems for each other;

[0123] The writing unit 603 is used to query the first business data table in the second system that is associated with the business scenario, so as to write business data into the business data table and store it.

[0124] The calculation unit 604 is used to obtain the second business data table corresponding to the first business data table in the first system, so as to call the preset calculation component to calculate the similarity between the first business data table and the second business data table.

[0125] The determining unit 605 is used to determine the switching test results of the first system and the second system based on the similarity.

[0126] It should be understood that the manner in which embodiments of the present invention are implemented is different from the implementation method. Figure 2 The methods used in the illustrated embodiments are the same and will not be repeated here.

[0127] In one embodiment, the device 600 further includes:

[0128] The acquisition unit is used to acquire the processing efficiency of the business simulation data of the second system within a preset time period;

[0129] The acquisition unit is further configured to acquire first result data of the business simulation data in the second system in response to the processing efficiency being greater than a preset threshold;

[0130] The determining unit 605 is further configured to query the second result data in the first system, call the calculation component, and calculate the similarity between the first result data and the second result data to determine the switching test results of the first system and the second system.

[0131] In one embodiment, the triggering unit 602 is further configured to send an application instance stop instruction to the second system to trigger a switchback instruction, causing the second system to switch back to the first system;

[0132] The calculation unit 604 is also used to write business data into the first business data table, query the second business data table, and call a preset calculation component to calculate the similarity between the first business data table and the second business data table.

[0133] The determining unit 605 is further configured to determine the switching test results of the first system and the second system based on the similarity.

[0134] In one embodiment, the sending unit 601 is further configured to send an establishment instruction to the second system, so that the second system establishes a first business data table associated with the business scenario.

[0135] In one embodiment, the sending unit 601 is further configured to respond to an abnormal test instruction by invoking a business scenario simulation program and sending business simulation data so that the first system can process the simulated business data;

[0136] The triggering unit 602 is also used to send a stop command to the first system and trigger a device switching command, so that the first system is switched to the second system;

[0137] The determining unit 605 is further configured to send a recovery command to the first system and obtain log data of the first system and the second system within a preset time period to determine the number of successful business processes in the first system and the number of records of business processes in the second system.

[0138] The determining unit 605 is further configured to determine the abnormal test results of the first system and the second system based on the number of successes and the number of records.

[0139] In one embodiment, the writing unit 603 is further configured to query a preset data table in the first system to write first data into the preset data table;

[0140] The determining unit 605 is further configured to acquire second data from the preset data table, compare it with the first data, and obtain a comparison result, so as to determine the abnormal test results of the first system and the second system based on the comparison result.

[0141] In one embodiment, the sending unit 601 is further configured to send a database repair instruction to the second system to restore the data synchronization relationship between the first system and the second system;

[0142] The triggering unit 602 is also used to trigger a device switchback command, so that the second system is switched to the first system and writes third data into a preset data table in the first system;

[0143] The determining unit 605 is further configured to acquire the fourth data in the preset data table of the second system, so as to determine the abnormal test results of the first system and the second system based on the third data and the fourth data.

[0144] It should be understood that the manner in which embodiments of the present invention are implemented is different from the implementation method. Figure 2 , 3 The embodiments shown in 4 and 5 are the same, and will not be described again here.

[0145] In this embodiment of the invention, various business scenarios are simulated through a business scenario simulation program. After system switching, business data can be written to the business data table in the second system to compare the similarity between the corresponding business data tables in the second system and the first business system. The test results are determined by the similarity, so that the disaster recovery system test does not need to be performed manually, which not only improves the testing efficiency but also reduces the testing cost.

[0146] According to embodiments of the present invention, an electronic device and a readable storage medium are also provided.

[0147] An electronic device according to an embodiment of the present invention includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform a disaster recovery system testing method provided in an embodiment of the present invention.

[0148] Figure 7 An exemplary system architecture 700 is shown, which can be applied to a method or apparatus for testing a disaster recovery system according to embodiments of the present invention.

[0149] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, and 703, a network 704, and a server 705. Network 704 serves as the medium for providing communication links between terminal devices 701, 702, and 703 and server 705. Network 704 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0150] Users can use terminal devices 701, 702, and 703 to interact with server 705 via network 704 to receive or send messages, etc. Various client applications can be installed on terminal devices 701, 702, and 703.

[0151] Terminal devices 701, 702, and 703 can be, but are not limited to, smartphones, tablets, laptops, and desktop computers, etc.

[0152] Server 705 can be a server that provides various services. The server can analyze and process data such as received product information query requests, and feed back the processing results (such as product information - just an example) to the terminal device.

[0153] It should be noted that the disaster recovery system testing method provided in this embodiment of the invention is generally executed by server 705, and correspondingly, the disaster recovery system testing device is generally set in server 705.

[0154] It should be understood that Figure 7 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0155] The following is for reference. Figure 8 It shows a schematic diagram of the structure of a computer system 800 suitable for implementing embodiments of the present invention. Figure 8The computer system shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0156] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the system 800. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0157] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.

[0158] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs the functions defined above in the system of this invention.

[0159] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0160] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a unit, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0161] The units described in the embodiments of the present invention can be implemented in software or hardware. The described units can also be located in a processor; for example, a processor can be described as including a sending unit, a triggering unit, a writing unit, a calculation unit, and a determination unit. The names of these units do not necessarily limit the specific unit; for example, a sending unit can also be described as a "unit for instruction sending functionality."

[0162] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to perform the disaster recovery system testing method provided by the present invention.

[0163] In another aspect, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the method for testing a disaster recovery system provided in the embodiments of the present invention.

[0164] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for testing a disaster recovery system, characterized in that, include: In response to a switch test command, a business scenario simulation program is invoked, and business simulation data is sent so that the first system can process the business simulation data; wherein, a corresponding business scenario simulation program is generated based on different business type requirements, and the corresponding business scenario simulation program is invoked according to the business type requirements; Obtain the second system corresponding to the first system to trigger a system switching command, so that the first system is switched to the second system, and the second system and the first system are disaster recovery systems for each other; Query the first business data table in the second system that is associated with the business scenario, so as to write business data into the first business data table and store it; Obtain the second business data table in the first system that corresponds to the first business data table, and call a preset calculation component to calculate the similarity between the first business data table and the second business data table; The handover test results of the first system and the second system are determined based on the similarity. After triggering the device switching command, the method further includes: obtaining the processing efficiency of the business simulation data of the second system within a preset time period; in response to the processing efficiency being greater than a preset threshold, obtaining the first result data of the business simulation data in the second system; querying the second result data in the first system, calling the computing component, and calculating the similarity between the first result data and the second result data to determine the switching test results of the first system and the second system; It also includes: responding to an abnormal test instruction, invoking a business scenario simulation program, sending business simulation data, so that the first system processes the business simulation data; sending a stop instruction to the first system, triggering a system switching instruction, so that the first system is switched to the second system; sending a recovery instruction to the first system, obtaining log data of the first system and the second system within a preset time period, so as to determine the number of successful business processing in the first system and the number of recorded business processing in the second system; and determining the abnormal test results of the first system and the second system based on the number of successful processing and the number of recorded processing.

2. The method according to claim 1, characterized in that, After determining the handover test results of the first system and the second system, the process also includes: Send an application instance stop command to the second system to trigger a switchback command, causing the second system to switch back to the first system; Write business data into the second business data table, query the first business data table, and call a preset calculation component to calculate the similarity between the first business data table and the second business data table. The switching test results of the first system and the second system are determined based on the similarity.

3. The method according to claim 1, characterized in that, Before querying the first business data table associated with the business scenario in the second system, the process also includes: A setup instruction is sent to the second system to enable the second system to create a first business data table associated with the business scenario.

4. The method according to claim 1, characterized in that, Before sending a stop command to the first system, the following is also included: Query the preset data table in the first system to write the first data into the preset data table; After sending the recovery command to the first system, the process also includes: The second data in the preset data table is obtained and compared with the first data to obtain a comparison result, so as to determine the abnormal test results of the first system and the second system based on the comparison result.

5. The method according to claim 1, characterized in that, After sending the recovery command to the first system, the process also includes: Send a database repair command to the second system to restore the data synchronization relationship between the first system and the second system; Trigger the device switchback command to switch the second system to the first system and write the third data into the preset data table in the first system; Obtain the fourth data from the preset data table in the second system, and determine the abnormal test results of the first system and the second system based on the third data and the fourth data.

6. An apparatus for testing a disaster recovery system, characterized in that, include: The sending unit is used to respond to a switching test command, call a business scenario simulation program, and send business simulation data so that the first system can process the business simulation data; wherein, a corresponding business scenario simulation program is generated based on different business type requirements, and the corresponding business scenario simulation program is called according to the business type requirements; The triggering unit is used to obtain the second system corresponding to the first system, so as to trigger the device switching command, so that the first system is switched to the second system, and the second system and the first system are disaster recovery systems for each other; The writing unit is used to query the first business data table in the second system that is associated with the business scenario, so as to write business data into the business data table and store it. The calculation unit is used to obtain the second business data table in the first system that corresponds to the first business data table, and to call a preset calculation component to calculate the similarity between the first business data table and the second business data table. A determining unit is configured to determine the switching test results of the first system and the second system based on the similarity. The device further includes: an acquisition unit, configured to acquire the processing efficiency of the business simulation data of the second system within a preset time period; the acquisition unit is further configured to acquire first result data of the business simulation data in the second system in response to the processing efficiency being greater than a preset threshold; the determination unit is further configured to query second result data in the first system, call the calculation component, calculate the similarity between the first result data and the second result data, so as to determine the switching test result between the first system and the second system; The sending unit is also configured to respond to an abnormal test instruction by calling a business scenario simulation program and sending business simulation data so that the first system can process the business simulation data; The triggering unit is also used to send a stop command to the first system and trigger a device switching command, so that the first system is switched to the second system; The determining unit is further configured to send a recovery command to the first system and obtain log data of the first system and the second system within a preset time period to determine the number of successful business processes in the first system and the number of records of business processes in the second system. The determining unit is further configured to determine the abnormal test results of the first system and the second system based on the number of successes and the number of records.

7. The apparatus according to claim 6, characterized in that, The triggering unit is further configured to send an application instance stop instruction to the second system to trigger a switchback instruction, causing the second system to switch back to the first system; The calculation unit is also used to write business data into the first business data table, query the second business data table, and call a preset calculation component to calculate the similarity between the first business data table and the second business data table. The determining unit is further configured to determine the switching test results of the first system and the second system based on the similarity.

8. The apparatus according to claim 6, characterized in that, The sending unit is further configured to send an establishment instruction to the second system, so that the second system establishes a first business data table associated with the business scenario.

9. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-5.

10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.

11. A computer program product, comprising a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Disaster backup exercise method, device and equipment and readable storage medium

    CN109697116A

  • Disaster recovery system verification method and device

    CN113157498A