Power data disaster recovery method, system, device, computer equipment and storage medium
By using the first server to process pending power service requests and perform data synchronization when the second server fails, the problem of low backup efficiency in the existing technology is solved, and efficient backup and non-intrusive business switching for power data disaster recovery are achieved.
Patent Information
- Application Number
- CN202210496130.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-09
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-05-09
AI Technical Summary
Existing power data disaster recovery methods have low backup efficiency when encountering natural disasters or man-made destruction, resulting in inconsistency between backup data and actual data.
When a fault of the second server is detected, the first server obtains and processes the pending power service request, uses the same stored power data and business processing logic as the second server for data synchronization, and realizes non-inductive processing of the business. Data recovery is performed when the second server resumes operation.
It improves the backup efficiency of power data disaster recovery, ensures the consistency of data and business processing logic, reduces the risk of data loss, and achieves long-term stable operation and smooth switching of the business system.
Smart Images

Figure CN114900532B
Abstract
Description
Technical Field
[0001] The present application relates to the field of power safety technology, and in particular to a power data disaster recovery method, system, device, computer equipment, storage medium and computer program product. Background Art
[0002] With the development of big data and artificial intelligence, digitalization is the core driving force to promote fundamental changes in production, operation, management and service models. Big data, as the data core of the production system, includes relational data, analytical data and unstructured data, and serves as the base of business data. Among them, unstructured data is frequently used in the business of the power industry and occupies an important position in the power industry. Therefore, how to ensure the security and reliability of unstructured power data has become the primary problem to be solved in power production. At present, when power data encounters natural disasters or man-made damage, it is usually achieved through local disk replication. However, the disaster recovery method of the local disk can easily lead to inconsistencies between the backup data and the actual data.
[0003] Therefore, the current power data disaster recovery method has the defect of low backup efficiency. Summary of the invention
[0004] Based on this, it is necessary to provide a power data disaster recovery method, system, device, computer equipment, storage medium and computer program product that can improve backup efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a power data disaster recovery method, which is applied to a first server, and the method includes:
[0006] Fault information of the second server is detected, and a pending power service request of the second server is obtained; the pending power service request includes pending power data; the first server stores the same stored power data and service processing logic as the second server; the stored power data and service processing logic are obtained by synchronizing data with the first server when the second server stores the pending power data in the power service request sent by the user terminal;
[0007] The to-be-processed power service request is processed according to the service processing logic, and the to-be-processed power data is stored in the first database of the first server as stored power data.
[0008] In one embodiment, the method further comprises:
[0009] receiving a multi-copy replication request sent by the second server; the multi-copy replication request includes processed power data obtained after the second server processes the power service request sent by the user terminal;
[0010] Obtaining the processed power data in the multi-copy replication request and storing it in a first database to obtain stored power data;
[0011] Sending storage completion information to the second server; the second server is used to receive the storage completion information and return power business processing completion information to the user terminal.
[0012] In one embodiment, after processing the pending power service request according to the service processing logic and storing the pending power data in the first database of the first server as stored power data, the method further includes:
[0013] Receive the resumption information sent by the second server, and synchronize the power data stored in the first database with the power data stored in the second database of the second server through the object storage gateway service.
[0014] In a second aspect, the present application provides a power data disaster recovery method, which is applied to a second server, and the method includes:
[0015] Detecting the fault information of the second server, sending the to-be-processed power service request sent by the user terminal and including the to-be-processed power data to the first server; the first server is used to process the to-be-processed power service request according to the same business processing logic as the second server, and store the to-be-processed power data in the first database of the first server as stored power data;
[0016] The recovery operation information of the second server is detected, and the stored power data in the first database is synchronized with the stored power data in the second database of the second server through the object storage gateway service.
[0017] In one embodiment, the method further comprises:
[0018] Receiving an electric power service request sent by a user terminal, and obtaining the electric power data to be processed in the electric power service request;
[0019] Processing the power service request according to the service processing logic to obtain processed power data, and storing the processed power data in a second database of the second server as stored power data;
[0020] A multi-copy replication request including the processed power data is sent to the first server; the first server is used to obtain the processed power data in the multi-copy replication request and store it in the first database to obtain the stored power data.
[0021] In one of the embodiments, after sending the multiple copies replication request including the processed power data to the first server, the method further includes:
[0022] Receiving storage completion information sent by the first server;
[0023] Returning power service processing completion information corresponding to the power service to the user terminal.
[0024] In a third aspect, the present application provides a power data disaster recovery system, the system comprising: a user terminal, a first server and a second server;
[0025] The user terminal is used to send a to-be-processed power service request including to-be-processed power data to the second server;
[0026] The second server is used to detect the fault information of the second server and send the to-be-processed power service request sent by the user terminal including the to-be-processed power data to the first server;
[0027] The first server is used to process the pending power service request according to the same service processing logic as that of the second server, and store the pending power data in a first database of the first server as stored power data.
[0028] In a fourth aspect, the present application provides a power data disaster recovery device, applied to a first server, the device comprising:
[0029] A first acquisition module is used to detect fault information of a second server and acquire a pending power service request of the second server; the pending power service request includes pending power data; the first server stores the same stored power data and service processing logic as the second server; the stored power data and service processing logic are obtained by synchronizing data with the first server when the second server stores the pending power data in the power service request sent by the user terminal;
[0030] A processing module is used to process the pending power service request according to the service processing logic, and store the pending power data in the first database of the first server as stored power data.
[0031] In a fifth aspect, the present application provides a power data disaster recovery device, applied to a second server, the device comprising:
[0032] a sending module, configured to detect fault information of the second server, and send a pending power service request including pending power data sent by a user terminal to the first server; the first server is configured to process the pending power service request according to the same service processing logic as that of the second server, and store the pending power data in a first database of the first server as stored power data;
[0033] The recovery module is used to detect the recovery operation information of the second server and synchronize the stored power data in the first database with the stored power data in the second database of the second server through the object storage gateway service.
[0034] In a sixth aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0035] In a seventh aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above-mentioned method when executed by a processor.
[0036] In an eighth aspect, the present application provides a computer program product, comprising a computer program, which implements the steps of the above method when executed by a processor.
[0037] The above-mentioned power data disaster recovery method, system, device, computer equipment, storage medium and computer program product, when detecting that the second server has a fault, will obtain the pending power business request being processed by the second server. The first server stores the same stored power data and business processing logic as the second server, and the stored power data and business processing logic are obtained by synchronizing data with the first server when the second server stores the pending power data in the above-mentioned power business request. The first server processes the pending power business request according to the above-mentioned business processing logic, and stores the pending power data to the first database as the stored power data. When it is detected that the second server resumes operation, the first server can also synchronize data with the second server to restore the data of the second server. Compared with the traditional backup disaster recovery method based on local disk, this solution uses the first server with the same stored power data and business processing logic as the second server to process the power business request being processed by the second server when the second server fails, so as to realize the senseless processing of the business and improve the backup efficiency of power data disaster recovery. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A diagram of an application environment of a power data disaster recovery method in an embodiment;
[0039] Figure 2 A schematic diagram of a flow chart of a power data disaster recovery method in one embodiment;
[0040] Figure 3 A schematic diagram of a flow chart of a power data disaster recovery method in another embodiment;
[0041] Figure 4 A schematic diagram of a flow chart of a power data disaster recovery method in another embodiment;
[0042] Figure 5 is a structural block diagram of a power data disaster recovery device in an embodiment;
[0043] Figure 6 is a structural block diagram of a power data disaster recovery device in another embodiment;
[0044] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0046] The power data disaster recovery method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the first server 102 communicates with the second server 104 through the network. The first server 102 and the second server 104 can be set in a distributed storage active-active architecture, and the second server 104 can normally receive the pending power service request sent from the user terminal, and process the power service request. The first server 102 can obtain the pending power service request of the second server 104 when the fault information of the second server 104 is detected, and based on the same stored power data as the second server 104, and using the same business logic as the second server 104 to process the pending power business, the pending power data in the pending power service request is stored to form stored power data. Among them, the first server 102 and the second server 104 can be implemented with independent servers or server clusters consisting of multiple servers.
[0047] In one embodiment, Figure 2 As shown, a power data disaster recovery method is provided, which is applied to Figure 1 Taking the first server in the example as an example, the following steps are included:
[0048] Step S202, detecting the fault information of the second server, obtaining the pending power service request of the second server; the pending power service request includes pending power data; the first server stores the same stored power data and business processing logic as the second server; the stored power data and business processing logic are obtained by synchronizing data with the first server when the second server stores the pending power data in the power service request sent by the user terminal.
[0049] Among them, the user terminal can be a terminal held by a user who needs to conduct electricity business, and the user can conduct the corresponding electricity business through the user terminal; the second server can be a main server, and the first server can be a backup server. The second server 104 can receive pending electricity business requests sent from the user terminal under normal circumstances, and based on the stored electricity data in the second database of the second server 104, process the pending electricity business requests sent by the above user terminal through the business processing logic of the second server 104. The first server 102 and the second server 104 can be set in the same distributed storage active-active architecture.
[0050] Among them, the first server 102 and the second server 104 can be connected in communication, and can realize two-way synchronization of data and business. When the second server 104 fails, for example, when it encounters a natural disaster or man-made damage, the second server 104 can send fault information to the first server 102, and the first server 104 can detect the fault information of the second server 104, and perform disaster recovery processing through the first server 102. When the second server 104 fails, the first server 102 can obtain the pending power business request being processed by the second server 104. Among them, the pending power business request includes pending power data. Since the first server 102 and the second server 104 adopt a dual-center synchronization mode, the main and standby servers can simultaneously process data to realize real-time increment, so the first server 102 stores the same stored power data and the same business processing logic as the second server 104. Among them, the stored power data represents the power data formed by storing the processed power data obtained after the first server 102 or the second server 104 processes the pending power business, that is, the stored power data is a kind of power data stored in the database. The service processing logic may be a processing logic for the power service request to be processed. For example, the power service to be processed may be a data writing request. Then, the first server 102 and the second server 104 have the same storage principle for the power service request to be processed.
[0051] Among them, under normal operation, the second server 104 can receive the power service request sent by the user terminal, and process and store the pending power data in the power service request. When the second server 104 completes storing the above-mentioned pending power data, before returning the processing result to the user terminal, it can initiate data synchronization to the first server 102. The first server 102 can synchronize the business processing logic and the stored power data with the second server 104, thereby ensuring the data consistency and processing logic consistency between the first server 102 and the second server 104.
[0052] Step S204 , processing the pending power service request according to the service processing logic, and storing the pending power data in the first database of the first server as stored power data.
[0053] Among them, the business processing logic of the above-mentioned first server 102 can be the same as the business processing logic of the second server 104. The first server 102 serves as a backup server. When the second server 102 fails, it can process the pending power business request being processed by the second server 102 according to the same business processing logic as the second server 104. The above-mentioned pending power business request includes pending power data. The first server 102 processes the pending power data to obtain processed power data. The first server 102 can store the processed power data in the first database of the first server 102 as new stored power data to update the database, and complete the processing of the pending power business of the user terminal to achieve disaster recovery processing of the power data, so that when the second server 104 as the main server fails, the power data disaster recovery processing can also be performed through the first server 102, realizing seamless switching and seamless processing of power business.
[0054] Among them, the above-mentioned various power data can all be a kind of unstructured power data, and the above-mentioned processing of power data disaster recovery can be a data disaster recovery method based on unstructured data. Due to the large amount of unstructured data and the large storage of individual files, the above-mentioned first server 102 and the second server 104 can adopt a dual-center synchronization mode to ensure disaster recovery capabilities, reduce data loss and realize real-time increment of power data. Through the above-mentioned dual-center synchronization mode, there is no difference in data between the first server 102 and the second server 104, and the business system can be used after switching, which reduces the risk of data loss and ensures the long-term stable operation of the business system.
[0055] In the above-mentioned power data disaster recovery method, when a failure of the second server is detected, the pending power business request being processed by the second server will be obtained. The first server stores the same stored power data and business processing logic as the second server, and the stored power data and business processing logic are obtained by synchronizing data with the first server when the second server stores the pending power data in the above-mentioned power business request. The first server processes the pending power business request according to the above-mentioned business processing logic, and stores the pending power data to the first database as the stored power data. When it is detected that the second server resumes operation, the first server can also synchronize data with the second server to restore the data of the second server. Compared with the traditional backup disaster recovery method based on local disk, this solution uses the first server with the same stored power data and business processing logic as the second server to process the power business request being processed by the second server when the second server fails, so as to realize the senseless processing of the business and improve the backup efficiency of power data disaster recovery.
[0056] In one embodiment, it also includes: receiving a multi-copy replication request sent by a second server; the multi-copy replication request includes processed power data obtained after the second server processes the power service request sent by the user terminal; obtaining the processed power data in the multi-copy replication request and storing it in the first database to obtain stored power data; sending storage completion information to the second server; the second server is used to receive the storage completion information and return the power service processing completion information to the user terminal.
[0057] In this embodiment, the second server 104 can be used as a master server to receive the power service request of the user terminal under normal operation. After the second server 104 completes the processing of the above power service request, the processed power data can be obtained. The first server 102 and the second server 104 can be designed according to the distributed storage (Ceph) active-active architecture. Ceph is a unified distributed storage system, and the original design intention is to provide better performance, reliability and scalability. Then the second server 104 can send a multi-copy replication request to the first server 102 after storing the processed power data in the pending power service request and before feeding back the processing completion information to the user terminal, and the first server 102 can receive the multi-copy replication request sent by the second server 104. Among them, the existence of multiple copies is a necessary means to improve the reliability, availability, performance and scalability of a distributed system. Replication can improve the reliability of the system. Multiple copies can be used for diversion, such as the master-slave structure of the database, and can also be used to speed up the response time, such as CDN, which makes replication have the utility of enhancing system availability and scalability.
[0058] The first server 102 may receive a multi-copy replication request sent by the second server 104. The multi-copy replication request may include processed power data obtained after the second server processes the power service request sent by the user terminal. The first server 102 may obtain the processed power data in the multi-copy replication request, and store the processed power data in the first database of the first server 102 to obtain the stored power data stored in the first server 102. Thus, real-time data synchronization between the first server 102 and the second server 104 is achieved. After the first server 102 synchronizes the power data just processed by the second server 104, it may send storage completion information to the second server 104. After the second server 104 receives the storage completion information sent by the first server 102, it represents that the real-time synchronization of data between the first server 102 and the second server 104 has been completed. Then, the second server 104 may return the power service processing completion information to the user terminal after receiving the above storage completion information. After the user terminal receives the above power service processing completion information, it may generate corresponding prompt information so that the user knows that the power service has been processed. Among them, the above power service processing completion information may be information in the form of a code.
[0059] For example, taking the power business as an example of power data writing, when the business request writes data, it is pointed to the main center, that is, the second server 104, by default through the load device. When the second server 104 completes the storage, it can send a multi-copy replication request to the backup center, that is, the first server 102. After the first server 102 completes the multi-copy replication, the second server 104 can return a 200OK message to the user terminal, prompting the user terminal that the data writing has been completed.
[0060] Through this embodiment, the first server 102 can synchronize the data of multiple copies with the second server 104 when the second server 104 completes the processing of the power business, so that there is no difference in the data between the primary and backup servers, and real-time increment is achieved, thereby improving the backup efficiency of power data disaster recovery.
[0061] In one embodiment, after processing the pending power business request according to the business processing logic and storing the pending power data in the first database of the first server as stored power data, it also includes: receiving the resumption of operation information sent by the second server, and synchronizing the stored power data in the first database with the stored power data in the second database of the second server through the object storage gateway service.
[0062] In this embodiment, the first server 102 can process the power business being processed by the second server 104 when the second server 104 fails. After processing the power business request, the first server 102 can store the power data therein to obtain the stored power data. At this time, since the second server 104 may be failing, the stored power data of the first server 102 at this time and the stored power data of the second server 104 at this time may be different. When the second server 104 resumes normal operation, the first server 102 can receive the recovery operation information sent by the second server 104, and synchronize the stored power data in the first database with the stored power data in the second database in the second server 104 through the RGW (RADOS Gateway, object storage gateway) service. Among them, the synchronization between the above-mentioned first database and the second database can be a two-way synchronization based on the RGW service in the distributed storage active-active structure, and the RGW service is a storage service supported by the Ceph overall architecture. Among them, the data synchronization process between the above-mentioned master and standby servers is an asynchronous operation with the business request, and the synchronization time cannot be guaranteed. Therefore, the master and standby server clusters can complete data synchronization in a timely manner through an internal consistency check mechanism to ensure the consistency of power data.
[0063] Through this embodiment, the first server 102 can synchronize the stored power data with the second server 104 after the second server 104 resumes normal operation, thereby improving the efficiency of disaster recovery backup of power data and ensuring data consistency between the primary and backup servers.
[0064] In one embodiment, Figure 3 As shown, a power data disaster recovery method is provided, which is applied to Figure 1 The second server in the example is used as an example to illustrate, including the following steps:
[0065] Step S302, detects fault information of the second server, and sends a pending power business request including pending power data sent by the user terminal to the first server; the first server is used to process the pending power business request according to the same business processing logic as the second server, and stores the pending power data in the first database of the first server as stored power data.
[0066] Among them, the user terminal can be a terminal held by a user who needs to conduct electricity business, and the user can conduct the corresponding electricity business through the user terminal; the second server can be a main server, and the first server can be a backup server. The second server 104 can receive pending electricity business requests sent from the user terminal under normal circumstances, and based on the stored electricity data in the second database of the second server 104, process the pending electricity business requests sent by the above user terminal through the business processing logic of the second server 104. The first server 102 and the second server 104 can be set in the same distributed storage active-active architecture.
[0067] Among them, the first server 102 and the second server 104 can be connected in communication, and can realize two-way synchronization of data and business. When the second server 104 fails, for example, when it encounters a natural disaster or man-made damage, the second server 104 can send fault information to the first server 102, and the first server 104 can detect the fault information of the second server 104, and perform disaster recovery processing through the first server 102. When the second server 104 fails, the first server 102 can obtain the pending power business request being processed by the second server 104. Among them, the pending power business request includes pending power data. Since the first server 102 and the second server 104 adopt a dual-center synchronization mode, the main and standby servers can simultaneously process data to realize real-time increment, so the first server 102 stores the same stored power data and the same business processing logic as the second server 104. Among them, the stored power data represents the power data formed by storing the processed power data obtained after the first server 102 or the second server 104 processes the pending power business, that is, the stored power data is a kind of power data stored in the database. The service processing logic may be a processing logic for the power service request to be processed. For example, the power service to be processed may be a data writing request. Then, the first server 102 and the second server 104 have the same storage principle for the power service request to be processed.
[0068] The business processing logic of the above-mentioned first server 102 can be the same as the business processing logic of the second server 104. The first server 102 serves as a backup server. When the second server 102 fails, it can process the pending power business request being processed by the second server 102 according to the same business processing logic as the second server 104. The above-mentioned pending power business request includes pending power data. The first server 102 processes the pending power data to obtain processed power data. The first server 102 can store the processed power data in the first database of the first server 102 as new stored power data to update the database, and complete the processing of the pending power business of the user terminal to achieve disaster recovery processing of the power data, so that when the second server 104 serving as the main server fails, the power data disaster recovery processing can also be performed through the first server 102, realizing seamless switching and seamless processing of power business.
[0069] Step S304: Detecting the recovery operation information of the second server, and synchronizing the stored power data in the first database with the stored power data in the second database of the second server through the object storage gateway service.
[0070] Among them, the first server 102 can process the power business being processed by the second server 104 when the second server 104 fails. After processing the power business request, the first server 102 can store the power data therein to obtain the stored power data. At this time, since the second server 104 may be in a fault, the stored power data of the first server 102 at this time and the stored power data of the second server 104 at this time may be different. When the second server 104 resumes normal operation, the first server 102 can receive the recovery operation information sent by the second server 104, and synchronize the stored power data in the first database with the stored power data in the second database in the second server 104 through the RGW (RADOS Gateway, object storage gateway) service. Among them, the synchronization between the above-mentioned first database and the second database can be a two-way synchronization based on the RGW service in the distributed storage active-active structure, and the RGW service is a storage service supported by the Ceph overall architecture. Among them, the data synchronization process between the above-mentioned master and standby servers is an asynchronous operation with the business request, and the synchronization time cannot be guaranteed, so the master and standby server clusters can complete data synchronization in a timely manner through an internal consistency check mechanism to ensure the consistency of power data.
[0071] In the above-mentioned power data disaster recovery method, when a failure of the second server is detected, the pending power business request being processed by the second server will be obtained. The first server stores the same stored power data and business processing logic as the second server, and the stored power data and business processing logic are obtained by synchronizing data with the first server when the second server stores the pending power data in the above-mentioned power business request. The first server processes the pending power business request according to the above-mentioned business processing logic, and stores the pending power data to the first database as the stored power data. When it is detected that the second server resumes operation, the first server can also synchronize data with the second server to restore the data of the second server. Compared with the traditional backup disaster recovery method based on local disk, this solution uses the first server with the same stored power data and business processing logic as the second server to process the power business request being processed by the second server when the second server fails, so as to realize the senseless processing of the business and improve the backup efficiency of power data disaster recovery.
[0072] In one embodiment, it also includes: receiving an electric power service request sent by a user terminal, obtaining the unprocessed electric power data in the electric power service request; processing the electric power service request according to the service processing logic to obtain processed electric power data, and storing the processed electric power data in a second database of a second server as stored electric power data; sending a multi-copy replication request including processed electric power data to a first server; the first server is used to obtain the processed electric power data in the multi-copy replication request and store it in the first database to obtain stored electric power data.
[0073] In this embodiment, under normal operation, the second server 104 can receive the power service request sent by the user terminal, and process and store the pending power data in the power service request. When the second server 104 completes storing the above-mentioned pending power data, before returning the processing result to the user terminal, it can initiate data synchronization to the first server 102. The first server 102 can synchronize the business processing logic and the stored power data with the second server 104, thereby ensuring the data consistency and processing logic consistency between the first server 102 and the second server 104.
[0074] Specifically, when the second server 104 is operating normally, it can serve as a main server to receive the power service request of the user terminal. The second server 104 can receive the power service request sent by the user terminal and obtain the pending power data in the request. The second server 104 can process the power service request according to the business processing logic and obtain the processed power data. The second server 104 can store the processed power data in the second database of the second server 104 as the stored power data. After the second server 104 completes the processing of the power service request, the processed power data can be obtained. The first server 102 and the second server 104 can be designed according to the active-active architecture of distributed storage (Ceph). Ceph is a unified distributed storage system, and the original design is to provide better performance, reliability and scalability. Then, after storing the processed power data in the pending power service request, the second server 104 can send a multi-copy replication request to the first server 102 before feeding back the processing completion information to the user terminal, and the first server 102 can receive the multi-copy replication request sent by the second server 104. Among them, the existence of multiple copies is a necessary means to improve the reliability, availability, performance and scalability of a distributed system. Replication can improve system reliability. Multiple copies can be used for traffic diversion, such as the master-slave structure of a database, or to speed up response time, such as CDN. This makes replication effective in enhancing system availability and scalability.
[0075] The first server 102 may receive a multi-copy replication request sent by the second server 104. The multi-copy replication request may include processed power data obtained after the second server processes the power service request sent by the user terminal. The first server 102 may obtain the processed power data in the multi-copy replication request, and store the processed power data in the first database of the first server 102 to obtain the stored power data stored in the first server 102. This enables real-time data synchronization between the first server 102 and the second server 104. After the first server 102 stores the above-mentioned processed power data, it may also return corresponding processing completion information to the second server 104 to notify the second server 104 to proceed to the next step of processing.
[0076] Through this embodiment, the first server 102 can synchronize the data of multiple copies with the second server 104 when the second server 104 completes the processing of the power business, so that there is no difference in the data between the primary and backup servers, and real-time increment is achieved, thereby improving the backup efficiency of power data disaster recovery.
[0077] In one embodiment, after sending a multiple copy replication request including processed power data to the first server, it also includes: receiving storage completion information sent by the first server; and returning power service processing completion information corresponding to the power service to the user terminal.
[0078] In this embodiment, after the first server 102 completes the above-mentioned multiple copies, it can return corresponding storage completion information to the second server 104. The second server 104 can receive the storage completion information sent by the first server 102, and return the power service processing completion information corresponding to the above-mentioned power service to the user terminal. The user terminal can generate corresponding prompt information based on the service processing completion information to prompt the user that the service has been processed.
[0079] Specifically, after the first server 102 synchronizes the power data just processed by the second server 104, it can send storage completion information to the second server 104. After the second server 104 receives the storage completion information sent by the first server 102, it means that the real-time synchronization of data between the first server 102 and the second server 104 has been completed. Then, the second server 104 can return power service processing completion information to the user terminal after receiving the above storage completion information. After the user terminal receives the above power service processing completion information, it can generate corresponding prompt information to let the user know that the power service has been processed. Among them, the above power service processing completion information can be a code-formed information.
[0080] For example, taking the power business as an example of power data writing, when the business request writes data, it is pointed to the main center, that is, the second server 104, by default through the load device. When the second server 104 completes the storage, it can send a multi-copy replication request to the backup center, that is, the first server 102. After the first server 102 completes the multi-copy replication, the second server 104 can return a 200OK message to the user terminal, prompting the user terminal that the data writing has been completed.
[0081] Through this embodiment, the first server 102 can synchronize the data of multiple copies with the second server 104 when the second server 104 completes the processing of the power business, so that there is no difference in the data between the primary and backup servers, and real-time increment is achieved, thereby improving the backup efficiency of power data disaster recovery. The second server 104 sends the business processing completion information to the user terminal only after the first server 102 completes the multiple copies of the replication, ensuring that the first server 102 and the second server 104 can maintain the consistency of data and business logic, thereby improving the efficiency of power data disaster recovery.
[0082] In one embodiment, Figure 4 As shown, Figure 4FIG. 1 is a flow chart of a power data disaster recovery method in another embodiment. Figure 4 It can be seen that the second server 104 (Cluster1) and the first server 102 (Cluster2) are designed with a distributed storage active-active architecture. The first server 102 and the second server 104 can perform bidirectional data synchronization through the RGW service, and the server and the user terminal can be connected through load balancing. Take the business request of writing power data as an example. When the business request writes data, the load device defaults to the main center, that is, the second server 104. When the main center storage completes the multi-copy replication to the backup center (first server 102), the second server 104 will return 200OK to the user terminal on the business side, thereby completing the data writing. At the same time, data synchronization from the main center cluster to the backup center cluster can also be performed to achieve business data disaster recovery and optimize storage and network efficiency. When the above-mentioned main center fails, the load will transfer the business request to the backup center, and the storage principle of the backup center is consistent with that of the data center. After the data center is restored, data synchronization can be performed between the main center and the backup center to ensure the consistency of the dual-center data.
[0083] Among them, since the master-slave data synchronization process and business requests are asynchronous operations and the synchronization time cannot be guaranteed, the master-slave clusters can use an internal consistency check mechanism to complete data synchronization in a timely manner to ensure data consistency.
[0084] Through the above-mentioned embodiments, by utilizing the first server with the same stored power data and business processing logic as the second server, the power business request being processed by the second server is processed when the second server fails, so as to realize the seamless processing of the business and improve the backup efficiency of power data disaster recovery. Moreover, for the disaster recovery of the above-mentioned unstructured power data, the above-mentioned embodiments can restore the operation of the business system in a relatively short time, meet the business requirements for the reliability of the information system, and finally realize the main center when it encounters natural disasters or man-made damage. In addition, seamless or rapid business switching can be realized to ensure business continuity. Among them, due to the dual-center synchronous mode, data processing is carried out simultaneously between the primary and the standby, realizing real-time increment. And because there is no difference in data, the primary and the standby can be switched between each other, the business is realized seamlessly, and it can be used immediately after switching.
[0085] In one embodiment, a power data disaster recovery system is provided, characterized in that the system includes: a user terminal, a first server and a second server; the user terminal is used to send a pending power business request including pending power data to the second server; the second server is used to detect fault information of the second server and send the pending power business request including pending power data sent by the user terminal to the first server; the first server is used to process the pending power business request according to the same business processing logic as the second server, and store the pending power data in the first database of the first server as stored power data.
[0086] For the specific definition of the power data disaster recovery system, please refer to the definition of the power data disaster recovery method above, which will not be repeated here. Each module in the above power data disaster recovery system can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0087] It should be understood that although Figure 2-Figure 4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-Figure 4 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0088] In one embodiment, Figure 5 As shown, a power data disaster recovery device is provided, including: a first acquisition module 500 and a processing module 502, wherein:
[0089] The first acquisition module 500 is used to detect the fault information of the second server and obtain the pending power service request of the second server; the pending power service request includes pending power data; the first server stores the same stored power data and business processing logic as the second server; the stored power data and business processing logic are obtained by synchronizing data with the first server when the second server stores the pending power data in the power service request sent by the user terminal.
[0090] The processing module 502 is used to process the pending power service request according to the service processing logic, and store the pending power data in the first database of the first server as stored power data.
[0091] In one embodiment, the above-mentioned device also includes: a first synchronization module, used to receive a multi-copy replication request sent by the second server; the multi-copy replication request includes processed power data obtained after the second server processes the power service request sent by the user terminal; obtaining the processed power data in the multi-copy replication request and storing it in the first database to obtain stored power data; sending storage completion information to the second server; the second server is used to receive the storage completion information and return the power service processing completion information to the user terminal.
[0092] In one embodiment, the above-mentioned device also includes: a second synchronization module, which is used to receive the resumption of operation information sent by the second server, and synchronize the stored power data in the first database with the stored power data in the second database of the second server through the object storage gateway service.
[0093] In one embodiment, Figure 6 As shown, a power data disaster recovery device is provided, including: a sending module 600 and a processing module 602, wherein:
[0094] The sending module 600 is used to detect the fault information of the second server and send the pending power business request sent by the user terminal including the pending power data to the first server; the first server is used to process the pending power business request according to the same business processing logic as the second server, and store the pending power data in the first database of the first server as stored power data.
[0095] The recovery module 602 is used to detect the recovery operation information of the second server, and synchronize the stored power data in the first database with the stored power data in the second database of the second server through the object storage gateway service.
[0096] In one embodiment, the above-mentioned device also includes: a request receiving module, which is used to receive an electric power service request sent by a user terminal and obtain the unprocessed electric power data in the electric power service request; process the electric power service request according to the business processing logic to obtain the processed electric power data, and store the processed electric power data in a second database of a second server as stored electric power data; send a multi-copy replication request including the processed electric power data to the first server; the first server is used to obtain the processed electric power data in the multi-copy replication request and store it in the first database to obtain the stored electric power data.
[0097] In one embodiment, the above-mentioned device further includes: a notification module, configured to receive storage completion information sent by the first server; and return power service processing completion information corresponding to the power service to the user terminal.
[0098] For the specific definition of the power data disaster recovery device, please refer to the definition of the power data disaster recovery method above, which will not be repeated here. Each module in the above-mentioned power data disaster recovery device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0099] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store power data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a power data disaster recovery method is implemented.
[0100] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0101] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above-mentioned power data disaster recovery method when executing the computer program.
[0102] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned power data disaster recovery method is implemented.
[0103] In one embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned power data disaster recovery method when executed by a processor.
[0104] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0105] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0106] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0107] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A power data disaster recovery method, characterized in that: Applied to the first server, the method includes: detecting fault information of a second server, and obtaining a pending power service request from the second server; the pending power service request includes pending power data; the first server stores the same stored power data and service processing logic as those of the second server; the stored power data and service processing logic are obtained by synchronizing data with the first server when the second server stores the pending power data in the power service request sent by the user terminal, wherein the first server and the second server are communicatively connected to achieve bidirectional synchronization of data and services, and the service processing logic is processing logic for the pending power service request; Processing the pending power service request according to the service processing logic, and storing the pending power data in a first database of the first server as stored power data; receiving the resumption information sent by the second server, and synchronizing the power data stored in the first database with the power data stored in the second database of the second server through the object storage gateway service; Among them, the second server and the first server are designed with a distributed storage active-active architecture. The first server and the second server perform bidirectional data synchronization through the object storage gateway service, and the server and the user terminal are connected through load balancing; the business request is directed to the second server by default through the load device. When the second server completes the business processing and replicates the multiple copies to the first server, the second server returns the confirmation to the user terminal on the business side; when the first server fails, the load transfers the business request to the second server for business processing. When the second server recovers, the second server and the first server synchronize data to ensure the consistency of the dual-center data.
2. The method according to claim 1, characterized in that The method further comprises: receiving a multi-copy replication request sent by the second server; the multi-copy replication request includes processed power data obtained by the second server after processing the power service request sent by the user terminal; Obtaining the processed power data in the multi-copy replication request and storing it in a first database to obtain stored power data; Sending storage completion information to the second server; the second server is used to receive the storage completion information and return power service processing completion information to the user terminal.
3. The method according to claim 1, characterized in that The method further includes: the first server and the second server are designed according to a distributed storage active-active architecture, wherein the distributed storage active-active architecture is a unified distributed storage system.
4. A power data disaster recovery method, characterized in that: Applied to the second server, the method includes: detecting fault information of the second server, and sending a pending power service request including pending power data sent by a user terminal to the first server; the first server is configured to process the pending power service request according to the same service processing logic as the second server, and store the pending power data in a first database of the first server as stored power data, wherein the first server and the second server are communicatively connected to achieve bidirectional synchronization of data and services, and the service processing logic is processing logic for the pending power service request; detecting the resumption of operation information of the second server, and synchronizing the power data stored in the first database with the power data stored in the second database of the second server through the object storage gateway service; Among them, the second server and the first server are designed with a distributed storage active-active architecture. The first server and the second server perform bidirectional data synchronization through the object storage gateway service, and the server and the user terminal are connected through load balancing; the business request is directed to the second server by default through the load device. When the second server completes the business processing and replicates the multiple copies to the first server, the second server returns the confirmation to the user terminal on the business side; when the first server fails, the load transfers the business request to the second server for business processing. When the second server recovers, the second server and the first server synchronize data to ensure the consistency of the dual-center data.
5. The method according to claim 4, characterized in that The method further comprises: Receiving a power service request sent by a user terminal, and obtaining the power data to be processed in the power service request; processing the power service request according to the service processing logic to obtain processed power data, and storing the processed power data in a second database of the second server as stored power data; A multi-copy replication request including the processed power data is sent to the first server; the first server is used to obtain the processed power data in the multi-copy replication request and store it in a first database to obtain stored power data.
6. The method according to claim 5, characterized in that After sending the multi-copy replication request including the processed power data to the first server, the method further includes: receiving storage completion information sent by the first server; Returning power service processing completion information corresponding to the power service to the user terminal.
7. A power data disaster recovery system, characterized in that: The system includes: a user terminal, a first server and a second server; The user terminal is configured to send a power service request to be processed including power data to be processed to the second server; The second server is configured to detect fault information of the second server and send a pending power service request including pending power data sent by the user terminal to the first server, wherein the first server and the second server are communicatively connected to achieve bidirectional synchronization of data and services; The first server is configured to process the pending power service request according to the same service processing logic as that of the second server, and store the pending power data in a first database of the first server as stored power data, wherein the service processing logic is a processing logic for the pending power service request; receiving the resumption information sent by the second server, and synchronizing the power data stored in the first database with the power data stored in the second database of the second server through the object storage gateway service; Among them, the second server and the first server are designed with a distributed storage active-active architecture. The first server and the second server perform bidirectional data synchronization through the object storage gateway service, and the server and the user terminal are connected through load balancing; the business request is directed to the second server by default through the load device. When the second server completes the business processing and replicates the multiple copies to the first server, the second server returns the confirmation to the user terminal on the business side; when the first server fails, the load transfers the business request to the second server for business processing. When the second server recovers, the second server and the first server synchronize data to ensure the consistency of the dual-center data.
8. A power data disaster recovery device, characterized in that: Applied to a first server, the device includes: a first acquisition module, configured to detect fault information of a second server and acquire a pending power service request from the second server; the pending power service request includes pending power data; the first server stores the same stored power data and service processing logic as the second server; the stored power data and service processing logic are obtained by synchronizing data with the first server when the second server stores the pending power data in the power service request sent by the user terminal, wherein the first server and the second server are communicatively connected to achieve bidirectional synchronization of data and services, and the service processing logic is processing logic for the pending power service request; a processing module, configured to process the pending power service request according to the service processing logic, and store the pending power data in a first database of the first server as stored power data; The second synchronization module is used to receive the recovery operation information sent by the second server, and synchronize the stored power data in the first database with the stored power data in the second database of the second server through the object storage gateway service; wherein, the second server and the first server are designed with a distributed storage active-active architecture, and the first server and the second server perform two-way synchronization of data through the object storage gateway service, and the server and the user terminal are connected through load balancing; the business request is directed to the second server by default through the load device, and when the second server completes the business processing and replicates the multiple copies to the first server, the second server returns a confirmation to the user terminal on the business side; when the first server fails, the load transfers the business request to the second server for business processing, and when the second server recovers, the second server and the first server synchronize data to ensure the consistency of the dual-center data.
9. A power data disaster recovery device, characterized in that: Applied to the second server, the device includes: a sending module, configured to detect fault information of the second server and send a pending power service request including pending power data sent by a user terminal to the first server; the first server is configured to process the pending power service request according to the same service processing logic as the second server, and store the pending power data in a first database of the first server as stored power data, wherein the first server and the second server are communicatively connected to achieve bidirectional synchronization of data and services, and the service processing logic is processing logic for the pending power service request; A recovery module is used to detect the recovery operation information of the second server, and synchronize the stored power data in the first database with the stored power data in the second database of the second server through the object storage gateway service; wherein, the second server and the first server are designed with a distributed storage active-active architecture, and the first server and the second server perform two-way synchronization of data through the object storage gateway service, and the server and the user terminal are connected through load balancing; the business request is directed to the second server by default through the load device, and when the second server completes the business processing and replicates the multiple copies to the first server, the second server returns a confirmation to the user terminal on the business side; when the first server fails, the load transfers the business request to the second server for business processing, and when the second server recovers, the second server and the first server synchronize data to ensure the consistency of the dual-center data.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
