Data backup methods, devices, equipment and media for cloud-native applications

By performing incremental and full backups of cloud-native application components and associating them with storage, the consistency problem of cloud-native application data backup is solved, and the application recovery success rate is improved.

CN115543691BActive Publication Date: 2026-03-10CHINA EVERBRIGHT BANK
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing cloud-native application data backup methods cannot guarantee the consistency of backup data, resulting in a low application recovery success rate.

Method used

By acquiring the components of cloud-native stateful applications and their backup priorities, incremental and full backups are performed, and the backup data is associated and stored to ensure data consistency.

Benefits of technology

It increases the probability of successful data backup and recovery for cloud-native applications and ensures the consistency of backup data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115543691B_ABST
    Figure CN115543691B_ABST
Patent Text Reader

Abstract

This invention discloses a data backup method, apparatus, device, and medium for cloud-native applications. The method includes: acquiring a cloud-native stateful application and its corresponding multiple components, as well as the backup priority of each component; acquiring incremental backup data for each stateful component and full backup data for each stateless component according to the backup priority of each component; and associating and storing the incremental backup data for each stateful component and the full backup data for each stateless component to complete the data backup of the cloud-native stateful application. The technical solution of this embodiment, by performing incremental backups on the stateful components included in the stateful application and full backups on the stateless components, and associating and storing the incremental backup data and full backup data to complete the data backup, can ensure the consistency of the backup data of the stateful application and improve the probability of successful application recovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud-native technology, and in particular to a data backup method, apparatus, device, and medium for cloud-native applications. Background Technology

[0002] With the widespread adoption of technologies such as containers and microservices in enterprises, cloud-native has become a crucial engine driving business growth. However, due to significant changes in technical architecture, backup and recovery of application systems, especially stateful applications, in cloud-native environments has brought new challenges.

[0003] Currently, existing data backup methods for cloud-native applications typically rely on unified storage devices to back up stateful cloud-native applications. However, with existing technologies, it is difficult to guarantee the consistency of backup data for online backups of stateful cloud-native applications, thus compromising the success rate of application recovery. Summary of the Invention

[0004] This invention provides a data backup method, apparatus, device, and medium for cloud-native applications, which can ensure the consistency of backup data for cloud-native stateful applications and improve the probability of successful application recovery.

[0005] According to one aspect of the present invention, a data backup method for cloud-native applications is provided, comprising:

[0006] Obtain cloud-native stateful applications, and obtain at least one component corresponding to the cloud-native stateful applications, as well as the backup priority of each component; the components include stateful components and stateless components.

[0007] Based on the backup priority of each component, obtain the incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component.

[0008] The incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component are associated and stored to complete the data backup of the cloud-native stateful application.

[0009] According to another aspect of the present invention, a data backup device for cloud-native applications is provided, comprising:

[0010] The component acquisition module is used to acquire cloud-native stateful applications and acquire at least one component corresponding to the cloud-native stateful applications, as well as the backup priority of each component; the components include stateful components and stateless components.

[0011] The backup data acquisition module is used to acquire incremental backup data corresponding to each stateful component and full backup data corresponding to each stateless component according to the backup priority of each component.

[0012] The data storage module is used to associate and store the incremental backup data corresponding to each of the stateful components and the full backup data corresponding to each of the stateless components, so as to complete the data backup of the cloud-native stateful application.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] At least one processor; and

[0015] A memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the data backup method for cloud-native applications according to any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the data backup method for cloud-native applications as described in any embodiment of the present invention.

[0018] The technical solution of this invention involves acquiring a cloud-native stateful application, its corresponding multiple components, and the backup priority of each component. Then, based on the backup priority of each component, incremental backup data for each stateful component and full backup data for each stateless component are acquired. Finally, the incremental backup data for each stateful component and the full backup data for each stateless component are associated and stored to complete the data backup of the cloud-native stateful application. By performing incremental backups on the stateful components included in the stateful application and full backups on the stateless components, and by associating the incremental and full backup data, the consistency of the backup data for the stateful application can be guaranteed, thus increasing the probability of successful application recovery.

