CN115202934A - Data backup method, device, equipment and storage medium - Google Patents

Data backup method, device, equipment and storage medium Download PDF

Info

Publication number
CN115202934A
CN115202934A CN202210860242.2A CN202210860242A CN115202934A CN 115202934 A CN115202934 A CN 115202934A CN 202210860242 A CN202210860242 A CN 202210860242A CN 115202934 A CN115202934 A CN 115202934A
Authority
CN
China
Prior art keywords
backup
file
service
flow
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210860242.2A
Other languages
Chinese (zh)
Inventor
马昱忻
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202210860242.2A priority Critical patent/CN115202934A/en
Publication of CN115202934A publication Critical patent/CN115202934A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1461Backup scheduling policy
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method, a device, equipment and a storage medium for data backup, and relates to the technical field of data backup management; the method is applied to a container organizer, and comprises the following steps: deploying the preset backup behavior abstract file as a resource file; acquiring preset backup information and a preset backup logic file, wherein the backup information comprises a backup tool; taking the backup information as the parameters of the backup behavior abstract file, and creating a backup service object according to the parameters of the backup behavior abstract file; creating backup operation service according to the backup service object and the backup logic file; and calling the backup tool to perform backup processing through the backup operation service according to the backup logic in the backup logic file. Therefore, the data backup method, device, equipment and storage medium of the embodiment of the invention can realize the decoupling of the backup operation service and the backup tool.

Description

