Data backup method and server

By using a combination of image files and metadata in data backup, the problem of slow data backup speed caused by volatile media in the existing technology is solved, and efficient and reliable data backup and recovery are achieved.

CN118689706APending Publication Date: 2024-09-24XFUSION DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410694541.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In existing data backup technology, the buffer of volatile media causes data loss after the device restarts abnormally, requiring full backup, resulting in low backup speed.

Method used

Both image files and metadata are used for backup. Image files are stored in volatile storage media, and metadata is stored in persistent storage media. Metadata can be used to efficiently restore data when the server is abnormal, avoiding full backup.

Benefits of technology

It improves the speed and reliability of data backup, reduces the cost of data protection, avoids full backup due to loss of image files, and enhances the efficiency and accuracy of data protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689706A
    Figure CN118689706A
Patent Text Reader

Abstract

The embodiment of the invention provides a data backup method and a server, and the method comprises the steps: capturing a data processing request under the condition of processing the data processing request for source data, and obtaining a mirror image file and metadata corresponding to the source data; the mirror image file is stored in a first storage area, the metadata is stored in a second storage area, volatile storage media are adopted in the first storage area, and persistent storage media are adopted in the second storage area; and performing data backup based on the mirror image file or the metadata. According to the embodiment of the invention, the data backup efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data protection technology, and in particular to a data backup method and server. Background Art

[0002] With the continuous development of information technology, data information has become an important wealth of society and the foundation of enterprise survival. The production, operation and strategy of enterprises are inseparable from the support of data. Since data storage equipment damage, data misoperation, human destruction and other factors can lead to data damage and loss, it is very important to protect data.

[0003] Continuous Data Protection (CDP) is a method that can continuously capture or track any changes in target data without affecting the operation of primary data, and can restore it to any previous time point. It is a major breakthrough in traditional data protection technology.

[0004] In the related art, the buffer of CDP technology often uses volatile media. After the device restarts abnormally, the data in the buffer is lost and the data needs to be fully backed up again, which results in a low data backup speed.

[0005] Therefore, how to improve the speed of data backup becomes an urgent problem to be solved. Summary of the invention

[0006] The embodiments of the present application provide a data backup method and a server, which can improve the speed of data backup.

[0007] In a first aspect, an embodiment of the present application provides a data backup method, which is applied to a server, and the method includes:

[0008] When processing a data processing request for source data, capturing the data processing request to obtain an image file and metadata corresponding to the source data;

[0009] The image file is stored in a first storage area, and the metadata is stored in a second storage area, wherein the first storage area uses a volatile storage medium, and the second storage area uses a persistent storage medium;

[0010] Data backup is performed based on the image file or the metadata.

[0011] In the above scheme, on the one hand, the data processing requests for the source data are backed up in two ways, mirror files and metadata, which can effectively back up the source data in an incremental backup manner and improve the reliability of data backup. On the other hand, since the metadata data volume is small, the metadata is saved through a persistent storage medium, and when the server is abnormal, the data can be efficiently backed up according to the metadata, without the need to re-back up the data in full due to the loss of the mirror file, which can effectively improve the speed of data backup.

[0012] Optionally, the data processing request includes source data corresponding to the request and location information of the source data corresponding to the request in a third storage area, wherein the third storage area adopts a persistent storage medium.

[0013] In the above scheme, according to the data processing request, the source data corresponding to the request can be accurately obtained.

[0014] Optionally, the method further includes:

[0015] Detecting whether an abnormality occurs in the first storage area;

[0016] If an abnormality occurs in the first storage area, the first source data corresponding to the metadata in the third storage area is determined based on the metadata currently in the second storage area, and the first source data is written to the backup storage to complete the data backup; and the metadata in the second storage area is cleaned up.

[0017] In the above scheme, on the one hand, when an abnormality occurs in the first storage area, data backup can be achieved based on the metadata stored in the second storage area, thereby improving the reliability of data protection; on the other hand, since the amount of metadata is small, the mirror file of the data processing request is saved by a volatile storage medium, and the metadata is saved by a persistent storage medium. This can reduce the cost of data protection while meeting the need for effective data protection.

[0018] Optionally, the method further includes:

[0019] If no abnormality occurs in the first storage area, writing the image file in the first storage area to the backup storage to complete the data backup;

[0020] And, clearing the image files in the first storage area and the metadata in the second storage area.

[0021] In the above scheme, when no abnormality occurs in the first storage area, the image files in the first storage area are written to the backup storage, and the image files in the first storage area and the metadata in the second storage area are cleared, so that data backup can be performed quickly and accurately.