[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1A This is a flowchart of a data backup method for cloud-native applications provided according to Embodiment 1 of the present invention;

[0022] Figure 1B This is a flowchart illustrating a data backup method for cloud-native applications according to Embodiment 1 of the present invention;

[0023] Figure 2 This is a schematic diagram of the structure of a data backup device for cloud-native applications according to Embodiment 2 of the present invention;

[0024] Figure 3 This is a schematic diagram of the structure of an electronic device that implements the data backup method for cloud-native applications according to embodiments of the present invention. Detailed Implementation

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

[0026] It should be noted that the terms "first," "second," "target," etc., used in the specification, claims, and accompanying drawings of this invention 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 embodiments of the invention 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 a 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.

[0027] Example 1

[0028] Figure 1AThis is a flowchart illustrating a data backup method for cloud-native applications according to Embodiment 1 of the present invention. This embodiment is applicable to online data backup of stateful cloud-native applications. The method can be executed by a cloud-native application data backup device, which can be implemented in hardware and / or software. This data backup device can be configured in an electronic device, typically a computer or server. Figure 1A As shown, the method includes:

[0029] S110. Obtain the cloud-native stateful application, and obtain at least one component corresponding to the cloud-native stateful application, as well as the backup priority of each component.

[0030] It's important to note that cloud-native applications can be categorized into two types: stateless applications and stateful applications. Stateless applications do not depend on the local runtime environment and can scale freely and flexibly horizontally. Stateful applications, on the other hand, depend on the local runtime environment, with inter-application dependencies (e.g., startup order) and cannot be arbitrarily scaled or expanded. Furthermore, stateful applications can contain some stateful components and some stateless components. For example, in Kubernetes, stateful components can include resource objects like StatefulSets, while stateless components can include resource objects like Deployments.

[0031] For stateful application backups in a Kubernetes cluster within a cloud-native environment, the backup content can include two parts: the relevant resource objects in the cluster and the storage volume data associated with the relevant instances. Kubernetes storage volumes can support mounting filesystem devices or block devices and can be provided to relevant instances as filesystem directories.

[0032] In this embodiment, a cloud-native stateful application may include multiple components, which can be stateful or stateless. Specifically, all components can be categorized into stateful and stateless components by determining whether their state is affected by events or external messages. Stateful components may include at least one of databases, middleware, and microservices. It should be noted that cloud-native applications can be deployed under one or more namespaces. Therefore, based on the actual architecture of the business system, the Kubernetes Application Programming Interface (API) can be used to automatically retrieve relevant namespaces and labels within the Kubernetes cluster to define and obtain the cloud-native stateful application.

[0033] In this embodiment, backup priorities for different components can be pre-set. Typically, the backup priorities from highest to lowest can be database, middleware, and microservices. Therefore, after obtaining the components included in the cloud-native stateful application, the backup priority for each component can be obtained.

[0034] S120. Based on the backup priority of each component, obtain the incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component.

[0035] Specifically, data backups can be performed on each component in descending order of backup priority. For stateful components, incremental backups can be performed to obtain the incremental backup data for each stateful component. For stateless components, full backups can be performed to obtain the full backup data for each stateless component.

[0036] The process of obtaining full backup data for each stateless component based on its backup priority can include: when a stateless component is detected as the component to be backed up based on its backup priority, a snapshot identifier (ID) for that stateless component can be generated, such as a snapshot-id, and resources such as the application description and configuration information for that stateless component can be extracted based on the Kubernetes API to serve as the corresponding full backup data; then, a mapping relationship between the snapshot identifier and the obtained resources can be generated and stored in a preset external object storage space.

[0037] In an optional implementation of this embodiment, obtaining incremental backup data corresponding to each stateful component based on the backup priority of each component may include:

[0038] If the component to be backed up is detected as a currently stateful component based on the backup priority of each component, then the storage volume associated with the running instance of the currently stateful component and the file system directory corresponding to the storage volume are obtained.

[0039] Obtain the pre-hook function corresponding to the current stateful component, and perform silent service operation on the current stateful component through the pre-hook function;

[0040] Based on the file system directory corresponding to the storage volume, obtain the component data corresponding to the currently stateful component;

[0041] Obtain the post-hook function corresponding to the current stateful component, and use the post-hook function to perform a service silencing operation on the current stateful component;

[0042] Perform incremental backups on the component data corresponding to the currently stateful component to obtain the incremental backup data corresponding to the currently stateful component.

[0043] In another scenario, when the component to be backed up is a stateful component, the storage volume associated with the running instance of the stateful component and the corresponding file system directory (i.e., storage path) can be obtained based on Kubernetes APIs (e.g., VolumeSource, Persistent VolumeClaim, and PersistentVolume in the CoreAPIv1 interface). Then, a pre-hook function can be generated for this stateful component, and this pre-hook function can be used to perform silent operations on the stateful component, blocking any update operations (e.g., write operations) to the storage volume data.

[0044] Next, the component data corresponding to the currently stateful component can be read according to the file system directory corresponding to the obtained storage volume. Further, a posthook function can be generated for this currently stateful component to undo the service quiescent operation, i.e., resume the update operation on the storage volume data. Finally, incremental backups can be performed on the read component data to obtain incremental backup data corresponding to the currently stateful component.

[0045] In another optional implementation of this embodiment, incremental backup of the component data corresponding to the currently stateful component is performed to obtain incremental backup data corresponding to the currently stateful component, which may include:

[0046] Obtain the snapshot identifier corresponding to the currently stateful component, and obtain the historical backup data corresponding to the currently stateful component based on the snapshot identifier corresponding to the currently stateful component;

[0047] The component data corresponding to the currently stateful component is compared with the corresponding historical backup data to obtain the difference data, and the difference data is used as the incremental backup data corresponding to the currently stateful component.

[0048] In a specific example, the snapshot ID corresponding to the current stateful component can be obtained first. Based on this snapshot ID, the historical backup data corresponding to the current stateful component can be retrieved from a preset external object storage space. The historical backup data can be the most recent backup data. Then, the component data and the historical backup data can be compared to obtain the difference data between the two, and this difference data can be used as the data to be backed up this time, i.e., incremental backup data.

[0049] In this embodiment, incremental backups of stateful components can avoid duplicate backups of the same component data, thereby improving the data backup efficiency of stateful applications.

[0050] S130. The incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component are associated and stored together to complete the data backup of the cloud-native stateful application.

[0051] Specifically, after obtaining the incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component of the current cloud-native stateful application, the incremental backup data and the full backup data can be stored in a preset external object storage space, and the association between the incremental backup data and the full backup data can be established to realize the associated storage of incremental backup data and full backup data, thereby realizing the data backup of the cloud-native stateful application.

[0052] Optionally, after associating incremental backup data and full backup data, you can also obtain application information corresponding to cloud-native stateful applications, as well as backup time points and current statistics, and store this information in the same index file in a preset external object storage space.

[0053] The technical solution of this invention involves acquiring a cloud-native stateful application, its corresponding multiple components, and the backup priority of each component. Then, based on the backup priority of each component, incremental backup data for each stateful component and full backup data for each stateless component are acquired. Finally, the incremental backup data for each stateful component and the full backup data for each stateless component are associated and stored to complete the data backup of the cloud-native stateful application. By performing incremental backups on the stateful components included in the stateful application and full backups on the stateless components, and by associating the incremental and full backup data, the consistency of the backup data for the stateful application can be guaranteed, thus increasing the probability of successful application recovery.

[0054] In another optional implementation of this embodiment, performing service silencing operations on the currently stateful component through the pre-hook function may include:

[0055] If the current stateful component is the first preset middleware, then the memory data corresponding to the current stateful component is written to the snapshot data file through the pre-hook function, and the snapshot data file is stored to the preset disk;

[0056] If the currently stateful component is the second preset middleware, then the preset proxy service is silenced through the pre-hook function to block external calls to write operations; and

[0057] If the currently stateful component is a preset database, then the global lock of the preset database is enabled through the pre-hook function to block internal write operations.

[0058] The first and second preset middleware can be different pre-configured middlewares. For example, the first preset middleware can be Zookeeper, and the second preset middleware can be Nginx. The preset database can be a pre-configured database, such as MySQL.

[0059] In this embodiment, different pre-hook functions can be set for different stateful components to perform different operations, thereby achieving service silencing for the corresponding stateful components.

[0060] In a specific example, when performing silent service operations on the current stateful component through the pre-hook function, if the current stateful component is the middleware Zookeeper, the pre-hook function can call the Zookeeper's Filesnap snapshot data external interface (including writing and reading snapshot data) to write the memory data corresponding to the current stateful component to the snapshot data file, so as to serialize the memory data, and store the snapshot data file to the preset disk, thereby achieving forced disk persistence of Zookeeper memory data.

[0061] Secondly, if the current stateful component is the middleware Nginx, a pre-defined silent proxy service Nginx can be enabled through a pre-hook function to block external write operations. For example, you can execute `kubectl patch svc -n nginx-test nginx --type merge -p '{"spec":{"ports":[{"port":52,"name":"web"}]}}'`. If the current stateful component is the database MySQL, a global lock can be enabled through a pre-hook function to block internal write operations. For example, you can configure a global lock `flush tables with read lock;` before a MySQL hot backup to flush the cache and globally disable write operations, thus ensuring that the data stored in the database remains unchanged during subsequent backups.

[0062] Optionally, performing service silent operations on the current stateful component through the pre-hook function may further include: performing consistency detection and processing within the current stateful component through the pre-hook function.

[0063] In another optional implementation of this embodiment, performing the service silencing operation on the currently stateful component through the post-hook function may include:

[0064] If the currently stateful component is a preset database, then the global lock of the preset database is disabled through the post-hook function to restore internal write operations; and

[0065] If the currently stateful component is the second preset middleware, then the preset proxy service is deactivated through the post-hook function to restore external calls to write operations.

[0066] In a specific example, if the current stateful component is the database MySQL, the MySQL global lock can be disabled through a post-hook function to resume internal write operations. For example, the global lock can be released before a MySQL hot backup using the command "unlock tables;" to resume write operations. Conversely, if the current stateful component is the middleware Nginx, the Nginx quiescent function can be unhooked to resume external write operations. For example, the command `kubectl patch svc -n nginx-test nginx --type merge -p '{"spec":{"ports":[{"port":80,"name":"web"}]}}'` can be executed.

[0067] In this embodiment, by setting the pre-hook function and post-hook function for each component, it can be ensured that the application data will not change during the data backup, thus strictly guaranteeing the consistency of the backup data and improving the probability of successful application recovery.

[0068] In another optional implementation of this embodiment, the incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component are stored together to complete the data backup of the cloud-native stateful application. This may include:

[0069] Obtain the snapshot identifier corresponding to each of the stateful components and the snapshot identifier corresponding to each of the stateless components;

[0070] Generate a mapping relationship between snapshot identifiers and incremental backup data for each stateful component and store it in a preset external object storage space; generate a mapping relationship between snapshot identifiers and full backup data for each stateless component and store it in a preset external object storage space.

[0071] The association between the snapshot identifiers corresponding to each stateful component and the snapshot identifiers corresponding to each stateless component is generated and stored in a preset external object storage space to complete the data backup of the cloud-native stateful application.

[0072] In this embodiment, when associating incremental backup data and full backup data, snapshot identifiers corresponding to each stateful component and each stateless component can be generated first. Then, a mapping relationship can be generated between the snapshot identifiers of each stateful component and their corresponding incremental backup data, as well as between the snapshot identifiers of each stateless component and their corresponding full backup data. These generated mapping relationships are then stored in an index file of a preset external object storage space. Next, an association relationship can be generated between the snapshot identifiers of each stateful component and the snapshot identifiers of each stateless component, and this association relationship is also stored in the preset external object storage space to ultimately complete the data backup of the cloud-native stateful application.

[0073] In one specific implementation of this embodiment, the data backup process for cloud-native applications can be as follows: Figure 1B As shown. Specifically, first, define and obtain the cloud-native stateful application, and determine the list of components included in the cloud-native stateful application, as well as the backup priority of each component. Then, according to the backup priority order of each component, perform incremental backups on each stateful component first to obtain the incremental backup data corresponding to each stateful component, and then perform full backups on each stateless component to obtain the full backup data corresponding to each stateless component.

[0074] Next, the incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component are stored in the external object storage space. Then, the association between the snapshot identifiers corresponding to each stateful component and the snapshot identifiers corresponding to each stateless component is generated and stored in the external object storage space.

[0075] When performing incremental backups of stateful components, the pre-hook and post-hook functions for each component can be obtained. By combining these functions, component data remains unchanged during the incremental backup process, ensuring data consistency. For different stateful components, the pre-hook function can perform any of the following operations: writing memory data to disk, enabling silent services, enabling global locks, and consistency checks. Correspondingly, the post-hook function can be used to disable global locks or remove silent services.

[0076] Example 2

[0077] Figure 2 This is a schematic diagram of the structure of a data backup device for cloud-native applications provided in Embodiment 2 of the present invention. Figure 2 As shown, the device may include: a component acquisition module 210, a backup data acquisition module 220, and a data storage module 230; wherein,

[0078] The component acquisition module 210 is used to acquire cloud-native stateful applications and acquire at least one component corresponding to the cloud-native stateful applications, as well as the backup priority of each component; the components include stateful components and stateless components.

[0079] The backup data acquisition module 220 is used to acquire incremental backup data corresponding to each stateful component and full backup data corresponding to each stateless component according to the backup priority of each component.

[0080] The data storage module 230 is used to associate and store the incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component, so as to complete the data backup of the cloud-native stateful application.

[0081] The technical solution of this invention involves acquiring a cloud-native stateful application, its corresponding multiple components, and the backup priority of each component. Then, based on the backup priority of each component, incremental backup data for each stateful component and full backup data for each stateless component are acquired. Finally, the incremental backup data for each stateful component and the full backup data for each stateless component are associated and stored to complete the data backup of the cloud-native stateful application. By performing incremental backups on the stateful components included in the stateful application and full backups on the stateless components, and by associating the incremental and full backup data, the consistency of the backup data for the stateful application can be guaranteed, thus increasing the probability of successful application recovery.

[0082] Optionally, the backup data acquisition module 220 includes:

[0083] The file system directory acquisition unit is used to acquire the storage volume associated with the running instance of the current stateful component and the file system directory of the storage volume if the component to be backed up is detected as a currently stateful component according to the backup priority of each component.

[0084] The pre-hook function acquisition unit is used to acquire the pre-hook function corresponding to the current stateful component, and to perform service silent operation on the current stateful component through the pre-hook function;

[0085] The component data acquisition unit is used to acquire the component data corresponding to the currently stateful component based on the file system directory corresponding to the storage volume.

[0086] The post-hook function acquisition unit is used to acquire the post-hook function corresponding to the current stateful component, and to perform a service silencing operation on the current stateful component through the post-hook function;

[0087] The incremental backup data acquisition unit is used to perform incremental backup of the component data corresponding to the currently stateful component in order to obtain the incremental backup data corresponding to the currently stateful component.

[0088] Optionally, stateful components include at least one of databases, middleware, and microservices.

[0089] Optionally, the pre-hook function acquisition unit is specifically used to write the memory data corresponding to the current stateful component to a snapshot data file and store the snapshot data file to a preset disk through the pre-hook function if the current stateful component is a first preset middleware.

[0090] If the currently stateful component is the second preset middleware, then the preset proxy service is silenced through the pre-hook function to block external calls to write operations; and

[0091] If the currently stateful component is a preset database, then the global lock of the preset database is enabled through the pre-hook function to block internal write operations.

[0092] Optionally, the post-hook function acquisition unit is specifically used to, if the currently stateful component is a preset database, disable the global lock of the preset database through the post-hook function to resume internal write operations; and

[0093] If the currently stateful component is the second preset middleware, then the preset proxy service is deactivated through the post-hook function to restore external calls to write operations.

[0094] Optional, the incremental backup data acquisition unit includes:

[0095] The historical backup data acquisition subunit is used to acquire the snapshot identifier corresponding to the currently stateful component, and acquire the historical backup data corresponding to the currently stateful component based on the snapshot identifier corresponding to the currently stateful component.

[0096] The difference data acquisition subunit is used to compare the component data corresponding to the currently stateful component with the corresponding historical backup data to obtain difference data, and use the difference data as the incremental backup data corresponding to the currently stateful component.

[0097] Optional, the data storage module 230 includes:

[0098] A snapshot identifier acquisition unit is used to acquire snapshot identifiers corresponding to each of the stateful components and snapshot identifiers corresponding to each of the stateless components.

[0099] The mapping relationship storage unit is used to generate a mapping relationship between the snapshot identifier and the corresponding incremental backup data of each stateful component and store it in a preset external object storage space, and to generate a mapping relationship between the snapshot identifier and the corresponding full backup data of each stateless component and store it in a preset external object storage space.

[0100] The association storage unit is used to generate the association relationship between the snapshot identifiers corresponding to each stateful component and the snapshot identifiers corresponding to each stateless component and store it in a preset external object storage space to complete the data backup of the cloud-native stateful application.

[0101] The cloud-native application data backup device provided in this embodiment of the invention can execute the cloud-native application data backup method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0102] Example 3