Data backup method, device, equipment and storage medium
Technical Field
The present invention relates to, but not limited to, the field of data backup management technologies, and in particular, to a method, an apparatus, a device, and a storage medium for data backup.
Background
The operation mode of the traditional backup tool is generally divided into an independent remote backup server or a local backup service; the former generally takes commercial backup software as a main part, needs to independently deploy a backup server to realize backup configuration and management, and realizes backup service through client sides arranged at a source end and a target end; the latter is mostly an open source tool, and is deployed at a source end or a backup end; however, the data backup by using the service with the data backup of the container organizer is often limited by the type of the data backup tool provided by the container organizer or the corresponding backup operation service needs to be deployed for the actual application backup during the backup, so that the backup operation service and the backup tool of the existing method for performing data backup for the container organizer are strongly correlated, which results in weak universality of data backup deployment and incapability of adapting to personalized backup requirements.
Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
The embodiment of the invention provides a data backup method, a data backup device, data backup equipment and a data backup storage medium, which can realize the decoupling of backup operation service and a backup tool.
In a first aspect, an embodiment of the present invention provides a data backup method, which is applied to a container orchestrator, where the data backup method includes:
deploying the preset backup behavior abstract file as a resource file;
acquiring preset backup information and a preset backup logic file, wherein the backup information comprises a backup tool;
taking the backup information as the parameters of the backup behavior abstract file, and creating a backup service object according to the parameters of the backup behavior abstract file;
creating a backup operation service according to the backup service object and the backup logic file;
and calling the backup tool to perform backup processing through the backup operation service according to the backup logic in the backup logic file.
According to some embodiments of the first aspect of the present invention, the backup information includes a target path and a source path, and the backup behavior abstract file carries a backup policy;
the calling the backup tool to perform backup processing through the backup operation service according to the backup logic in the backup logic file comprises:
extracting a backup strategy, a target path and a source path from the backup service object through the backup operation service;
when the backup strategy is incremental backup, identifying at least one difference file which is different from the previous backup in the source path through the backup operation service;
and calling the backup tool to copy at least one difference file to the target path through the backup running service.
According to some embodiments of the first aspect of the present invention, identifying, by the backup execution service, at least one difference file in the source path that differs from a previous backup includes:
identifying, by the backup operating service, at least one first difference file having a file update date difference from a previous backup under the source path;
identifying at least one second difference file which has a file size difference with the previous backup and has the same file updating date under the source path through the backup operation service;
and taking the identified first difference file and the identified second difference file as the difference files.
According to some embodiments of the first aspect of the present invention, after creating the backup run service, the method further comprises:
counting a first network flow of a physical node where the container orchestrator is located;
comparing the first network flow with a preset flow threshold;
when the first network traffic exceeds a preset first percentage of the traffic threshold, adjusting second network traffic allowed to be transmitted by the physical node to be below a second percentage of the traffic threshold.
According to some embodiments of the first aspect of the present invention, the flow threshold is determined by:
extracting a first flow upper limit value from the backup service object;
acquiring a second flow upper limit value configured by the physical node;
and calculating to obtain the flow threshold value by taking the first flow upper limit value and the second flow upper limit value as input parameters of a preset flow algorithm.
According to some embodiments of the first aspect of the present invention, the calculating the flow threshold value by using the first flow upper limit value and the second flow upper limit value as input parameters of a preset flow algorithm includes:
calculating the second flow upper limit value according to a preset third percentage to obtain a third flow upper limit value;
and taking the smaller value of the third flow upper limit value and the first flow upper limit value as the flow threshold value.
According to some embodiments of the first aspect of the present invention, after creating the backup run service, the method further comprises:
and updating the file quantity obtained by statistics in the backup processing process and the corresponding backup consumption data into the backup service object.
In a second aspect, an embodiment of the present invention further provides an apparatus with a data backup function, including:
the resource definition module is used for deploying the preset backup behavior abstract file as a resource file;
the device comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring preset backup information and a preset backup logic file, and the backup information comprises a backup tool;
the object creating module is used for taking the backup information as the parameter of the backup behavior abstract file and creating a backup service object according to the parameter of the backup behavior abstract file;
the service creating module is used for creating backup operation service according to the backup service object and the backup logic file;
and the operation module is used for calling the backup tool to perform backup processing through the backup operation service according to the backup logic in the backup logic file.
In a third aspect, an embodiment of the present invention further provides an electronic device, including: at least one processor, and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions for execution by the at least one processor to cause the at least one processor to carry out the method of data backup according to any one of the first aspect when the instructions are executed.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, where the computer-executable instructions are configured to perform the method for backing up data according to any one of the first aspect.
The above embodiment of the invention has at least the following beneficial effects: the backup behavior abstract file is set, the backup behavior is abstracted, different backup service objects are obtained by inputting different backup information, and the backup service objects are managed through the backup logic, so that the backup operation service can realize personalized customized backup operation according to customized backup requirements (namely the backup logic) based on a backup tool in the input backup object. Compared with the traditional data backup method, the device, the equipment and the backup service corresponding to the storage medium are deployed by decoupling the specific backup tool and the deployment, so that the deployment mode is more universal and can adapt to personalized backup requirements.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the present invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and do not constitute a limitation thereof.
FIG. 1 is a flow chart illustrating a method for backing up data according to an embodiment of the present invention;
FIG. 2 is an example of a backup behavior abstraction file in a method of data backup according to an embodiment of the present invention;
FIG. 3 is an example of backup service object creation in a method of data backup in an embodiment of the present invention;
FIG. 4 is a schematic flowchart of incremental backup difference file determination in the data backup method according to the embodiment of the present invention;
fig. 5 is a schematic flowchart of backup flow control in a data backup method according to an embodiment of the present invention;
FIG. 6 is a block diagram of an apparatus with data backup function according to an embodiment of the present invention;
fig. 7 is a hardware schematic diagram of an electronic device applying a method of data backup according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flowcharts shown in the figures are illustrative only and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The following is an explanation of some terms used in the present invention.
The container organizer can operate in any environment in which containers are used. It can help you deploy the same program in multiple environments without needing to rewrite it.
Kubernets, also known as K8S or Kube, is one type of container organizer. Open source container orchestrator techniques for automated deployment, expansion, and management of containerized applications; it makes it simple to deploy and manage microservice architecture applications by forming an abstraction layer on top of the cluster.
Operator, based on the combination of two concepts in Kubernetes: custom resources and custom controllers. It allows engineers to write custom controllers for applications based on domain logic unique to the application. The custom resource is a resource object which is not provided by kubernets.
CRD, named CustomResourceDefinition, CRD can extend Kubernets API, and new resource types can be added into the Kubernets API through CRD without modifying Kubernets source codes or creating customized API server.
The operation mode of the traditional backup tool is generally divided into an independent remote backup server or a local backup service; the former generally takes commercial backup software as a main part, needs to independently deploy a backup server to realize backup configuration and management, and realizes backup service through client sides arranged at a source end and a target end; the latter is mostly an open source tool, and is deployed at a source end or a backup end. The two modes have the problems that a large amount of operation and maintenance manpower is needed to be consumed for stable and reliable backup service, and the like, and meanwhile, the two modes cannot well adapt to a container orchestrator, such as the backup requirement of a K8S environment. Taking K8S as an example, two main modes for using K8S by a current user are the hosting mode, namely purchasing ready-made K8S service from a cloud service provider, hosting the whole K8S platform to the cloud service provider for maintenance, and only serving as an application computing user; the second is a self-hosting mode, which is to maintain its own K8S platform on bare metal servers or computing resources provided by cloud service providers. The former is limited to services provided by cloud providers; the latter is that auxiliary services necessary for the application to the production environment, such as backup of critical applications and data, etc., need to be built in part or in whole. Therefore, the backup operation service on the current container orchestrator is strongly related to the backup tool and deployment, and the deployment of the backup operation service does not have generality and cannot meet the personalized customization requirements of users. Based on this, the embodiments of the present invention provide a method, an apparatus, a device, and a storage medium for data backup, which can implement decoupling of a backup operation service and a backup tool, thereby improving deployment universality of data backup in a decoupling manner and adapting to personalized backup requirements.
In a first aspect, referring to fig. 1, an embodiment of the present invention provides a data backup method, which is applied to a container orchestrator, where the data backup method includes:
and S100, deploying the preset backup behavior abstract file as a resource file.
It should be noted that the backup behavior abstraction file is used to abstract the backup behavior, such as the name of the called backup tool, the backup policy (e.g. incremental, full), the backup path (including the source path and the target path), and so on. The user can create a backup behavior abstract file on a platform corresponding to the container organizer to serve as a custom resource. Illustratively, taking deployment on K8S as an example, with reference to fig. 2, a backup behavior abstract file named backup ref. Wherein, the backtools correspond to a backup tool, and the source and target correspond to a source path and a target path respectively; the "type" corresponds to a backup strategy, and the "required" indicates that the necessary parameters in the backup file are a backup tool, a source path and a target path, and at this time, other parameters of the backup behavior abstract file are optional parameters, and a user can set the parameters according to actual backup requirements, and when the specific values of the optional parameters are not set, the operation is performed according to default parameters. Yaml of backup behavior abstract files can be used as K8S custom resources after being created, and can be created based on the custom resources when a subsequent object is instantiated.
Step S200, obtaining preset backup information and a preset backup logic file, where the backup information includes a backup tool.
It should be noted that, for backup, the backup information for instantiation includes at least a backup tool and a backup path (e.g., at least one of a source path and a target path).
It should be noted that the backup information is a parameter for generating a specific backup service object, and instantiation of the custom resource is implemented. The backup behavior abstract file can obtain an instantiation object with information such as a backup tool, a backup source path and a backup target path based on the backup information.
It should be noted that, in practical applications, when a plurality of different instances need to be created, a plurality of different backup information may be input to create the instances corresponding to the backup information one to one.
It should be noted that the backup logic file is used to provide logic in the backup operation process, and is used to manage the instantiation object corresponding to the backup information.
And step S300, taking the backup information as the parameters of the abstract file of the backup behavior, and creating a backup service object according to the parameters of the abstract file of the backup behavior.
For example, taking deployment on K8S as an example, referring to fig. 3, after backerref.yaml is deployed on a cluster managed by a container orchestrator, a backup service object can be created by instantiating a custom resource, and the backup service object is defined as a backup 01, so that the backup service object shown in fig. 3 is obtained, where Spec fields correspond to parameters of the same fields in the backerref.yaml one by one, and at this time, a backup service object calling an rsync backup tool can be created.
And step S400, creating backup operation service according to the backup service object and the backup logic file.
It should be noted that, for the container orchestrator, a backup operation service may be created through an extension plug-in, for example, for K8S, the Operator creates a backup operation service deployment on K8S based on backtools in the instance of the back 01, and parameters such as sources and Targets.
And step S500, calling a backup tool for backup processing through the backup operation service according to the backup logic in the backup logic file.
It should be noted that the backup logic is used to characterize the policy of the backup operation service operation, such as the definition of the incremental policy, such as the control of the backup traffic, and the like.
It should be noted that the backup operation service and the backup service object correspond to each other one to one. When a plurality of backup service objects exist, the plurality of backup service objects can share one backup logic file, and a plurality of backup logic files can be created, so that different backup service objects perform backup operation according to different backup logics.
It should be noted that the backup operation service may be deployed through the Operator, so that the backup operation service may operate based on the backup logic.
Therefore, by setting the abstract file of the backup behavior, abstracting the backup behavior, obtaining different backup service objects by inputting different backup information, and managing the backup service objects through the backup logic, the backup operation service can realize personalized customized backup operation according to customized backup requirements (namely the backup logic) based on the backup tool in the input backup object, and at the moment, a user can establish the backup service only by determining the name of the backup tool selected for backup, the backup path and the operation needing backup without paying attention to the deployment mode of the backup tool while establishing the backup operation service, so that the backup operation service can be decoupled from the specific backup tool and deployment. Compared with the traditional data backup method, the deployment of the backup service has the advantages that the deployment mode is more universal and can be adapted to personalized backup requirements through the decoupling with the specific backup tool and the deployment.
It should be noted that, in the embodiment of the present invention, it is preferable that the backup behavior abstract file is deployed on the K8S platform as a custom resource file of the K8S platform, and the custom resource file is called to perform instantiation to obtain a backup service object, and then a backup operation service corresponding to the backup service object is created through an Operator, and the backup operation service is called based on a preset backup logic to perform backup processing. At this time, a platform plug-in development mode supported by a K8S official authority is adopted, automatic management of backup is achieved, the backup operation service deployment is decoupled from a specific backup tool and a deployment structure, and a user only needs to configure the backup tool and backup contents. Because the backup behavior abstract file and the backup logic file are both universal files and are predefined in the platform as resource information, for a plurality of different backup operation services, different backup operation services can be realized by instantiating different backup behavior abstract files and the backup logic file to be combined and created, and further customized backup requirements are realized.
It can be understood that the backup information comprises a target path and a source path, and the backup behavior abstract file carries a backup strategy; step S500, according to the backup logic in the backup logic file, calling a backup tool through the backup operation service to perform backup processing, including: extracting a backup strategy, a target path and a source path from a backup service object through a backup operation service; when the backup strategy is incremental backup, identifying at least one difference file which is different from the previous backup in a source path through a backup operation service; and calling a backup tool through the backup operation service to copy the at least one difference file to the target path.
It should be noted that the backup information at least includes one of the backup tool and the target path or the source path; as in some embodiments, the target path is not limited, and a customized directory in the file is used, so that only the source path can be input to specify the source of the backup file. In some embodiments, only files of the specified directory are backed up, the source path in the backup behavior abstract file may be set as the path, and the setting of the backup path may be implemented by inputting only the target path in the backup information. In other embodiments, both the source path and the target path of the backup need to be specified to fulfill backup requirements of different applications, and at this time, the source path and the target path may be set in the backup information. Preferably, in the embodiment of the present invention, the backup tool, the target path, and the source path are all used as parameters necessary for backing up the behavior abstract file.
It should be noted that, for the backup behavior abstract file, in some embodiments, the backup policy is an optional parameter, that is, the backup policy may be limited to be incremental or full through the backup information or a default manner is selected for backup. In other embodiments, the backup policy is a mandatory parameter, i.e., instantiation of a backup service object requires information that the backup policy must be entered.
It should be noted that, since the backup service object is based on the backup behavior abstract file and the backup information, the corresponding information can be directly extracted from the backup service object.
It should be noted that, when the backup policy is incremental backup, it is necessary to determine whether there is a history version, that is, whether there is a file already backed up, if there is a history version, a DIFF tool may be used for comparison, and a difference file is determined by comparing a difference between the history version and a current version.
It is to be understood that, referring to fig. 4, identifying at least one difference file in the source path from the previous backup by the backup execution service includes:
step S510, identifying, by the backup operation service, at least one first difference file having a file update date difference from a previous backup under the source path.
It should be noted that, for each file, the modified information, that is, the file update date, is recorded, and by reading the file update date, it can be determined whether the last backed-up file is updated. For example, for the a folder under the path, the first difference file may be determined by comparing the update dates of the folders, and in other embodiments, the update dates of each file under the a folder may be directly compared. Note that the update date may be compared with the date of the file itself, or may be compared with the date of the previous backup of the file to be backed up. If the previous backup date is 2021 year 10 month 1 day, at least the files whose update date under the current directory is 10 month 1 day after 2021 year need to be backed up by the update. At this time, the backed-up files can be quickly screened out by comparing with the backup date.
Step S520, identifying at least one second difference file having a file size difference and a file update date the same as that of the previous backup under the source path through the backup operation service.
It should be noted that each file to be backed up has a record of the size of the file content, and when the file update dates are the same but the file sizes are different, it indicates that there is a missed backup in the previous backup.
It should be noted that the comparison of the file size and the update date is more efficient than the comparison of the direct text.
Step S530, the identified first difference file and the identified second difference file are both used as difference files.
It should be noted that, by performing incremental backup on the date or size of a file, the backup behavior is more detailed, the backup bandwidth and the storage consumption are saved, but the comparison consumption is increased. Therefore, in some embodiments, storage consumption, comparison consumption, and the like during backup are recorded.
It is understood that, after step S500, referring to fig. 5, the method for backing up data further includes:
step S610, counting the first network flow of the physical node where the container orchestrator is located.
It should be noted that, the first network traffic may be counted by a traffic counting tool provided in the container orchestrator, or the traffic may be counted by a custom traffic counting module, which is not limited in the embodiment of the present invention. For example, taking K8S as an example, the network traffic of the POD is read by the K8S metric server to determine the traffic occupied by the node backup where the current backup is located.
Step S620, comparing the first network traffic with a preset traffic threshold.
Step S630, when the first network traffic exceeds a preset first percentage of the traffic threshold, adjusting a second network traffic allowed to be transmitted by the physical node to be below a second percentage of the traffic threshold.
It should be noted that the first percentage and the second percentage can be set according to actual conditions, for example, the first percentage is 80% and the second percentage is 10%. The threshold for flow may be set to a fixed value or dynamically set by user parameters.
It should be noted that when the current node flow rate exceeds 80%, the flow rate is set to 1/10 of the flow rate threshold value by calling the iptables tool, otherwise, the flow rate is limited to not exceed the flow rate threshold value, so that the restriction of the flow rate is released, and the flow limitation is performed only after a first percentage of the threshold value is exceeded.
For example, assuming that the traffic threshold is set to 20M and the current first network traffic is 19M, it is determined that the current node traffic exceeds 80% and traffic limitation needs to be performed, at this time, the current node traffic is adjusted so that it occupies 2M traffic at most for backup, and when the current node traffic is already lower than 80%, the current node traffic is not limited until the current node traffic exceeds 80% again.
It will be appreciated that the flow threshold is determined by: extracting a first flow upper limit value from a backup service object; acquiring a second flow upper limit value configured by the physical node; and taking the first flow upper limit value and the second flow upper limit value as input parameters of a preset flow algorithm, and calculating to obtain a flow threshold value.
The second upper limit value of the flow is the upper limit of the flow allowed to pass by the node, the first upper limit value of the flow is set in the backup service object as an optional parameter, and a user can selectively write the value in the backup information to dynamically adjust the information. Exemplarily, referring to fig. 2, it is set in "netlimit" in backer01. Spec.
It should be noted that the flow algorithm is set in the backup logic, and the flow algorithm may be adjusted by modifying the backup logic file.
It can be understood that the calculation of the flow threshold value using the first flow upper limit value and the second flow upper limit value as the input parameters of the preset flow algorithm includes:
calculating the second flow upper limit value according to a preset third percentage to obtain a third flow upper limit value;
and taking the smaller value of the third flow upper limit value and the first flow upper limit value as a flow threshold value.
It should be noted that the third percentage may be set according to specific situations, for comparison, the embodiment of the present invention is not limited, and preferably, in the embodiment of the present invention, the third percentage is set to be one third.
It should be noted that, by using a smaller traffic value as the traffic threshold, it is ensured that the capacity of the physical link is sufficient during the backup process, and there is no packet loss of the normal application data due to the excessively large bandwidth of the backup traffic. It should be noted that, the second flow upper limit value is set in a certain proportion to obtain a third flow upper limit value, and the flows on the current node can be reasonably distributed, so that the bandwidth occupied during backup does not affect normal application interaction, and large-bandwidth capacity transmission can be performed as far as possible.
It should be noted that, in some embodiments, the backup time of the backup operation service is set to be the idle time, and at this time, the value set by the third percentage may be larger, so that the backup may be performed as quickly as possible with sufficient bandwidth. When the backup time of the backup operation service is overlapped with the use time of the application, a proper proportion, such as one third, can be selected according to the experience value to limit the backup bandwidth.
It can be understood that after step S400, the method of data backup further includes: and updating the file quantity and the corresponding backup consumption data obtained by statistics in the backup processing process into a backup service object.
It should be noted that a field of a state may be created in the backup service object, at this time, when the backup operation service is hosted in the container orchestrator, the container orchestrator may perform real-time detection according to the field, and further determine an operation state of the hosted backup operation service, and at this time, the platform may automatically repair some simple abnormalities through a hosted service repair mechanism, and further reduce the amount of manual maintenance.
It should be noted that the backup consumption data includes a flow rate occupied by the backup, a storage (such as memory consumption or hard disk space occupation) occupied during the backup, and the like, and the embodiment of the present invention is not limited to this, and specifically, specific parameters of the backup consumption data may be set according to parameters related to system tuning.
For example, referring to fig. 1 to fig. 5, taking the deployment of the method for backing up data by K8S + Operator as an example, first, referring to fig. 1 and fig. 2, a part behavioral abstraction file, backserdef.yaml, is created on a K8S platform, and the part behavioral abstraction file is deployed as a custom resource of K8S. Then, referring to fig. 1 and fig. 3, instantiating the custom resource to obtain a backup service object back 01 (a plurality of backup service objects may be provided) with the information shown in fig. 3. Then writing a backup logic file backup-Operator according to the backup logic, wherein the Operator creates a depolyme for running backup service on the K8S according to parameters such as backtools and sourceTargets in a user-defined resource object backup 01 example in the K8S cluster; and the backup running service meeting the user condition in the guarantee can be run on the cluster when a back-Operator of the K8S platform runs by referring to other application middleware deployed in the K8S and being managed to the K8S platform. Since the backup path information is specified in the backup service object back 01, kubecect get/cp can be called to copy the resource to be backed up to the local temporary path. Referring to fig. 4, according to the backup strategy specified by the back 01 parameter, difference comparison is performed on the increment, if the historical version exists, a DIFF tool is called to compare the historical version with the current version, if no difference exists, the current version is discarded, and finally only files with differences are reserved. Then, generating a rync calling parameter according to a backup strategy, a target path, a source path and the like specified in the back 01 spec, and operating a rync tool to execute backup of the difference file; determining the current node flow by reading the network flow of a backup tool POD through reading a K8S meter server, and referring to fig. 5, taking a small value of 1/3 of an upper flow limit and a lower flow limit of a node in backup 01.Spec as a backup flow threshold, if the current node flow exceeds the flow threshold of 80%, setting the current node flow as 1/10 of the flow threshold by calling an iptables tool, otherwise, limiting the current node flow as not exceeding the flow threshold; and after the backup is completed, the backup amount and the backup consumption are updated to status of the back-er 01.
Therefore, the backup operation service is hosted to the K8S cluster based on the CDR + Operator mode of the K8S, the operation and maintenance tool is self-hosted, the platform plug-in development mode supported by the K8S official party is adopted, the backup operation service is decoupled from the specific backup tool and the deployment, the user can configure the tool and the content and purpose of the backup, and the implementation is realized for the user: 1. the backup behavior is decoupled from the specific implementation, and the maintenance is convenient; and 2, cloud service is unified, and learning and maintenance are facilitated. Simultaneously, for the backup operation service itself: compared with the traditional backup service, the method has the advantages that the K8S self-hosting is realized, and the controller controls the self-defined backup behavior: 1, more elaborate incremental backups can be realized; 2, automatically controlling backup flow and reducing manual intervention; and 3, by maintaining the status of the back 01, the indexes of the backup service can be submitted to a metric server of K8S, and finally, the indexes are uniformly delivered to a monitoring system for display, so that uniform index collection and display are realized at low cost.
Therefore, the data backup method of the embodiment of the invention can at least decouple the backup operation service and the specific backup tool from the deployment, and is convenient for maintenance and setting. In some embodiments, by further implementing refined management on incremental backup, automatic control of backup traffic can improve backup efficiency. In other embodiments, the collection of the backup index and the collection of the backup state at low cost are realized by recording the backup consumption in the backup process.
In a second aspect, referring to fig. 6, an apparatus with a data backup function according to an embodiment of the present invention includes:
the resource definition module 100 is configured to deploy a preset backup behavior abstract file as a resource file;
an obtaining module 200, configured to obtain preset backup information and a preset backup logic file, where the backup information includes a backup tool;
the object creating module 300 is configured to use the backup information as a parameter of the abstract file of the backup behavior, and create a backup service object according to the parameter of the abstract file of the backup behavior;
a service creation module 400, configured to create a backup operation service according to the backup service object and the backup logic file;
the running module 500 is configured to invoke a backup tool to perform backup processing through the backup running service according to the backup logic in the backup logic file.
It should be noted that in some embodiments, the running module 500 includes a comparing module and a backup module, and the comparing module is configured to call a comparing tool and a comparing logic defined in the backup logic to compare files on the backup path, so as to determine a backup file to be backed up. The backup module is used for carrying out backup operation on the difference files obtained by comparison in the comparison module and the backup parameters in the backup service object. It should be noted that, in some embodiments, the comparison module determines the first difference file by comparing the update dates of the files under the source path and the target path, then, based on the first difference file, screens out the remaining files under the source path with the same update dates, screens out the second difference file with a file size different from the file size in the previous backup operation from the remaining files, and backs up both the first difference file and the second difference file as the difference files. It should be noted that, when the backup policy is set to full backup, all files in the source path may be completely backed up to the target path. At this time, the files with the same file name are overwritten by the latest file under the target path. Therefore, through the refined setting mode of the backup strategy, the customization of the personalized backup requirement can be carried out according to the actual backup scene, and the backup efficiency is improved under the condition of incremental backup.
It should be noted that, in some embodiments, the apparatus with a data backup function further includes an operation and maintenance module, and the operation and maintenance module is configured to limit a flow of the backup tool by detecting, in real time, a flow situation occupied by the backup tool during the backup process according to a flow limitation policy defined in the backup logic file. The current limiting mode is that the actual flow threshold value is determined according to the preset algorithm of calculating the flow threshold value by the set node flow upper limit value and the flow upper limit value of the backup tool.
To be described, in some embodiments, the apparatus having a data backup function further includes a state recording module, where the state recording module is configured to monitor backup consumption data, such as memory and traffic, consumed by the operation module 500 during the backup process, and record the backup consumption data in a backup service object, so that a container orchestrator in which the backup service object is located detects a state of the consumption data in real time through a self-hosting service, and repairs the backup operation service by using a self-hosting recovery mechanism; the probability of human intervention can then be reduced in this way.
The method of the present invention is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
It can be understood that, referring to the embodiment shown in fig. 6, the embodiment of the present invention further provides an electronic device, which includes:
in a third aspect, an electronic device provided according to an embodiment of the present invention includes:
at least one processor, and,
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions that are executable by the at least one processor to cause the at least one processor, when executing the instructions, to implement the method for data backup according to the above-described embodiment of the present invention.
It should be noted that, since the electronic device applies any one of the methods for data backup provided in the first aspect, all the advantageous effects of the method for data backup provided in the first aspect are obtained.
It should be noted that, for the method applied to the K8S platform, the electronic device corresponds to the hardware structure of the K8S platform.
The hardware structure of the computer apparatus will be described in detail below with reference to fig. 7. The electronic device includes: a processor 610, a memory 620, an input/output interface 630, a communication interface 640, and a bus 650.
The processor 610 may be implemented by a general CPU (Central processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute a relevant program to implement the technical solution provided by the embodiment of the present disclosure;
the Memory 620 may be implemented in a ROM (Read Only Memory), a static Memory device, a dynamic Memory device, or a RAM (Random Access Memory). The memory 620 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present disclosure is implemented by software or firmware, the relevant program codes are stored in the memory 620 and called by the processor 610 to perform the method of data backup of the embodiments of the present disclosure;
an input/output interface 630 for implementing information input and output;
the communication interface 640 is used for realizing communication interaction between the device and other devices, and may realize communication in a wired manner (e.g., USB, network cable, etc.) or in a wireless manner (e.g., mobile network, WIFI, bluetooth, etc.); and a bus 650 that transfers information between various components of the device, such as the processor 610, memory 620, input/output interfaces 630, and communication interface 640;
the processor 610, the memory 620, the input/output interface 630, and the communication interface 640 are communicatively coupled to each other within the device via a bus 650.
Illustratively, referring to fig. 1, 4 and 5, the processor 610 performs the method as shown in steps S100 to S500, in other embodiments, the processor 610 performs the method as shown in steps S100 to S500 and all the steps S510 to S530, and in other embodiments, the processor 610 performs the method as shown in steps S100 to S500, all the steps S510 to S530 and all the steps S610 to S630.
It is understood that the present invention also provides a computer-readable storage medium storing computer-executable instructions for performing the above-described method of data backup.
It is noted that the computer readable storage ring, as it executes the method of any one of the first aspect, has all the benefits of the method of data backup of the first aspect.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
The embodiment described in the embodiment of the present invention is for more clearly illustrating the technical solution of the embodiment of the present invention, and does not constitute a limitation to the technical solution provided in the embodiment of the present invention, and it can be known by those skilled in the art that the technical solution provided in the embodiment of the present invention is also applicable to similar technical problems with the evolution of technology and the occurrence of new application scenarios.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, and functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "comprises," "comprising," and any other variation thereof, in the description of the present invention are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It is to be understood that, in the present invention, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b and c may be single or plural.
While the preferred embodiments of the present invention have been described in detail, it will be understood by those skilled in the art that the foregoing and various other changes, omissions and deviations in the form and detail thereof may be made without departing from the scope of this invention.

Claims (10)

1. A method for data backup, applied to a container organizer, comprising:
deploying the preset backup behavior abstract file as a resource file;
acquiring preset backup information and a preset backup logic file, wherein the backup information comprises a backup tool;
taking the backup information as the parameters of the backup behavior abstract file, and creating a backup service object according to the parameters of the backup behavior abstract file;
creating a backup operation service according to the backup service object and the backup logic file;
and calling the backup tool to perform backup processing through the backup operation service according to the backup logic in the backup logic file.
2. The method for backing up data according to claim 1, wherein the backup information includes a target path and a source path, and the backup behavior abstract file carries a backup policy;
the calling the backup tool to perform backup processing through the backup operation service according to the backup logic in the backup logic file comprises:
extracting a backup strategy, a target path and a source path from the backup service object through the backup operation service;
when the backup strategy is incremental backup, identifying at least one difference file which is different from the previous backup in the source path through the backup operation service;
and calling the backup tool through the backup operation service to copy at least one difference file to the target path.
3. The method of data backup according to claim 2, wherein identifying at least one difference file in the source path that differs from a previous backup by the backup execution service comprises:
identifying, by the backup operating service, at least one first difference file having a file update date difference from a previous backup under the source path;
identifying at least one second difference file which has a file size difference with the previous backup and has the same file updating date under the source path through the backup operation service;
and taking the identified first difference file and the identified second difference file as the difference files.
4. The method of data backup according to claim 1, wherein after creating a backup running service, the method further comprises:
counting a first network flow of a physical node where the container orchestrator is located;
comparing the first network flow with a preset flow threshold;
when the first network traffic exceeds a preset first percentage of the traffic threshold, adjusting second network traffic allowed to be transmitted by the physical node to be below a second percentage of the traffic threshold.
5. The method of data backup according to claim 4, wherein the traffic threshold is determined by:
extracting a first flow upper limit value from the backup service object;
acquiring a second flow upper limit value configured by the physical node;
and calculating to obtain the flow threshold value by taking the first flow upper limit value and the second flow upper limit value as input parameters of a preset flow algorithm.
6. The method for backing up data according to claim 5, wherein the calculating the flow threshold value by using the first flow upper limit value and the second flow upper limit value as input parameters of a preset flow algorithm comprises:
calculating the second flow upper limit value according to a preset third percentage to obtain a third flow upper limit value;
and taking the smaller value of the third flow upper limit value and the first flow upper limit value as the flow threshold value.
7. The method of data backup according to claim 1, wherein after creating the backup execution service, the method further comprises:
and updating the number of files counted in the backup processing process and the corresponding backup consumption data into the backup service object.
8. An apparatus having a data backup function, comprising:
the resource definition module is used for deploying the preset backup behavior abstract file as a resource file;
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring preset backup information and a preset backup logic file, and the backup information comprises a backup tool;
the object creating module is used for taking the backup information as the parameter of the backup behavior abstract file and creating a backup service object according to the parameter of the backup behavior abstract file;
the service creating module is used for creating backup operation service according to the backup service object and the backup logic file;
and the operation module is used for calling the backup tool to perform backup processing through the backup operation service according to the backup logic in the backup logic file.
9. An electronic device, comprising: at least one processor, and,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions for execution by the at least one processor to cause the at least one processor, when executing the instructions, to perform the method of data backup according to any of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer-executable instructions for performing at least the method of data backup according to any of claims 1 to 7.
CN202210860242.2A 2022-07-21 2022-07-21 Data backup method, device, equipment and storage medium Pending CN115202934A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210860242.2A CN115202934A (en) 2022-07-21 2022-07-21 Data backup method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210860242.2A CN115202934A (en) 2022-07-21 2022-07-21 Data backup method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115202934A true CN115202934A (en) 2022-10-18

Family

ID=83584569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210860242.2A Pending CN115202934A (en) 2022-07-21 2022-07-21 Data backup method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115202934A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115357433A (en) * 2022-10-19 2022-11-18 江苏博云科技股份有限公司 Database backup method, device, equipment and storage medium under container environment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115357433A (en) * 2022-10-19 2022-11-18 江苏博云科技股份有限公司 Database backup method, device, equipment and storage medium under container environment

Similar Documents

Publication Publication Date Title
US11966774B2 (en) Workflow generation using multiple interfaces
US8082414B2 (en) Method and system for centralized memory management in wireless terminal devices
CN103067484B (en) A kind of method and system of auto-update application program
CN104866391B (en) A kind of end message backup method and device based on increment information system
US9244960B2 (en) Metadata-driven version management service in pervasive environment
CN116055283B (en) Multi-platform unified cloud management system supporting global tenant application resource quota setting
JP2017123188A (en) Recovery of tenant data across tenant moves
EP1872230B1 (en) Centralized memory management in wireless terminal devices
CN106708548A (en) Program upgrading method and terminal device
WO2019109519A1 (en) Service rule management method, apparatus and device, and computer-readable storage medium
CN112199193A (en) Resource scheduling method and device, electronic equipment and storage medium
CN114706690B (en) Method and system for sharing GPU (graphics processing Unit) by Kubernetes container
CN115202934A (en) Data backup method, device, equipment and storage medium
CN103270520A (en) Importance class based data management
US9549044B1 (en) Data processing
JP5533440B2 (en) Arrangement determining program, method and apparatus
CN115098297B (en) Consistent snapshot generation method and system for cloud primary storage data volume
CN114844791B (en) Cloud service automatic management and distribution method and system based on big data and storage medium
CN114489761B (en) Service integration and application integration method based on container cluster
CN105338058A (en) Application updating method and device
CN114625479A (en) Cloud edge collaborative application management method in edge computing and corresponding device
CN106371882A (en) Method and device for loading configuration file
CN113326052A (en) Method and device for upgrading service component, computer equipment and storage medium
CN111813880A (en) Method, system and storage medium for managing territorial space planning project
CN108363614B (en) Application service module management method and device and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination