Fault recovery method and device of server and storage medium

By obtaining a priority list and transmitting difference files when a server fails, the problem of low efficiency in server failure recovery is solved, enabling rapid business recovery and resource optimization.

CN121967176APending Publication Date: 2026-05-01INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2026-01-19
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

The existing server failure recovery efficiency is low, resulting in business interruption and resource waste, especially in batch processing or continuous transaction processing.

Method used

By obtaining the priority list of backup servers, the target backup server is determined, and the difference file is transferred to the target backup server to upgrade its status to the second primary server and continue to perform business operations.

Benefits of technology

It enables rapid recovery of business processes, improves server fault recovery efficiency, and reduces resource consumption and downtime.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967176A_ABST
    Figure CN121967176A_ABST
Patent Text Reader

Abstract

The invention discloses a server fault recovery method and device and a storage medium. Relates to the field of cloud computing, and the method comprises the steps that under the condition that it is detected that a first main server executing a target service breaks down, a priority list of standby servers is acquired, the priority sequence of each standby server is recorded in the priority list, and the target standby server is used for replacing the first main server to execute the target service; determining a target standby server according to the priority list of the standby servers; a difference file of the first main server and the target standby server is determined, and the difference file is a file, different from that in the first main server, in the target standby server; transmitting the difference file to a target standby server, receiving the difference file through the target standby server, and upgrading the state of the target standby server to a second main server; and continuing to execute the target service through the second main server. Through the method and the device, the problem of low server fault recovery efficiency in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Server fault recovery methods, devices, and storage media Technical Field

[0001] This application relates to the field of cloud computing, and more specifically, to a method, apparatus, and storage medium for server fault recovery. Background Technology

[0002] In current server deployment practices, when the primary server encounters a sudden failure, such as hardware damage, software crash, or network outage, the direct impact is the forced interruption of ongoing business processing. Traditional fault recovery mechanisms rely on reloading all data or completely restarting business tasks, which typically means consuming significant resources and experiencing significant service latency. Especially for batch jobs or continuous transaction processing, once the primary server becomes unavailable, not only is manual intervention and environment reconfiguration time-consuming (sometimes several hours), but also the re-execution of already processed data is required, leading to resource waste and a significant decline in user experience. Considering the unpredictability of server failures and their potential threat to business continuity, the industry generally pursues building more robust and flexible server architectures to achieve rapid recovery and seamless failover. However, existing solutions often fail to fully consider the unique needs of various business types, particularly in resource allocation, processing priority, and data consistency, lacking effective automated and intelligent management methods. This not only limits the overall efficiency of the system but may also trigger additional data security risks and resource conflict issues.

[0003] There is currently no effective solution to the problem of low server failure recovery efficiency in related technologies. Summary of the Invention

[0004] The main objective of this application is to provide a server fault recovery method, apparatus, and storage medium to solve the problem of low server fault recovery efficiency in related technologies.

[0005] To achieve the above objectives, according to one aspect of this application, a server fault recovery method is provided. The method includes: upon detecting a failure of a first primary server executing a target service, obtaining a priority list of backup servers, wherein the priority list records the priority order of each backup server, and a target backup server is used to replace the first primary server to execute the target service; determining the target backup server based on the priority list of backup servers; determining a difference file between the first primary server and the target backup server, wherein the difference file is a file different from that in the first primary server; transmitting the difference file to the target backup server, receiving the difference file through the target backup server, and upgrading the status of the target backup server to a second primary server; and continuing to execute the target service through the second primary server.

[0006] Optionally, before obtaining the priority list of backup servers in the event that the primary server executing the target service has failed, the method further includes: establishing multiple groups of servers according to the service type, wherein each group of servers corresponds to and serves a service type, each group of servers includes a primary server and backup servers, and the service type includes at least the target service; and creating a file storage partition in each server of each group of servers, wherein the file storage partition is used to store service-related files.

[0007] Optionally, after establishing multiple sets of servers according to the business type, the method further includes: predicting the predicted business volume of the target business within a preset time period based on the historical business volume of the target business; and adjusting the number of reserve servers for the target business based on the predicted business volume.