[0022] Optionally, the clearing of metadata currently in the second storage area includes:

[0023] Deleting all metadata currently in the second storage area;

[0024] Alternatively, the status of the metadata currently in the second storage area is marked as completed.

[0025] In the above scheme, the metadata in the current second storage area can be cleaned up flexibly and accurately by deleting all metadata in the current second storage area, or marking the status of the metadata in the current second storage area as completed. Therefore, when the first storage area is abnormal, the corresponding first source data can be accurately obtained and written into the backup storage based on the metadata in the second storage area, which is conducive to improving the accuracy of data backup.

[0026] Optionally, the method further includes:

[0027] If an abnormality occurs in the third storage area, data in the third storage area is restored according to the backup storage.

[0028] In the above solution, when an abnormality occurs in the third storage area, data in the third storage area can be restored according to the backup storage, so that data protection can be effectively performed.

[0029] Optionally, the method further includes:

[0030] Determine a plurality of second metadata from the second storage area, where position information corresponding to the plurality of second metadata are adjacent or overlapped;

[0031] The plurality of second metadata are concatenated and merged into one metadata.

[0032] In the above scheme, by deduplicating the metadata in the second storage area, the amount of metadata in the second storage area can be effectively reduced, so that when an abnormality occurs in the first storage area, the corresponding first source data can be quickly obtained based on the metadata in the second storage area, which is conducive to improving data backup efficiency.

[0033] Optionally, the metadata corresponding to the source data includes location information of the source data in the third storage area, or the metadata includes one or more of an index, a data offset and a data length of the source data in the third storage area.

[0034] In the above scheme, the metadata corresponding to the source data includes the location information of the source data in the third storage area, or one or more of the index, data offset and data length of the source data in the third storage area. The server can accurately determine the location of the source data in the third storage area based on the metadata, so that the first source data can be accurately backed up, which is conducive to improving the reliability of data protection.

[0035] Optionally, the second storage area is a local storage medium, a local file system or a database server.

[0036] In the above solution, the second storage area can persistently store metadata, and the metadata in the second storage area is not lost when an exception occurs. The server can back up data based on the metadata in the second storage area, effectively improving the reliability of data backup.

[0037] In a second aspect, an embodiment of the present application provides a server, the server comprising: a processor, and a memory communicatively connected to the processor;

[0038] The memory stores computer-executable instructions;

[0039] The processor executes the computer-executable instructions stored in the memory to implement the aforementioned method.

[0040] In the above scheme, on the one hand, the data processing requests for the source data are backed up in two ways, mirror files and metadata, which can effectively back up the source data in an incremental backup manner and improve the reliability of data backup. On the other hand, since the metadata data volume is small, the metadata is saved through a persistent storage medium, and when the server is abnormal, the data can be efficiently backed up according to the metadata, without the need to re-back up the data in full due to the loss of the mirror file, which can effectively improve the speed of data backup.

[0041] The data backup method and server provided in the embodiment of the present application, when processing a data processing request for source data, captures the data processing request to obtain a mirror file and metadata corresponding to the source data; stores the mirror file in a first storage area, and stores the metadata in a second storage area, wherein the first storage area uses a volatile storage medium, and the second storage area uses a persistent storage medium; performs data backup based on the mirror file or the metadata, so that, on the one hand, the data processing request for the source data is backed up in two ways, the mirror file and the metadata, which can effectively back up the source data in an incremental backup manner and improve the reliability of data backup. On the other hand, since the amount of metadata is small, the metadata is saved by a persistent storage medium, and when the server is abnormal, data backup can be efficiently performed based on the metadata, without the need to re-back up the data in full due to the loss of the mirror file, which can effectively improve the speed of data backup. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0043] Figure 2 is a schematic diagram of another application scenario provided by an embodiment of the present application;

[0044] Figure 3 is a schematic diagram of another application scenario provided by an embodiment of the present application;

[0045] Figure 4 is a schematic diagram of another application scenario provided by an embodiment of the present application;

[0046] Figure 5 It is a flowchart of a data backup method provided in an embodiment of the present application;

[0047] Figure 6 It is a flowchart of another data backup method provided in an embodiment of the present application.

[0048] Description of reference numerals:

[0049] 100-server;

[0050] 200 - application;

[0051] 300-first storage area;

[0052] 400-second storage area;

[0053] 500 - the third storage area;

[0054] 600-backup storage;

[0055] 700-Host machine. DETAILED DESCRIPTION

