System disaster recovery switching method, device, equipment and storage medium

Through automated file backup and configuration information switching mechanisms, the problem of low efficiency of system disaster recovery switching caused by manual intervention in the existing technology is solved, and fast and reliable disaster recovery switching is achieved, reducing the risk of business interruption.

CN114237982BActive Publication Date: 2024-12-10PING AN SECURITIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111533327.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2024-12-10
Estimated Expiration
2041-12-15

AI Technical Summary

Technical Problem

The existing system disaster recovery switching methods rely on manual intervention, resulting in high time costs and low efficiency, which affects business continuity.

Method used

By obtaining application-related information, it is configured in the configuration information database, and it is used to backup files and switch configuration information when receiving disaster recovery switching tasks, and automatically restart the process. If it fails, it will roll back and try again until it is successful.

Benefits of technology

It improves the efficiency of system disaster recovery switching, reduces manual intervention, shortens the time for disaster recovery switching, and reduces business impact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114237982B_ABST
    Figure CN114237982B_ABST
Patent Text Reader

Abstract

The present invention relates to artificial intelligence technology, and discloses a system disaster recovery switching method, including: configuring rules based on application-related information, obtaining application configuration rules and storing them in a configuration information database; when receiving a trigger instruction for a system disaster recovery switching task, backing up the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file; obtaining disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database, switching the disaster recovery file based on the disaster recovery switching configuration information and restarting the process; if the process restart fails, performing disaster recovery switching on the backup disaster recovery file, obtaining the switched disaster recovery file and restarting the process until the process restarts successfully. In addition, the present invention also relates to blockchain technology, and the application configuration rules can be stored in the nodes of the blockchain. The present invention also proposes a system disaster recovery switching device, an electronic device, and a storage medium. The present invention can improve the efficiency of system disaster recovery switching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a system disaster recovery switching method, device, electronic device and computer-readable storage medium. Background Art

[0002] Application business systems usually run stably, and generally do not need to modify the configuration for switching; however, in extreme cases or certain scenarios, it is necessary to modify the configuration, restart the application system, and quickly restore the application system's services to ensure the stable operation of the business system. The existing method for handling application system disaster recovery switching is usually through manual intervention by operation and maintenance, logging into the background application server, modifying the business application configuration, and restarting the relevant applications. This method increases the manual maintenance cost when there are many online application systems deployed. At the same time, manual processing requires finding the corresponding configuration step by step to modify and restart, and the time cost in the middle is also high, resulting in a relatively long period of unavailability when the system switches, which affects the business. Therefore, it is urgent to propose a more efficient system disaster recovery switching method. Summary of the invention

[0003] The present invention provides a system disaster recovery switching method, device and computer-readable storage medium, the main purpose of which is to improve the efficiency of system disaster recovery switching.

[0004] To achieve the above object, the present invention provides a system disaster recovery switching method, comprising:

[0005] Acquire application related information, perform rule configuration based on the application related information to obtain application configuration rules, and store the application configuration rules in a preset configuration information database;

[0006] When a trigger instruction of a system disaster recovery switching task is received, a switching file corresponding to the disaster recovery switching task is backed up to obtain a backup disaster recovery file;

[0007] Obtaining disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database, switching the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information, and restarting the process according to the switched disaster recovery file;

[0008] If the process is restarted successfully, it is determined that the system disaster recovery switch is successful. If the process fails to restart, the backup disaster recovery file is switched to obtain the switched disaster recovery file and restart the process until the process is restarted successfully.

[0009] Optionally, performing rule configuration based on the application related information to obtain application configuration rules includes:

[0010] Identify the information format of the application-related information, and determine whether the information format is consistent with a preset format;

[0011] If the information format is consistent with the preset format, the application related information is used as standard application information;

[0012] If the information format is inconsistent with the preset format, converting the information format into information in the preset format using a format converter and using the converted information as standard application information;

[0013] Deploying the standard application information to obtain multiple deployment rules;

[0014] A plurality of the deployment rules are aggregated and recorded in a preset default configuration file to obtain application configuration rules.

[0015] Optionally, the deploying the standard application information to obtain multiple deployment rules includes:

[0016] Obtaining the preset disaster recovery situation and the corresponding response method of the disaster recovery situation;