[0008] Optionally, after establishing multiple groups of servers according to business type, the method further includes: determining a first weight of load status and a second weight of historical business processing volume; obtaining the load status of each preparatory server and the historical business processing volume of each preparatory server; calculating the priority score of each preparatory server based on the first weight, the second weight, the load status of each preparatory server, and the historical business processing volume of each preparatory server; and generating a priority list of preparatory servers based on the priority score of each preparatory server.

[0009] Optionally, determining the difference files between the first primary server and the target backup server includes: obtaining the metadata of the files in the first primary server and the metadata of the files in the target backup server; comparing the metadata of the files in the first primary server and the metadata of the files in the target backup server to determine the difference files between the first primary server and the target backup server.

[0010] Optionally, transmitting the difference file to the target backup server and receiving the difference file through the target backup server includes: packaging the difference file to obtain a packaged file; encrypting the packaged file to obtain an encrypted file; reading the encrypted file from the first primary server and transmitting the encrypted file to the target backup server; and reading the breakpoint resume log through the target backup server and receiving the encrypted file at the breakpoint, wherein the breakpoint resume log records the breakpoint in the file transmission.

[0011] Optionally, continuing to execute the target service through the second master server includes: loading service status information related to the target service through the second master server; transferring service requests sent to the first master server to the second master server; and processing the service requests through the second master server to continue executing the target service.

[0012] To achieve the above objectives, according to another aspect of this application, a server fault recovery apparatus is provided. The apparatus includes: a first acquisition unit, configured to acquire a priority list of backup servers when a first primary server executing a target service is detected to have failed, wherein the priority list records the priority order of each backup server, and a target backup server is used to replace the first primary server in executing the target service; a first determination unit, configured to determine the target backup server based on the priority list of backup servers; a second determination unit, configured to determine the difference files between the first primary server and the target backup server, wherein the difference files are files in the target backup server that differ from those in the first primary server; an upgrade unit, configured to transmit the difference files to the target backup server, receive the difference files through the target backup server, and upgrade the status of the target backup server to that of a second primary server; and an execution unit, configured to continue executing the target service through the second primary server.

[0013] According to another aspect of this application, a computer-readable storage medium is provided, which includes a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform any server fault recovery method.

[0014] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a fault recovery method for performing any type of server.

[0015] According to another aspect of this application, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps of a server fault recovery method according to any one of the above.

[0016] In this embodiment, when a failure is detected in the first primary server executing the target service, a priority list of backup servers is obtained, wherein the priority list records the priority order of each backup server, and the target backup server is used to replace the first primary server to execute the target service; the target backup server is determined according to the priority list of backup servers; the difference files between the first primary server and the target backup server are determined, wherein the difference files are files in the target backup server that are different from those in the first primary server; the difference files are transmitted to the target backup server, the target backup server receives the difference files, and the status of the target backup server is upgraded to that of the second primary server; the target service continues to be executed through the second primary server, thus solving the technical problem of low server failure recovery efficiency. In this application, when an anomaly or failure is detected in the primary server responsible for executing the target business, a fault recovery mechanism is triggered. Then, the priority list of backup servers is accessed, which records the priority order of all backup servers. After selecting the target backup server, the file differences between the primary server and the target backup server are analyzed. Only the difference files that need to be transmitted are identified and marked. The difference files are transmitted to the target backup server. After the transmission is completed, the status of the target backup server is automatically upgraded to the second primary server, which takes over the business processing and continues to execute the target business. This achieves rapid recovery of business processing and improves the technical effect of server fault recovery efficiency. Attached Figure Description

[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 shows a hardware structure block diagram of a computer terminal for implementing a server fault recovery method;

[0019] Figure 2 is a flowchart of a server fault recovery method provided according to an embodiment of this application;

[0020] Figure 3 is a schematic diagram of a server fault recovery device provided according to an embodiment of this application;

[0021] Figure 4 is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0024] It should be noted that all relevant information (including but not limited to business information, document information, etc.) and data (including but not limited to data used for transmission, data used for processing, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties. For example, if there is an interface between this system and the relevant user or organization, before obtaining the relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving the consent information from the aforementioned user or organization.

[0025] Example 1

[0026] According to an embodiment of this application, a method embodiment for server fault recovery is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0027] The method embodiment provided in Embodiment 1 of this application can be executed in a mobile terminal, computer terminal, or similar computing device. Figure 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a server fault recovery method. As shown in Figure 1, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that the structure shown in Figure 1 is only illustrative and does not limit the structure of the above-described electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in Figure 1, or have a different configuration than shown in Figure 1.