[0056] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0057] The module in this application refers to a functional module or a logical module. It can be in software form, and its functions are realized by executing program code by a processor; it can also be in hardware form. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects before and after are in an "or" relationship.

[0058] With the continuous development of information technology, data information has become an important wealth of society and the foundation of enterprise survival. The production, operation and strategy of enterprises are inseparable from the support of data. Since data storage equipment damage, data misoperation, human destruction and other factors can lead to data damage and loss, it is very important to protect data.

[0059] Continuous Data Protection (CDP) is a method that can continuously capture or track any changes in target data without affecting the operation of primary data, and can restore it to any previous time point. It is a major breakthrough in traditional data protection technology.

[0060] In the related art, the buffer of CDP technology often uses volatile media. After the device restarts abnormally, the data in the buffer is lost and the data needs to be fully backed up again, which results in a low data backup speed.

[0061] Therefore, how to improve the speed of data backup becomes an urgent problem to be solved.

[0062] The embodiments of the present application provide a data backup method and a server, aiming to solve the above-mentioned technical problems.

[0063] The data backup method and server provided in the embodiment of the present application are described in detail below through a specific implementation method.

[0064] For ease of understanding, the following Figure 1-Figure 4 , the application scenarios involved in the embodiments of the present application are described.

[0065] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, the server 100 includes an application 200 , a first storage area 300 , and a second storage area 400 .

[0066] The application 200 obtains a data processing request, which may be an IO write request or a read request, etc. The data processing request includes source data corresponding to the data processing request and location information corresponding to the source data in the third storage area 500; the data processing request may be used to instruct to write the corresponding source data into the third storage area 500. Exemplarily, a user may send a data processing request at the client of the server 100 to request to write the source data, and the application 200 receives the data processing request.

[0067] In the case of processing a data processing request for source data, the server 100 captures the data processing request, obtains a mirror request, and writes the data corresponding to the mirror request (such as a mirror file in this embodiment) into the first storage area 300, and writes the metadata corresponding to the mirror request into the second storage area 400, the mirror file corresponds to the source data, and the metadata is the metadata corresponding to the source data, that is, the first storage area 300 stores the mirror file corresponding to the source data, the second storage area 400 stores the metadata corresponding to the source data, and the third storage area 500 stores the source data corresponding to the data processing request. The server 100 can back up the source data in the third storage area 500 to the backup storage 600 based on the mirror file in the first storage area 300 and / or the metadata in the second storage area 400, so as to realize the backup of the source data in the third storage area 500. Among them, the image file may include the image file of the data processing request corresponding to the source data; the metadata may include the location information of the source data in the third storage area 500; the first storage area 300 and the second storage area 400 act as a buffer (or cache), which is beneficial to reduce the number of read and write times of the server 100 to the backup storage 600, and reduce the impact of the data backup process on the server performance. The metadata stored in the second storage area 400 is used to realize data backup and recovery in the event of an abnormal restart of the server 100 to avoid data loss.

[0068] The first storage area 300 may be located in the server 100. The first storage area 300 may use a volatile storage medium to increase the data backup speed, such as a static random access memory (SRAM) or a dynamic random access memory (DRAM). When the server 100 is normal, data backup may be performed based on the image file in the first storage area 300.

[0069] The second storage area 400 can use a persistent storage medium to avoid metadata loss in the event of an abnormal restart of the server 100. Therefore, after the server 100 is abnormally restarted, data backup and recovery can be achieved through the metadata in the second storage area 400, thereby avoiding re-backing up the full amount of source data in the third storage area 13.

[0070] It should be noted that the second storage area 400 may be located inside the server 100 or outside the server 100 . Figure 1 The second storage area 400 is located in the server 100 as an example for explanation, which does not constitute a limitation on the technical solution provided in the embodiment of the present application. Exemplarily, when the second storage area 400 is located in the server 100, the second storage area 400 may include but is not limited to a local file system or a local storage medium (such as a solid state drive (Solid State Disk or Solid State Drive, referred to as SSD)).

[0071] Combine the following Figure 2 , taking the second storage area 400 being located outside the server 100 as an example for explanation.

[0072] Figure 2 A schematic diagram of another application scenario provided by an embodiment of the present application. Figure 2 As shown, the server 100 includes an application 200 and a first storage area 300 .