[0017] The standard application information is compared with the disaster recovery situation, and the response method corresponding to the disaster recovery situation that is consistent with the comparison is used as the deployment rule of the standard application information.

[0018] Optionally, backing up the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file includes:

[0019] Performing file encapsulation processing on the switching file to obtain a backup data package and storing the backup data package in a preset file backup source end;

[0020] Receiving a backup data packet sent by a file backup source, parsing the backup data packet using a preset file transfer protocol to obtain at least one backup file;

[0021] Obtaining file information of each backup file, matching the file information with a preset backup strategy, and obtaining a matching result;

[0022] According to the matching result, the backup file is stored in the storage location in the backup strategy to obtain a backup disaster recovery file.

[0023] Optionally, the performing file encapsulation processing on the switching file to obtain a backup data packet includes:

[0024] Splitting the switching file based on a preset standard size to obtain a plurality of split sub-files;

[0025] The file descriptions corresponding to the plurality of the slice sub-files are obtained, the plurality of the slice sub-files and the corresponding file descriptions are matched one by one, and the one-to-one matched slice sub-files and file descriptions are summarized to obtain a backup data package.

[0026] Optionally, switching the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information includes:

[0027] Identify the file path of the disaster recovery file and the corresponding configuration information;

[0028] Information search is performed based on the file path, and the configuration information is replaced by using the disaster recovery switching configuration information to obtain the disaster recovery file after switching.

[0029] Optionally, before restarting the process according to the switched disaster recovery file, the method further includes:

[0030] Use the preset detection code to check whether the process's port is successfully opened.

[0031] In order to solve the above problem, the present invention further provides a system disaster recovery switching device, the device comprising:

[0032] A rule configuration module, used to obtain application related information, perform rule configuration based on the application related information, obtain application configuration rules, and store the application configuration rules in a preset configuration information database;

[0033] A file backup module is used to back up the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file when receiving a trigger instruction of the system disaster recovery switching task;

[0034] A file switching module, used to obtain the disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database, switch the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information, and restart the process according to the switched disaster recovery file;

[0035] The process restart module is used to determine that the system disaster recovery switch is successful if the process restart is successful, and if the process restart fails, perform disaster recovery switch on the backup disaster recovery file, obtain the switched disaster recovery file and restart the process until the process restart is successful.

[0036] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0037] at least one processor; and,

[0038] a memory communicatively connected to the at least one processor; wherein,

[0039] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the system disaster recovery switching method described above.

[0040] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned system disaster recovery switching method.

[0041] The embodiment of the present invention performs rule configuration based on application-related information to obtain application configuration rules and store them in a configuration information database. The pre-set rule configuration can be used as the subsequent data basis to improve the efficiency of disaster recovery switching. When a trigger instruction for a system disaster recovery switching task is received, a file backup is performed on the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file. The file backup can be used as the original data for the next disaster recovery switching after the disaster recovery switching fails. The disaster recovery file in the disaster recovery switching task is switched based on the disaster recovery switching configuration information corresponding to the disaster recovery switching task obtained from the configuration information database, and the process is restarted according to the switched disaster recovery file. The efficiency of system disaster recovery switching can be improved. Therefore, the system disaster recovery switching method, device, electronic device and computer-readable storage medium proposed in the present invention can solve the problem of insufficient efficiency of system disaster recovery switching. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of a flow chart of a system disaster recovery switching method provided by an embodiment of the present invention;

[0043] Figure 2 A functional module diagram of a system disaster recovery switching device provided by an embodiment of the present invention;

[0044] Figure 3 A schematic diagram of the structure of an electronic device for implementing the system disaster recovery switching method provided by an embodiment of the present invention.

[0045] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0047] The embodiment of the present application provides a system disaster recovery switching method. The execution subject of the system disaster recovery switching method includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the system disaster recovery switching method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0048] Reference Figure 1 FIG. 1 is a flow chart of a method for switching a system disaster recovery according to an embodiment of the present invention. In this embodiment, the method for switching a system disaster recovery comprises:

[0049] S1. Acquire application-related information, perform rule configuration based on the application-related information to obtain application configuration rules, and store the application configuration rules in a preset configuration information database.