[0028] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0029] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the server fault recovery method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned server fault recovery method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0030] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0031] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0032] Under the above operating environment, this application provides a server fault recovery method as shown in Figure 2. Figure 2 is a flowchart of the server fault recovery method according to Embodiment 1 of this application.

[0033] Step S201: If a failure is detected in the first primary server executing the target service, a priority list of backup servers is obtained. The priority list records the priority order of each backup server. The target backup server is used to replace the first primary server to execute the target service.

[0034] Optionally, the primary server is the server that performs the target business, which may be batch data processing, transaction verification, or other critical operations. A primary server failure occurs when the server malfunctions due to hardware failure, software anomalies, or network interruptions. The priority list of backup servers is sorted by preset rules (such as resource status and processing capacity) to determine which backup server is most suitable to replace the failed primary server.

[0035] Step S202: Determine the target backup server based on the priority list of the backup servers.

[0036] Optionally, the highest-ranked backup server can be selected as the target backup server based on the preset sorting rules in the priority list, in preparation for state switching.

[0037] Step S203: Determine the difference files between the first primary server and the target backup server, wherein the difference files are files in the target backup server that are different from those in the first primary server.

[0038] Optionally, due to changes in processing time or status, there may be files with inconsistent content between the primary server and the target backup server, namely the aforementioned difference files. By accurately transmitting the difference files, the duplicate transmission of the entire data can be avoided, reducing network load and storage pressure.

[0039] Step S204: The difference file is transmitted to the target backup server, the target backup server receives the difference file, and the status of the target backup server is upgraded to the second primary server.

[0040] Optionally, the target backup server can be adjusted from the standby state to the master server state, and can officially take over the processing of the target business.

[0041] Step S205: Continue executing the target service through the second main server.

[0042] Optionally, based on the received difference file, the second master server can continue the processing of the target business from the breakpoint without re-executing the full task, which can reduce the resource consumption of repeated task execution and improve the efficiency of fault recovery.

[0043] The server fault recovery method provided in this application, when a fault is detected in the first primary server executing the target service, obtains a priority list of backup servers, wherein the priority list records the priority order of each backup server, and the target backup server is used to replace the first primary server to execute the target service; determines the target backup server according to the priority list of backup servers; determines the difference file between the first primary server and the target backup server, wherein the difference file is a file different from that in the first primary server; transmits the difference file to the target backup server, receives the difference file, and upgrades the status of the target backup server to a second primary server; and continues to execute the target service through the second primary server, thus solving the technical problem of low server fault recovery efficiency. In this application, when an anomaly or failure is detected in the primary server responsible for executing the target business, a fault recovery mechanism is triggered. Then, the priority list of backup servers is accessed, which records the priority order of all backup servers. After selecting the target backup server, the file differences between the primary server and the target backup server are analyzed. Only the difference files that need to be transmitted are identified and marked. The difference files are transmitted to the target backup server. After the transmission is completed, the status of the target backup server is automatically upgraded to the second primary server, which takes over the business processing and continues to execute the target business. This achieves rapid recovery of business processing and improves the technical effect of server fault recovery efficiency.

[0044] To improve business continuity, optionally, in the server fault recovery method provided in this application embodiment, before obtaining the priority list of backup servers when a fault is detected in the first primary server executing the target business, the method further includes:

[0045] The first step is to establish multiple server groups based on the business type. Each server group corresponds to and serves a specific business type. Each server group includes a main server and a backup server. The business type must include at least the target business.