[0073] The server 100 captures the data processing request, obtains the mirror request, writes the mirror file corresponding to the mirror request into the first storage area 300, and writes the metadata corresponding to the mirror request into the second storage area 400, that is, the first storage area 22 stores the mirror file corresponding to the source data, the second storage area 400 stores the metadata corresponding to the source data, and the third storage area 500 stores the source data corresponding to the data processing request. The server 100 can back up the source data in the third storage area 500 to the backup storage 600 based on the mirror file in the first storage area 300 and the metadata in the second storage area 400. Among them, the second storage area 400 is located outside the server 100, and the metadata stored in the second storage area 400 is used to realize data backup and recovery to avoid data loss in the case of abnormal restart of the server 100.

[0074] Exemplarily, the second storage area 400 may include but is not limited to a database server, such as a key-value database.

[0075] The third storage area 500 may use a persistent storage medium to avoid source data loss. Similarly, the third storage area 500 may be located in the server 100 or outside the server 100 . Figure 1 , Figure 2 The example of the third storage area 500 being located in the server 100 is used for illustration, which does not constitute a limitation on the technical solution provided in the embodiment of the present application.

[0076] It is understandable that the server 100 may be a physical machine or a virtual machine.

[0077] Figure 3 A schematic diagram of another application scenario provided by the embodiment of the present application. Figure 3 As shown, the server 100 includes an application 200 and a first storage area 300. The server 100 is a virtual machine, and the server 100 is deployed on a host machine 700. Referring to the above example, the second storage area 400 can be located in the server 100 or outside the server 100, and the third storage area 500 can be located in the server 100 or outside the server 100, which will not be described in detail here.

[0078] In actual applications, the second storage area may not be set. Figure 4 A schematic diagram of another application scenario provided by the embodiment of the present application. Figure 4 As shown, the server 100 includes an application 200 and a first storage area 300. The server 100 may be a virtual machine or a physical machine; the third storage area 500 may be located inside the server 100 or outside the server 100, which will not be described in detail.

[0079] The server 100 captures the data processing request, obtains the mirror request, writes the mirror file corresponding to the mirror request into the first storage area 300, and writes the metadata corresponding to the mirror request into the backup storage 600, that is, the first storage area 300 stores the mirror file corresponding to the source data, the backup storage 600 stores the metadata corresponding to the source data, and the third storage area 500 stores the source data corresponding to the data processing request. The metadata stored in the backup storage 600 is used to implement data backup and recovery to avoid data loss in the event of an abnormal restart of the server 100. When the server 100 is normal, the mirror file in the first storage area 300 can be written into the backup storage 600, and the metadata corresponding to the mirror file in the backup storage can be deleted; wherein, the metadata corresponding to the mirror file is the metadata corresponding to the source data corresponding to the mirror file.

[0080] Combine the following Figure 5 , the data backup method provided in the embodiment of the present application is described.

[0081] Figure 5is a flow chart of a data backup method provided in an embodiment of the present application. The execution subject of the method may be Figure 1-Figure 4 The server 100 shown in the figure may also be a processing chip set on the server 100. Here, the execution subject is taken as an example to illustrate. Figure 5 As shown, the data backup method may include:

[0082] S501, when processing a data processing request for source data, the data processing request is captured to obtain a mirror file and metadata corresponding to the source data.

[0083] The data processing request may be an IO write request or a read request, etc.

[0084] In a possible implementation, the data processing request includes source data corresponding to the data processing request and location information of the source data in the third storage area; the data processing request can be used to instruct to write the corresponding source data into the third storage area. The third storage area uses a persistent storage medium.

[0085] The server captures the data processing request, obtains the mirror request corresponding to the data processing request, and obtains the mirror file and metadata corresponding to the mirror request as the mirror file and metadata corresponding to the source data.

[0086] In a possible implementation, the metadata corresponding to the source data may include location information of the source data in the third storage area. Based on the metadata corresponding to the source data, the source data may be accurately obtained from the third storage area.

[0087] Exemplarily, the metadata corresponding to the source data may include, but is not limited to, the index of the source data in the third storage area, the data offset, or the data length.

[0088] S502, storing the image file in a first storage area, and storing the metadata in a second storage area, wherein the first storage area uses a volatile storage medium, and the second storage area uses a persistent storage medium.

[0089] The server writes the image file corresponding to the source data into the first storage area, and writes the metadata corresponding to the source data into the second storage area, that is, the first storage area stores the image file corresponding to the source data, the second storage area stores the metadata corresponding to the source data, and the third storage area stores the source data corresponding to the data processing request.

[0090] The second storage area may be located in the server or outside the server. In one implementation, the second storage area is a local storage medium, a local file system or a database server.

[0091] Exemplarily, the second storage area may be a local storage medium located in the server, and the second storage area may be connected to the server via a direct-attached storage (DAS). Accordingly, the server storing the metadata in the second storage area may include writing the metadata into the second storage area via an interface corresponding to the server.

