WO2023165226A1 - Application resource backup method and apparatus, electronic device, and storage medium - Google Patents

Application resource backup method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2023165226A1
WO2023165226A1 PCT/CN2022/140467 CN2022140467W WO2023165226A1 WO 2023165226 A1 WO2023165226 A1 WO 2023165226A1 CN 2022140467 W CN2022140467 W CN 2022140467W WO 2023165226 A1 WO2023165226 A1 WO 2023165226A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
target
application
backup
data
Prior art date
Application number
PCT/CN2022/140467
Other languages
French (fr)
Chinese (zh)
Inventor
李龙峰
刘茂扬
Original Assignee
苏州浪潮智能科技有限公司
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 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Publication of WO2023165226A1 publication Critical patent/WO2023165226A1/en

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Definitions

  • the present application relates to the field of computer technology, in particular to a method, device, electronic device and storage medium for backing up application resources.
  • the present application provides a backup method, device, electronic equipment and storage medium for application resources.
  • a method for backing up application resources including:
  • the resource backup request includes a first resource identifier corresponding to the first application resource to be backed up;
  • the first resource data is backed up to the object storage pool according to the target storage information, so as to complete the backup of the first application resource.
  • the method also includes:
  • the corresponding relationship between the resource identifier and the authentication information is established, and the corresponding relationship is stored in the database.
  • create target storage information corresponding to the first application resource in the object storage pool including:
  • a storage location and a storage path corresponding to the first application resource are created based on the encrypted configuration information, and the storage location and the storage path are used as target storage information.
  • the method before invoking the target interface according to the target authentication information to generate encryption configuration information corresponding to the first application resource, the method further includes:
  • the target authentication information matches the preset authentication information, determine that the target authentication information has been verified
  • the target interface is invoked according to the target authentication information to generate encryption configuration information corresponding to the first application resource.
  • backing up the first resource data to the object storage pool according to the target storage information includes:
  • the updated target interface is called to create the first backup data corresponding to the first application resource in the object storage pool, so as to complete the backup of the first application resource.
  • the method further includes:
  • the resource restoration request includes a second resource identifier corresponding to a second application resource to be restored;
  • a second application resource is generated in the target cluster based on the second backup data.
  • generating a second application resource in the target cluster based on the second backup data includes:
  • a second application resource is created on the target node according to the image file and the second backup data.
  • a device for backing up application resources including:
  • a receiving module configured to receive a resource backup request, wherein the resource backup request includes a first resource identifier corresponding to the first application resource to be backed up;
  • the response module is configured to, in response to the resource backup request, create target storage information corresponding to the first application resource in the object storage pool, and the object storage pool is used to store the backup data of the application resource;
  • a query module configured to use the first resource identifier to query the first resource data corresponding to the first application resource from the database
  • the backup module is configured to back up the first resource data to the object storage pool according to the target storage information, so as to complete the backup of the first application resource.
  • a storage medium is further provided, the storage medium includes a stored program, and the above steps are executed when the program runs.
  • an electronic device including a processor, a communication interface, a memory, and a communication bus, wherein, the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein:
  • the memory is used to store computer programs; the processor is used to execute the steps in the above method by running the programs stored in the memory.
  • the embodiment of the present application also provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the steps in the above method.
  • the above-mentioned technical solution provided by the embodiment of the present application has the following advantages: the method provided by the embodiment of the present application automatically creates the storage information of the application resources to be backed up in the object storage pool according to the resource backup request, and the storage information of the application resources to be backed up will be created according to the storage information.
  • the resource data of the backup application resource is backed up to the object storage pool, so as to realize the backup of the resource data in the object storage pool. This avoids the situation that the resource data of the application resource has not been backed up when it is lost, and improves the guarantee of the application resource.
  • FIG. 1 is a flow chart of a method for backing up application resources provided by an embodiment of the present application
  • FIG. 2 is a flow chart of a method for backing up application resources provided by another embodiment of the present application.
  • FIG. 3 is a schematic diagram of a service system provided by an embodiment of the present application.
  • FIG. 4 is a block diagram of an application resource backup device provided in an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Embodiments of the present application provide a backup method, device, electronic equipment, and storage medium for application resources.
  • the method provided by the embodiment of the present invention can be applied to any required electronic device, for example, it can be an electronic device such as a server or a terminal, which is not specifically limited here, and is referred to as an electronic device for convenience of description.
  • Fig. 1 is a flowchart of a method for backing up application resources provided by an embodiment of the present application. As shown in Fig. 1, the method includes:
  • Step S11 receiving a resource backup request, wherein the resource backup request includes a first resource identifier corresponding to the first application resource to be backed up.
  • the method provided by the embodiment of this application is applied to the target cluster.
  • the resource backup request can be initiated by the user to the target cluster through the client.
  • the selected operation acting on the client can be detected, and the selected first operation can be determined based on the selected operation.
  • An application resource and determine a first resource identifier corresponding to the first application resource, then generate a resource backup request according to the first resource identifier, and send the resource backup request to the target cluster.
  • the resource backup request can also be automatically initiated periodically.
  • the application resources in the target cluster can be detected periodically, and then the first resource identifier set corresponding to the deployed application resources in the target cluster can be determined. And acquire the second set of resource identifiers of the executed backup application resources from the object storage pool.
  • the first set of resource identifiers With the second set of resource identifiers, it is possible to determine from the first set of resource identifiers the first application resource in the target cluster that has not yet been backed up, and at this time obtain the first resource corresponding to the first application resource ID, and generate a resource backup request based on the first resource ID.
  • Step S12 in response to the resource backup request, create target storage information corresponding to the first application resource in the object storage pool, and the object storage pool is used to store backup data of the application resource.
  • the method further includes the following steps A1-A2:
  • Step A1 determine the resource identifier corresponding to the currently deployed application resource in the target cluster, and obtain the authentication information corresponding to the application resource.
  • Step A2 establish the corresponding relationship between the resource identifier and the authentication information, and store the corresponding relationship in the database.
  • this embodiment of the application will pre-collect the resource identifiers corresponding to the currently deployed application resources in the target cluster, and then query the corresponding authentication information for the resource identifiers, where the authentication information can be pre-uploaded by the developer.
  • the authentication information includes the access key corresponding to the application resource. Then establish the corresponding relationship between the resource identifier and the authentication information, and store the corresponding relationship in the database.
  • step S12 creating the target storage information corresponding to the first application resource in the object storage pool, includes the following steps B1-B3:
  • Step B1 obtaining the corresponding relationship between the resource identifier and the authentication information from the database, and obtaining the target authentication information corresponding to the first application resource based on the corresponding relationship.
  • the method before invoking the target interface according to the target authentication information to generate the encryption configuration information corresponding to the first application resource, the method further includes: verifying the target authentication information, If the information matches, it is determined that the target authentication information has passed the verification, and if the target authentication information has passed the verification, the target interface is invoked according to the target authentication information to generate encrypted configuration information corresponding to the first application resource.
  • Step B2 calling the target interface according to the target authentication information to generate encryption configuration information corresponding to the first application resource.
  • Step B3 Create a storage location and a storage path corresponding to the first application resource based on the encryption configuration information, and use the storage location and the storage path as target storage information.
  • the object storage authentication information call the target interface (that is, Kubernetes API) to create encrypted configuration information, and the encrypted configuration information carries object storage information, which is used to identify the final storage location and the uniqueness of the storage path .
  • object storage information For example: Use the information ID in the object storage information to identify the uniqueness.
  • encrypted configuration information is used to create unique storage paths and storage locations for application resources.
  • Step S13 using the first resource identifier to query the first resource data corresponding to the first application resource from the database.
  • the database also stores resource data corresponding to each application resource, so the first resource data corresponding to the first application resource can be queried from the database by using the first resource identifier, wherein the first resource data includes: Stateful load, stateless load, common configuration, encrypted configuration, service data, etc.
  • Step S14 back up the first resource data to the object storage pool according to the target storage information, so as to complete the backup of the first application resource.
  • step S14 backing up the first resource data to the object storage pool according to the target storage information, includes the following steps C1-C2:
  • Step C1 Generate an interface annotation of the target interface based on the first resource data, and add the interface annotation and target storage information to the target interface to obtain an updated target interface.
  • the first resource data is generated into an object structure according to a preset format, and then the object structure is added to the target interface in the form of interface annotation, and the target storage information is also added to the Target interface, get the updated target interface.
  • the object structure is added to the target interface in the manner of interface annotation, so that the target interface can directly create backup resources when called.
  • the object structure generated by generating the first resource data according to a preset format is as follows:
  • Step C2 calling the updated target interface to create first backup data corresponding to the first application resource in the object storage pool, so as to complete the backup of the first application resource.
  • the updated target interface is called to create the first backup data corresponding to the first application resource in the object storage pool according to the storage path and storage location, so as to complete the backup of the first application resource.
  • the method provided in the embodiment of this application automatically creates the storage information of the application resources to be backed up in the object storage pool according to the resource backup request, and backs up the resource data of the application resources to be backed up to the object storage pool according to the storage information, thereby realizing resource data storage in the object storage pool. Backups in the pool. This avoids the situation that the resource data of the application resource has not been backed up when it is lost, and improves the guarantee of the application resource.
  • the method further includes the following steps:
  • Step S21 receiving a resource restoration request, wherein the resource restoration request includes a second resource identifier corresponding to the second application resource to be restored.
  • the resource restoration request can be initiated by the user to the target cluster through the client. Specifically, the user can detect whether resource loss occurs in the target cluster through the client. The resource identifier of each application resource, the client will periodically query the survival status of the application resource in the target cluster according to the resource identifier. If the client does not query the survival state of the application resource corresponding to a resource identifier within the current detection cycle, it determines that the application resource corresponding to the resource identifier has been lost in the target cluster.
  • the client when there is resource loss in the target cluster, the client will determine the second application resource lost in the target cluster, and determine the second resource identifier corresponding to the lost second application resource.
  • the second resource identifier acquires the backup data of the second application resource from the object storage pool.
  • Step S22 acquiring second backup data matching the second resource identifier from the object storage pool.
  • the second backup data matching the second resource ID can be obtained from the object storage pool according to the second resource ID.
  • resource identifier a backup data A
  • resource identifier b backup data B
  • resource identifier c backup data C. Therefore, after determining the resource ID of the lost application resource, the backup data corresponding to the resource ID can be obtained from the object storage pool according to the resource ID, and the lost application resource can be restored in the target cluster based on the backup data.
  • Step S23 generating a second application resource in the target cluster based on the second backup data.
  • step S23 generating the second application resource in the target cluster based on the second backup data, includes the following steps D1-D3:
  • Step D1 query the target node corresponding to the second backup data from the target cluster.
  • Step D2 obtain the image file satisfying the corresponding framework of the target node from the image repository.
  • the target node after determining the target node to perform the restoration operation, it is necessary to query the framework corresponding to the target node, and then obtain the mirror file matching the framework from the mirror warehouse, which stores each node in the target cluster framework, and the image file corresponding to the framework.
  • Step D3 creating a second application resource on the target node according to the image file and the second backup data.
  • the target node in the target cluster creates the second application resource, thereby completing the restoration operation of the lost application resource.
  • the image file is similar to the rar ZIP archive, which makes a specific series of files into a single file in a certain format, so that users can download and use it conveniently.
  • the backup resources are pulled from the object storage pool and restored in the target cluster. In this way, the characteristics of high guarantee of application resources in the deployment of Kubernetes computing clusters based on multi-architecture domestic servers are improved.
  • the service system includes: a storage device and a backup device.
  • the storage device includes: a database and an object storage pool.
  • the backup device After the backup device receives the resource backup request, the backup device is configured to acquire the resource data of the application resources to be backed up from the database in the storage device, and create storage information in the object storage pool in the storage device. Then perform a backup operation according to the storage information, that is, back up the resource data of the application resource to be backed up to the object storage pool.
  • the target cluster also includes: a restoration device and a mirror warehouse, which are used to receive resource restoration requests, obtain the backup data corresponding to the application resources to be restored from the object storage pool according to the resource restoration requests, and obtain the backup data from the mirror warehouse Obtain an image file that satisfies the target node corresponding to the application resource to be restored, and then restore the application resource based on the image file and backup data.
  • a restoration device and a mirror warehouse which are used to receive resource restoration requests, obtain the backup data corresponding to the application resources to be restored from the object storage pool according to the resource restoration requests, and obtain the backup data from the mirror warehouse Obtain an image file that satisfies the target node corresponding to the application resource to be restored, and then restore the application resource based on the image file and backup data.
  • Fig. 4 is a block diagram of an application resource backup device provided by an embodiment of the present application, and the device can be implemented as part or all of an electronic device through software, hardware or a combination of the two. As shown in Figure 4, the device includes:
  • the receiving module 41 is configured to receive a resource backup request, wherein the resource backup request includes a first resource identifier corresponding to the first application resource to be backed up.
  • the response module 42 is configured to, in response to the resource backup request, create target storage information corresponding to the first application resource in the object storage pool, and the object storage pool is used to store backup data of the application resource.
  • the query module 43 is configured to query the first resource data corresponding to the first application resource from the database by using the first resource identifier.
  • the backup module 44 is configured to back up the first resource data to the object storage pool according to the target storage information, so as to complete the backup of the first application resource.
  • the device for backing up application resources further includes: a storage module, configured to determine the resource identifier corresponding to the currently deployed application resource in the target cluster, and obtain the authentication information corresponding to the application resource; establish the resource identifier and authentication information The corresponding relationship between them, and store the corresponding relationship in the database.
  • a storage module configured to determine the resource identifier corresponding to the currently deployed application resource in the target cluster, and obtain the authentication information corresponding to the application resource; establish the resource identifier and authentication information The corresponding relationship between them, and store the corresponding relationship in the database.
  • the response module 42 is configured to obtain the correspondence between the resource identifier and the authentication information from the database, and obtain the target authentication information corresponding to the first application resource based on the correspondence;
  • the target interface generates encrypted configuration information corresponding to the first application resource; creates a storage location and a storage path corresponding to the first application resource based on the encrypted configuration information, and uses the storage location and the storage path as target storage information.
  • the device for backing up application resources further includes: a storage module, configured to verify the target authentication information; and determine the target authentication information when the target authentication information matches the preset authentication information The verification is passed; if the verification of the target authentication information is passed, the target interface is invoked according to the target authentication information to generate encrypted configuration information corresponding to the first application resource.
  • the backup module 44 is configured to generate the interface annotation of the target interface based on the first resource data, and add the interface annotation and target storage information to the target interface to obtain an updated target interface; call the updated target interface The interface creates the first backup data corresponding to the first application resource in the object storage pool, so as to complete the backup of the first application resource.
  • the device for backing up application resources further includes: a restoration module, configured to receive a resource restoration request, wherein the resource restoration request includes a second resource identifier corresponding to the second application resource to be restored;
  • the second backup data matching the second resource identifier is obtained from the storage pool; and the second application resource is generated in the target cluster based on the second backup data.
  • the restoration module is used to query the target node corresponding to the second backup data from the target cluster; obtain the image file satisfying the corresponding framework of the target node from the mirror warehouse; The target node creates a second application resource.
  • the embodiment of this application also provides an electronic device. As shown in FIG.
  • the communication bus 1504 completes mutual communication.
  • Memory 1503 for storing computer programs
  • the processor 1501 is configured to implement the steps of the above-mentioned embodiments when executing the computer program stored in the memory 1503 .
  • the communication bus mentioned in the above-mentioned terminal may be a Peripheral Component Interconnect (PCI for short) bus or an Extended Industry Standard Architecture (EISA for short) bus or the like.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the communication interface is used for communication between the terminal and other devices.
  • the memory may include a random access memory (Random Access Memory, RAM for short), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
  • non-volatile memory such as at least one disk memory.
  • the memory may also be at least one storage device located far away from the aforementioned processor.
  • the above-mentioned processor can be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc.; it can also be a digital signal processor (Digital Signal Processing, referred to as DSP) , Application Specific Integrated Circuit (ASIC for short), Field Programmable Gate Array (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • a computer-readable storage medium is also provided, and instructions are stored in the computer-readable storage medium, and when it is run on a computer, the computer is made to execute any one of the above-mentioned embodiments.
  • the method for backing up the application resources is also provided.
  • a computer program product including instructions is also provided, which, when run on a computer, causes the computer to execute the application resource backup method described in any one of the above embodiments.
  • a computer program product includes one or more computer instructions.
  • Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g. Coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) to another website site, computer, server or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server, a data center, etc. integrated with one or more available media.
  • Available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application discloses an application resource backup method and apparatus, an electronic device, and a storage medium. The method comprises: receiving a resource backup request, wherein the resource backup request comprises a first resource identifier corresponding to a first application resource to be subjected to a backup operation; in response to the resource backup request, creating target storage information corresponding to the first application resource in an object storage pool; querying first resource data corresponding to the first application resource from a database by using the first resource identifier; and backing up the first resource data to the object storage pool according to the target storage information to complete backup of the first application resource. According to the present application, storage information of application resources to be backed up in the object storage pool is automatically created according to the resource backup request, and resource data of said application resources is backed up to the object storage pool according to the storage information, thereby achieving backup of the resource data. The situation that the resource data of the application resources has not been backed up when it is lost is avoided, thereby improving the security of the application resources.