[0046] Optionally, the business types include various functions such as account settlement, loan approval, and account management, with each server group dedicated to serving a specific business type. Each server group includes a primary server and a backup server. The primary server is responsible for processing business under normal circumstances, while the backup server is set up to handle situations where the primary server fails. It is normally in standby mode and can quickly take over business when the primary server fails. Each business has a dedicated server group to support it, avoiding resource contention. In the event of a primary server failure, the backup server can quickly take over, improving business continuity.

[0047] The second step is to create a file storage partition on each server in each group of servers. This file storage partition is used to store business-related files.

[0048] Optionally, a file storage partition is an area allocated on each server's hard drive to store files and data related to business processing. It is isolated from other business data, which can improve data security and business processing efficiency.

[0049] In summary, by establishing multiple server groups according to business type and configuring independent file storage partitions for each, each business type can receive dedicated resources and services, enhancing business stability. When a primary server fails, a backup server for that business type can be quickly located, and only the relevant difference files need to be synchronized for rapid failover, reducing business interruption time and improving fault recovery efficiency.

[0050] To improve resource utilization, optionally, in the server fault recovery method provided in this application embodiment, after establishing multiple groups of servers according to business type, the method further includes:

[0051] The first step is to predict the target business's business volume within a preset time period based on the target business's historical business volume.

[0052] Optionally, the historical business volume of the target business refers to the number of transactions, data processing volume, etc., of the target business over a past period. The preset time period can be several hours, several days, or longer. Based on historical data, statistical analysis or machine learning algorithms can be used to predict the business volume for a future period, which helps to rationally plan server resources and avoid resource waste or insufficiency.

[0053] The second step is to adjust the number of backup servers for the target business based on the predicted business volume.

[0054] Optionally, if the predicted traffic volume is higher than the historical average, the number of backup servers can be increased to ensure sufficient spare resources to handle high loads in the event of a primary server failure. If the predicted traffic volume is lower, the number of backup servers can be reduced to avoid resource idleness and improve resource utilization efficiency.

[0055] In summary, by following the steps above and analyzing historical business data to predict the business volume of the target business within a preset time period in the future, and by dynamically adjusting the number of reserve servers based on the business forecast, it is possible to optimize resource allocation while ensuring business continuity.

[0056] To select a more suitable backup server, optionally, in the server fault recovery method provided in this application embodiment, after establishing multiple groups of servers according to business type, the method further includes:

[0057] The first step is to determine the first weight of the load status and the second weight of the historical processing volume of the business.

[0058] Optionally, load status is an indicator that measures the current resource usage of the server, including CPU utilization, memory usage, etc. Historical business processing volume refers to the server's ability and efficiency in processing business under similar or identical past conditions; this can be indicators such as throughput and response time. The first and second weights assign importance to load status and historical business processing volume in priority calculation; the higher the weight value, the stronger its influence in priority calculation.

[0059] The second step is to obtain the load status of each standby server and the historical processing volume of each standby server.

[0060] Optionally, by obtaining the load status and historical processing volume of each standby server, a data foundation can be provided for subsequent priority calculation.

[0061] The third step is to calculate the priority score for each backup server based on the first weight, the second weight, the load status of each backup server, and the historical processing volume of each backup server.

[0062] Optionally, based on the set weights, the load status of each backup server, and the historical processing volume of the business, a mathematical model (e.g., weighted summation) can be applied to calculate the priority score of each backup server. The higher the priority score, the greater the likelihood that the backup server will be preferred during fault recovery.

[0063] The fourth step is to generate a priority list of the reserve servers based on their priority scores.

[0064] Optionally, the priority scores of all candidate servers can be compared, and a priority list can be generated according to the priority scores. The top of the priority list is the candidate server with the highest priority.

[0065] In summary, by taking the steps described above, determining the weights of different indicators, obtaining the load status and historical business processing information of the backup server, combining these data with weights, converting them into comparable priority scores, and finally generating a priority list, we can provide guidance for selecting backup servers during fault recovery and help choose a more suitable backup server.

[0066] To improve the efficiency of server fault recovery, optionally, in the server fault recovery method provided in this application embodiment, determining the difference files between the first primary server and the target backup server includes:

[0067] The first step is to obtain the metadata of the files in the primary server and the target backup server.