[0103] Figure 3 A schematic diagram of an electronic device 30 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0104] like Figure 3 As shown, the electronic device 30 includes at least one processor 31 and a memory, such as a read-only memory (ROM) 32 or a random access memory (RAM) 33, communicatively connected to the at least one processor 31. The memory stores computer programs executable by the at least one processor. The processor 31 can perform various appropriate actions and processes based on the computer program stored in the ROM 32 or loaded from storage unit 38 into the RAM 33. The RAM 33 can also store various programs and data required for the operation of the electronic device 30. The processor 31, ROM 32, and RAM 33 are interconnected via a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.

[0105] Multiple components in electronic device 30 are connected to I / O interface 35, including: input unit 36, such as keyboard, mouse, etc.; output unit 37, such as various types of monitors, speakers, etc.; storage unit 38, such as disk, optical disk, etc.; and communication unit 39, such as network card, modem, wireless transceiver, etc. Communication unit 39 allows electronic device 30 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0106] Processor 31 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 31 performs the various methods and processes described above, such as data backup methods for cloud-native applications.

[0107] In some embodiments, the data backup method for cloud-native applications may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 30 via ROM 32 and / or communication unit 39. When the computer program is loaded into RAM 33 and executed by processor 31, one or more steps of the data backup method for cloud-native applications described above may be performed. Alternatively, in other embodiments, processor 31 may be configured to perform the data backup method for cloud-native applications by any other suitable means (e.g., by means of firmware).