[0050] In the embodiment of the present invention, the application related information refers to the type and file path of the configuration file for deploying the application. The application configuration rules obtained by performing rule configuration are prepared in advance according to the specific deployment mode of the system, and the application configuration rules facilitate rapid system switching in emergencies.

[0051] Specifically, the performing rule configuration based on the application related information to obtain the application configuration rule includes:

[0052] Identify the information format of the application-related information, and determine whether the information format is consistent with a preset format;

[0053] If the information format is consistent with the preset format, the application related information is used as standard application information;

[0054] If the information format is inconsistent with the preset format, converting the information format into information in the preset format using a format converter and using the converted information as standard application information;

[0055] Deploying the standard application information to obtain multiple deployment rules;

[0056] A plurality of the deployment rules are aggregated and recorded in a preset default configuration file to obtain application configuration rules.

[0057] In detail, the preset format can be json, xml or ini file format, and it is determined whether the information format of the application-related information is the preset file format. If the information format is the preset file format, the application-related information is used as standard application information. If the information format is not the preset file format, the format converter is used to convert the information format into the preset file format and the converted information is used as standard application information.

[0058] Furthermore, the standard application information is deployed to obtain a plurality of deployment rules, including:

[0059] Obtaining the preset disaster recovery situation and the corresponding response method of the disaster recovery situation;

[0060] The standard application information is compared with the disaster recovery situation, and the response method corresponding to the disaster recovery situation that is consistent with the comparison is used as the deployment rule of the standard application information.

[0061] In detail, the disaster recovery situation is a situation in which a disaster recovery scenario is frequently encountered in an application system, and the coping method is a common method for handling disaster recovery situations.

[0062] S2. When a trigger instruction of a system disaster recovery switching task is received, a switching file corresponding to the disaster recovery switching task is backed up to obtain a backup disaster recovery file.

[0063] In an embodiment of the present invention, the trigger instruction of the system disaster recovery switching task refers to a request issued when disaster recovery switching is required. When the trigger instruction is received, the switching file corresponding to the disaster recovery switching task needs to be backed up first to provide a data basis to prevent subsequent misoperation or operation errors.

[0064] Specifically, backing up the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file includes:

[0065] Performing file encapsulation processing on the switching file to obtain a backup data package and storing the backup data package in a preset file backup source end;

[0066] Receiving a backup data packet sent by a file backup source, parsing the backup data packet using a preset file transfer protocol to obtain at least one backup file;

[0067] Obtaining file information of each backup file, matching the file information with a preset backup strategy, and obtaining a matching result;

[0068] According to the matching result, the backup file is stored in the storage location in the backup strategy to obtain a backup disaster recovery file.

[0069] In detail, by setting the backup strategy, the backup files received by the file backup terminal can be classified and processed, and stored in the preset storage location, so that the backup files can be automatically classified, so that the backup files can be better processed, thereby improving the convenience of managing the backup files. The backup strategy includes several backup path matching strategies; the file information includes at least one of the following data: backup path, file owner ID, file type, file capacity and file permissions; the backup path matching strategy corresponds to the data in the file information one by one.

[0070] Furthermore, the step of performing file encapsulation processing on the switching file to obtain a backup data packet includes:

[0071] Splitting the switching file based on a preset standard size to obtain a plurality of split sub-files;

[0072] The file descriptions corresponding to the plurality of the slice sub-files are obtained, the plurality of the slice sub-files and the corresponding file descriptions are matched one by one, and the one-to-one matched slice sub-files and file descriptions are summarized to obtain a backup data package.

[0073] The preset standard size can be set according to the specific size of the switching file. The file description corresponding to the molecular file refers to a sentence that briefly explains the file.

[0074] In another embodiment of the present invention, backing up the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file includes:

[0075] Get the automatic backup time and the file list of the automatic backup switch file;

[0076] Match the automatic backup time with the current time to obtain matching processing information;

[0077] The backup files in the file list are backed up according to the matching processing information to obtain backup disaster recovery files.

[0078] In detail, by setting the automatic backup time, the file backup source can be automatically backed up according to the preset automatic backup time, thereby improving the convenience of the backup processing of the file backup.

[0079] S3. Obtain disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database, switch the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information, and restart the process according to the switched disaster recovery file.