[0068] Optionally, file metadata is data describing file attributes, such as file size, creation date, modification date, hash value, etc. After detecting a failure of the primary server and identifying the target backup server, the file metadata can be obtained by traversing the file directories on both servers.

[0069] The second step is to compare the metadata of the files in the first primary server with the metadata of the files in the target backup server to determine the files that are different between the first primary server and the target backup server.

[0070] Optionally, the metadata of the files on the first primary server and the target backup server are compared. If the metadata of the files (especially the modification date and hash value) is different, the two files are considered to be different, i.e., the aforementioned difference file needs to be transferred and updated.

[0071] In summary, by following the steps above and reading the metadata of files on the primary server and the target backup server, and comparing the metadata of files on the two servers, the differences that need to be transferred can be quickly identified. This avoids the need for full file transfer, reduces network bandwidth consumption, and improves the efficiency of server fault recovery.

[0072] To avoid wasting resources on full retransmission, optionally, in the server fault recovery method provided in this application embodiment, the difference file is transmitted to the target backup server, and receiving the difference file through the target backup server includes:

[0073] The first step is to package the difference files to obtain the packaged files.

[0074] Optionally, after determining the difference files to be transmitted, the difference files can be compressed and packaged into one or more packaged files, which can reduce the number of files to be transmitted and improve transmission efficiency.

[0075] The second step is to encrypt the packaged files to obtain encrypted files.

[0076] Optionally, encrypting the packaged files using encryption algorithms can improve the security and confidentiality of the files during transmission.

[0077] The third step is to read the encrypted file from the primary server and then transfer the encrypted file to the target backup server.

[0078] Optionally, the encrypted difference file is read from the first primary server and then transmitted over the network to the target backup server.

[0079] The fourth step is to read the breakpoint resume log from the target backup server and receive the encrypted file at the point of interruption. The breakpoint resume log records the point at which the file transmission was interrupted.

[0080] Optionally, during the process of receiving the encrypted file, the target backup server will refer to the breakpoint resume log and can continue the transmission from the breakpoint recorded in the log until the file is fully received.

[0081] In summary, the above steps, by packaging and encrypting the different files, improve the security and confidentiality of the transmission process. The interrupted transmission mechanism quickly resumes transmission from the point of interruption, avoiding the waste of resources from full retransmission and improving the efficiency of server fault recovery.

[0082] To restore the normal operation of the target service, optionally, in the server fault recovery method provided in this application embodiment, continuing to execute the target service through a second main server includes:

[0083] The first step is to load the business status information related to the target business through the second main server.

[0084] Optionally, when the first master server fails, the second master server needs to load all business status information related to the target business, including business data, transaction status, session information, etc.

[0085] The second step is to transfer the business requests sent to the first master server to the second master server.

[0086] Optionally, by modifying the routing rules, business requests that were originally directed to the first primary server can be redirected to the second primary server.

[0087] The third step is to process business requests through a second master server in order to continue executing the target business.

[0088] Optionally, after loading the business status information and accepting the business request, the second master server can process the business request according to the business logic and continue to execute the target business.

[0089] In summary, through the above steps, by loading the business status information, the second master server obtains the context required to execute the target business, thereby maintaining the continuity of the business. The business requests are transferred to the second master server, which processes the business requests, allowing the target business to continue running and achieving the purpose of fault recovery.

[0090] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0091] Example 2

[0092] This application also provides a server fault recovery device. It should be noted that the server fault recovery device of this application can be used to execute the server fault recovery method provided in this application. The following describes the server fault recovery device provided in this application.

[0093] According to an embodiment of this application, an apparatus for implementing the above-described server fault recovery method is also provided, as shown in FIG3. The apparatus includes: a first acquisition unit 301, a first determination unit 302, a second determination unit 303, an upgrade unit 304, and an execution unit 305.

[0094] Specifically, the first acquisition unit 301 is used to acquire a priority list of backup servers when a failure is detected in the first master server performing the target service. The priority list records the priority order of each backup server, and the target backup server is used to replace the first master server to perform the target service.

[0095] The first determining unit 302 is used to determine the target backup server based on the priority list of the backup servers;