[0108] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0109] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0110] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0111] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0112] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0113] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0114] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

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

Claims

1. A method for data backup of a cloud-native application, characterized in that, The method comprises the following steps: obtaining a cloud-native stateful application, and obtaining at least one component corresponding to the cloud-native stateful application and a backup priority corresponding to each component; the components include stateful components and stateless components; obtaining incremental backup data corresponding to each stateful component and full backup data corresponding to each stateless component according to the backup priority corresponding to each component; performing associated storage on the incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component to complete data backup of the cloud-native stateful application; wherein, according to the backup priority corresponding to each component, obtaining the incremental backup data corresponding to each stateful component comprises: if it is detected according to the backup priority corresponding to each component that the component to be currently backed up is a current stateful component, obtaining a storage volume associated with a running instance corresponding to the current stateful component and a file system directory corresponding to the storage volume; obtaining a pre-hook function corresponding to the current stateful component and performing service silencing operation on the current stateful component through the pre-hook function; obtaining component data corresponding to the current stateful component according to the file system directory corresponding to the storage volume; obtaining a post-hook function corresponding to the current stateful component and performing service un-silencing operation on the current stateful component through the post-hook function; performing incremental backup on the component data corresponding to the current stateful component to obtain the incremental backup data corresponding to the current stateful component.

2. The method of claim 1, wherein, The stateful component includes at least one of a database, a middleware and a microservice.

3. The method of claim 2, wherein, The service silencing operation on the current stateful component through the pre-hook function comprises: if the current stateful component is a first preset middleware, writing memory data corresponding to the current stateful component into a snapshot data file through the pre-hook function, and storing the snapshot data file to a preset disk; if the current stateful component is a second preset middleware, enabling preset proxy service silencing through the pre-hook function to block external calls to write operations; and if the current stateful component is a preset database, starting a preset database global lock through the pre-hook function to block internal write operations.

4. The method of claim 2, wherein, The service un-silencing operation on the current stateful component through the post-hook function comprises: if the current stateful component is a preset database, disabling the preset database global lock through the post-hook function to restore internal write operations; and if the current stateful component is a second preset middleware, removing the preset proxy service silencing through the post-hook function to restore external calls to write operations.

5. The method of claim 1, wherein, The incremental backup on the component data corresponding to the current stateful component to obtain the incremental backup data corresponding to the current stateful component comprises: obtaining a snapshot identifier corresponding to the current stateful component, and obtaining historical backup data corresponding to the current stateful component according to the snapshot identifier corresponding to the current stateful component; The component data corresponding to the current stateful component and the corresponding historical backup data are compared to obtain difference data, and the difference data is taken as the incremental backup data corresponding to the current stateful component.