[0080] In the embodiment of the present invention, the configuration information database stores multiple application configuration rules, and the pre-stored application configuration rules help improve the efficiency of subsequent disaster recovery switching. Obtaining the disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database can be used for direct switching.

[0081] Specifically, switching the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information includes:

[0082] Identify the file path of the disaster recovery file and the corresponding configuration information;

[0083] Information search is performed based on the file path, and the configuration information is replaced by using the disaster recovery switching configuration information to obtain the disaster recovery file after switching.

[0084] Specifically, the process of the switched disaster recovery file may be restarted to determine whether the switch is successful.

[0085] Furthermore, before restarting the process according to the switched disaster recovery file, the method further includes:

[0086] Use the preset detection code to check whether the process's port is successfully opened.

[0087] The preset detection code may be netstat -lnp|grep port name, which is used to check which process occupies the port, thereby checking whether the port is successfully opened.

[0088] Specifically, when restarting the process according to the switched disaster recovery file, there may be two possible situations: successful restart of the process and failed restart of the process.

[0089] S4. If the process is restarted successfully, it is determined that the system disaster recovery switch is successful. If the process fails to be restarted, the backup disaster recovery file is switched to obtain the switched disaster recovery file and restart the process until the process is restarted successfully.

[0090] In an embodiment of the present invention, when the process is restarted successfully, it indicates that the system disaster recovery switch is successful. When the process fails to restart, it indicates that the system disaster recovery switch fails. At this time, it is necessary to perform disaster recovery switching on the backup disaster recovery file instead of switching the switched disaster recovery file. The switched disaster recovery file has been modified. Performing disaster recovery switching on this basis is not accurate enough. The backup disaster recovery file obtained after the file backup can be used as the basis for modification. The backup disaster recovery file is switched to obtain the switched disaster recovery file and restart the process until the process is restarted successfully.

[0091] Among them, if the corresponding process cannot be restarted or the port cannot be started, operation and maintenance will need to intervene again to ensure that there is an emergency plan to restore the system.

[0092] The embodiment of the present invention performs rule configuration based on application-related information, obtains application configuration rules and stores them in a configuration information database. The pre-set rule configuration can be used as the subsequent data basis to improve the efficiency of disaster recovery switching. When a trigger instruction of a system disaster recovery switching task is received, a file backup is performed on the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file. The file backup can be used as the original data for the next disaster recovery switching after the disaster recovery switching fails. The disaster recovery file in the disaster recovery switching task is switched based on the disaster recovery switching configuration information corresponding to the disaster recovery switching task obtained from the configuration information database, and the process is restarted according to the switched disaster recovery file. The efficiency of the system disaster recovery switching can be improved. Therefore, the system disaster recovery switching method proposed in the present invention can solve the problem that the efficiency of the system disaster recovery switching is not high enough.

[0093] like Figure 2 , which is a functional module diagram of a system disaster recovery switching device provided by an embodiment of the present invention.

[0094] The system disaster recovery switching device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the system disaster recovery switching device 100 can include a rule configuration module 101, a file backup module 102, a file switching module 103 and a process restart module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0095] In this embodiment, the functions of each module / unit are as follows:

[0096] The rule configuration module 101 is used to obtain application related information, perform rule configuration based on the application related information, obtain application configuration rules, and store the application configuration rules in a preset configuration information database;

[0097] The file backup module 102 is used to back up the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file when receiving a trigger instruction of the system disaster recovery switching task;

[0098] The file switching module 103 is used to obtain the disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database, switch the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information, and restart the process according to the switched disaster recovery file;

[0099] The process restart module 104 is used to determine that the system disaster recovery switch is successful if the process restart is successful, and to perform disaster recovery switch on the backup disaster recovery file if the process restart fails, obtain the switched disaster recovery file and restart the process until the process restart is successful.

[0100] In detail, the specific implementation of each module of the system disaster recovery switching device 100 is as follows:

[0101] Step 1: Obtain application related information, perform rule configuration based on the application related information to obtain application configuration rules, and store the application configuration rules in a preset configuration information database.

[0102] In the embodiment of the present invention, the application related information refers to the type and file path of the configuration file for deploying the application. The application configuration rules obtained by performing rule configuration are prepared in advance according to the specific deployment mode of the system, and the application configuration rules facilitate rapid system switching in emergencies.