Description

一种应用资源的备份方法、装置、电子设备及存储介质Application resource backup method, device, electronic equipment and storage medium
相关申请的交叉引用Cross References to Related Applications
本申请要求于2022年03月02日提交中国专利局,申请号为202210195612.5,申请名称为“一种应用资源的备份方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the China Patent Office on March 2, 2022, the application number is 202210195612.5, and the application name is "a backup method, device, electronic equipment and storage medium for application resources", all of which The contents are incorporated by reference in this application.
技术领域technical field
本申请涉及计算机技术领域,尤其涉及一种应用资源的备份方法、装置、电子设备及存储介质。The present application relates to the field of computer technology, in particular to a method, device, electronic device and storage medium for backing up application resources.
背景技术Background technique
在容器技术时代,大量的业务应用场景,通过Kubernetes容器编排技术上云,其中上云的业务场景对应的K8s元数据以及PV用户数据是用户重要的数据资产。现有技术中,经常出现当用户进行不可预知的操作,如在数据库中误删除应用资源或者因应用资源在数据库更新过程中丢失的情况下,使应用资源的资源数据丢失时还未进行备份,导致应用资源资源后续无法进行快速恢复。In the era of container technology, a large number of business application scenarios are migrated to the cloud through the Kubernetes container orchestration technology. The K8s metadata and PV user data corresponding to the cloud-enabled business scenarios are important data assets for users. In the prior art, when the user performs an unpredictable operation, such as deleting an application resource by mistake in the database or the resource data of the application resource is lost due to the loss of the application resource in the database update process, the backup has not been performed. As a result, application resource resources cannot be quickly restored in the future.
发明内容Contents of the invention
为了解决上述技术问题或者至少部分地解决上述技术问题,本申请提供了一种应用资源的备份方法、装置、电子设备及存储介质。In order to solve the above technical problems or at least partly solve the above technical problems, the present application provides a backup method, device, electronic equipment and storage medium for application resources.
根据本申请实施例的一个方面,提供了一种应用资源的备份方法,包括:According to an aspect of an embodiment of the present application, a method for backing up application resources is provided, including:
接收资源备份请求,其中,资源备份请求中包括待执行备份操作的第一应用资源对应的第一资源标识;Receiving a resource backup request, wherein the resource backup request includes a first resource identifier corresponding to the first application resource to be backed up;
响应于资源备份请求,创建第一应用资源在对象存储池中对应的目标存储信息,对象存储池用于存储应用资源的备份数据;In response to the resource backup request, create target storage information corresponding to the first application resource in the object storage pool, and the object storage pool is used to store backup data of the application resource;
利用第一资源标识从数据库中查询第一应用资源对应的第一资源数据;Querying the first resource data corresponding to the first application resource from the database by using the first resource identifier;
将第一资源数据按照目标存储信息备份至对象存储池,以完成第一应用资源的备份。The first resource data is backed up to the object storage pool according to the target storage information, so as to complete the backup of the first application resource.
进一步的,方法还包括:Further, the method also includes:
确定目标集群中当前部署应用资源对应的资源标识,并获取应用资源对应的鉴权信息;Determine the resource identifier corresponding to the currently deployed application resource in the target cluster, and obtain the authentication information corresponding to the application resource;
建立资源标识与鉴权信息之间的对应关系,并将对应关系存储至数据库。The corresponding relationship between the resource identifier and the authentication information is established, and the corresponding relationship is stored in the database.
进一步的,创建第一应用资源在对象存储池中对应的目标存储信息,包括:Further, create target storage information corresponding to the first application resource in the object storage pool, including:
从数据库中获取资源标识与鉴权信息之间的对应关系,基于对应关系获取第一应用资源对应的目标鉴权信息;Acquiring the correspondence between the resource identifier and the authentication information from the database, and obtaining the target authentication information corresponding to the first application resource based on the correspondence;
根据目标鉴权信息调用目标接口生成第一应用资源对应的加密配置信息;calling the target interface according to the target authentication information to generate encrypted configuration information corresponding to the first application resource;
基于加密配置信息创建第一应用资源对应的存储位置,以及存储路径,并将存储位置以及存储路径作为目标存储信息。A storage location and a storage path corresponding to the first application resource are created based on the encrypted configuration information, and the storage location and the storage path are used as target storage information.
进一步的,在根据目标鉴权信息调用目标接口生成第一应用资源对应的加密配置信息之前,方法还包括:Further, before invoking the target interface according to the target authentication information to generate encryption configuration information corresponding to the first application resource, the method further includes:
对目标鉴权信息进行验证;Verify the target authentication information;
在目标鉴权信息与预设鉴权信息相匹配的情况下,确定目标鉴权信息验证通过;If the target authentication information matches the preset authentication information, determine that the target authentication information has been verified;
在目标鉴权信息验证通过的情况下,根据目标鉴权信息调用目标接口生成第一应用资源对应的加密配置信息。If the target authentication information is verified, the target interface is invoked according to the target authentication information to generate encryption configuration information corresponding to the first application resource.
进一步的,将第一资源数据按照目标存储信息备份至对象存储池,包括:Further, backing up the first resource data to the object storage pool according to the target storage information includes:
基于第一资源数据生成目标接口的接口注解,并将接口注解以及目标存储信息添加至目标接口,得到更新后的目标接口;Generate an interface annotation of the target interface based on the first resource data, and add the interface annotation and target storage information to the target interface to obtain an updated target interface;
调用更新后的目标接口在对象存储池中创建第一应用资源对应的第一备份数据,以完成第一应用资源的备份。The updated target interface is called to create the first backup data corresponding to the first application resource in the object storage pool, so as to complete the backup of the first application resource.
进一步的,在将第一资源数据按照目标存储信息备份至对象存储池之后,方法还包括:Further, after backing up the first resource data to the object storage pool according to the target storage information, the method further includes:
接收资源还原请求,其中,资源还原请求中包括待执行还原操作的第二应用资源对应的第二资源标识;Receiving a resource restoration request, wherein the resource restoration request includes a second resource identifier corresponding to a second application resource to be restored;
从对象存储池中获取与第二资源标识相匹配的第二备份数据;Obtain second backup data matching the second resource identifier from the object storage pool;
基于第二备份数据在目标集群中生成第二应用资源。A second application resource is generated in the target cluster based on the second backup data.
进一步的,基于第二备份数据在目标集群中生成第二应用资源,包括:Further, generating a second application resource in the target cluster based on the second backup data includes:
从目标集群中查询第二备份数据对应的目标节点;Querying the target node corresponding to the second backup data from the target cluster;
从镜像仓库中获取满足目标节点的对应框架的镜像文件;Obtain the image file that satisfies the corresponding framework of the target node from the image warehouse;
根据镜像文件以及第二备份数据在目标节点创建第二应用资源。A second application resource is created on the target node according to the image file and the second backup data.
根据本申请实施例的另一个方面,还提供了一种应用资源的备份装置,包括:According to another aspect of the embodiments of the present application, a device for backing up application resources is also provided, including:
接收模块,用于接收资源备份请求,其中,资源备份请求中包括待执行备份操作的第一应用资源对应的第一资源标识;A receiving module, configured to receive a resource backup request, wherein the resource backup request includes a first resource identifier corresponding to the first application resource to be backed up;
响应模块,用于响应于资源备份请求,创建第一应用资源在对象存储池中对应的目标存储信息,对象存储池用于存储应用资源的备份数据;The response module is configured to, in response to the resource backup request, create target storage information corresponding to the first application resource in the object storage pool, and the object storage pool is used to store the backup data of the application resource;
查询模块,用于利用第一资源标识从数据库中查询第一应用资源对应的第一资源数据;A query module, configured to use the first resource identifier to query the first resource data corresponding to the first application resource from the database;
备份模块,用于将第一资源数据按照目标存储信息备份至对象存储池,以完成第一应用资源的备份。The backup module is configured to back up the first resource data to the object storage pool according to the target storage information, so as to complete the backup of the first application resource.
根据本申请实施例的另一方面,还提供了一种存储介质,该存储介质包括存储的程序,程序运行时执行上述的步骤。According to another aspect of the embodiments of the present application, a storage medium is further provided, the storage medium includes a stored program, and the above steps are executed when the program runs.
根据本申请实施例的另一方面,还提供了一种电子装置,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;其中:存储器,用于存放计算机程序;处理器,用于通过运行存储器上所存放的程序来执行上述方法中的步骤。According to another aspect of the embodiment of the present application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein, the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein: The memory is used to store computer programs; the processor is used to execute the steps in the above method by running the programs stored in the memory.
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述方法中的步骤。The embodiment of the present application also provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the steps in the above method.
本申请实施例提供的上述技术方案与现有技术相比具有如下优点:本申请实施例提供的方法根据资源备份请求自动创建待备份应用资源在对象存储池中的存储信息,依据存储信息将待备份应用资源的资源数据备份到对象存储池,从而实现资源数据在对象存储池中的备 份。避免出现在应用资源的资源数据丢失时还未进行备份的情况,提高了对应用资源的保障性。Compared with the prior art, the above-mentioned technical solution provided by the embodiment of the present application has the following advantages: the method provided by the embodiment of the present application automatically creates the storage information of the application resources to be backed up in the object storage pool according to the resource backup request, and the storage information of the application resources to be backed up will be created according to the storage information. The resource data of the backup application resource is backed up to the object storage pool, so as to realize the backup of the resource data in the object storage pool. This avoids the situation that the resource data of the application resource has not been backed up when it is lost, and improves the guarantee of the application resource.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application.
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, In other words, other drawings can also be obtained from these drawings without paying creative labor.
图1为本申请实施例提供的一种应用资源的备份方法的流程图;FIG. 1 is a flow chart of a method for backing up application resources provided by an embodiment of the present application;
图2为本申请另一实施例提供的一种应用资源的备份方法的流程图;FIG. 2 is a flow chart of a method for backing up application resources provided by another embodiment of the present application;
图3为本申请实施例提供的一种服务系统的示意图;FIG. 3 is a schematic diagram of a service system provided by an embodiment of the present application;
图4为本申请实施例提供的一种应用资源的备份装置的框图;FIG. 4 is a block diagram of an application resource backup device provided in an embodiment of the present application;
图5为本申请实施例提供的一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请的一部分实施例,而不是全部的实施例,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of the present application, rather than all the embodiments. The schematic embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation of the present application. Based on the embodiments in the present application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present application.
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个类似的实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relative terms such as "first" and "second" are only used to distinguish one entity or operation from another similar entity or operation, and do not necessarily require or Any such actual relationship or order between such entities or operations is implied. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
本申请实施例提供了一种应用资源的备份方法、装置、电子设备及存储介质。本发明实施例所提供的方法可以应用于任意需要的电子设备,例如,可以为服务器、终端等电子设备,在此不做具体限定,为描述方便,后续简称为电子设备。Embodiments of the present application provide a backup method, device, electronic equipment, and storage medium for application resources. The method provided by the embodiment of the present invention can be applied to any required electronic device, for example, it can be an electronic device such as a server or a terminal, which is not specifically limited here, and is referred to as an electronic device for convenience of description.
根据本申请实施例的一方面,提供了一种应用资源的备份方法的方法实施例。图1为本申请实施例提供的一种应用资源的备份方法的流程图,如图1所示,该方法包括:According to an aspect of the embodiments of the present application, a method embodiment of a method for backing up application resources is provided. Fig. 1 is a flowchart of a method for backing up application resources provided by an embodiment of the present application. As shown in Fig. 1, the method includes:
步骤S11,接收资源备份请求,其中,资源备份请求中包括待执行备份操作的第一应用资源对应的第一资源标识。Step S11, receiving a resource backup request, wherein the resource backup request includes a first resource identifier corresponding to the first application resource to be backed up.
本申请实施例提供的方法应用于目标集群,资源备份请求可以是用户通过客户端向目标集群发起的,具体的,可以检测作用于客户端的选定操作,基于选定操作确定被选定的第一应用资源,并确定第一应用资源对应的第一资源标识,然后根据第一资源标识生成资源备份请求,并将资源备份请求发送至目标集群。The method provided by the embodiment of this application is applied to the target cluster. The resource backup request can be initiated by the user to the target cluster through the client. Specifically, the selected operation acting on the client can be detected, and the selected first operation can be determined based on the selected operation. An application resource, and determine a first resource identifier corresponding to the first application resource, then generate a resource backup request according to the first resource identifier, and send the resource backup request to the target cluster.
在本申请实施例中,资源备份请求还可以是周期性自动发起的,具体的,可以周期性检测目标集群中的应用资源,然后确定目标集群中已部署应用资源对应的第一资源标识集合,以及从对象存储池中获取已执行备份应用资源的第二资源标识集合。通过对比第一资源标识集合和第二资源标识集合,能够从第一资源标识集合中确定出目标集群中当前还未执行备份的第一应用资源,此时获取第一应用资源对应的第一资源标识,并基于第一资源标识生成资源备份请求。In this embodiment of the application, the resource backup request can also be automatically initiated periodically. Specifically, the application resources in the target cluster can be detected periodically, and then the first resource identifier set corresponding to the deployed application resources in the target cluster can be determined. And acquire the second set of resource identifiers of the executed backup application resources from the object storage pool. By comparing the first set of resource identifiers with the second set of resource identifiers, it is possible to determine from the first set of resource identifiers the first application resource in the target cluster that has not yet been backed up, and at this time obtain the first resource corresponding to the first application resource ID, and generate a resource backup request based on the first resource ID.
步骤S12,响应于资源备份请求,创建第一应用资源在对象存储池中对应的目标存储信息,对象存储池用于存储应用资源的备份数据。Step S12, in response to the resource backup request, create target storage information corresponding to the first application resource in the object storage pool, and the object storage pool is used to store backup data of the application resource.
在本申请实施例中,方法还包括以下步骤A1-A2:In the embodiment of this application, the method further includes the following steps A1-A2:
步骤A1,确定目标集群中当前部署应用资源对应的资源标识,并获取应用资源对应的鉴权信息。Step A1, determine the resource identifier corresponding to the currently deployed application resource in the target cluster, and obtain the authentication information corresponding to the application resource.
步骤A2,建立资源标识与鉴权信息之间的对应关系,并将对应关系存储至数据库。Step A2, establish the corresponding relationship between the resource identifier and the authentication information, and store the corresponding relationship in the database.
本申请实施例为了保证后续执行备份操作的安全性,会预先收集目标集群中当前所部署应用资源对应的资源标识,然后资源标识查询对应的鉴权信息,其中鉴权信息可以是开发人员预先上传至数据库的,鉴权信息中包括应用资源对应的访问密钥。然后建立资源标识与鉴权信息之间的对应关系,并将对应关系存储至数据库。In order to ensure the security of subsequent backup operations, this embodiment of the application will pre-collect the resource identifiers corresponding to the currently deployed application resources in the target cluster, and then query the corresponding authentication information for the resource identifiers, where the authentication information can be pre-uploaded by the developer. To the database, the authentication information includes the access key corresponding to the application resource. Then establish the corresponding relationship between the resource identifier and the authentication information, and store the corresponding relationship in the database.
在本申请实施例中,步骤S12,创建第一应用资源在对象存储池中对应的目标存储信息,包括以下步骤B1-B3:In the embodiment of this application, step S12, creating the target storage information corresponding to the first application resource in the object storage pool, includes the following steps B1-B3:
步骤B1,从数据库中获取资源标识与鉴权信息之间的对应关系,基于对应关系获取第一应用资源对应的目标鉴权信息。Step B1, obtaining the corresponding relationship between the resource identifier and the authentication information from the database, and obtaining the target authentication information corresponding to the first application resource based on the corresponding relationship.
在本申请实施例中,在根据目标鉴权信息调用目标接口生成第一应用资源对应的加密配置信息之前,方法还包括:对目标鉴权信息进行验证,在目标鉴权信息与预设鉴权信息相匹配的情况下,确定目标鉴权信息验证通过,在目标鉴权信息验证通过的情况下,根据目标鉴权信息调用目标接口生成第一应用资源对应的加密配置信息。In this embodiment of the application, before invoking the target interface according to the target authentication information to generate the encryption configuration information corresponding to the first application resource, the method further includes: verifying the target authentication information, If the information matches, it is determined that the target authentication information has passed the verification, and if the target authentication information has passed the verification, the target interface is invoked according to the target authentication information to generate encrypted configuration information corresponding to the first application resource.
步骤B2,根据目标鉴权信息调用目标接口生成第一应用资源对应的加密配置信息。Step B2, calling the target interface according to the target authentication information to generate encryption configuration information corresponding to the first application resource.
步骤B3,基于加密配置信息创建第一应用资源对应的存储位置,以及存储路径,并将存储位置以及存储路径作为目标存储信息。Step B3: Create a storage location and a storage path corresponding to the first application resource based on the encryption configuration information, and use the storage location and the storage path as target storage information.
在本申请实施例中,根据对象存储鉴权信息,调用目标接口(即Kubernetes API)创建加密配置信息,加密配置信息中携带对象存储信息,用于标识最终得到的存储位置以及存储路径的唯一性。例如:使用对象存储信息中的信息ID标识唯一性。具体的使用加密配置信息创建具有应用资源唯一性的存储路径以及存储位置。In this embodiment of the application, according to the object storage authentication information, call the target interface (that is, Kubernetes API) to create encrypted configuration information, and the encrypted configuration information carries object storage information, which is used to identify the final storage location and the uniqueness of the storage path . For example: Use the information ID in the object storage information to identify the uniqueness. Specifically, encrypted configuration information is used to create unique storage paths and storage locations for application resources.
步骤S13,利用第一资源标识从数据库中查询第一应用资源对应的第一资源数据。Step S13, using the first resource identifier to query the first resource data corresponding to the first application resource from the database.
在本申请实施例中,数据库还存储有每个应用资源对应的资源数据,因此可以利用第一资源标识从数据库中查询第一应用资源对应的第一资源数据,其中,第一资源数据包括:有状态负载,无状态负载,普通配置,加密配置以及服务数据等等。In this embodiment of the present application, the database also stores resource data corresponding to each application resource, so the first resource data corresponding to the first application resource can be queried from the database by using the first resource identifier, wherein the first resource data includes: Stateful load, stateless load, common configuration, encrypted configuration, service data, etc.
步骤S14,将第一资源数据按照目标存储信息备份至对象存储池,以完成第一应用资源的备份。Step S14, back up the first resource data to the object storage pool according to the target storage information, so as to complete the backup of the first application resource.
在本申请实施例中,步骤S14,将第一资源数据按照目标存储信息备份至对象存储池,包括以下步骤C1-C2:In the embodiment of the present application, step S14, backing up the first resource data to the object storage pool according to the target storage information, includes the following steps C1-C2:
步骤C1,基于第一资源数据生成目标接口的接口注解,并将接口注解以及目标存储信息添加至目标接口,得到更新后的目标接口。Step C1: Generate an interface annotation of the target interface based on the first resource data, and add the interface annotation and target storage information to the target interface to obtain an updated target interface.
在本申请实施例中,在确定第一资源数据后,将第一资源数据按照预设格式生成对象结构,然后将对象结构按照接口注解的方式添加到目标接口,同时还将目标存储信息添加至目标接口,得到更新后的目标接口。需要说明的是,将对象结构按照接口注解的方式添加到目标接口,以使目标接口在被调用时直接创建备份资源。In this embodiment of the application, after the first resource data is determined, the first resource data is generated into an object structure according to a preset format, and then the object structure is added to the target interface in the form of interface annotation, and the target storage information is also added to the Target interface, get the updated target interface. It should be noted that the object structure is added to the target interface in the manner of interface annotation, so that the target interface can directly create backup resources when called.
作为一个示例,将第一资源数据按照预设格式生成的对象结构如下:As an example, the object structure generated by generating the first resource data according to a preset format is as follows:
{{
”namespace”:”test-backup”,"namespace": "test-backup",
”resourcesType”:”deployments.apps”,"resourcesType": "deployments.apps",
”resourcesName”:[”workload-deploy1”,”workload-deploy2”……],"resourcesName": ["workload-deploy1", "workload-deploy2"...],
},{}, {
”namespace”:”test-backup”,"namespace": "test-backup",
”resourcesType”:”statefulsets.apps”,"resourcesType": "statefulsets.apps",
”resourcesName”:[”workload-sts1”,”workload-sts2”……],"resourcesName":["workload-sts1", "workload-sts2"...],
}}
……...
步骤C2,调用更新后的目标接口在对象存储池中创建第一应用资源对应的第一备份数据,以完成第一应用资源的备份。Step C2, calling the updated target interface to create first backup data corresponding to the first application resource in the object storage pool, so as to complete the backup of the first application resource.
在本申请实施例中,调用更新后的目标接口在对象存储池中按照存储路径以及存储位置创建第一应用资源对应的第一备份数据,以完成第一应用资源的备份。In this embodiment of the present application, the updated target interface is called to create the first backup data corresponding to the first application resource in the object storage pool according to the storage path and storage location, so as to complete the backup of the first application resource.
本申请实施例提供的方法根据资源备份请求自动创建待备份应用资源在对象存储池中的存储信息,依据存储信息将待备份应用资源的资源数据备份到对象存储池,从而实现资源数据在对象存储池中的备份。避免出现在应用资源的资源数据丢失时还未进行备份的情况,提高了对应用资源的保障性。The method provided in the embodiment of this application automatically creates the storage information of the application resources to be backed up in the object storage pool according to the resource backup request, and backs up the resource data of the application resources to be backed up to the object storage pool according to the storage information, thereby realizing resource data storage in the object storage pool. Backups in the pool. This avoids the situation that the resource data of the application resource has not been backed up when it is lost, and improves the guarantee of the application resource.
在本申请实施例中,如图3所示,在将第一资源数据按照目标存储信息备份至对象存储池之后,方法还包括以下步骤:In the embodiment of the present application, as shown in FIG. 3, after the first resource data is backed up to the object storage pool according to the target storage information, the method further includes the following steps:
步骤S21,接收资源还原请求,其中,资源还原请求中包括待执行还原操作的第二应用资源对应的第二资源标识。Step S21, receiving a resource restoration request, wherein the resource restoration request includes a second resource identifier corresponding to the second application resource to be restored.
在本申请实施例中,资源还原请求可以是用户通过客户端向目标集群发起,具体的,用户可以通过客户端检测目标集群中是否发生资源丢失的情况,例如:客户端中存储有目标集群中各个应用资源的资源标识,客户端会周期性按照资源标识查询应用资源在目标集群中的生存状态。如果客户端在当前检测周期内未查询到某个资源标识对应应用资源的生存状态时,则确定该资源标识对应的应用资源已在目标集群中丢失。In the embodiment of this application, the resource restoration request can be initiated by the user to the target cluster through the client. Specifically, the user can detect whether resource loss occurs in the target cluster through the client. The resource identifier of each application resource, the client will periodically query the survival status of the application resource in the target cluster according to the resource identifier. If the client does not query the survival state of the application resource corresponding to a resource identifier within the current detection cycle, it determines that the application resource corresponding to the resource identifier has been lost in the target cluster.
在本申请实施例中,当目标集群中存在资源丢失的情况时,客户端会确定目标集群中丢失的第二应用资源,并确定丢失的第二应用资源对应的第二资源标识,后续依据第二资源标识从对象存储池中获取第二应用资源的备份数据。In this embodiment of the application, when there is resource loss in the target cluster, the client will determine the second application resource lost in the target cluster, and determine the second resource identifier corresponding to the lost second application resource. The second resource identifier acquires the backup data of the second application resource from the object storage pool.
步骤S22,从对象存储池中获取与第二资源标识相匹配的第二备份数据。Step S22, acquiring second backup data matching the second resource identifier from the object storage pool.
在本申请实施例中,由于对象存储池中存储有目标集群中各个应用资源对应的备份数据,因此可以依据第二资源标识从对象存储池中获取第二资源标识相匹配的第二备份数据。In the embodiment of the present application, since the backup data corresponding to each application resource in the target cluster is stored in the object storage pool, the second backup data matching the second resource ID can be obtained from the object storage pool according to the second resource ID.
作为一个示例,对象存储池中存储有多个资源标识,以及资源标识对应的备份数据,资源标识a—备份数据A,资源标识b—备份数据B,资源标识c—备份数据C。因此在确定丢失应用资源的资源标识后,可以依据资源标识从对象存储池中获取资源标识对应的备份数据,后续可以依据备份数据在目标集群中对丢失的应用资源进行还原。As an example, multiple resource identifiers and backup data corresponding to the resource identifiers are stored in the object storage pool, resource identifier a—backup data A, resource identifier b—backup data B, resource identifier c—backup data C. Therefore, after determining the resource ID of the lost application resource, the backup data corresponding to the resource ID can be obtained from the object storage pool according to the resource ID, and the lost application resource can be restored in the target cluster based on the backup data.
步骤S23,基于第二备份数据在目标集群中生成第二应用资源。Step S23, generating a second application resource in the target cluster based on the second backup data.
在本申请实施例中,步骤S23,基于第二备份数据在目标集群中生成第二应用资源,包括以下步骤D1-D3:In the embodiment of the present application, step S23, generating the second application resource in the target cluster based on the second backup data, includes the following steps D1-D3:
步骤D1,从目标集群中查询第二备份数据对应的目标节点。Step D1, query the target node corresponding to the second backup data from the target cluster.
在本申请实施例中,由于目标集群中部署有多个节点,例如:X86节点,ARM节点等等。在还原丢失应用资源之前,需要确定将丢失应用资源对应的备份数据还原到哪一个节点(即目标节点),此时可以利用应用资源与节点之间的对应关系,查询丢失应用资源(即第二应用资源)所部署的目标节点。In the embodiment of the present application, since multiple nodes are deployed in the target cluster, for example: X86 nodes, ARM nodes and so on. Before restoring the lost application resources, it is necessary to determine which node (i.e. the target node) to restore the backup data corresponding to the lost application resources. Application resource) is deployed on the target node.
步骤D2,从镜像仓库中获取满足目标节点的对应框架的镜像文件。Step D2, obtain the image file satisfying the corresponding framework of the target node from the image repository.
在本申请实施例中,在确定执行还原操作的目标节点后,需要查询目标节点对应的框架,然后从镜像仓库中获取与该框架相匹配的镜像文件,镜像仓库中存储有目标集群中各个节点的框架,以及与其框架对应的镜像文件。In the embodiment of the present application, after determining the target node to perform the restoration operation, it is necessary to query the framework corresponding to the target node, and then obtain the mirror file matching the framework from the mirror warehouse, which stores each node in the target cluster framework, and the image file corresponding to the framework.
步骤D3,根据镜像文件以及第二备份数据在目标节点创建第二应用资源。Step D3, creating a second application resource on the target node according to the image file and the second backup data.
在本申请实施例中,依据从镜像仓库中拉取的镜像文件以及第二备份数据,在目标集群中的目标节点创建第二应用资源,从而完成丢失应用资源的还原操作。需要说明的是,镜像文件是和rar ZIP压缩包类似,它将特定的一系列文件按照一定的格式制作成单一的文件,以方便用户下载和使用。In the embodiment of the present application, according to the image file pulled from the image warehouse and the second backup data, the target node in the target cluster creates the second application resource, thereby completing the restoration operation of the lost application resource. It should be noted that the image file is similar to the rar ZIP archive, which makes a specific series of files into a single file in a certain format, so that users can download and use it conveniently.
在本申请实施例中,在发生不可预知的人为操作造成资源丢失的情况下,把备份的资源资源从对象存储池中拉取,并在目标集群中进行还原。从而提高基于多架构国产服务器部署Kubernetes计算集群内的应用资源高保障的特性。In the embodiment of the present application, in the event of resource loss due to unpredictable human operations, the backup resources are pulled from the object storage pool and restored in the target cluster. In this way, the characteristics of high guarantee of application resources in the deployment of Kubernetes computing clusters based on multi-architecture domestic servers are improved.
作为一个示例,如图3所示,服务系统包括:存储装置,备份装置。其中,存储装置包括:数据库和对象存储池。备份装置接收资源备份请求后,备份装置,用于从存储装置中的数据库中获取待备份应用资源的资源数据,并在存储装置中的对象存储池中创建存储信息。然后依据存储信息执行备份操作,即将待备份应用资源的资源数据备份到对象存储池。As an example, as shown in FIG. 3 , the service system includes: a storage device and a backup device. Wherein, the storage device includes: a database and an object storage pool. After the backup device receives the resource backup request, the backup device is configured to acquire the resource data of the application resources to be backed up from the database in the storage device, and create storage information in the object storage pool in the storage device. Then perform a backup operation according to the storage information, that is, back up the resource data of the application resource to be backed up to the object storage pool.
如图3所示,目标集群中还包括:还原装置和镜像仓库,用于接收资源还原请求,并依据资源还原请求从对象存储池中获取待还原应用资源对应的备份数据,并从镜像仓库中获取满足待还原应用资源对应目标节点的镜像文件,然后依据该镜像文件以及备份数据还原应用资源。As shown in Figure 3, the target cluster also includes: a restoration device and a mirror warehouse, which are used to receive resource restoration requests, obtain the backup data corresponding to the application resources to be restored from the object storage pool according to the resource restoration requests, and obtain the backup data from the mirror warehouse Obtain an image file that satisfies the target node corresponding to the application resource to be restored, and then restore the application resource based on the image file and backup data.
图4为本申请实施例提供的一种应用资源的备份装置的框图,该装置可以通过软件、硬件或者两者的结合实现成为电子设备的部分或者全部。如图4所示,该装置包括:Fig. 4 is a block diagram of an application resource backup device provided by an embodiment of the present application, and the device can be implemented as part or all of an electronic device through software, hardware or a combination of the two. As shown in Figure 4, the device includes:
接收模块41,用于接收资源备份请求,其中,资源备份请求中包括待执行备份操作的第一应用资源对应的第一资源标识。The receiving module 41 is configured to receive a resource backup request, wherein the resource backup request includes a first resource identifier corresponding to the first application resource to be backed up.
响应模块42,用于响应于资源备份请求,创建第一应用资源在对象存储池中对应的目标存储信息,对象存储池用于存储应用资源的备份数据。The response module 42 is configured to, in response to the resource backup request, create target storage information corresponding to the first application resource in the object storage pool, and the object storage pool is used to store backup data of the application resource.
查询模块43,用于利用第一资源标识从数据库中查询第一应用资源对应的第一资源数据。The query module 43 is configured to query the first resource data corresponding to the first application resource from the database by using the first resource identifier.
备份模块44,用于将第一资源数据按照目标存储信息备份至对象存储池,以完成第一应用资源的备份。The backup module 44 is configured to back up the first resource data to the object storage pool according to the target storage information, so as to complete the backup of the first application resource.
在本申请实施例中,应用资源的备份装置还包括:存储模块,用于确定目标集群中当前部署应用资源对应的资源标识,并获取应用资源对应的鉴权信息;建立资源标识与鉴权信息之间的对应关系,并将对应关系存储至数据库。In the embodiment of the present application, the device for backing up application resources further includes: a storage module, configured to determine the resource identifier corresponding to the currently deployed application resource in the target cluster, and obtain the authentication information corresponding to the application resource; establish the resource identifier and authentication information The corresponding relationship between them, and store the corresponding relationship in the database.
在本申请实施例中,响应模块42,用于从数据库中获取资源标识与鉴权信息之间的对应关系,基于对应关系获取第一应用资源对应的目标鉴权信息;根据目标鉴权信息调用目标接口生成第一应用资源对应的加密配置信息;基于加密配置信息创建第一应用资源对应的存储位置,以及存储路径,并将存储位置以及存储路径作为目标存储信息。In the embodiment of the present application, the response module 42 is configured to obtain the correspondence between the resource identifier and the authentication information from the database, and obtain the target authentication information corresponding to the first application resource based on the correspondence; The target interface generates encrypted configuration information corresponding to the first application resource; creates a storage location and a storage path corresponding to the first application resource based on the encrypted configuration information, and uses the storage location and the storage path as target storage information.
在本申请实施例中,应用资源的备份装置还包括:存储模块,用于对目标鉴权信息进行验证;在目标鉴权信息与预设鉴权信息相匹配的情况下,确定目标鉴权信息验证通过;在目标鉴权信息验证通过的情况下,根据目标鉴权信息调用目标接口生成第一应用资源对应的加密配置信息。In the embodiment of the present application, the device for backing up application resources further includes: a storage module, configured to verify the target authentication information; and determine the target authentication information when the target authentication information matches the preset authentication information The verification is passed; if the verification of the target authentication information is passed, the target interface is invoked according to the target authentication information to generate encrypted configuration information corresponding to the first application resource.
在本申请实施例中,备份模块44,用于基于第一资源数据生成目标接口的接口注解,并将接口注解以及目标存储信息添加至目标接口,得到更新后的目标接口;调用更新后的目标接口在对象存储池中创建第一应用资源对应的第一备份数据,以完成第一应用资源的备份。In the embodiment of the present application, the backup module 44 is configured to generate the interface annotation of the target interface based on the first resource data, and add the interface annotation and target storage information to the target interface to obtain an updated target interface; call the updated target interface The interface creates the first backup data corresponding to the first application resource in the object storage pool, so as to complete the backup of the first application resource.
在本申请实施例中,应用资源的备份装置还包括:还原模块,用于接收资源还原请求,其中,资源还原请求中包括待执行还原操作的第二应用资源对应的第二资源标识;从对象存储池中获取与第二资源标识相匹配的第二备份数据;基于第二备份数据在目标集群中生成第二应用资源。In this embodiment of the present application, the device for backing up application resources further includes: a restoration module, configured to receive a resource restoration request, wherein the resource restoration request includes a second resource identifier corresponding to the second application resource to be restored; The second backup data matching the second resource identifier is obtained from the storage pool; and the second application resource is generated in the target cluster based on the second backup data.
在本申请实施例中,还原模块,用于从目标集群中查询第二备份数据对应的目标节点;从镜像仓库中获取满足目标节点的对应框架的镜像文件;根据镜像文件以及第二备份数据在目标节点创建第二应用资源。In the embodiment of the present application, the restoration module is used to query the target node corresponding to the second backup data from the target cluster; obtain the image file satisfying the corresponding framework of the target node from the mirror warehouse; The target node creates a second application resource.
本申请实施例还提供一种电子设备,如图5所示,电子设备可以包括:处理器1501、通信接口1502、存储器1503和通信总线1504,其中,处理器1501,通信接口1502,存储器1503通过通信总线1504完成相互间的通信。The embodiment of this application also provides an electronic device. As shown in FIG. The communication bus 1504 completes mutual communication.
存储器1503,用于存放计算机程序; Memory 1503, for storing computer programs;
处理器1501,用于执行存储器1503上所存放的计算机程序时,实现上述实施例的步骤。The processor 1501 is configured to implement the steps of the above-mentioned embodiments when executing the computer program stored in the memory 1503 .
上述终端提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,简称PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,简称EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus mentioned in the above-mentioned terminal may be a Peripheral Component Interconnect (PCI for short) bus or an Extended Industry Standard Architecture (EISA for short) bus or the like. The communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
通信接口用于上述终端与其他设备之间的通信。The communication interface is used for communication between the terminal and other devices.
存储器可以包括随机存取存储器(Random Access Memory,简称RAM),也可以包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include a random access memory (Random Access Memory, RAM for short), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far away from the aforementioned processor.
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(Digital Signal Processing,简称DSP)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor can be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc.; it can also be a digital signal processor (Digital Signal Processing, referred to as DSP) , Application Specific Integrated Circuit (ASIC for short), Field Programmable Gate Array (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
在本申请提供的又一实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述实施例中任一所述的应用资源的备份方法。In yet another embodiment provided by the present application, a computer-readable storage medium is also provided, and instructions are stored in the computer-readable storage medium, and when it is run on a computer, the computer is made to execute any one of the above-mentioned embodiments. The method for backing up the application resources.
在本申请提供的又一实施例中,还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述实施例中任一所述的应用资源的备份方法。In yet another embodiment provided by the present application, a computer program product including instructions is also provided, which, when run on a computer, causes the computer to execute the application resource backup method described in any one of the above embodiments.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. A computer can be a general purpose computer, special purpose computer, computer network, or other programmable device. Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g. Coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server, a data center, etc. integrated with one or more available media. Available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk).
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application are included within the protection scope of this application.
以上所述仅是本申请的具体实施方式,使本领域技术人员能够理解或实现本申请。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所申请的原理和新颖特点相一致的最宽的范围。The above descriptions are only specific implementation manners of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the application. Therefore, the present application will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims (20)

  1. 一种应用资源的备份方法,其特征在于,包括:A method for backing up application resources, characterized by comprising:
    接收资源备份请求,其中,所述资源备份请求中包括待执行备份操作的第一应用资源对应的第一资源标识;Receiving a resource backup request, wherein the resource backup request includes a first resource identifier corresponding to the first application resource to be backed up;
    响应于所述资源备份请求,创建所述第一应用资源在对象存储池中对应的目标存储信息,所述对象存储池用于存储应用资源的备份数据;In response to the resource backup request, create target storage information corresponding to the first application resource in an object storage pool, where the object storage pool is used to store backup data of application resources;
    利用所述第一资源标识从数据库中查询所述第一应用资源对应的第一资源数据;Querying the first resource data corresponding to the first application resource from a database by using the first resource identifier;
    将所述第一资源数据按照所述目标存储信息备份至对象存储池,以完成所述第一应用资源的备份。The first resource data is backed up to an object storage pool according to the target storage information, so as to complete the backup of the first application resource.
  2. 根据权利要求1所述的方法,其特征在于,在所述接收资源备份请求之前,所述方法还包括:The method according to claim 1, wherein before receiving the resource backup request, the method further comprises:
    检测作用于客户端的选定操作,并基于所述选定操作确定被选定的第一应用资源;detecting a selected operation acting on the client, and determining a selected first application resource based on the selected operation;
    确定所述第一应用资源对应的第一资源标识,并根据所述第一资源标识生成资源备份请求。Determine a first resource identifier corresponding to the first application resource, and generate a resource backup request according to the first resource identifier.
  3. 根据权利要求1所述的方法,其特征在于,在所述接收资源备份请求之前,所述方法还包括:The method according to claim 1, wherein before receiving the resource backup request, the method further comprises:
    周期性检测目标集群中的应用资源,并确定所述目标集群中已部署应用资源对应的第一资源标识集合;Periodically detect the application resources in the target cluster, and determine the first set of resource identifiers corresponding to the deployed application resources in the target cluster;
    从对象存储池中获取已执行备份应用资源的第二资源标识集合;Obtain a second set of resource identifiers of executed backup application resources from the object storage pool;
    通过对比所述第一资源标识集合和所述第二资源标识集合,从所述第一资源标识集合中确定所述目标集群中当前还未执行备份的第一应用资源;By comparing the first set of resource identifiers with the second set of resource identifiers, determine from the first set of resource identifiers the first application resources in the target cluster that have not yet been backed up;
    获取所述第一应用资源对应的第一资源标识,并基于所述第一资源标识生成资源备份请求。Acquire a first resource identifier corresponding to the first application resource, and generate a resource backup request based on the first resource identifier.
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, further comprising:
    确定目标集群中当前部署应用资源对应的资源标识,并获取所述应用资源对应的鉴权信息;Determine the resource identifier corresponding to the currently deployed application resource in the target cluster, and obtain the authentication information corresponding to the application resource;
    建立所述资源标识与所述鉴权信息之间的对应关系,并将所述对应关系存储至所述数据库。Establish a corresponding relationship between the resource identifier and the authentication information, and store the corresponding relationship in the database.
  5. 根据权利要求4所述的方法,其特征在于,所述鉴权信息中包括应用资源对应的访问密钥。The method according to claim 4, wherein the authentication information includes an access key corresponding to the application resource.
  6. 根据权利要求1所述的方法,其特征在于,所述创建所述第一应用资源在对象存储池中对应的目标存储信息,包括:The method according to claim 1, wherein the creating the target storage information corresponding to the first application resource in the object storage pool comprises:
    从所述数据库中获取资源标识与鉴权信息之间的对应关系,基于所述对应关系获取所述第一应用资源对应的目标鉴权信息;Obtain a correspondence between resource identifiers and authentication information from the database, and obtain target authentication information corresponding to the first application resource based on the correspondence;
    根据所述目标鉴权信息调用目标接口生成所述第一应用资源对应的加密配置信息;calling a target interface according to the target authentication information to generate encryption configuration information corresponding to the first application resource;
    基于所述加密配置信息创建所述第一应用资源对应的存储位置,以及存储路径,并将所述存储位置以及所述存储路径作为所述目标存储信息。Create a storage location and a storage path corresponding to the first application resource based on the encryption configuration information, and use the storage location and the storage path as the target storage information.
  7. 根据权利要求6所述的方法,其特征在于,所述加密配置信息中包括对象存储信息,所述对象存储信息用于标识所述第一应用资源对应的存储位置以及存储路径的唯一 性。The method according to claim 6, wherein the encrypted configuration information includes object storage information, and the object storage information is used to identify the storage location corresponding to the first application resource and the uniqueness of the storage path.
  8. 根据权利要求1所述的方法,其特征在于,在所述根据所述目标鉴权信息调用目标接口生成所述第一应用资源对应的加密配置信息之前,所述方法还包括:The method according to claim 1, wherein before calling the target interface according to the target authentication information to generate the encryption configuration information corresponding to the first application resource, the method further comprises:
    对所述目标鉴权信息进行验证;Verifying the target authentication information;
    在所述目标鉴权信息与预设鉴权信息相匹配的情况下,确定所述目标鉴权信息验证通过;If the target authentication information matches the preset authentication information, determine that the target authentication information has been verified;
    在所述目标鉴权信息验证通过的情况下,根据所述目标鉴权信息调用目标接口生成所述第一应用资源对应的加密配置信息。In a case that the target authentication information passes the verification, the target interface is invoked according to the target authentication information to generate encryption configuration information corresponding to the first application resource.
  9. 根据权利要求6所述的方法,其特征在于,所述将所述第一资源数据按照所述目标存储信息备份至对象存储池,包括:The method according to claim 6, wherein the backing up the first resource data to the object storage pool according to the target storage information comprises:
    基于所述第一资源数据生成所述目标接口的接口注解,并将所述接口注解以及所述目标存储信息添加至所述目标接口,得到更新后的所述目标接口;generating an interface annotation of the target interface based on the first resource data, and adding the interface annotation and the target storage information to the target interface to obtain an updated target interface;
    调用更新后的所述目标接口在所述对象存储池中创建所述第一应用资源对应的第一备份数据,以完成所述第一应用资源的备份。Invoking the updated target interface to create first backup data corresponding to the first application resource in the object storage pool, so as to complete the backup of the first application resource.
  10. 根据权利要求9所述的方法,其特征在于,所述基于所述第一资源数据生成所述目标接口的接口注解,并将所述接口注解以及所述目标存储信息添加至所述目标接口,得到更新后的所述目标接口,包括:The method according to claim 9, wherein the interface annotation of the target interface is generated based on the first resource data, and the interface annotation and the target storage information are added to the target interface, Get the updated target interface, including:
    将所述第一资源数据按照预设格式生成对象结构;generating an object structure from the first resource data according to a preset format;
    将所述对象结构按照接口注解的方式添加到所述目标接口,并将所述目标存储信息添加至所述目标接口,得到更新后的所述目标接口。The object structure is added to the target interface in the form of interface annotation, and the target storage information is added to the target interface to obtain the updated target interface.
  11. 根据权利要求1所述的方法,其特征在于,在所述将所述第一资源数据按照所述目标存储信息备份至对象存储池之后,所述方法还包括:The method according to claim 1, wherein after backing up the first resource data to the object storage pool according to the target storage information, the method further comprises:
    接收资源还原请求,其中,所述资源还原请求中包括待执行还原操作的第二应用资源对应的第二资源标识;Receiving a resource restoration request, wherein the resource restoration request includes a second resource identifier corresponding to a second application resource to be restored;
    从所述对象存储池中获取与所述第二资源标识相匹配的第二备份数据;Obtain second backup data matching the second resource identifier from the object storage pool;
    基于所述第二备份数据在目标集群中生成所述第二应用资源。The second application resource is generated in the target cluster based on the second backup data.
  12. 根据权利要求11所述的方法,其特征在于,在所述接收资源还原请求之前,所述方法还包括:The method according to claim 11, wherein before receiving the resource restoration request, the method further comprises:
    周期性按照资源标识查询应用资源在所述目标集群中的生存状态;Periodically query the survival status of the application resource in the target cluster according to the resource identifier;
    如果在当前检测周期内未查询到某个资源标识对应应用资源的生存状态时,则确定所述资源标识对应的应用资源已在所述目标集群中丢失;If the survival state of the application resource corresponding to a certain resource identifier is not found in the current detection period, it is determined that the application resource corresponding to the resource identifier has been lost in the target cluster;
    当所述目标集群中存在资源丢失的情况时,则确定所述目标集群中丢失的第二应用资源,并确定所述第二应用资源对应的第二资源标识;When there is resource loss in the target cluster, determine a second application resource lost in the target cluster, and determine a second resource identifier corresponding to the second application resource;
    依据所述第二资源标识,生成资源还原请求。A resource restoration request is generated according to the second resource identifier.
  13. 根据权利要求11所述的方法,其特征在于,所述基于所述第二备份数据在目标集群中生成所述第二应用资源,包括:The method according to claim 11, wherein the generating the second application resource in the target cluster based on the second backup data comprises:
    从所述目标集群中查询所述第二备份数据对应的目标节点;Querying the target node corresponding to the second backup data from the target cluster;
    从镜像仓库中获取满足所述目标节点的对应框架的镜像文件;Obtain an image file satisfying the corresponding framework of the target node from the image repository;
    根据所述镜像文件以及所述第二备份数据在所述目标节点创建所述第二应用资源。The second application resource is created on the target node according to the image file and the second backup data.
  14. 根据权利要求13所述的方法,其特征在于,所述从所述目标集群中查询所述第 二备份数据对应的目标节点,包括:The method according to claim 13, wherein the querying the target node corresponding to the second backup data from the target cluster comprises:
    利用应用资源与节点之间的对应关系,从所述目标集群中查询所述第二备份数据对应的目标节点。The target node corresponding to the second backup data is queried from the target cluster by using the corresponding relationship between the application resource and the node.
  15. 根据权利要求13所述的方法,其特征在于,所述镜像仓库中存储有所述目标集群中各个节点对应的框架,以及与所述框架对应的镜像文件。The method according to claim 13, wherein the mirror repository stores a framework corresponding to each node in the target cluster, and a mirror file corresponding to the framework.
  16. 根据权利要求1至15任一所述的方法,其特征在于,所述第一资源数据包括如下的一项或多项:The method according to any one of claims 1 to 15, wherein the first resource data includes one or more of the following:
    有状态负载、无状态负载、普通配置、加密配置、服务数据。Stateful payload, stateless payload, common configuration, encrypted configuration, service data.
  17. 一种应用资源的备份装置,其特征在于,包括:A device for backing up application resources is characterized by comprising:
    接收模块,用于接收资源备份请求,其中,所述资源备份请求中包括待执行备份操作的第一应用资源对应的第一资源标识;A receiving module, configured to receive a resource backup request, wherein the resource backup request includes a first resource identifier corresponding to the first application resource to be backed up;
    响应模块,用于响应于所述资源备份请求,创建所述第一应用资源在对象存储池中对应的目标存储信息,所述对象存储池用于存储应用资源的备份数据;A response module, configured to, in response to the resource backup request, create target storage information corresponding to the first application resource in an object storage pool, where the object storage pool is used to store backup data of application resources;
    查询模块,用于利用所述第一资源标识从数据库中查询所述第一应用资源对应的第一资源数据;A query module, configured to use the first resource identifier to query the first resource data corresponding to the first application resource from a database;
    备份模块,用于将所述第一资源数据按照所述目标存储信息备份至对象存储池,以完成所述第一应用资源的备份。A backup module, configured to back up the first resource data to an object storage pool according to the target storage information, so as to complete the backup of the first application resource.
  18. 根据权利要求17所述的装置,其特征在于,所述装置还包括:The device according to claim 17, further comprising:
    存储模块,用于确定目标集群中当前部署应用资源对应的资源标识,并获取所述应用资源对应的鉴权信息;建立所述资源标识与所述鉴权信息之间的对应关系,并将所述对应关系存储至所述数据库。A storage module, configured to determine a resource identifier corresponding to the currently deployed application resource in the target cluster, and obtain authentication information corresponding to the application resource; establish a correspondence between the resource identifier and the authentication information, and store the The corresponding relationship is stored in the database.
  19. 一种存储介质,其特征在于,所述存储介质包括存储的程序,其中,所述程序运行时执行上述权利要求1至16中任一项所述的方法步骤。A storage medium, characterized in that the storage medium includes a stored program, wherein the method steps described in any one of claims 1 to 16 are executed when the program is running.
  20. 一种电子设备,其特征在于,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;其中:An electronic device is characterized in that it includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete mutual communication through the communication bus; wherein:
    存储器,用于存放计算机程序;memory for storing computer programs;
    处理器,用于通过运行存储器上所存放的程序来执行权利要求1-16中任一项所述的方法步骤。A processor configured to execute the method steps of any one of claims 1-16 by running a program stored in the memory.
PCT/CN2022/140467 2022-03-02 2022-12-20 Application resource backup method and apparatus, electronic device, and storage medium WO2023165226A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210195612.5A CN114328029B (en) 2022-03-02 2022-03-02 Backup method and device of application resources, electronic equipment and storage medium
CN202210195612.5 2022-03-02

Publications (1)

Publication Number Publication Date
WO2023165226A1 true WO2023165226A1 (en) 2023-09-07

Family

ID=81030265

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/140467 WO2023165226A1 (en) 2022-03-02 2022-12-20 Application resource backup method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN114328029B (en)
WO (1) WO2023165226A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114328029B (en) * 2022-03-02 2022-06-03 苏州浪潮智能科技有限公司 Backup method and device of application resources, electronic equipment and storage medium
CN117312044A (en) * 2022-06-28 2023-12-29 华为技术有限公司 Backup method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541694A (en) * 2012-01-18 2012-07-04 浪潮(北京)电子信息产业有限公司 Method and device for database backup
CN112181720A (en) * 2020-09-11 2021-01-05 济南浪潮数据技术有限公司 Virtual data center backup method and device based on cloud management platform
CN113687911A (en) * 2021-07-30 2021-11-23 广东浪潮智慧计算技术有限公司 Metadata management method, system, electronic equipment and storage medium
CN113722155A (en) * 2021-11-01 2021-11-30 苏州浪潮智能科技有限公司 Data backup and repair method in distributed file system and related components
CN113722157A (en) * 2021-11-03 2021-11-30 苏州浪潮智能科技有限公司 Virtual machine data management method, device, equipment and medium
CN114090344A (en) * 2022-01-19 2022-02-25 苏州浪潮智能科技有限公司 Method, device, equipment and medium for deleting backup resources of container cluster
CN114328029A (en) * 2022-03-02 2022-04-12 苏州浪潮智能科技有限公司 Backup method and device of application resources, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8819471B2 (en) * 2011-06-03 2014-08-26 Apple Inc. Methods and apparatus for power state based backup
CN108279996A (en) * 2018-01-17 2018-07-13 链家网(北京)科技有限公司 A kind of high in the clouds data backup processing method and device
CN109284205B (en) * 2018-09-21 2023-04-07 平安科技(深圳)有限公司 Snapshot backup method and device, computer equipment and storage medium
CN111597078A (en) * 2020-05-15 2020-08-28 山东汇贸电子口岸有限公司 Timed backup method and system for copying ceph block storage data to object storage
CN112380067B (en) * 2020-11-30 2023-08-22 四川大学华西医院 Metadata-based big data backup system and method in Hadoop environment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541694A (en) * 2012-01-18 2012-07-04 浪潮(北京)电子信息产业有限公司 Method and device for database backup
CN112181720A (en) * 2020-09-11 2021-01-05 济南浪潮数据技术有限公司 Virtual data center backup method and device based on cloud management platform
CN113687911A (en) * 2021-07-30 2021-11-23 广东浪潮智慧计算技术有限公司 Metadata management method, system, electronic equipment and storage medium
CN113722155A (en) * 2021-11-01 2021-11-30 苏州浪潮智能科技有限公司 Data backup and repair method in distributed file system and related components
CN113722157A (en) * 2021-11-03 2021-11-30 苏州浪潮智能科技有限公司 Virtual machine data management method, device, equipment and medium
CN114090344A (en) * 2022-01-19 2022-02-25 苏州浪潮智能科技有限公司 Method, device, equipment and medium for deleting backup resources of container cluster
CN114328029A (en) * 2022-03-02 2022-04-12 苏州浪潮智能科技有限公司 Backup method and device of application resources, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114328029A (en) 2022-04-12
CN114328029B (en) 2022-06-03