[0096] The second determining unit 303 is used to determine the difference files between the first primary server and the target backup server, wherein the difference files are files in the target backup server that are different from those in the first primary server;

[0097] Upgrade unit 304 is used to transfer the difference file to the target backup server, receive the difference file through the target backup server, and upgrade the status of the target backup server to the second primary server;

[0098] Execution unit 305 is used to continue executing the target business through the second master server.

[0099] The server fault recovery device provided in this application embodiment, through a first acquisition unit 301, acquires a priority list of backup servers when a fault is detected in the first primary server executing the target service. The priority list records the priority order of each backup server, and the target backup server is used to replace the first primary server to execute the target service. A first determination unit 302 determines the target backup server based on the priority list of backup servers. A second determination unit 303 determines the difference files between the first primary server and the target backup server, where the difference files are files different from those in the first primary server. An upgrade unit 304 transmits the difference files to the target backup server, receives the difference files, and upgrades the target backup server's status to that of a second primary server. An execution unit 305 continues to execute the target service through the second primary server. This solves the technical problem of low server fault recovery efficiency, achieves rapid recovery of service processing, and improves the technical effect of server fault recovery efficiency.

[0100] Optionally, in the server fault recovery apparatus provided in the embodiments of this application, the apparatus further includes: an establishment unit, configured to establish multiple groups of servers according to the service type before obtaining the priority list of backup servers when a fault is detected in the first master server executing the target service, wherein each group of servers corresponds to and serves a service type, each group of servers includes a master server and backup servers, and the service type includes at least the target service; and a creation unit, configured to create a file storage partition in each server of each group of servers, wherein the file storage partition is used to store service-related files.

[0101] Optionally, in the server fault recovery device provided in the embodiments of this application, the device further includes: a prediction unit, used to predict the predicted business volume of the target business within a preset time period based on the historical business volume of the target business after establishing multiple groups of servers according to the business type; and an adjustment unit, used to adjust the number of reserve servers for the target business based on the predicted business volume.

[0102] Optionally, in the server fault recovery apparatus provided in this application embodiment, the apparatus further includes: a third determining unit, configured to determine a first weight of load status and a second weight of historical processing volume of business after establishing multiple groups of servers according to business type; a second obtaining unit, configured to obtain the load status of each preparatory server and the historical processing volume of business of each preparatory server; a calculating unit, configured to calculate the priority score of each preparatory server according to the first weight, the second weight, the load status of each preparatory server, and the historical processing volume of business of each preparatory server; and a generating unit, configured to generate a priority list of preparatory servers according to the priority score of each preparatory server.

[0103] Optionally, in the server fault recovery device provided in this application embodiment, the second determining unit 303 includes: an acquisition module, used to acquire the metadata of files in the first master server and the metadata of files in the target backup server; and a comparison module, used to compare the metadata of files in the first master server and the metadata of files in the target backup server to determine the difference files between the first master server and the target backup server.

[0104] Optionally, in the server fault recovery device provided in this application embodiment, the upgrade unit 304 includes: a packaging module for packaging the difference files to obtain a packaged file; an encryption module for encrypting the packaged file to obtain an encrypted file; a transmission module for reading the encrypted file from the first master server and transmitting the encrypted file to the target backup server; and a receiving module for reading the breakpoint resume log through the target backup server and receiving the encrypted file at the breakpoint, wherein the breakpoint resume log records the breakpoint of file transmission.

[0105] Optionally, in the server fault recovery device provided in this application embodiment, the execution unit 305 includes: a loading module, used to load business status information related to the target business through the second master server; a transfer module, used to transfer the business request sent to the first master server to the second master server; and a processing module, used to process the business request through the second master server to continue executing the target business.

[0106] It should be noted that the first acquisition unit 301, the first determination unit 302, the second determination unit 303, the upgrade unit 304, and the execution unit 305 mentioned above correspond to steps S201 to S205 in Embodiment 1. The five units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.

[0107] Example 3

[0108] Embodiments of this application may provide a computer terminal, which may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the aforementioned computer terminal may also be replaced with a mobile terminal or an electronic device, etc.