[0103] Specifically, the performing rule configuration based on the application related information to obtain the application configuration rule includes:

[0104] Identify the information format of the application-related information, and determine whether the information format is consistent with a preset format;

[0105] If the information format is consistent with the preset format, the application related information is used as standard application information;

[0106] If the information format is inconsistent with the preset format, converting the information format into information in the preset format using a format converter and using the converted information as standard application information;

[0107] Deploying the standard application information to obtain multiple deployment rules;

[0108] A plurality of the deployment rules are aggregated and recorded in a preset default configuration file to obtain application configuration rules.

[0109] In detail, the preset format can be json, xml or ini file format, and it is determined whether the information format of the application-related information is the preset file format. If the information format is the preset file format, the application-related information is used as standard application information. If the information format is not the preset file format, the format converter is used to convert the information format into the preset file format and the converted information is used as standard application information.

[0110] Furthermore, the standard application information is deployed to obtain a plurality of deployment rules, including:

[0111] Obtaining the preset disaster recovery situation and the corresponding response method of the disaster recovery situation;

[0112] The standard application information is compared with the disaster recovery situation, and the response method corresponding to the disaster recovery situation that is consistent with the comparison is used as the deployment rule of the standard application information.

[0113] In detail, the disaster recovery situation is a situation in which a disaster recovery scenario is frequently encountered in an application system, and the coping method is a common method for handling disaster recovery situations.

[0114] Step 2: When a trigger instruction of a system disaster recovery switching task is received, a switching file corresponding to the disaster recovery switching task is backed up to obtain a backup disaster recovery file.

[0115] In an embodiment of the present invention, the trigger instruction of the system disaster recovery switching task refers to a request issued when disaster recovery switching is required. When the trigger instruction is received, the switching file corresponding to the disaster recovery switching task needs to be backed up first to provide a data basis to prevent subsequent misoperation or operation errors.

[0116] Specifically, backing up the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file includes:

[0117] Performing file encapsulation processing on the switching file to obtain a backup data package and storing the backup data package in a preset file backup source end;

[0118] Receiving a backup data packet sent by a file backup source, parsing the backup data packet using a preset file transfer protocol to obtain at least one backup file;

[0119] Obtaining file information of each backup file, matching the file information with a preset backup strategy, and obtaining a matching result;

[0120] According to the matching result, the backup file is stored in the storage location in the backup strategy to obtain a backup disaster recovery file.

[0121] In detail, by setting the backup strategy, the backup files received by the file backup terminal can be classified and processed, and stored in the preset storage location, so that the backup files can be automatically classified, so that the backup files can be better processed, thereby improving the convenience of managing the backup files. The backup strategy includes several backup path matching strategies; the file information includes at least one of the following data: backup path, file owner ID, file type, file capacity and file permissions; the backup path matching strategy corresponds to the data in the file information one by one.

[0122] Furthermore, the step of performing file encapsulation processing on the switching file to obtain a backup data packet includes:

[0123] Splitting the switching file based on a preset standard size to obtain a plurality of split sub-files;

[0124] The file descriptions corresponding to the plurality of the slice sub-files are obtained, the plurality of the slice sub-files and the corresponding file descriptions are matched one by one, and the one-to-one matched slice sub-files and file descriptions are summarized to obtain a backup data package.

[0125] The preset standard size can be set according to the specific size of the switching file. The file description corresponding to the molecular file refers to a sentence that briefly explains the file.

[0126] In another embodiment of the present invention, backing up the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file includes:

[0127] Get the automatic backup time and the file list of the automatic backup switch file;

[0128] Match the automatic backup time with the current time to obtain matching processing information;

[0129] The backup files in the file list are backed up according to the matching processing information to obtain backup disaster recovery files.

[0130] In detail, by setting the automatic backup time, the file backup source can be automatically backed up according to the preset automatic backup time, thereby improving the convenience of the backup processing of the file backup.

[0131] Step three: Obtain disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database, switch the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information, and restart the process according to the switched disaster recovery file.

[0132] In the embodiment of the present invention, the configuration information database stores multiple application configuration rules, and the pre-stored application configuration rules help improve the efficiency of subsequent disaster recovery switching. Obtaining the disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database can be used for direct switching.

[0133] Specifically, switching the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information includes:

[0134] Identify the file path of the disaster recovery file and the corresponding configuration information;

[0135] Information search is performed based on the file path, and the configuration information is replaced by using the disaster recovery switching configuration information to obtain the disaster recovery file after switching.

[0136] Specifically, the process of the switched disaster recovery file may be restarted to determine whether the switch is successful.

[0137] Furthermore, before restarting the process according to the switched disaster recovery file, the following steps are also performed:

[0138] Use the preset detection code to check whether the process's port is successfully opened.

[0139] The preset detection code may be netstat -lnp|grep port name, which is used to check which process occupies the port, thereby checking whether the port is successfully opened.

[0140] Specifically, when restarting the process according to the switched disaster recovery file, there may be two possible situations: successful restart of the process and failed restart of the process.

[0141] Step 4: If the process is restarted successfully, it is determined that the system disaster recovery switch is successful. If the process fails to restart, the backup disaster recovery file is switched to obtain the switched disaster recovery file and restart the process until the process is restarted successfully.

[0142] In an embodiment of the present invention, when the process is restarted successfully, it indicates that the system disaster recovery switch is successful. When the process fails to restart, it indicates that the system disaster recovery switch fails. At this time, it is necessary to perform disaster recovery switching on the backup disaster recovery file instead of switching the switched disaster recovery file. The switched disaster recovery file has been modified. Performing disaster recovery switching on this basis is not accurate enough. The backup disaster recovery file obtained after the file backup can be used as the basis for modification. The backup disaster recovery file is switched to obtain the switched disaster recovery file and restart the process until the process is restarted successfully.

[0143] Among them, if the corresponding process cannot be restarted or the port cannot be started, operation and maintenance will need to intervene again to ensure that there is an emergency plan to restore the system.

[0144] The embodiment of the present invention performs rule configuration based on application-related information, obtains application configuration rules and stores them in a configuration information database. The pre-set rule configuration can be used as the subsequent data basis to improve the efficiency of disaster recovery switching. When a trigger instruction of a system disaster recovery switching task is received, a file backup is performed on the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file. The file backup can be used as the original data for the next disaster recovery switching after the disaster recovery switching fails. The disaster recovery file in the disaster recovery switching task is switched based on the disaster recovery switching configuration information corresponding to the disaster recovery switching task obtained from the configuration information database, and the process is restarted according to the switched disaster recovery file. The efficiency of the system disaster recovery switching can be improved. Therefore, the system disaster recovery switching device proposed in the present invention can solve the problem of insufficient efficiency of the system disaster recovery switching.

[0145] like Figure 3 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a system disaster recovery switching method provided by an embodiment of the present invention.

[0146] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a system disaster recovery switching program.

[0147] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a system disaster recovery switching program, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.

[0148] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the system disaster recovery switching program, but also can be used to temporarily store data that has been output or is to be output.

[0149] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0150] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0151] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0152] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0153] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0154] The system disaster recovery switching program stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0155] Acquire application related information, perform rule configuration based on the application related information to obtain application configuration rules, and store the application configuration rules in a preset configuration information database;

[0156] When a trigger instruction of a system disaster recovery switching task is received, a switching file corresponding to the disaster recovery switching task is backed up to obtain a backup disaster recovery file;

[0157] Obtaining disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database, switching the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information, and restarting the process according to the switched disaster recovery file;

[0158] If the process is restarted successfully, it is determined that the system disaster recovery switch is successful. If the process fails to restart, the backup disaster recovery file is switched to obtain the switched disaster recovery file and restart the process until the process is restarted successfully.

[0159] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.

[0160] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0161] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0162] Acquire application related information, perform rule configuration based on the application related information to obtain application configuration rules, and store the application configuration rules in a preset configuration information database;

[0163] When a trigger instruction of a system disaster recovery switching task is received, a switching file corresponding to the disaster recovery switching task is backed up to obtain a backup disaster recovery file;

[0164] Obtaining disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database, switching the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information, and restarting the process according to the switched disaster recovery file;

[0165] If the process is restarted successfully, it is determined that the system disaster recovery switch is successful. If the process fails to restart, the backup disaster recovery file is switched to obtain the switched disaster recovery file and restart the process until the process is restarted successfully.

[0166] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0167] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0168] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0169] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0170] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0171] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0172] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0173] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A system disaster recovery switching method, characterized in that: The method comprises: Acquire application related information, perform rule configuration based on the application related information to obtain application configuration rules, and store the application configuration rules in a preset configuration information database; When a trigger instruction of a system disaster recovery switching task is received, a switching file corresponding to the disaster recovery switching task is backed up to obtain a backup disaster recovery file; Obtaining disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database, switching the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information, and restarting the process according to the switched disaster recovery file; If the process is successfully restarted, it is determined that the system disaster recovery switch is successful. If the process fails to be restarted, the backup disaster recovery file is switched to a disaster recovery file, the switched disaster recovery file is obtained and the process is restarted until the process is successfully restarted; Among them, the rule configuration based on the application-related information to obtain the application configuration rules includes: identifying the information format of the application-related information, and judging whether the information format is consistent with the preset format; if the information format is consistent with the preset format, using the application-related information as standard application information; if the information format is inconsistent with the preset format, using a format converter to convert the information format into information in a preset format and using the converted information as standard application information; deploying the standard application information to obtain multiple deployment rules; summarizing and recording multiple deployment rules in a preset default configuration file to obtain application configuration rules; The deploying of the standard application information to obtain a plurality of deployment rules includes: obtaining a preset disaster recovery situation and a response method corresponding to the disaster recovery situation; comparing the standard application information with the disaster recovery situation, and using the response method corresponding to the disaster recovery situation that is consistent with the comparison as the deployment rule of the standard application information; The switching of the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information includes: identifying the file path and corresponding configuration information of the disaster recovery file; performing information search based on the file path, and replacing the configuration information with the disaster recovery switching configuration information to obtain the switched disaster recovery file.

2. The system disaster recovery switching method according to claim 1, characterized in that: The step of backing up the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file includes: Performing file encapsulation processing on the switching file to obtain a backup data package and storing the backup data package in a preset file backup source end; Receiving a backup data packet sent by a file backup source, parsing the backup data packet using a preset file transfer protocol to obtain at least one backup file; Obtaining file information of each backup file, matching the file information with a preset backup strategy, and obtaining a matching result; According to the matching result, the backup file is stored in the storage location in the backup strategy to obtain a backup disaster recovery file.

3. The system disaster recovery switching method according to claim 2, characterized in that: The step of performing file encapsulation processing on the switching file to obtain a backup data packet includes: Splitting the switching file based on a preset standard size to obtain a plurality of split sub-files; The file descriptions corresponding to the plurality of the slice sub-files are obtained, the plurality of the slice sub-files and the corresponding file descriptions are matched one by one, and the one-to-one matched slice sub-files and file descriptions are summarized to obtain a backup data package.

4. The system disaster recovery switching method according to any one of claims 1 to 3, characterized in that: Before restarting the process according to the switched disaster recovery file, the method further includes: Use the preset detection code to check whether the process's port is successfully opened.

5. A system disaster recovery switching device, used to implement the system disaster recovery switching method according to any one of claims 1 to 4, characterized in that: The device comprises: A rule configuration module, used to obtain application related information, perform rule configuration based on the application related information, obtain application configuration rules, and store the application configuration rules in a preset configuration information database; A file backup module is used to back up the switching file corresponding to the disaster recovery switching task to obtain a backup disaster recovery file when receiving a trigger instruction of the system disaster recovery switching task; A file switching module, used to obtain the disaster recovery switching configuration information corresponding to the disaster recovery switching task from the configuration information database, switch the disaster recovery file in the disaster recovery switching task based on the disaster recovery switching configuration information, and restart the process according to the switched disaster recovery file; The process restart module is used to determine that the system disaster recovery switch is successful if the process restart is successful, and if the process restart fails, perform disaster recovery switch on the backup disaster recovery file, obtain the switched disaster recovery file and restart the process until the process restart is successful.

6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the system disaster recovery switching method as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the system disaster recovery switching method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Database recovery method and device, computer equipment and storage medium

    CN108628705A

  • Disaster recovery switching method and device for application system, computer equipment and storage medium

    CN111966530A