Similar Documents

Publication Publication Date Title
CN107408064B (en) Method for executing commands in virtual machine instances and system for implementing the method
WO2023165226A1 (en) Application resource backup method and apparatus, electronic device, and storage medium
US11405183B2 (en) Using cache objects to store events for adding corresponding objects in a blockchain
US9910895B2 (en) Push subscriptions
US10762109B2 (en) Asynchronous deletion in non-relational databases
US11953997B2 (en) Systems and methods for cross-regional back up of distributed databases on a cloud service
US8856540B1 (en) Customized ID generation
US8660996B2 (en) Monitoring files in cloud-based networks
WO2018233630A1 (en) Fault discovery
US11442752B2 (en) Central storage management interface supporting native user interface versions
US20210097476A1 (en) Container Management Method, Apparatus, and Device
US11531712B2 (en) Unified metadata search
US9930063B2 (en) Random identifier generation for offline database
US20180121486A1 (en) System and Method for Configuration Management Database Governance
US10902018B2 (en) Synchronizing in-use source data and an unmodified migrated copy thereof
US20220083426A1 (en) Method and system for hybrid incremental file-based backups
US8600960B2 (en) Processing proposed changes to data
US10104163B1 (en) Secure transfer of virtualized resources between entities
US9665732B2 (en) Secure Download from internet marketplace
US11195179B2 (en) Detecting cashback and other related reimbursement frauds using blockchain technology
WO2023092316A1 (en) Third-party service login method and apparatus, terminal device, and storage medium
CN107085681B (en) Robust computing device identification framework
WO2018121164A1 (en) Method, device, and system for creating service numbers
US20200401561A1 (en) Method, device, and computer program product for managing data object
CN115987683B (en) Node access control method, device, equipment and medium in block chain network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22929652

Country of ref document: EP

Kind code of ref document: A1