[0092] Exemplarily, the second storage area may also be a local file system located in the server, and the second storage area and the server are located in the same local area network. Accordingly, the server storing the metadata in the second storage area may include sending a write request to the second storage area through an interface corresponding to the server, so that the metadata is written into the second storage area.

[0093] Exemplarily, the second storage area may also be a database server, such as a key-value database, located outside the server. Accordingly, the server storing the metadata in the second storage area may include reading the current metadata from the second storage area by calling a function library; or sending a write request to the second storage area through a network to write the metadata to the second storage area.

[0094] S503, backing up data based on the image file or metadata.

[0095] The first storage area and the second storage area act as buffers (or caches). The server can back up the source data in the third storage area based on the image file in the first storage area and / or the metadata in the second storage area, and write the backup data to the backup storage. This helps the server reduce the number of read and write times for the backup storage and reduce the impact of the data backup process on the server performance. The metadata stored in the second storage area is used to implement data backup and recovery in the event of an abnormal restart of the server to avoid data loss.

[0096] In actual applications, the server stores the image file in the first storage area, stores the metadata in the second storage area, and performs data processing in parallel according to the data processing request. The amount of metadata is small, so obtaining the metadata and writing it to the second storage area has little impact on the normal data processing process.

[0097] In this example, on the one hand, the data processing requests for the source data are backed up in two ways: image files and metadata. This can effectively back up the source data in an incremental backup manner and improve the reliability of data backup. On the other hand, since the metadata is small in size, metadata can be saved through persistent storage media. When the server is abnormal, data can be backed up efficiently based on metadata. There is no need to re-back up the data in full due to the loss of image files, which can effectively improve the speed of data backup.

[0098] In a possible implementation, the method further includes:

[0099] If an abnormality occurs in the third storage area, data in the third storage area is restored according to the backup storage.

[0100] Exemplarily, the abnormality occurring in the third storage area may include that source data in the third storage area is lost and / or damaged.

[0101] Based on the backup storage, the data in the third storage area can be restored to effectively protect the data.

[0102] In a possible implementation, the method further includes:

[0103] Detecting whether an abnormality occurs in the first storage area;

[0104] If an abnormality occurs in the first storage area, the first source data corresponding to the metadata in the third storage area is determined based on the metadata in the second storage area, and the first source data is written to the backup storage to complete the data backup; and the metadata in the second storage area is cleared.

[0105] The server may periodically detect whether an abnormality occurs in the first storage area. Exemplarily, the server detecting whether an abnormality occurs in the first storage area may include monitoring the server for restart, and when the server restart is detected, determining whether it is an abnormal restart. It is understandable that the abnormal restart may be a restart that is not actively triggered by a server user.

[0106] If an abnormality occurs in the first storage area, the image file in the current first storage area may be lost, and the server performs data backup according to the metadata in the second storage area. The server performs data backup according to the metadata in the second storage area, which may include reading the metadata in the current second storage area, determining the first source data corresponding to the metadata in the current third storage area, and writing the first source data to the backup storage to complete the data backup. It can be understood that the first source data corresponds to the image file lost when the first storage area is abnormal. In this way, on the one hand, due to the small amount of metadata data, the speed of obtaining the first source data is fast. On the other hand, when the first storage area is abnormal, the first source data corresponding to the lost image file in the first storage area can be accurately obtained, and data backup is performed according to the first source data. There is no need to perform a full backup of the source data in the current third storage area, which can effectively shorten the backup time and improve the efficiency of data backup. After writing the first source data to the backup storage, the metadata in the second storage area is cleaned up.

[0107] The second storage area may be located inside the server or outside the server.

[0108] Exemplarily, the second storage area may be a local storage medium located in the server, and the second storage area may be connected to the server via a direct-attached storage (DAS). Accordingly, the server reading the metadata in the current second storage area may include: reading the metadata in the current second storage area via an interface corresponding to the server.

[0109] Exemplarily, the second storage area may also be a local file system located in the server, and the second storage area and the server are located in the same local area network. Accordingly, the server reading the metadata in the current second storage area may include: reading the metadata in the current second storage area through an interface corresponding to the server. Exemplarily, the server may read the metadata in the current second storage area through a Portable Operating System Interface of UNIX (POSIX).

[0110] Exemplarily, the second storage area may also be a database server, such as a key-value database, located outside the server. Accordingly, the server reading the metadata in the current second storage area may include: reading the current metadata from the second storage area by calling a function library; or sending a read request to the second storage area through a network to obtain the metadata in the current second storage area returned by the second storage area. For example, the server may read the metadata in the current second storage area through the TCP / IP protocol (Transmission Control Protocol / Internet Protocol).

[0111] It is understandable that the specific implementation of the second storage area includes but is not limited to the above examples. In actual applications, other storage methods that can persistently store metadata can also be selected according to production needs, and are not limited here.

[0112] In this example, on the one hand, when an exception occurs in the first storage area, data backup can be achieved based on the metadata stored in the second storage area, thereby improving the reliability of data protection; on the other hand, since the amount of metadata is small, the mirror file of the data processing request is saved through a volatile storage medium, and the metadata is saved through a persistent storage medium. When an exception occurs, there is no need to re-perform a full backup. The speed of data backup can be improved while meeting the need for effective data protection.

[0113] Specifically, the metadata may include one or more of the index of the source data in the third storage area, the data offset, and the data length. The data backup method provided in the embodiment of the present application may be implemented based on block storage or file storage.

[0114] For example, in a block storage scenario, the source data includes source data blocks, the third storage area includes a source data volume, the index of the source data in the third storage area includes a volume index of the source data block in the source data volume, and the metadata includes one or more of the volume index of the source data block in the source data volume, a data offset, and a data length; in a file storage scenario, the source data includes a source data file, the third storage area may include a source data system, the index of the source data in the source data may include a file index of the source data file in the source data system, and the metadata includes one or more of the file index of the source data file in the source data system, a data offset, and a data length.

[0115] In this example, the metadata includes one or more of the index of the source data in the third storage area, the data offset, and the data length. Based on the metadata, the location information of the source data in the third storage area can be accurately determined, so that the first source data can be accurately backed up, which is beneficial to improving the reliability of data protection.

[0116] Optionally, if no abnormality occurs in the first storage area, the source data may be backed up based on the first storage area. In one example, the method further includes:

[0117] If no abnormality occurs in the first storage area, the mirror file in the first storage area is written to the backup storage to complete the data backup;

[0118] And, clear the image files in the first storage area and the metadata in the second storage area.

[0119] Specifically, the first storage area uses a volatile storage medium with a faster read and write speed. Therefore, if no abnormality occurs in the first storage area, the mirror file in the first storage area is written to the backup storage, which can quickly realize data backup, which is conducive to improving the efficiency of data backup. After the mirror file in the first storage area is written to the backup storage, the mirror file in the first storage area and the metadata in the second storage area are cleaned up. Since the metadata cleaning can be performed in the background and the amount of metadata is small, the newly added metadata cleaning process in the second storage area has less impact on the front-end business process. When necessary, the source data under different backup points can be restored according to the data saved in the backup storage.

[0120] Exemplarily, different backup points may correspond to different backup times.

[0121] Exemplarily, all / part of the image files in the first storage area can be periodically written to the backup storage, and the image files written to the backup storage in the first storage area and the corresponding metadata in the second storage area can be cleaned up; or, when the occupancy rate of the first storage area reaches a preset threshold, all / part of the image files in the first storage area can be written to the backup storage, and the image files written to the backup storage in the first storage area and the corresponding metadata in the second storage area can be cleaned up.

[0122] In this example, when no abnormality occurs in the first storage area, the image files in the first storage area are written to the backup storage, and the image files in the first storage area and the metadata in the second storage area are cleared, so that data backup can be performed quickly and accurately.

[0123] There are many specific ways to clean up the second storage area. In one example, cleaning up the metadata in the current second storage area may include:

[0124] Delete all metadata in the current second storage area;

[0125] Alternatively, the status of the metadata currently in the second storage area is marked as completed.

[0126] It should be noted that, according to actual production needs, all or part of the image files in the first storage area may be selected to be written into the backup storage, which is not limited here.

[0127] In one possible implementation, all image files in the first storage area are written to the backup storage; and all image files currently in the first storage area and all metadata currently in the second storage area are deleted, or the status of all image files currently in the first storage area and all metadata currently in the second storage area are marked as completed.

[0128] In one possible implementation, some image files in the first storage area are written to backup storage; and some image files currently written to backup storage in the first storage area and some metadata corresponding to the some image files currently in the second storage area are deleted, or the status of some image files currently written to backup storage in the first storage area and some metadata corresponding to the some image files currently in the second storage area are marked as completed.

[0129] It is understandable that after obtaining the corresponding first source data according to the metadata in the second storage area, the metadata in the second storage area can also be cleaned up in the same manner, which will not be described in detail here.

[0130] In this example, the metadata in the current second storage area can be cleaned up flexibly and accurately by deleting all metadata in the current second storage area, or marking the status of the metadata in the current second storage area as completed. Therefore, when the first storage area is abnormal, the corresponding first source data can be accurately obtained and written into the backup storage based on the metadata in the second storage area, which is conducive to improving the accuracy of data backup.

[0131] Optionally, in order to further improve the efficiency of data backup, the metadata in the second storage area may be deduplicated. In one example, the data backup method may further include:

[0132] Determine a plurality of second metadata from the second storage area, where position information corresponding to the plurality of second metadata is adjacent or overlapped;

[0133] Combine multiple pieces of second metadata into one piece of metadata.

[0134] Specifically, multiple pieces of second metadata are determined from the second storage area, and position information corresponding to the multiple pieces of second metadata are adjacent or overlapped in the third storage area, and the multiple pieces of second metadata are concatenated and merged into one piece of metadata.

[0135] Exemplarily, multiple pieces of second metadata can be periodically determined from the second storage area and spliced ​​and merged into one piece of metadata; or, when the second storage area is abnormal, multiple pieces of second metadata can be determined from the second storage area and spliced ​​and merged into one piece of metadata, and data backup can be performed based on the metadata in the second storage area after splicing and merging.

[0136] Figure 6 FIG. 1 is a flow chart of another data backup method provided by an embodiment of the present application, wherein the execution subject of the method is a data backup device. Figure 6 As shown, the method includes:

[0137] S601, detecting whether an abnormality occurs in the first storage area.

[0138] S602: When an exception occurs in the first storage area, the first storage area is set to an exception recovery state.

[0139] When an abnormality occurs in the first storage area, the image file in the first storage area is lost, and data backup cannot be performed based on the image file in the first storage area. At this time, the state of the first storage area is set to an abnormal recovery state. When the server detects the abnormal recovery state flag of the first storage area, it stops backing up data based on the image file in the first storage area and backs up data based on the metadata in the second storage area.

[0140] S603: Read metadata from the second storage area.

[0141] Reading metadata from the second storage area may include reading all metadata currently in the second storage area.

[0142] S604: Determine multiple pieces of second metadata from the metadata currently read in the second storage area, and combine the multiple pieces of second metadata into one piece of metadata.

[0143] There may be multiple ways to determine multiple items of second metadata. Taking two items of second metadata as an example, in one possible implementation, if the sum of the data offset and the data length of the location information corresponding to one item of metadata in the third storage area is not less than the data offset of the location information corresponding to another item of metadata in the third storage area, and the data offset of the location information corresponding to the metadata in the third storage area is not greater than the sum of the data offset and the data length of the location information corresponding to another item of metadata in the third storage area, then the two items of metadata are regarded as two items of second metadata, and the two items of second metadata are spliced ​​and merged into one item of metadata.

[0144] For example, assuming that in the metadata in the second storage area, the position information corresponding to metadata A1 has an index a in the third storage area, a data offset of 5, and a data length of 4, and the position information corresponding to metadata A2 has an index a, a data offset of 9, and a data length of 2 in the third storage area, then metadata A1 and metadata A2 are two items of second metadata, and the position information corresponding to metadata A1 in the third storage area is adjacent to the position information corresponding to metadata A2 in the third storage area. Metadata A1 and metadata A2 are concatenated into metadata A12, and the position information corresponding to metadata A12 has an index a in the third storage area, a data offset of 5, and a data length of 6. Assuming that in the metadata in the second storage area, the position information corresponding to metadata A3 has an index a in the third storage area, a data offset of 5, and a data length of 4, and the position information corresponding to metadata A4 has an index a, a data offset of 6, and a data length of 5 in the third storage area, then metadata A3 and metadata A4 are two items of second metadata, and the position information corresponding to metadata A3 in the third storage area coincides with the position information corresponding to metadata A4 in the third storage area. Metadata A3 and metadata A4 are concatenated into metadata A34, and the position information corresponding to metadata A34 has an index a in the third storage area, a data offset of 5, and a data length of 6.

[0145] S605: Obtain corresponding first source data from the source data according to the metadata after splicing and merging.

[0146] S606, writing the first source data into the backup storage.

[0147] S607: Release or delete the corresponding metadata in the second storage area in batches.

[0148] S608, determining whether the above-mentioned processing of S603-S607 is performed on all metadata in the second storage area. If the above-mentioned processing is not performed on all metadata in the second storage area, returning to S603 until the above-mentioned processing of S603-S607 is performed on all metadata in the second storage area.