6. The method of claim 1, wherein, The incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component are associatedly stored to complete the data backup of the cloud-native stateful application, including: Obtaining the snapshot identifier corresponding to each stateful component and the snapshot identifier corresponding to each stateless component; Generating the mapping relationship between the snapshot identifier corresponding to each stateful component and the corresponding incremental backup data and storing it to the preset external object storage space, and generating the mapping relationship between the snapshot identifier corresponding to each stateless component and the corresponding full backup data and storing it to the preset external object storage space; Generating the association relationship between the snapshot identifier corresponding to each stateful component and the snapshot identifier corresponding to each stateless component and storing it to the preset external object storage space to complete the data backup of the cloud-native stateful application. 7.A data backup apparatus of a cloud-native application, characterized by comprising: Including: The component acquisition module is used to acquire the cloud-native stateful application, and acquire at least one component corresponding to the cloud-native stateful application and the backup priority corresponding to each component; the component includes a stateful component and a stateless component; The backup data acquisition module is used to acquire the incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component according to the backup priority corresponding to each component; The data storage module is used to associatedly store the incremental backup data corresponding to each stateful component and the full backup data corresponding to each stateless component to complete the data backup of the cloud-native stateful application; Wherein, according to the backup priority corresponding to each component, the incremental backup data corresponding to each stateful component is acquired, including: If it is detected according to the backup priority corresponding to each component that the current component to be backed up is a current stateful component, the storage volume associated with the running instance corresponding to the current stateful component and the file system directory corresponding to the storage volume are acquired; The pre-hook function corresponding to the current stateful component is acquired, and the service silent operation is performed on the current stateful component through the pre-hook function; According to the file system directory corresponding to the storage volume, the component data corresponding to the current stateful component is acquired; The post-hook function corresponding to the current stateful component is acquired, and the service silent operation is removed on the current stateful component through the post-hook function; The component data corresponding to the current stateful component is incrementally backed up to obtain the incremental backup data corresponding to the current stateful component.

8. An electronic device, comprising: The electronic device includes: At least one processor; and The memory is in communication connection with the at least one processor; wherein The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the data backup method of the cloud-native application in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing the processor to implement the data backup method of the cloud native application in any one of claims 1-6 when executed.

Citation Information

Patent Citations

  • Wireless AP configuration information backup and system recovery control system

    CN114138554A

  • Methods and systems for data backup based on cognitive data classification

    US20200241967A1