[0109] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.

[0110] In this embodiment, the computer terminal described above can execute the program code for the following steps in the server fault recovery method: When a failure is detected in the first primary server executing the target service, a priority list of backup servers is obtained, wherein the priority list records the priority order of each backup server, and the target backup server is used to replace the first primary server to execute the target service; the target backup server is determined according to the priority list of backup servers; the difference files between the first primary server and the target backup server are determined, wherein the difference files are files different in the target backup server from those in the first primary server; the difference files are transmitted to the target backup server, the target backup server receives the difference files, and the status of the target backup server is upgraded to that of the second primary server; the target service continues to be executed through the second primary server.

[0111] Optionally, the computer terminal described above can execute the program code for the following steps in the server fault recovery method: before obtaining the priority list of backup servers in the event that the first master server executing the target business has failed, the method further includes: establishing multiple groups of servers according to the business type, wherein each group of servers corresponds to and serves a business type, each group of servers includes a master server and a backup server, and the business type includes at least the target business; creating a file storage partition in each server of each group of servers, wherein the file storage partition is used to store business-related files.

[0112] Optionally, the computer terminal described above can execute program code for the following steps in the server fault recovery method: after establishing multiple groups of servers according to the business type, the method further includes: predicting the predicted business volume of the target business within a preset time period based on the historical business volume of the target business; and adjusting the number of reserve servers for the target business based on the predicted business volume.

[0113] Optionally, the computer terminal described above can execute program code for the following steps in the server fault recovery method: After establishing multiple groups of servers according to business type, the method further includes: determining a first weight of load status and a second weight of historical business processing volume; obtaining the load status of each standby server and the historical business processing volume of each standby server; calculating the priority score of each standby server based on the first weight, the second weight, the load status of each standby server, and the historical business processing volume of each standby server; and generating a priority list of standby servers based on the priority score of each standby server.

[0114] Optionally, the computer terminal described above can execute program code for the following steps in the server fault recovery method: determining the difference files between the first primary server and the target backup server includes: obtaining the metadata of the files in the first primary server and the metadata of the files in the target backup server; comparing the metadata of the files in the first primary server and the metadata of the files in the target backup server to determine the difference files between the first primary server and the target backup server.

[0115] Optionally, the aforementioned computer terminal can execute the program code for the following steps in the server fault recovery method: transmitting the difference file to the target backup server, and receiving the difference file through the target backup server includes: packaging the difference file to obtain a packaged file; encrypting the packaged file to obtain an encrypted file; reading the encrypted file from the first primary server and transmitting the encrypted file to the target backup server; reading the breakpoint resume log through the target backup server and receiving the encrypted file at the breakpoint, wherein the breakpoint resume log records the breakpoint of file transmission.

[0116] Optionally, the computer terminal described above can execute program code for the following steps in the server fault recovery method: continuing to execute the target business through the second master server includes: loading business status information related to the target business through the second master server; transferring business requests sent to the first master server to the second master server; and processing the business requests through the second master server to continue executing the target business.

[0117] Optionally, FIG4 is a structural block diagram of an electronic device according to an embodiment of the present application. As shown in FIG4, the electronic device may include: one or more (only one is shown in FIG4) processors 402, memory 404, memory controller, and peripheral interface, wherein the peripheral interface is connected to a radio frequency module, an audio module, and a display.

[0118] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the server fault recovery method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned server fault recovery method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0119] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described above in the server's fault recovery method.

[0120] This application provides a server fault recovery scheme. When a failure is detected in the first primary server executing the target service, a priority list of backup servers is obtained, where the priority list records the priority order of each backup server. A target backup server is used to replace the first primary server to execute the target service. The target backup server is determined based on the priority list of backup servers. A difference file is determined between the first primary server and the target backup server, where the difference file is a file different from that in the first primary server. The difference file is transmitted to the target backup server, which receives the difference file and upgrades its status to that of a second primary server. The target service continues to be executed through the second primary server. This solves the technical problem of low server fault recovery efficiency, achieves rapid recovery of service processing, and improves the technical effect of server fault recovery efficiency.

[0121] Those skilled in the art will understand that the structure shown in Figure 4 is merely illustrative, and the electronic device may also be a smartphone, tablet computer, PDA, mobile internet device (MID), PAD, or other terminal device. Figure 4 does not limit the structure of the aforementioned electronic device. For example, the electronic device may include more or fewer components (such as network interfaces, display devices, etc.) than shown in Figure 4, or may have a different configuration than that shown in Figure 4.

[0122] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0123] Example 4

[0124] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the server fault recovery method provided in Embodiment 1.

[0125] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0126] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing steps of a server fault recovery method.

[0127] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0128] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0129] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.

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

[0131] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0132] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0133] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for server fault recovery, characterized in that, include: If a failure is detected in the primary server executing the target service, a priority list of backup servers is obtained, wherein the priority list records the priority order of each backup server, and the target backup server is used to replace the primary server to execute the target service; the target backup server is determined according to the priority list of backup servers; the difference files between the primary server and the target backup server are determined, wherein the difference files are files in the target backup server that are different from those in the primary server; the difference files are transmitted to the target backup server, the target backup server receives the difference files, and the status of the target backup server is upgraded to that of a second primary server; the target service continues to be executed through the second primary server.

2. The method according to claim 1, characterized in that, Before obtaining the priority list of backup servers in the event that the primary server executing the target service has failed, the method further includes: establishing multiple groups of servers according to the service type, wherein each group of servers corresponds to and serves a service type, each group of servers includes a primary server and backup servers, and the service type includes at least the target service; and creating a file storage partition in each server of each group of servers, wherein the file storage partition is used to store service-related files.

3. The method according to claim 2, characterized in that, After establishing multiple sets of servers according to the business type, the method further includes: predicting the predicted business volume of the target business within a preset time period based on the historical business volume of the target business; and adjusting the number of reserve servers for the target business based on the predicted business volume.

4. The method according to claim 2, characterized in that, After establishing multiple groups of servers according to business type, the method further includes: determining a first weight of load status and a second weight of historical business processing volume; obtaining the load status of each preparatory server and the historical business processing volume of each preparatory server; calculating the priority score of each preparatory server based on the first weight, the second weight, the load status of each preparatory server, and the historical business processing volume of each preparatory server; and generating a priority list of the preparatory servers based on the priority score of each preparatory server.

5. The method according to claim 1, characterized in that, Determining the difference files between the first primary server and the target backup server includes: obtaining the metadata of the files in the first primary server and the metadata of the files in the target backup server; comparing the metadata of the files in the first primary server and the metadata of the files in the target backup server to determine the difference files between the first primary server and the target backup server.

6. The method according to claim 1, characterized in that, The process of transmitting the difference file to the target backup server and receiving the difference file through the target backup server includes: packaging the difference file to obtain a packaged file; encrypting the packaged file to obtain an encrypted file; reading the encrypted file from the first primary server and transmitting the encrypted file to the target backup server; and reading the breakpoint resume log through the target backup server and receiving the encrypted file at the point of interruption, wherein the breakpoint resume log records the point of interruption in the file transmission.

7. The method according to claim 1, characterized in that, Continuing to execute the target service through the second master server includes: loading service status information related to the target service through the second master server; transferring service requests sent to the first master server to the second master server; and processing the service requests through the second master server to continue executing the target service.

8. A server fault recovery device, characterized in that, include: A first acquisition unit is configured to acquire a priority list of backup servers when a failure is detected in the first primary server executing the target service, wherein the priority list records the priority order of each backup server, and the target backup server is used to replace the first primary server to execute the target service; a first determination unit is configured to determine the target backup server according to the priority list of backup servers; a second determination unit is configured to determine the difference file between the first primary server and the target backup server, wherein the difference file is a file in the target backup server that is different from that in the first primary server; an upgrade unit is configured to transmit the difference file to the target backup server, receive the difference file through the target backup server, and upgrade the status of the target backup server to a second primary server; and an execution unit is configured to continue executing the target service through the second primary server.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the server fault recovery method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the server fault recovery method according to any one of claims 1 to 7.

11. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the fault recovery method for the server according to any one of claims 1 to 7.