[0149] S609: If the above processing has been performed on all metadata in the second storage area, a new backup point is added in the backup storage based on all first source data written to the backup storage according to the metadata after the first storage area is abnormal.

[0150] Exemplarily, the backup point may include the current backup time and the first source data written into the backup storage.

[0151] S610, returning to normal state.

[0152] After detecting that the first storage area has returned to normal and the newly added backup point has been completed, the state of the first storage area is set to normal. When the server detects the normal state mark of the first storage area, it resumes data backup based on the mirror file in the first storage area and stops data backup based on the metadata in the second storage area.

[0153] In this example, by deduplicating the metadata in the second storage area, the amount of metadata in the second storage area can be effectively reduced. Therefore, when an abnormality occurs in the first storage area, the corresponding first source data can be quickly obtained based on the metadata in the second storage area, which is conducive to improving data backup efficiency.

[0154] The embodiment of the present application further provides a server, the server comprising: a first storage area, a processor, and a memory communicatively connected to the processor;

[0155] The memory stores computer-executable instructions;

[0156] The processor executes the computer-executable instructions stored in the memory to implement the method described above.

[0157] It is understandable that the server is Figure 1-4The server shown, in one implementation, the server includes an application, a first storage area, a processor, and a memory connected to the processor in communication; in one implementation, the server includes an application, a first storage area, a second storage area, a processor, and a memory connected to the processor in communication; in one implementation, the server includes an application, a first storage area, a second storage area, a third storage area, a processor, and a memory connected to the processor in communication; in one implementation, the server includes an application, a first storage area, a third storage area, a processor, and a memory connected to the processor in communication.

[0158] The server provided in this embodiment can be used to execute the method shown in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.

[0159] It should be noted that the memory is different from the first storage area, the second storage area and the third storage area in the above embodiments. The memory is used to store computer execution instructions, which are used to implement the method described in the above embodiments when executed by the processor.

[0160] An embodiment of the present application provides a non-temporary computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method described in the above embodiment. The implementation principle and technical effect are similar and will not be elaborated here.

[0161] All or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviated: ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppy disk), optical disc (English: optical disc) and any combination thereof.

[0162] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable terminal device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0163] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0164] These computer program instructions can also be loaded onto a computer or other programmable terminal device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0165] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the embodiments of the present application are also intended to include these changes and variations. Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present application, rather than to limit them; although the embodiments of the present application are described in detail with reference to the aforementioned embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A data backup method, characterized in that: Applied to a server, the method comprises: When processing a data processing request for source data, capturing the data processing request to obtain an image file and metadata corresponding to the source data; The image file is stored in a first storage area, and the metadata is stored in a second storage area, wherein the first storage area uses a volatile storage medium, and the second storage area uses a persistent storage medium; Data backup is performed based on the image file or the metadata.

2. The method according to claim 1, characterized in that The data processing request includes source data corresponding to the request and location information of the source data corresponding to the request in a third storage area, wherein the third storage area adopts a persistent storage medium.

3. The method according to claim 2, characterized in that The method further comprises: Detecting whether an abnormality occurs in the first storage area; If an abnormality occurs in the first storage area, the first source data corresponding to the metadata in the third storage area is determined based on the metadata currently in the second storage area, and the first source data is written to the backup storage to complete the data backup; and the metadata in the second storage area is cleaned up.

4. The method according to claim 2, characterized in that: The method further comprises: If no abnormality occurs in the first storage area, writing the image file in the first storage area to the backup storage to complete the data backup; Clean up the image files in the first storage area and the metadata in the second storage area.

5. The method according to claim 3, characterized in that: The cleaning up metadata in the second storage area includes: Deleting all metadata currently in the second storage area; Alternatively, the status of the metadata currently in the second storage area is marked as completed.

6. The method according to claim 2, characterized in that The method further comprises: If an abnormality occurs in the third storage area, data in the third storage area is restored according to the backup storage.

7. The method according to claim 1, characterized in that The method further comprises: Determine a plurality of second metadata from the second storage area, where position information corresponding to the plurality of second metadata are adjacent or overlapped; The plurality of second metadata are concatenated and merged into one metadata.

8. The method according to claim 2, characterized in that: The metadata corresponding to the source data includes location information of the source data in the third storage area, or the metadata corresponding to the source data includes one or more of an index, a data offset and a data length of the source data in the third storage area.

9. The method according to any one of claims 1 to 8, characterized in that: The second storage area is a local storage medium, a local file system or a database server.

10. A server, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 9.