Mirror image processing method and apparatus, device, storage medium, and program product

By introducing automated image processing methods into the cloud architecture and utilizing the interaction between the access layer and the control layer of the source and destination clusters, the problem of low image replication efficiency under multi-regional deployment is solved, and efficient and reliable cross-regional mirroring is achieved. copy.

WO2024187775A1PCT designated stage expired Publication Date: 2024-09-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/128695
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-15
Filing Date
2023-10-31
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

In a cloud architecture deployed in multiple regions, existing technologies rely on manual operations, resulting in low efficiency and error-prone image replication, and cannot meet the needs of cross-regional image replication.

Method used

Through the interaction between the access layer and the control layer between the source and destination clusters, the image files to be copied and the image meta-information are automatically copied to implement a cross-regional image processing method and improve the efficiency of image replication.

Benefits of technology

It realizes the automation of cross-regional image replication, improves efficiency, reduces the error rate of manual operations, and meets the needs of image replication under multi-regional deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023128695_19092024_PF_FP_ABST
    Figure CN2023128695_19092024_PF_FP_ABST
Patent Text Reader

Abstract

Provided is a mirror image processing method, which is executed by a source cluster deployed in a source region. A source access layer and a source control layer are deployed in the source cluster, and a source mirror image storage and a source database are deployed in the source cluster. A mirror image file to be copied is stored in the source mirror image storage, and mirror image element information of said mirror image file is stored in the source database. The method comprises: acquiring a mirror image copying request by means of the source access layer, the mirror image copying request comprising mirror image file information to be copied and destination cluster information, the destination cluster information corresponding to a destination cluster, the destination cluster being deployed in a destination region, the destination region being different from the source region, and a destination access layer and a destination control layer being deployed in the destination cluster (S202); by means of the source access layer, on the basis of the mirror image copying request, copying the mirror image element information in the source database to a destination database via the destination access layer according to said mirror image file information and the destination cluster information (S204); acquiring the mirror image copying request by means of the source control layer (S206); and by means of the source control layer, on the basis of the mirror image copying request, copying said mirror image file in the source mirror image storage to a destination mirror image storage via the destination control layer according to said mirror image file information and the destination cluster information (S208).
Need to check novelty before this filing date? Find Prior Art

Description

Image processing method, device, equipment, storage medium and program product

[0001] Related applications

[0002] This application claims priority to Chinese patent application number 2023102508718, filed on March 15, 2023, entitled “Mirror processing method, device, equipment, storage medium and program product”, the entire text of which is hereby incorporated by reference. Technical Field

[0003] The present disclosure relates to the field of cloud technology, and more particularly, to an image processing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Art

[0004] As cloud customers expand their business scale and demand for edge computing grows, single-region cloud server clusters are clearly unable to meet customer needs, leading to the emergence of multi-region deployment architectures. However, in multi-region deployment architectures, virtual machine production relies heavily on images, making cross-region image replication crucial.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art.

[0006] Summary of the Invention

[0007] The present disclosure provides an image processing method, apparatus, device, readable storage medium, and program product.

[0008] In one aspect, an embodiment of the present disclosure provides an image processing method, which is executed by a source cluster deployed in a source region, wherein the source cluster is deployed with a source access layer and a source control layer, and the source cluster is deployed with a source image storage warehouse and a source database, wherein the source image storage warehouse stores image files to be copied, and the source database stores image metadata of the image files to be copied, wherein the method includes:

[0009] Obtaining, through the source access layer, an image copy request, the image copy request including information of an image file to be copied and information of a destination cluster, the destination cluster information corresponding to a destination cluster, the destination cluster being deployed in a destination region that is different from the source region, and the destination cluster being deployed with a destination access layer and a destination control layer;

[0010] By means of the source access layer, based on the image copy request, according to the to-be-copied image file information and the target cluster information, the image metadata in the source database is copied to the target database via the target access layer;

[0011] Obtaining the image copy request through the source control layer;

[0012] The source control layer copies the image file to be copied in the source image storage warehouse to the destination image storage warehouse via the destination control layer based on the image copy request, according to the image file information to be copied and the destination cluster information.

[0013] In another aspect, an embodiment of the present disclosure provides a mirroring method, which is executed by a destination cluster deployed in a destination region, wherein the destination cluster is deployed with a destination access layer and a destination control layer. The method includes:

[0014] Receiving, through the destination access layer, image meta information of the image file to be copied from the source access layer of the source cluster, the source cluster being deployed in a source region, the source region being different from the destination region, the source cluster being deployed with the source access layer and the source control layer, the source cluster being deployed with a source image storage warehouse and a source database, the source image storage warehouse storing the image file to be copied, and the source database storing the image meta information;

[0015] Writing the mirror metadata into a destination database via the destination access layer;

[0016] Receiving the image file to be copied from the source control layer via the destination control layer;

[0017] The image file to be copied is written into the image storage warehouse of the destination end through the destination end control layer.

[0018] In another aspect, an embodiment of the present disclosure provides an image processing device, which is deployed in a source cluster in a source region. The device includes a source access layer and a source control layer. The source cluster is deployed with a source image storage warehouse and a source database. The source image storage warehouse stores image files to be copied, and the source database stores image metadata of the image files to be copied.

[0019] The source access layer is configured to obtain an image replication request, the image replication request including information of an image file to be replicated and information of a destination cluster, the destination cluster information corresponding to a destination cluster, the destination cluster being deployed in a destination region, the destination region being different from the source region, the destination cluster being deployed with a destination access layer and a destination control layer, and based on the image replication request, copying the image metadata in the source database to the destination database via the destination access layer according to the information of the image file to be replicated and the information of the destination cluster;

[0020] The source-side control layer is configured to obtain the image copy request, and based on the image copy request, copy the image file to be copied in the source-side image storage warehouse to the destination-side image storage warehouse via the destination-side control layer according to the image file information to be copied and the destination-side cluster information.

[0021] In another aspect, an embodiment of the present disclosure provides a mirror processing device deployed in a destination cluster in a destination region, the device comprising a destination access layer and a destination control layer;

[0022] The destination access layer is configured to receive image metadata of an image file to be copied from a source access layer of a source cluster, wherein the source cluster is deployed in a source region, the source region being different from the destination region, the source cluster being deployed with the source access layer and the source control layer, the source cluster being deployed with a source image storage warehouse and a source database, the source image storage warehouse storing the image file to be copied, and the source database storing the image metadata; the destination access layer is further configured to write the image metadata into the destination database;

[0023] The destination control layer is used to receive the image file to be copied from the source control layer, and write the image file to be copied into the destination image storage warehouse through the destination control layer.

[0024] On the other hand, an embodiment of the present disclosure provides a device, comprising: a memory, a processor, and computer-readable instructions stored in the memory and executable in the processor, wherein the processor implements any of the above methods when executing the computer-readable instructions.

[0025] On the other hand, an embodiment of the present disclosure provides a computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions implement any of the above methods when executed by a processor.

[0026] In another aspect, embodiments of the present disclosure provide a computer program product comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the methods provided in the various optional implementations described above.

[0027] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.

[0029] FIG1 is a schematic diagram showing a system architecture in an embodiment of the present disclosure.

[0030] FIG2 shows a flow chart of a mirror processing method according to an embodiment of the present disclosure.

[0031] FIG3 is a schematic diagram showing the processing process of S202 and S204 shown in FIG2 in one embodiment.

[0032] FIG4 is a schematic diagram of an access layer implementation process according to FIG2 and FIG3 .

[0033] FIG. 5 is a schematic diagram showing the processing process of S206 shown in FIG. 2 in one embodiment.

[0034] FIG. 6 is a schematic diagram showing the processing process of S510 shown in FIG. 5 in one embodiment.

[0035] FIG. 7 is a schematic diagram showing the processing process of S602 shown in FIG. 6 in one embodiment.

[0036] FIG8 is a schematic diagram showing the processing process of S602 shown in FIG6 in another embodiment.

[0037] FIG. 9 is a schematic diagram showing the processing process of S816 shown in FIG. 8 in another embodiment.

[0038] FIG10 is a schematic diagram showing the processing procedures of S802 shown in FIG8 and S902 shown in FIG9 in another embodiment.

[0039] FIG11 shows a flow chart of another method different from the above-mentioned FIG2 based on FIG10 .

[0040] FIG. 12 is a schematic diagram showing the processing process of S602 shown in FIG. 6 in one embodiment.

[0041] FIG. 13 is a schematic diagram showing the processing process of S502 to S506 shown in FIG. 5 in one embodiment.

[0042] FIG. 14 is a schematic diagram showing the processing process of S1304 shown in FIG. 13 in one embodiment.

[0043] FIG. 15 is a flow chart showing a process of generating a mirror copy task by a source-side control layer interface according to FIG. 13 and FIG. 14 .

[0044] FIG. 16 is a flow chart illustrating a source-side control layer processing an image replication task according to FIG. 2 to FIG. 12 .

[0045] FIG17 shows a schematic diagram of the process of cross-region image replication in a private cloud cloud native cluster scenario based on FIG2 to FIG16.

[0046] FIG18 shows a block diagram of a mirror processing device according to an embodiment of the present disclosure.

[0047] FIG19 shows a block diagram of another mirror processing device according to an embodiment of the present disclosure.

[0048] FIG20 shows a schematic structural diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0050] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these examples are provided so that this disclosure will be more thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures indicate identical or similar parts, and thus repeated descriptions thereof will be omitted.

[0051] In addition, the described features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, devices, steps, etc. may be adopted. In other cases, well-known structures, methods, devices, implementations or operations are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0052] Furthermore, in the description of this disclosure, unless otherwise specified or limited, terms such as "connected" should be interpreted broadly. For example, they can mean electrically connected or capable of mutual communication; they can be directly connected or indirectly connected through an intermediary. "Multiple" means at least two, such as two or three, unless otherwise specified or limited. Those skilled in the art will understand the specific meanings of these terms in this disclosure based on the specific circumstances.

[0053] Some terms involved in the embodiments of the present disclosure are explained below.

[0054] Public Cloud: A public cloud typically refers to a cloud provided by a third-party provider for user use. Public clouds are typically accessible over the internet and may be free or low-cost. The core attribute of a public cloud is shared resource services. There are many instances of this type of cloud, providing services across today's open public networks.

[0055] Private Cloud: A private cloud is a cloud infrastructure with software and hardware resources created within a firewall, allowing departments within an organization or enterprise to share data center resources. In addition to hardware resources, creating a private cloud typically also includes cloud infrastructure (IaaS, Infrastructure as a Service) software.

[0056] Hybrid cloud, a fusion of public and private clouds, has been the primary model and development direction of cloud computing in recent years. Private clouds are primarily targeted at enterprise users. For security reasons, enterprises prefer to store data in private clouds, but at the same time, they desire access to public cloud computing resources. In this context, hybrid cloud is increasingly being adopted. It blends and matches public and private clouds to achieve optimal results. This personalized solution achieves both cost-saving and security goals.

[0057] Cloud Native: A cloud-based software architecture and a set of methodologies for cloud-based software development practices. In a cloud-native architecture, applications reside in the cloud, not in traditional data centers. This means applications are designed from the outset for the cloud environment, natively designed for the cloud, and optimized to run on the cloud, leveraging the elasticity and distribution of the cloud platform. Cloud Native is also an approach to building and running applications that leverages the advantages of the cloud computing software delivery model. These applications are characterized by rapid and frequent build, release, and deployment. By leveraging the characteristics of cloud computing and decoupling from the underlying hardware and operating system, they can easily meet requirements for scalability, availability, portability, and provide better economics.

[0058] In public, private, or hybrid cloud environments, cross-region replication of virtual machine images is crucial for multi-region deployments. Conventional technologies often rely on manual execution for cross-region image replication, resulting in low efficiency. For example, in a private cloud environment, the process of replicating a cloud native cluster image from Region A to Region B typically involves operations personnel obtaining the image package from the source region, manually uploading it to a file storage bucket, and then uploading the image to the destination region.

[0059] In the source region image replication process of the aforementioned related technologies, it can be seen that the entire image material package replication process, from preparing the image material package in the source region to importing the image material package into the destination region, relies heavily on manual operations by operations and maintenance personnel. Errors are prone to occur in the intermediate steps, resulting in unusable copied images. As a result, the entire process is very difficult to use and can only meet the basic requirements of cross-region image replication for private cloud native clusters.

[0060] Therefore, the present disclosure provides a mirror processing method, which may include: based on a mirror copy request including image file information to be copied and destination cluster information, the source access layer copies the image metadata stored in the source database in the source cluster to the destination database in the destination cluster via the destination access layer, and the source control layer copies the image file to be copied in the source image storage warehouse stored in the source cluster to the destination image storage warehouse via the destination control layer, so that the interaction between the various layers of the source cluster and the various layers of the destination cluster can realize automatic cross-regional copying of the image file to be copied and the image metadata, thereby improving the efficiency of cross-regional image copying.

[0061] The image processing method provided in the embodiments of the present disclosure can be applied to public cloud, private cloud, hybrid cloud and other environments, and the present disclosure does not limit it.

[0062] FIG1 shows an exemplary system architecture 10 to which the image processing method and apparatus of the present disclosure may be applied.

[0063] As shown in Figure 1, the system architecture 10 may include a terminal device 102, a network 1042, a network 1044, and servers 1062 and 1064. Servers 1062 and 1064 may be independent physical servers, or they may be server clusters or distributed systems consisting of multiple physical servers. They may also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal device 102 may be a smartphone, a tablet computer, a laptop, a notebook computer, a desktop computer, a wearable device, a vehicle-mounted terminal, a virtual reality device, a smart speaker, a smart watch, a smart home, etc., but is not limited thereto. Networks 1042 and 1044 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc. The terminal device 102 and the server 1062 and 1064 may be directly or indirectly connected via wired or wireless communication, and this application does not limit this.

[0064] Terminal device 102 can be used to send an image copy request to at least one of server 1062 or server 1064 via network 1042, requesting that the image to be copied be copied to a cloud server cluster in a different region than the requested server. For example, taking server 1062 as a source cluster deployed in the source region and server 1064 as a destination cluster deployed in the destination region, server 1062 can be deployed with a source image storage warehouse and a source database. The source image storage warehouse stores the image files to be copied, and the source database stores image metadata for the image files to be copied. Server 1064 can also include a destination image storage warehouse and a destination database.

[0065] After receiving an image copy request including information about the image file to be copied and information about the destination cluster via network 1042, server 1062 may, based on the image copy request and the information about the image file to be copied and the destination cluster, copy the image metadata in the source database to the destination database via network 1044. Server 1062 may also, based on the image copy request and the information about the image file to be copied and the destination cluster, copy the image file to be copied in the source image storage warehouse to the destination image storage warehouse via network 1044.

[0066] It should be understood that the number of terminal devices, networks, and servers in Figure 1 is merely illustrative and any number of terminal devices, networks, and servers may be provided as required.

[0067] Fig. 2 is a flow chart showing a mirror processing method according to an exemplary embodiment. The method shown in Fig. 2 can be applied to the server of the above system or to the terminal device of the above system.

[0068] The method shown in Figure 2 can be executed by a source-end cluster deployed in the source-end region, and is used to copy the image file to be copied and its image metadata from the source-end cluster to the destination-end cluster. The source-end region can be a geographical location that provides cloud services, and the virtual machine image to be copied already exists in the source-end region. The source-end cluster can be a server cluster deployed in the source-end region, used to provide cloud services. The source-end cluster can be deployed with a source-end access layer and a source-end control layer, the source-end image storage warehouse stores the image file to be copied, and the source-end database stores the image metadata of the image file to be copied. The destination region can be another geographical location that provides cloud services, which is different from the source region. The destination cluster can be a server cluster deployed in the destination region, used to provide cloud services. The destination cluster can be deployed with a destination access layer and a destination control layer.

[0069] In some embodiments, the source database and the destination database may be databases used to record key fields, with relatively small storage capacity and fast query speed. For example, the source database and the destination database may be relational databases, such as Oracle, DB2, MySQL, Microsoft SQL, etc. For another example, the source database and the destination database may be non-relational databases, such as Redis, Memcache, MongoDB, HBase, etc.

[0070] In some embodiments, the source-end mirror storage warehouse and the destination-end mirror storage warehouse can be file systems for storing large files, such as a distributed file system (DFS), such as HDFS (Hadoop Distributed File System), Ceph File System, Gluster File System, etc.

[0071] 2 , the method 20 provided by the embodiment of the present disclosure may include the following S202 to S206 .

[0072] In S202, an image copy request is obtained through the source access layer. The image copy request includes information about the image file to be copied and information about the destination cluster.

[0073] In some embodiments, the source access layer and the destination access layer can be implemented through an interface (Application Programming Interface, API, referred to as interface in the embodiments of the present disclosure). The access layer can also be called the API layer. The "source access layer API" in the embodiments of the present disclosure refers to the source access layer, and the "destination access layer API" refers to the destination access layer.

[0074] In some embodiments, an image copy request may be used to request that a virtual machine image to be copied from a source cluster be copied to a destination cluster. The virtual machine image to be copied may include the image file to be copied and its image metadata. The image metadata is used to identify the characteristics of the virtual machine image to be copied, and may include, for example, any one or more of the following: the image operating system (OS) type, the image architecture (arch) version, the image version (version), the image name, the image MD5 (message-digest algorithm 5) value, the image layering information, etc., but is not limited thereto.

[0075] In some embodiments, a console can be provided, allowing users to perform white-screen operations on a web page displayed on the console, select the image file information to be copied and the destination cluster information on the page, and then send an image copy request to the source cluster through the source access layer. White-screen operations are operations that allow users to implement corresponding functions by interacting with the human-computer interaction interface without writing code.

[0076] In S204, based on the image copy request, the image metadata in the source database is copied to the destination database via the destination access layer according to the image file information to be copied and the destination cluster information.

[0077] In some embodiments, the image file information to be copied refers to any relevant information that can uniquely identify the image file to be copied, for example, each image file can be assigned a unique identification (ID). The image file information to be copied may include the ID of the image file to be copied. The image file information to be copied can be used to search for image metadata of the image file to be copied in the source database of the source cluster. The destination cluster information may include an identifier of the destination region, and the source cluster may be associated with the Internet Protocol (IP) address of the destination cluster through the identifier of the destination region to achieve network connection between the source cluster and the destination cluster.

[0078] In some embodiments, the source access layer may call the destination access layer to copy the mirror metadata in the source database to the destination database. For specific implementations, see FIG. 3 and FIG. 4 .

[0079] In S206, the image copy request is obtained through the source control layer.

[0080] In some embodiments, the source control layer may include a source control layer interface, and the mirror copy request may be synchronized to the source control layer interface through the source access layer for processing. For specific implementations, please refer to Figures 14 to 16.

[0081] In S208, the source control layer copies the image file to be copied in the source image storage warehouse to the destination image storage warehouse via the destination control layer based on the image copy request, according to the image file information to be copied and the destination cluster information.

[0082] In some embodiments, the identifier of the image file to be copied in the image file information to be copied can also be used to search for the image file to be copied in the source image storage warehouse of the source cluster. The destination cluster information can include an identifier of the destination region. The source cluster can be associated with the Internet Protocol (IP) address of the destination cluster through the identifier of the destination region to enable file transfer between the source cluster and the destination cluster.

[0083] In some embodiments, a mirror copy task can be generated according to a mirror copy request, written to a source database, and retrieved from the source database and processed to achieve asynchronous completion of mirror import. For a specific implementation, see FIG6 .

[0084] In some embodiments, the image copy request can be synchronized to the source control layer through the source access layer, and then the source control layer synchronizes the image file to be copied in the source image storage warehouse to the destination based on the image file information to be copied and the destination cluster information, and copies it to the destination image storage warehouse to call the access layer. For a specific implementation method, please refer to Figure 7.

[0085] According to the mirror processing method provided by the embodiment of the present disclosure, the source access layer of the source cluster deployed in the source region obtains a mirror copy request including information of the image file to be copied and information of the destination cluster deployed in the destination region, and then the source access layer copies the image metadata stored in the source database in the source cluster to the destination database in the destination cluster via the destination access layer based on the mirror copy request, according to the information of the image file to be copied and the information of the destination cluster, and then the source control layer copies the image metadata stored in the source database in the source cluster to the destination database in the destination cluster via the destination control layer based on the mirror copy request, according to the information of the image file to be copied and the information of the destination cluster The image files to be copied stored in the source image storage warehouse in the source cluster are copied to the destination image storage warehouse, where the destination region is different from the source region. Therefore, through the interaction between the layers of the source cluster and the layers of the destination cluster, the image files to be copied and the image metadata can be automatically copied across regions at the code level. Compared with the related art of manually packaging the image files to be copied and the image metadata into an image material package, synchronizing the image material package across regions, decompressing it into the image files to be copied and the image metadata, and then manually uploading them to the image storage warehouse and database respectively, the efficiency of cross-region image copying is improved.

[0086] Figure 3 is a schematic diagram showing the processing process of S202 and S204 in one embodiment shown in Figure 2. As shown in Figure 3, in the embodiment of the present disclosure, the above S202 may further include the following S302, and the above S204 may further include the following S304 to S310.

[0087] S302, obtain the image copy request through the source access layer API 3002.

[0088] In some embodiments, the source access layer API 3002 may receive the image copy request from the console by providing a Hyper Text Transfer Protocol (HTTP) service.

[0089] In some embodiments, after receiving the image copy request, the source access layer API 3002 may perform a validity check on the request parameters, and then obtain the image metadata from the source database 3001 after the check passes. For a specific implementation, please refer to FIG. 4 .

[0090] S304, obtaining image metadata from the source database 3001 through the source access layer API 3002 according to the image file information to be copied.

[0091] In some embodiments, the source access layer API 3002 may obtain the image metadata of the image file to be copied from the source database 3001 of the source cluster according to the ID of the image file to be copied in the image file information to be copied.

[0092] S306: Synchronize the mirroring metadata to the destination access layer API 3004 through the source access layer API 3002 according to the destination cluster information.

[0093] In some embodiments, the source access layer API 3002 may send a request to the destination access layer API to copy image metadata. The destination access layer API may receive the request from the source access layer API 3002 by providing an http service.

[0094] S308 , receiving the image metadata through the destination access layer API 3004 .

[0095] In some embodiments, after the destination access layer API obtains the mirror meta information to be synchronized, it queries the destination database 3005 to confirm whether the mirror meta information already exists in the destination region. If it is confirmed to exist, the writing step S310 is skipped.

[0096] S310 , write the image metadata into the destination database 3005 through the destination access layer API 3004 .

[0097] In some embodiments, if it is confirmed that the mirror meta information does not exist in the destination region, the mirror meta information is written into the destination database 3005 .

[0098] According to the method provided in the embodiment of the present disclosure, the source access layer calls the destination access layer to copy the image metadata in the source database to the destination database, thereby realizing automatic cross-regional replication of the image metadata and improving the efficiency of cross-regional image replication.

[0099] Figure 4 is a schematic diagram of an access layer implementation process according to Figures 2 and 3. The process of implementing cross-region replication of mirror metadata at the access layer as shown in Figure 4 may include the following steps S402 to S434.

[0100] S402, the source access layer API 4002 process begins.

[0101] S404: The source access layer API 4002 receives the image copy request.

[0102] S406: The source access layer API 4002 checks whether the parameters of the received image copy request are valid. If they are valid, the process proceeds to S408. If not, the process ends at S434.

[0103] In some embodiments, the source access layer API 4002 may parse the received image copy request to obtain parameters such as the ID of the image file to be copied and the identifier of the destination region.

[0104] In some embodiments, the source access layer API 4002 can query the source database 4001 based on the ID of the image file to be copied to verify the validity of the parameters in the image copy request. For example, the source database 4001 can be queried for the image status of the image file to be copied to determine whether the parameters in the image copy request are valid. The image status can be used to indicate whether the image is available in the source cluster. For example, an image may be unavailable due to a user taking it offline.

[0105] In some embodiments, the source access layer API 4002 may determine whether the region to be synchronized exists based on the identifier of the destination region, so as to determine whether the parameters of the mirror copy request are legal.

[0106] S408, the source access layer API 4002 obtains image metadata from the source database 4001 according to the image file information to be copied.

[0107] S410: The source access layer API 4002 calls the destination access layer API 4004 and sends an image metadata copy request to the destination access layer API 4004. The image metadata copy request may include the ID of the image file to be copied and / or an image metadata identifier, such as an image md5 value.

[0108] S412, the destination access layer API 4004 process starts.

[0109] S414: The destination access layer API 4004 receives the image metadata copy request.

[0110] At step S416, the destination access layer API 4004 checks whether the parameters of the received image metadata copy request are valid. If valid, the process proceeds to step S418. If not, the process ends at step S422.

[0111] In some embodiments, the destination access layer API 4004 may parse the received image meta-information copy request to obtain parameters such as the ID of the image file to be copied and / or the image meta-information identifier.

[0112] In some embodiments, the destination access layer API 4004 can determine whether the parameters of the received image metadata copy request are valid by querying whether the image metadata to be copied exists in the destination database 4005 based on parameters such as the ID of the image file to be copied and / or the image metadata identifier. If the query determines that the image metadata to be copied exists in the destination database 4005, the parameters of the received image metadata copy request are determined to be valid; otherwise, they are determined to be invalid.

[0113] S418 , the destination access layer API 4004 writes the received image metadata into the destination database 4005 .

[0114] S420, the destination access layer API 4004 determines whether the write is successful. If not, the process returns to S416. If successful, the process goes to S422 and ends.

[0115] S422, the destination access layer API 4004 process ends and returns a return value to the source access layer API 4002. The return value of S422 is used to indicate whether the mirroring meta information is successfully written into the destination database 4005, and then continues to execute S424.

[0116] At step S424, the source access layer API 4002 checks the return value to determine whether the mirror metadata was written successfully. If not, the process proceeds to step S434 to end. If successful, the process proceeds to step S426.

[0117] S426: The source access layer API 4002 calls the source control layer API to copy the image file to be copied. This step can trigger the start of the process of Figure 15.

[0118] At step S430, after the process in Figure 15 completes, a return value is returned to the source access layer API 4002. The return value from step S430 indicates whether the image file to be copied was successfully written to the destination image storage repository. The source access layer API 4002 checks the return value to determine whether the image file to be copied was successfully written. If unsuccessful, the process ends at step S434. If successful, the process proceeds to step S432.

[0119] S432, the source access layer API 4002 updates the image status of the image to be copied in the source database 4001 to copying, and then proceeds to S434 to end the process.

[0120] In some embodiments, at different stages and under different circumstances, the status of the image to be copied in the source database 4001 may include waiting to be copied, copying, copy completed, etc., and may also include unavailable (caused by reasons such as being offline by the user). Before S432, the status of the image to be copied in the source database 4001 may be waiting to be copied.

[0121] S434, the source access layer API 4002 process ends.

[0122] According to the method provided by the embodiment of the present disclosure, the source access layer sends an image metadata replication request to the destination access layer after verifying the image replication request. After the destination access layer verifies the image metadata replication request, the image metadata in the source database is written to the destination database, thereby realizing a standardized, product-level cross-regional solution for image metadata and improving the efficiency of cross-regional image replication.

[0123] Fig. 5 is a schematic diagram showing the processing process of S206 in one embodiment shown in Fig. 2. As shown in Fig. 5, in the embodiment of the present disclosure, the above S206 may further include the following S502 to S512.

[0124] S502, obtaining a mirror copy request through the source control layer 5003.

[0125] S504: Generate a mirror copy task according to the mirror copy request through the source end control layer 5003.

[0126] S506 , writing the image copy task and the corresponding task information into the source-end database 5002 through the source-end control layer 5003 . The task information corresponding to the image copy task includes the information of the image file to be copied and the destination-end cluster information.

[0127] In some embodiments, the task information corresponding to the image copy task may include image copy task parameters. The image file information to be copied may include the image file ID to be copied, the destination cluster information may include the identifier of the destination region, and the image file ID to be copied and the identifier of the destination region may be the image copy task parameters.

[0128] In some embodiments, the mirror copy task and parameters may be copied to the source database. For example, when the source database is MySQL, a new task table may be created, and the mirror copy task and parameters may be written into the task table.

[0129] In some embodiments, the mirror copy request can be synchronized to the source control layer 5003 interface for processing through the source access layer. S502 to S506 can be executed by the source control layer 5003 interface. For specific implementations, please refer to Figures 14 to 16.

[0130] S508 , obtaining the mirror copy task from the source database 5002 through the source control layer 5003 , and obtaining task information corresponding to the mirror copy task.

[0131] In some embodiments, when creating a new task table, corresponding task execution parameters may also be configured, such as timed execution, etc. The source control layer 5003 may obtain and execute mirror copy tasks from the source database 5002 at regular intervals.

[0132] In some embodiments, the task information corresponding to the image copy task may include task parameters, and the task parameters may include the ID of the image file to be copied and the identifier of the destination region.

[0133] In some embodiments, when the source database 5002 is MySQL, the source control layer 5003 can obtain the asynchronous tasks written by the source control layer 5003 interface by polling the task table of the source database 5002 .

[0134] S510 , in response to executing the image replication task, the source-side control layer 5003 synchronizes the image file to be replicated to the destination-side control layer 5004 according to the image file information to be replicated and the destination-side cluster information.

[0135] In some embodiments, the source control layer 5003 may request the destination control layer 5004 to open a mirror synchronization port based on the destination region identifier for transmitting the mirror file to be copied, and close the port after the transmission is completed. For a specific implementation, please refer to Figure 7.

[0136] S512 , writing the image file to be copied into the image storage warehouse 5005 on the destination side through the control layer 5004 on the destination side.

[0137] In some embodiments, the source-end control layer 5003 can download the image file to be copied from the source-end image storage warehouse in real time and transmit it to the destination-end control layer 5004 through the port opened by the destination-end control layer 5004. The destination-end control layer 5004 then transmits the image file to be copied to the destination-end image storage warehouse 5005 in real time. For example, if the total size of the image file to be copied is 5G, when the source-end control layer 5003 downloads 100M from the source-end image storage warehouse, it also transmits 100M to the destination-end control layer 5004 through the port opened by the destination-end control layer 5004 in real time. The destination-end control layer 5004 also transmits 100M to the destination-end image storage warehouse 5005 in real time. When the download of all 5G is completed, it is basically all written to the destination-end image storage warehouse 5005, which can greatly reduce the time of image copying.

[0138] According to the method provided by the embodiment of the present disclosure, by generating a mirror copy task according to a mirror copy request, writing the mirror copy task into the source database, obtaining the mirror copy task from the source database and processing it, the import of the mirror is completed asynchronously, thereby realizing the productization of the cross-region mirror copy solution and improving the efficiency of cross-region mirror copy.

[0139] Fig. 6 is a schematic diagram showing the processing process of S510 in one embodiment shown in Fig. 5. As shown in Fig. 6, in the embodiment of the present disclosure, the above S510 may further include the following S602 to S606.

[0140] S602 , in response to executing the mirror copy task, the source-side control layer 6002 calls the destination-side control layer 6004 to open the mirror synchronization port according to the destination-side cluster information.

[0141] In some embodiments, the source-side control layer 6002 may send a request to open a mirror synchronization port to the destination-side control layer 6004 in response to executing a mirror copy task. The destination-side control layer 6004 may respond to the received request to open a mirror synchronization port by randomly opening a mirror synchronization port in the target port interval. For a specific implementation, please refer to Figure 7.

[0142] In other embodiments, the source-side control layer 6002 may also request the destination-side control layer 6004 to open the target mirror synchronization port. For example, the source-side control layer 6002 may include an identifier of the target mirror synchronization port to be opened in the request to open the mirror synchronization port sent to the destination-side control layer 6004. The destination-side control layer 6004 may respond to the received request to open the target mirror synchronization port and open the target mirror synchronization port.

[0143] In some embodiments, in response to executing a mirror replication task, the source control layer 6002 may send a request to the destination control layer 6004 to open a mirror synchronization port. Based on the received mirror synchronization port request, the destination control layer 6004 may generate a mirror synchronization port open task and write it to the destination database. The destination control layer 6004 then retrieves the mirror synchronization port open task from the destination database and executes it, thereby opening the mirror synchronization port. For a specific implementation, see FIG8 .

[0144] In some embodiments, before calling the destination control layer 6004 to open the mirror synchronization port, the source control layer 6002 may determine, based on the image layer information, whether the image file to be copied already exists in the destination image storage warehouse. If so, the image copy task is not continued. If not, the image copy task is executed and the destination control layer 6004 is called to open the mirror synchronization port. For a specific embodiment, see FIG12 .

[0145] S604 , the source-side control layer 6002 synchronizes the image file to be copied to the destination-side control layer 6004 based on the port opened by the destination-side control layer 6004 and according to the information of the image file to be copied.

[0146] In some embodiments, a file transfer tool may be used to detect the port opened by the destination control layer 6004 and receive the image file to be copied. For a specific implementation, please refer to FIG. 9 .

[0147] S606 , in response to determining that the synchronization of the image file to be copied is completed, the source control layer 6002 calls the destination control layer 6004 to close the port opened by the destination control layer 6004 according to the destination cluster information.

[0148] In some embodiments, the source control layer 6002 can determine that the synchronization of the image files to be copied is complete when the image copy progress is 100%. The specific implementation of the source control layer 6002 obtaining the image copy progress can be seen in FIG11.

[0149] In some embodiments, the source control layer 6002 may send a request to close the open mirror synchronization port to the destination control layer 6004. The request may include an identifier of the open mirror synchronization port. The destination control layer 6004 closes the corresponding port according to the request.

[0150] According to the method provided by the embodiment of the present disclosure, the source-side control layer executes the mirror copy task and, based on the identifier of the destination-side region, requests the destination-side control layer to open a mirror synchronization port for transmitting the image file to be copied, and closes the port after the transmission is completed. Thus, the port is opened only when synchronizing the image file to be copied, thereby reducing the number of resident ports opened, reducing the risk of the destination-side cluster server node being attacked, and improving the reliability of the system.

[0151] Fig. 7 is a schematic diagram showing the processing process of S602 in one embodiment shown in Fig. 6. As shown in Fig. 7, in the embodiment of the present disclosure, the above S602 may further include the following S702 to S704.

[0152] S702 , in response to executing the mirror copy task, the source-side control layer 7002 sends a request for opening a mirror synchronization port to the destination-side control layer 7004 according to the destination-side cluster information.

[0153] In some embodiments, the destination control layer 7004 may include a destination control layer interface. In response to executing the mirror replication task, the source control layer 7002 may, based on the destination region identifier in the destination cluster information, be associated with the destination cluster's IP address and send a request to the destination control layer interface to open the mirror synchronization port. The destination control layer interface may receive requests from the source control layer by providing an HTTP service. The process implemented by the destination control layer interface is shown in Figure 16.

[0154] S704 , the destination control layer 7004 randomly opens at least one port in the target port range according to the request to open the mirror synchronization port.

[0155] In some embodiments, the destination control layer 7004 responds to a request to open a mirror synchronization port by randomly opening a detectable port based on a preset target port range. For example, the target port range can be 50000-50200, 60000-60100, or 60000-60100. Each mirror replication task occupies one port. For example, if the target port range is 60000-60100, a maximum of 100 mirrors can be synchronized simultaneously.

[0156] According to the method provided by the embodiment of the present disclosure, the source-side control layer sends a request to the destination-side control layer to open a mirror synchronization port in response to executing a mirror replication task. The destination-side control layer responds to the received request for the mirror synchronization port and randomly opens a mirror synchronization port in the target port interval for the current mirror replication task, thereby achieving a design based on the target port interval to limit the maximum number of mirror replication tasks, thereby improving the availability of the cross-regional replication mirror solution.

[0157] Fig. 8 is a schematic diagram showing the processing process of S602 in another embodiment shown in Fig. 6. As shown in Fig. 8, in the embodiment of the present disclosure, the above S602 may further include the following S802 to S818.

[0158] S802 , in response to executing the mirror copy task, the source-side control layer 8002 sends a request for opening a mirror synchronization port to the destination-side control layer 8004 according to the destination-side cluster information.

[0159] In some embodiments, the specific implementation of S802 may refer to S602.

[0160] In some embodiments, the image copy task can be executed in the main process, and a request to open the image synchronization port is sent. After confirming that the image synchronization port is open, another sub-process is started to use a file transfer tool to synchronize the image file to be copied. For a specific implementation method, please refer to Figure 10.

[0161] S804: The destination control layer 8004 generates a mirror synchronization port opening task according to the request for opening the mirror synchronization port.

[0162] In some embodiments, the destination control layer 8004 interface that receives the request to open the mirror synchronization port can perform a validity check on the request. For example, if the source control layer 8002 requests the destination control layer 8004 to open the target mirror synchronization port, the request to open the mirror synchronization port can be parsed to obtain the identifier of the target mirror synchronization port requested to be opened, and then the identifier of the obtained target mirror synchronization port can be checked to see if it is within the preset target port interval. If the identifier of the target mirror synchronization port is within the preset target port interval, the validity check passes, and the corresponding task of opening the mirror synchronization port is generated; otherwise, the validity check fails, the process ends, and the return value of the request to open the mirror synchronization port indicates that the source control layer 8002 did not open the mirror synchronization port. The source control layer 8002 can then determine in S814 that the mirror synchronization port opening failed.

[0163] S806 , writing the task of opening the mirror synchronization port into the destination database 8006 through the destination control layer 8004 .

[0164] In some embodiments, when the destination database 8006 is MySQL, the destination control layer 8004 interface may write the mirror synchronization port opening task and parameters into the task table.

[0165] S808, returning the identifier of opening the mirror synchronization port task through the destination control layer 8004.

[0166] In some embodiments, after successfully writing the task of opening the mirror synchronization port, the destination control layer 8004 can return the identifier of the task of opening the mirror synchronization port to the source control layer 8002 as the return value of the request to open the mirror synchronization port, so that the source control layer 8002 can confirm that the mirror synchronization port is (about to) be opened and can prepare to transmit the mirror file to be copied.

[0167] S810 , obtaining a mirror synchronization port opening task from the destination database 8006 through the destination control layer 8004 .

[0168] S812 , opening at least one port in response to the execution of the mirror synchronization port opening task by the destination control layer 8004 .

[0169] In some embodiments, in response to executing the mirror synchronization port opening task, the destination control layer 8004 may randomly open at least one port in the target port interval. For example, the target port interval may be 50000-50200, 60000-60100, or 60000-60100. The destination control layer 8004 randomly opens a detectable port in the preset target port interval.

[0170] In other embodiments, the parameters of the open mirror synchronization port task may include an identifier of the target mirror synchronization port requested to be opened, and the destination control layer 8004 may open the target mirror synchronization port in response to executing the open mirror synchronization port task.

[0171] S814: The source-side control layer 8002 determines whether the mirror synchronization port opening task is successful based on the identifier of the mirror synchronization port opening task.

[0172] In some embodiments, if the source-side control layer 8002 receives an identifier for the mirror synchronization port opening task in the return value of the request to open the mirror synchronization port sent to the destination-side control layer 8004, the mirror synchronization port opening may be determined to be successful. If the identifier for the mirror synchronization port opening task is not received, the mirror synchronization port opening may be determined to be unsuccessful. If the opening is determined to be unsuccessful, the process returns to S802.

[0173] S816: If the opening is successful, the source control layer 8002 synchronizes the image file to be copied to the destination control layer 8004 based on the port opened by the destination control layer 8004 and the information of the image file to be copied.

[0174] In some embodiments, a file transfer tool may be used to detect the port opened by the destination control layer 8004 and receive the image file to be copied. For a specific implementation, please refer to FIG. 9 .

[0175] S818, writing the image file to be copied into the image storage warehouse on the destination side through the destination control layer 8004.

[0176] According to the method provided by the embodiment of the present disclosure, the source-side control layer sends a request to open the mirror synchronization port to the destination-side control layer in response to executing the mirror replication task. The destination-side control layer generates a task to open the mirror synchronization port based on the received request for the mirror synchronization port and writes it into the destination-side database. Then, the destination-side control layer obtains the task to open the mirror synchronization port from the destination-side database and executes it to open the mirror synchronization port, thereby asynchronously executing the request to open the mirror synchronization port and the execution of the task to open the mirror synchronization port, thereby realizing the productization of the cross-region mirror replication solution and improving the efficiency of cross-region mirror replication.

[0177] According to the method provided by the embodiment of the present disclosure, the source-end control layer and the destination-end control layer use ip+port to realize the image file transfer between them through the file transfer tool. Under cloud-native deployment, the source-end control layer and the destination-end control layer containers can be configured to use the host mode when the network is started (for example, the configuration command can be: --network=host). In this way, the container of the control layer will not virtualize its own network card, configure its own ip, etc., but use the ip of the cluster host. The cluster host machines can generally access each other through intranet interconnection, so the source-end control layer and the destination-end control layer containers can access each other, that is, the source-end control layer and the destination-end control layer ip can access each other. Compared with the traditional physical machine cluster cross-regional network access that requires a dedicated line, cloud-native deployment can more easily achieve cross-regional network access.

[0178] Fig. 9 is a schematic diagram showing the processing process of S816 in another embodiment shown in Fig. 8. As shown in Fig. 9, in the embodiment of the present disclosure, the above S816 may further include the following S902 to S904.

[0179] S902 , using a file transfer tool through the source-side control layer 9002 , based on the port opened by the destination-side control layer 9004 and according to the information of the image file to be copied, synchronizes the image file to be copied.

[0180] In some embodiments, the source control layer 9002 can use a file transfer tool based on the port opened by the destination control layer to start synchronizing the image file to be copied. For example, the file transfer tool can use open source tools such as netcat and rsync. Taking netcat as an example, the command for synchronizing files can be:

[0181] cat imgfile|nc ip port

[0182] In some embodiments, the image copy task can be executed in the main process, and a request to open the image synchronization port is sent. After confirming that the image synchronization port is open, another sub-process is started to use a file transfer tool to synchronize the image file to be copied. For a specific implementation method, please refer to Figure 10.

[0183] S904 , the destination control layer 9004 uses a file transfer tool to detect the port opened by the destination control layer 9004 and receive the image file to be copied.

[0184] In some embodiments, the destination control layer 9004 may use a file transfer tool to detect the port opened by the destination control layer. For example, the file transfer tool may use an open source tool such as netcat or rsync. Taking netcat as an example, the command in the destination control layer 9004 may be:

[0185] nc-4 -l port>img.file

[0186] According to the method provided in the embodiment of the present disclosure, the image file to be copied is transmitted from the source control layer to the port detectable by the destination control layer through a file transfer tool, thereby realizing the productization of the cross-region image replication solution and improving the efficiency of cross-region image replication.

[0187] Figure 10 is a schematic diagram showing the processing process of S802 shown in Figure 8 and S902 shown in Figure 9 in another embodiment. As shown in Figure 10, in the embodiment of the present disclosure, the above S902 may further include the following S1002, and the above S902 may further include the following S1004.

[0188] S1002: Start the main process through the source-side control layer to execute the mirror copy task, and send a request to open the mirror synchronization port to the destination-side control layer according to the destination-side cluster information.

[0189] S1004: Start a sub-process in the main process through the source control layer, run a file transfer tool in the sub-process, and synchronize the image file to be copied based on the port opened by the destination control layer and the information of the image file to be copied.

[0190] According to the method provided by the embodiments of the present disclosure, the image replication task is executed in the main process, a request is sent to open the image synchronization port, and after confirming that the image synchronization port is open, another sub-process is started to synchronize the image files to be replicated using a file transfer tool. This allows for the parallel synchronization of multiple image files to be replicated in multiple sub-processes. Furthermore, if the main process continues to respond to or generate other requests, the synchronization of the image files to be replicated in the sub-processes will not be affected, thereby improving the success rate and reliability of the cross-region image replication solution.

[0191] Figure 11 shows a flow chart of another method different from Figure 2 based on Figure 10. As shown in Figure 11, in relation to the above embodiment, the method provided by the embodiment of the present disclosure may further include the following S1102 to S1108 for obtaining the copy progress of the image file to be copied.

[0192] In S1102 , the source-side control layer 11002 queries the size of the synchronized image file to be copied in the main process.

[0193] In some embodiments, the source control layer 11002 can call a destination control layer interface in the main process to request the size of the synchronized image file to be copied. The destination control layer interface can obtain the size of the synchronized image file to be copied from the destination image storage warehouse and then return it to the source control layer interface.

[0194] In S1104 , the total size of the image file to be copied is obtained in the main process through the source control layer 11002 .

[0195] In some embodiments, the source-side control layer may obtain the total size of the image file to be copied from the source-side database 11001 according to the identifier of the image file to be copied in the main process.

[0196] In other embodiments, the task parameters of the image copy task may further include the total size of the image file to be copied, which may be obtained by the source-side control layer 11002 from the source-side database 11001 when generating the image copy task.

[0197] In S1106 , the source-end control layer 11002 obtains the copy progress information of the image file to be copied according to the synchronized size of the image file to be copied and the total size of the image file to be copied in the main process.

[0198] In some embodiments, the copy progress information of the image file to be copied can be obtained by dividing the size of the synchronized image file to be copied by the total size of the image files to be copied. For example, if the synchronized size of the image file to be copied is 500MB and the total size of the image files to be copied is 1GB, the copy progress information of the image file to be copied can be 50%.

[0199] In S1108 , the source-side control layer 11002 updates the task progress information corresponding to the image copy task in the source-side database 11001 according to the copy progress information of the image file to be copied in the main process.

[0200] In some embodiments, the status of each image copy task in the source database 11001 can be read in real time on the console, and the progress of copying each image file to be copied can be obtained through the status of each image copy task.

[0201] According to the method provided by the embodiment of the present disclosure, by starting a child process to synchronize the image files to be copied, the size of the copied image files to be copied is asynchronously queried in the main process, so that the image copying progress is calculated based on the total size of the image files to be copied, and the task progress can be updated to the source database at regular intervals, so that the user can obtain the copying progress of each image file to be copied through the source access layer in the console, thereby improving the user experience.

[0202] Fig. 12 is a schematic diagram showing the processing process of S602 in one embodiment shown in Fig. 6. As shown in Fig. 12, in the embodiment of the present disclosure, the above S602 may further include the following S1202 to S1210.

[0203] S1202 , in response to executing the image copy task, the source-side control layer 12004 obtains the image layer information of the image file to be copied from the source-side database 12002 according to the information of the image file to be copied.

[0204] In some embodiments, the source control layer 12004 can obtain the image layer information of the image file to be copied from the source database 12002 based on the image file ID to be copied in the image file information to be copied. Taking a private cloud environment as an example, the image file to be copied can be divided into a base layer image and a second layer image.

[0205] S1204, the source control layer 12004 calls the destination control layer 12006 according to the image layer information of the image file to be copied and the destination cluster information, and queries whether all layers of the image file to be copied already exist in the destination image storage warehouse.

[0206] Taking a private cloud environment as an example, the source control layer 12004 can call the destination control layer 12006 to query whether the base layer image and the second layer image, etc., of the image file to be copied already exist in the destination image storage warehouse.

[0207] S1206, the source-side control layer 12004 obtains the query result of the destination-side control layer 12006, and determines whether the query result shows that all layers of the image file to be copied already exist in the destination-side image storage warehouse.

[0208] S1208, if the source control layer 12004 obtains the query result that all layers of the image file to be copied do not exist in the target image storage warehouse, then the target control layer 12006 is called to open the image synchronization port according to the target cluster information.

[0209] S1210, if the source-side control layer 12004 obtains the query result that all layers of the image file to be copied already exist in the target-side image storage warehouse, then the status of the image copy task in the source-side database 12002 is updated to completed.

[0210] According to the method provided by the embodiment of the present disclosure, before calling the destination control layer 12006 to open the mirror synchronization port, the source control layer 12004 determines whether the image file to be copied already exists in the destination image storage warehouse based on the image layering information. If so, the image copy task will not be executed; if not, the image copy task will be executed. Calling the destination control layer 12006 to open the mirror synchronization port can avoid repeated execution of the same image copy task and improve the efficiency of cross-regional mirror copying.

[0211] Figure 13 is a schematic diagram showing the processing process of S502 to S506 in one embodiment shown in Figure 5. As shown in Figure 13, in the embodiment of the present disclosure, the above S502 may further include the following S1302, the above S504 may further include the following S1304, and the above S506 may further include the following S1306.

[0212] S1302 , obtain a mirror copy request through the source-side control layer interface 13002 .

[0213] In some embodiments, the mirror copy request can be synchronized to the source-side control layer interface 13002 through the source-side access layer.

[0214] S1304: Generate a mirror copy task according to the mirror copy request through the source-side control layer interface 13002.

[0215] In some embodiments, the source-side control layer interface 13002 may perform a validity check on the image copy request parameters and generate a corresponding image copy task after the check passes. For a specific implementation, please refer to FIG. 15 .

[0216] S1306 , write the image copy task and the corresponding task information into the source-side database 13001 through the source-side control layer interface 13002 .

[0217] In some embodiments, the task information corresponding to the mirror copy task can be task parameters. When the source database 13001 is MySQL, the source control layer interface can write the mirror copy task and parameters into the task table.

[0218] According to the method provided in the embodiment of the present disclosure, by setting a source control layer interface for the source control layer, parsing the image copy request and generating and writing the image copy task based on the parsing result, and decoupling the implementation of obtaining and executing the image copy task, the reliability of the cross-regional image copy solution of the source cluster can be improved.

[0219] Figure 14 shows a schematic diagram of the processing process of S1304 shown in Figure 13 in one embodiment. As shown in Figure 14, in the embodiment of the present disclosure, the above S1304 may further include the following S1402 to S1410. The process shown in Figure 14 may be implemented by the source end control layer interface 14002.

[0220] S1402: Parse the image copy request to obtain image copy request parameters, where the image copy request parameters include information about the image file to be copied and information about the destination cluster.

[0221] S1404: Perform validity verification on the image file information to be copied and the destination cluster information respectively to obtain validity verification results.

[0222] S1406: Determine whether the validity check result is passed.

[0223] In some embodiments, the source-side control layer interface may verify the validity of the mirror copy request parameters in the same manner as the access layer. For a specific implementation, refer to S406.

[0224] In some embodiments, the source-end control layer interface may also read the image metadata of the image file to be copied from the database for verification, such as the legitimacy of the image arch version, the legitimacy of the image version, and so on.

[0225] S1408: If the validity check result is passed, an image copy task is generated according to the image copy request parameters through the source control layer interface.

[0226] S1410: If the validity check result is failed, the process ends.

[0227] According to the method provided in the embodiment of the present disclosure, the image replication request is parsed and verified through the source control layer interface, and the corresponding image replication task is generated after the verification is passed. This can prevent illegal data from being written to the source database, and can also block some incorrect request operations, thereby improving the reliability of the cross-regional image replication solution.

[0228] Figure 15 is a schematic diagram of a process of generating a mirror copy task according to a source-side control layer interface shown in Figures 13 and 14. The implementation process shown in Figure 15 may include the following steps S1502 to S1512.

[0229] S1502, start.

[0230] S1504: Receive a mirror copy request.

[0231] S1506, check whether the image copy request parameters are legal. If the check result is illegal, go to S1512 and end the process.

[0232] S1508: If the check result is legal, a mirror copy task is generated according to the mirror copy request, and the mirror copy task and parameters are written into the source database.

[0233] S1510, determine whether the writing is successful. If the writing is unsuccessful, return to S1508 and write again.

[0234] S1512: If the writing is successful, the process ends.

[0235] According to the source-side control layer interface implementation method provided by the embodiment of the present disclosure, a corresponding image copy task is generated after the image copy request is verified and passed, and after the operation of writing to the source-side database is performed, it is determined whether the writing is successful. If it is unsuccessful, it is rewritten, which can avoid the loss of the task of writing to the source-side database, thereby improving the reliability of the cross-regional replication image solution.

[0236] Figure 16 is a schematic diagram of a process of processing an image replication task by a source control layer according to Figures 2 to 12. The standardized, product-level image replication task processing process shown in Figure 16 may include the following steps S1602 to S1680.

[0237] S1602, the source-side control layer 16002 starts the process.

[0238] S1604, the source-side control layer 16002 obtains the image replication task from the source-side database 16001.

[0239] S1606 , the source-side control layer 16002 obtains the image layering information from the source-side database 16001 .

[0240] S1608 , the source-side control layer 16002 calls the destination-side control layer API 16003 to query whether the image file to be copied exists in the destination-side image storage warehouse based on the acquired image layer information.

[0241] S1610, the destination control layer API 16003 starts the process.

[0242] S1612, the destination control layer API 16003 receives the request sent by the source control layer 16002 to query whether the image file to be copied exists in the destination image storage warehouse.

[0243] S1614 , the destination control layer API 16003 queries whether each layer of the image file to be copied exists in the destination image storage warehouse according to the request.

[0244] S1616 , the destination control layer API 16003 returns the query result to the source control layer 16002 .

[0245] S1618, the source-side control layer 16002 determines whether all layers of the image file to be copied exist in the destination-side image storage warehouse based on the returned query result.

[0246] S1619: If yes, the source control layer 16002 updates the status of the mirror copy task in the source database 16001 to success.

[0247] S1620: If not, call the destination control layer API 16004 to open the mirror synchronization port.

[0248] S1622, the destination control layer API 16004 starts the process.

[0249] S1624, the destination control layer API 16004 receives a request to open a mirror synchronization port.

[0250] S1626 , the destination control layer API 16004 generates a mirror synchronization port opening task according to the request for opening the mirror synchronization port, and writes the mirror synchronization port opening task and parameters into the destination database 16007 .

[0251] S1628 , the destination control layer API 16004 returns the task ID for opening the mirror synchronization port to the source control layer 16002 .

[0252] S1630, the destination control layer API 16004 ends the process.

[0253] S1632 , the source-side control layer 16002 queries whether the mirror synchronization port is opened successfully according to the mirror synchronization port opening task ID returned by the destination-side control layer API 16004 .

[0254] S1633: If the source-side control layer 16002 determines that the mirror synchronization port is not opened successfully, the state of the mirror copy task in the source-side database 16001 is updated to failure.

[0255] S1634, if the source-side control layer 16002 determines that the mirror synchronization port is opened successfully, it starts to synchronize the mirror file to be copied through the destination-side control layer 16006 using the opened port.

[0256] S1636, the destination control layer 16006 starts the process.

[0257] S1638 , the destination control layer 16006 obtains the task of opening the mirror synchronization port from the destination database 16007 .

[0258] S1640, the destination control layer 16006 executes the task of opening the mirror synchronization port, and randomly opens at least one port in the set target port range.

[0259] S1642: The destination control layer 16006 uses a file transfer tool to detect the open port.

[0260] S1644, the destination control layer 16006 uses a file transfer tool to receive the image file to be copied.

[0261] S1645, the destination control layer 16006 writes the received image file to be copied into the destination image storage warehouse.

[0262] S1646: The source control layer 16002 calls the destination control layer API 16005 to query the image copy progress.

[0263] S1648, the destination control layer API 16005 starts the process.

[0264] S1650 , the destination control layer API 16005 receives the request sent by the source control layer 16002 to query the size of the copied image file to be copied.

[0265] S1652 , the destination control layer API 16005 returns the query result to the source control layer 16002 .

[0266] S1654, the source-side control layer 16002 determines whether the image file to be copied is synchronized based on the query result returned by the destination-side control layer API 16005.

[0267] S1656: If yes, the source control layer 16002 updates the status of the mirror copy task in the source database 16001 to success. If no, S1654 is re-executed periodically until the synchronization is completed.

[0268] S1658: If yes, the source-side control layer 16002 calls the destination-side control layer API 16004 to close the opened mirror synchronization port.

[0269] S1660, the destination control layer API 16004 starts the process.

[0270] S1662, the destination control layer API 16004 receives the request for closing the mirror synchronization port sent by the source control layer 16002.

[0271] S1664 , the destination control layer API 16004 generates a task for closing the mirror synchronization port according to the request, and writes the task and parameters for closing the mirror synchronization port into the destination database 16007 .

[0272] S1666 , the destination control layer API 16004 returns the task ID for closing the mirror synchronization port to the source control layer 16002 .

[0273] S1670, the destination control layer API 16004 ends the process.

[0274] S1672 , the destination control layer 16006 obtains the task of closing the mirror synchronization port from the destination database 16007 .

[0275] S1674: The destination control layer 16006 executes the task of closing the mirror synchronization port to close the opened mirror synchronization port.

[0276] S1676, the destination control layer 16006 ends the process.

[0277] S1678: The source-side control layer 16002 queries whether the mirror synchronization port is closed successfully based on the task ID for closing the mirror synchronization port returned by the destination-side control layer API 16004. If not, the process returns to S1658.

[0278] S1680: If yes, the source control layer 16002 ends the process.

[0279] FIG17 illustrates a schematic diagram of the cross-region image replication process in a private cloud native cluster scenario based on FIG2 to FIG16. The cross-region image replication process shown in FIG17 may include the following S1702 to S1720, which are used to synchronize the image files to be replicated in the private cloud native cluster 17000 in region A to the private cloud native cluster 17100 in region A. Specifically, the private cloud native cluster 17000 in region A may include a database 17003 and an image storage repository 17010, and may be provided with an access layer API 17004, a control layer API 17006, and a control layer 17008; the private cloud native cluster 17100 in region B may include a database 17103 and an image storage repository 17110, and may be provided with an access layer API 17104, a control layer API 17106, and a control layer 17108.

[0280] S1702: Initiate a mirror copy request through the console 17002.

[0281] S1704 , the access layer API 17004 in the private cloud cloud native cluster 17000 in region A receives the image copy request and obtains the image metadata from the database 17003 .

[0282] S1706 , the access layer API 17004 synchronizes the image metadata to the access layer API 17104 in the private cloud cloud native cluster 17100 in region B.

[0283] S1708 , the access layer API 17104 writes the image metadata to the database 17103 in the private cloud cloud native cluster 17100 in region B.

[0284] S1710 , the access layer API 17004 synchronizes the received image copy request to the control layer API 17006 .

[0285] S1712 , the control layer API 17006 generates a mirror copy task according to the mirror copy request, and writes the mirror copy task into the database 17003 .

[0286] S1714, the control layer 17008 obtains the mirror copy task from the database 17003 and starts executing it.

[0287] S1716: The control layer 17008 calls the control layer API 17106 in the private cloud cloud native cluster 17100 in region B to request to open the mirror synchronization port.

[0288] S1718, the control layer 17008 synchronizes the image files to be copied in the image storage warehouse 17010 to the control layer 17108 in the private cloud cloud native cluster 17100 in region B through the opened image synchronization port, so that the control layer 17108 writes the image files to be copied to the image storage warehouse 17110 in the private cloud cloud native cluster 17100 in region B.

[0289] S1720, the control layer 17008 updates the task progress in the database 17003.

[0290] Figure 18 is a block diagram of an image processing device according to an exemplary embodiment. The device shown in Figure 18 can be applied to the cloud server of the above system, or to the terminal device of the above system.

[0291] The device shown in Figure 18 can be set in a source cluster deployed in the source area. The source cluster can be deployed with a source access layer and a source control layer. The source image storage warehouse stores the image files to be copied, and the source database stores the image metadata of the image files to be copied.

[0292] 18 , the apparatus 180 provided by the embodiment of the present disclosure may include a first acquisition module 1802 , a first processing module 1804 , a second acquisition module 1806 , and a second processing module 1808 .

[0293] The first acquisition module 1802 can be used to obtain an image copy request through the source access layer. The image copy request includes information about the image file to be copied and information about the destination cluster. The destination cluster information corresponds to the destination cluster. The destination cluster is deployed in a destination region that is different from the source region. The destination cluster can be deployed with a destination access layer and a destination control layer.

[0294] The first processing module 1804 may be configured to copy the image metadata in the source database to the destination database via the destination access layer based on the image copy request, the image file information to be copied, and the destination cluster information through the source access layer.

[0295] The first processing module 1804 can also be used to: obtain image meta information from the source-end database through the source-end access layer according to the image file information to be copied; synchronize the image meta information to the destination-end access layer through the source-end access layer according to the destination-end cluster information, so as to write the image meta information into the destination-end database through the destination-end access layer.

[0296] The second obtaining module 1806 may be configured to obtain an image replication request through the source-side control layer.

[0297] The second processing module 1808 can be used to copy the image file to be copied in the source image storage warehouse to the destination image storage warehouse through the destination control layer based on the image copy request, according to the image file information to be copied and the destination cluster information.

[0298] The second processing module 1808 can also be used to generate an image copy task through the source-side control layer according to the image copy request; write the image copy task and corresponding task information into the source-side database through the source-side control layer, where the task information corresponding to the image copy task includes the image file information to be copied and the destination cluster information; obtain the image copy task from the source-side database through the source-side control layer to obtain the task information corresponding to the image copy task; synchronize the image file to be copied to the destination-side control layer through the source-side control layer in response to executing the image copy task according to the image file information to be copied and the destination cluster information, so as to write the image file to be copied into the destination image storage warehouse through the destination control layer.

[0299] The second processing module 1808 can also be used to, through the source-side control layer, in response to executing the image copy task, call the destination-side control layer to open the image synchronization port according to the destination-side cluster information; through the source-side control layer, based on the port opened by the destination-side control layer, synchronize the image file to be copied to the destination-side control layer according to the image file information to be copied, so as to write the image file to be copied to the destination-side image storage warehouse through the destination-side control layer; through the source-side control layer, in response to determining that the synchronization of the image file to be copied is completed, call the destination-side control layer to close the port opened by the destination-side control layer according to the destination-side cluster information.

[0300] The second processing module 1808 can also be used to: through the source-side control layer, in response to executing the mirror replication task, send a request to open the mirror synchronization port to the destination-side control layer according to the destination-side cluster information, so that the destination-side control layer can randomly open at least one port in the target port range according to the request to open the mirror synchronization port.

[0301] The second processing module 1808 can also be used to: through the source-side control layer, in response to executing the mirror copy task, send a request to open the mirror synchronization port to the destination-side control layer according to the destination-side cluster information, so as to generate an open mirror synchronization port task through the destination-side control layer according to the request to open the mirror synchronization port, and write the open mirror synchronization port task into the destination-side database, return the identifier of the open mirror synchronization port task, obtain the open mirror synchronization port task from the destination-side database, and open at least one port in response to executing the open mirror synchronization port task; the second processing module is also used to: through the source-side control layer, determine whether the opening is successful according to the identifier of the open mirror synchronization port task; if it is determined that the opening is successful, then through the source-side control layer, based on the port opened by the destination-side control layer, according to the information of the mirror file to be copied, synchronize the mirror file to be copied to the destination-side control layer, so as to write the mirror file to be copied into the destination-side mirror storage warehouse through the destination-side control layer.

[0302] The second processing module 1808 can also be used to: synchronize the image file to be copied based on the port opened by the destination control layer through the source control layer using a file transfer tool, so as to detect the port opened by the destination control layer through the destination control layer using a file transfer tool, receive the image file to be copied, and write the image file to be copied into the destination image storage warehouse.

[0303] The second processing module 1808 can also be used to: start the main process through the source-side control layer to execute the image copy task, and call the destination-side control layer to open the image synchronization port according to the destination-side cluster information; start the sub-process in the main process through the source-side control layer, run the file transfer tool in the sub-process, and synchronize the image file to be copied based on the port opened by the destination-side control layer and the image file information to be copied.

[0304] The second processing module 1808 can also be used to: query the size of the synchronized image file to be copied in the main process through the source-side control layer; obtain the total size of the image file to be copied through the source-side control layer; obtain the copy progress information of the image file to be copied based on the synchronized size of the image file to be copied and the total size of the image file to be copied through the source-side control layer; and update the task progress information corresponding to the image copy task in the source-side database based on the copy progress information of the image file to be copied through the source-side control layer.

[0305] The second processing module 1808 can also be used to: obtain, through the source-side control layer, the image layer information of the image file to be copied from the source-side database in response to executing the image copy task based on the image file information to be copied; call the destination-side control layer through the source-side control layer based on the image layer information of the image file to be copied and the destination-side cluster information to query whether all layers of the image file to be copied already exist in the destination-side image storage warehouse; obtain the query result of the destination-side control layer through the source-side control layer; if the source-side control layer determines, based on the query result, that all layers of the image file to be copied do not already exist in the destination-side image storage warehouse, call the destination-side control layer through the source-side control layer based on the destination-side cluster information to open the image synchronization port.

[0306] The second processing module 1808 can also be used to: obtain a mirror copy request from the source access layer through the source control layer interface; generate a mirror copy task according to the mirror copy request through the source control layer interface; and write the mirror copy task and corresponding task information into the source database through the source control layer interface.

[0307] The second processing module 1808 can also be used to: parse the image copy request through the source control layer interface to obtain the image copy request parameters, where the image copy request parameters include the image file information to be copied and the destination cluster information; perform a validity check on the image file information to be copied and the destination cluster information through the source control layer interface to obtain a validity check result; if the validity check result is passed, generate an image copy task through the source control layer interface according to the image copy request parameters.

[0308] Figure 19 is a block diagram of another image processing device according to an exemplary embodiment. The device shown in Figure 19 can be applied to the cloud server of the above system, or to the terminal device of the above system.

[0309] The device shown in FIG. 19 may be set in a destination cluster deployed in a destination region. The destination cluster may be deployed with a destination access layer and a destination control layer.

[0310] 19 , the apparatus 190 provided by the embodiment of the present disclosure may include a first receiving module 1902 , a first writing module 1904 , a second receiving module 1906 , and a second writing module 1908 .

[0311] The first receiving module 1902 can be used to receive image metadata of the image file to be copied from the source access layer of the source cluster through the destination access layer. The source cluster is deployed in the source region, which is different from the destination region. The source cluster can be deployed with a source access layer and a source control layer. The image file to be copied is stored in the source image storage warehouse, and the image metadata is stored in the source database.

[0312] The first writing module 1904 may be configured to write the mirroring meta information into a destination database through a destination access layer.

[0313] The second receiving module 1906 may be configured to receive the image file to be copied from the source control layer via the destination control layer.

[0314] The second writing module 1908 may be configured to write the image file to be copied into the image storage warehouse at the destination end through the control layer at the destination end.

[0315] In some embodiments, a mirror processing device is provided, which is deployed in a source cluster in a source area. The device includes a source access layer and a source control layer. The source cluster is deployed with a source mirror storage warehouse and a source database. The source mirror storage warehouse stores the mirror files to be copied, and the source database stores the mirror metadata of the mirror files to be copied.

[0316] The source access layer is used to obtain an image copy request. The image copy request includes information about the image file to be copied and information about the destination cluster. The destination cluster information corresponds to the destination cluster. The destination cluster is deployed in a destination region that is different from the source region. The destination cluster is deployed with a destination access layer and a destination control layer. Based on the image copy request, the image metadata in the source database is copied to the destination database via the destination access layer according to the information about the image file to be copied and the information about the destination cluster.

[0317] The source-side control layer is used to obtain an image replication request. Based on the image replication request, the image file to be replicated in the source-side image storage warehouse is copied to the destination-side image storage warehouse via the destination-side control layer according to the image file information to be replicated and the destination-side cluster information.

[0318] In some embodiments, the source-side control layer is further used to generate an image copy task based on an image copy request; write the image copy task and corresponding task information into the source-side database, where the task information corresponding to the image copy task includes information of the image file to be copied and information of the destination cluster; obtain the image copy task from the source-side database to obtain task information corresponding to the image copy task; in response to executing the image copy task, synchronize the image file to be copied to the destination-side control layer based on the information of the image file to be copied and the destination cluster information, so that the image file to be copied is written into the destination-side image storage warehouse through the destination-side control layer.

[0319] In some embodiments, the source-side control layer is further used to synchronize the image file to be copied to the destination-side control layer based on the port opened by the destination-side control layer and according to the information of the image file to be copied, so as to write the image file to be copied into the destination-side image storage warehouse through the destination-side control layer; in response to determining that the synchronization of the image file to be copied is completed, the destination-side control layer is called to close the port opened by the destination-side control layer according to the destination-side cluster information.

[0320] In some embodiments, the source-side control layer is further used to send a request to open a mirror synchronization port to the destination-side control layer in response to executing a mirror replication task based on the destination-side cluster information, so that the destination-side control layer can randomly open at least one port in the target port range based on the request to open the mirror synchronization port.

[0321] In some embodiments, the source-side control layer is further used to, in response to executing a mirror copy task, send a request to open a mirror synchronization port to the destination-side control layer according to the destination-side cluster information, so that the destination-side control layer generates an open mirror synchronization port task according to the request to open the mirror synchronization port, writes the open mirror synchronization port task into the destination-side database, returns an identifier of the open mirror synchronization port task, obtains the open mirror synchronization port task from the destination-side database, and opens at least one port in response to executing the open mirror synchronization port task.

[0322] In some embodiments, the source-side control layer is further used to determine whether the opening is successful based on the identifier of the task of opening the mirror synchronization port; if it is determined that the opening is successful, the source-side control layer, based on the port opened by the destination-side control layer, synchronizes the image file to be copied to the destination-side control layer according to the information of the image file to be copied, so that the image file to be copied is written into the destination-side image storage warehouse through the destination-side control layer.

[0323] In some embodiments, the source-side control layer is further used to utilize a file transfer tool to synchronize the image file to be copied based on the port opened by the destination-side control layer and the information of the image file to be copied, so as to detect the port opened by the destination-side control layer through the destination-side control layer using the file transfer tool, receive the image file to be copied, and write the image file to be copied into the destination-side image storage warehouse.

[0324] In some embodiments, the source-side control layer is also used to start a main process to perform the image copy task, and call the destination-side control layer to open the image synchronization port based on the destination-side cluster information; start a sub-process in the main process, run a file transfer tool in the sub-process, and synchronize the image file to be copied based on the port opened by the destination-side control layer and the image file information to be copied.

[0325] In some embodiments, the source-side control layer is further used to query the size of the synchronized image file to be copied in the main process; obtain the total size of the image file to be copied in the main process; obtain the copy progress information of the image file to be copied in the main process based on the synchronized size of the image file to be copied and the total size of the image file to be copied; in the main process, update the task progress information corresponding to the image copy task in the source-side database based on the copy progress information of the image file to be copied.

[0326] In some embodiments, the source-side control layer is further configured to, in response to executing an image copy task, obtain image layering information of the image file to be copied from the source-side database based on the image file information to be copied; call the destination-side control layer based on the image layering information of the image file to be copied and the destination-side cluster information to query whether all layers of the image file to be copied already exist in the destination-side image storage warehouse; obtain the query result of the destination-side control layer; and if it is determined, based on the query result, that all layers of the image file to be copied do not already exist in the destination-side image storage warehouse, call the destination-side control layer based on the destination-side cluster information to open the image synchronization port.

[0327] In some embodiments, the source control layer includes a source control layer interface configured to obtain an image replication request from the source access layer, generate an image replication task based on the image replication request, and write the image replication task and corresponding task information into a source database.

[0328] In some embodiments, the source-side control layer interface is also used to parse the image copy request to obtain image copy request parameters, which include the image file information to be copied and the destination cluster information; perform a validity check on the image file information to be copied and the destination cluster information respectively to obtain a validity check result; if the validity check result is passed, generate a mirror copy task according to the image copy request parameters.

[0329] In some embodiments, the source access layer is further used to obtain image meta information from the source database based on the image file information to be copied; and synchronize the image meta information to the destination access layer based on the destination cluster information, so as to write the image meta information into the destination database through the destination access layer.

[0330] In some embodiments, a mirror processing device is provided, which is deployed in a destination cluster in a destination region. The device includes a destination access layer and a destination control layer.

[0331] The destination access layer is used to receive image metadata of the image files to be copied from the source access layer of the source cluster. The source cluster is deployed in the source region, which is different from the destination region. The source cluster is deployed with a source access layer and a source control layer. The source cluster is deployed with a source image storage warehouse and a source database. The source image storage warehouse stores the image files to be copied, and the source database stores the image metadata. The destination access layer is also used to write the image metadata to the destination database.

[0332] The target-side control layer is used to receive the image file to be copied from the source-side control layer, and write the image file to be copied into the target-side image storage warehouse through the target-side control layer.

[0333] The specific implementation of each module in the device provided by the embodiment of the present disclosure can refer to the content of the above method and will not be repeated here.

[0334] Figure 20 shows a schematic diagram of the structure of an electronic device in an embodiment of the present disclosure. It should be noted that the device shown in Figure 20 is only an example of a computer system and should not bring any limitations to the functions and scope of use of the embodiment of the present disclosure.

[0335] As shown in Figure 20, device 2000 includes a central processing unit (CPU) 2001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 2002 or a program loaded from a storage portion 2008 into a random access memory (RAM) 2003. Various programs and data required for the operation of device 2000 are also stored in RAM 2003. CPU 2001, ROM 2002, and RAM 2003 are connected to each other via a bus 2004. An input / output (I / O) interface 2005 is also connected to bus 2004.

[0336] The following components are connected to the I / O interface 2005: an input section 2006 including a keyboard, a mouse, and the like; an output section 2007 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 2008 including a hard disk and the like; and a communication section 2009 including a network interface card such as a LAN card or a modem. The communication section 2009 performs communication processing via a network such as the Internet. A drive 2010 is also connected to the I / O interface 2005 as needed. A removable medium 2011, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 2010 as needed, so that computer-readable instructions read therefrom are installed in the storage section 2008 as needed.

[0337] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes computer-readable instructions carried on a computer-readable medium, and the computer-readable instructions contain program code for executing the method shown in the flowchart. In such an embodiment, the computer program product can be downloaded and installed from a network via the communication part 2009, and / or installed from the removable medium 2011. When the computer-readable instructions of the computer program product are executed by the central processing unit (CPU) 2001, the above-mentioned functions defined in the system of the present disclosure are performed.

[0338] It should be noted that the computer-readable medium described in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.

[0339] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more computer-readable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0340] The modules described in the embodiments of the present disclosure may be implemented in software or hardware. The modules described may also be provided in a processor. For example, they may be described as follows: a processor includes a first acquisition module, a first processing module, a first acquisition module, and a second processing module. The names of these modules do not, in some cases, limit the modules themselves. For example, the first acquisition module may also be described as a module that "acquires a mirror copy request through the source access layer."

[0341] The present disclosure also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently and not be incorporated into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device implements the following method:

[0342] The source access layer obtains an image replication request; based on the image replication request, the source access layer copies the image metadata in the source database to the destination database via the destination access layer according to the image file information to be replicated and the destination cluster information; the source control layer obtains an image replication request; based on the image replication request, the source control layer copies the image file to be replicated in the source image storage warehouse to the destination image storage warehouse via the destination control layer according to the image file information to be replicated and the destination cluster information.

[0343] The present disclosure provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the methods provided in the various optional implementations described above.

[0344] While the exemplary embodiments of the present disclosure have been specifically illustrated and described above, it should be understood that the present disclosure is not limited to the detailed structures, configurations, or implementations described herein; rather, the present disclosure is intended to encompass various modifications and equivalent configurations within the spirit and scope of the appended claims.

[0345] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0346] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A mirror processing method, executed by a source cluster deployed in a source region, wherein the source cluster is deployed with a source access layer and a source control layer, wherein the source cluster is deployed with a source mirror storage warehouse and a source database, wherein the source mirror storage warehouse stores a mirror file to be copied, and the source database stores mirror meta information of the mirror file to be copied, wherein the method comprises: Obtaining an image copy request through the source access layer, the image copy request including image file information to be copied and destination cluster information, the destination cluster information corresponding to the destination cluster, the destination cluster deployed in a destination region, the destination region is different from the source region, and the destination cluster is deployed with a destination access layer and a destination control layer; By means of the source access layer, based on the image replication request, according to the image file information to be replicated and the target cluster information, the image metadata in the source database is replicated to the target database via the target access layer; Obtaining the image replication request through the source control layer; and Through the source control layer, based on the image copy request, according to the image file information to be copied and the target cluster information, the image file to be copied in the source image storage warehouse is copied to the target image storage warehouse via the target control layer.

2. The method according to claim 1, wherein the source control layer, based on the image copy request, according to the image file information to be copied and the target cluster information, copies the image file to be copied in the source image storage warehouse to the target image storage warehouse via the target control layer, comprising: Generate the image replication task according to the image replication request through the source control layer; Writing the image replication task and corresponding task information into the source-end database through the source-end control layer, wherein the task information corresponding to the image replication task includes the image file information to be replicated and the destination-end cluster information; Obtaining the mirror copy task from the source database through the source control layer to obtain task information corresponding to the mirror copy task; Through the source-end control layer, in response to executing the image replication task, the image file to be replicated is synchronized to the destination-end control layer according to the image file information to be replicated and the destination-end cluster information, so that the image file to be replicated is written into the destination-end image storage warehouse through the destination-end control layer.

3. The method according to claim 2, wherein, in response to executing the image replication task, the image file to be replicated is synchronized to the destination control layer according to the image file information to be replicated and the destination cluster information, so as to write the image file to be replicated into the destination image storage warehouse through the destination control layer, comprising: By the source-side control layer, in response to executing the mirror replication task, the destination-side control layer is called to open a mirror synchronization port according to the destination-side cluster information; By means of the source control layer, based on the port opened by the destination control layer, according to the information of the image file to be copied, synchronizing the image file to be copied to the destination control layer, so as to write the image file to be copied into the destination image storage warehouse by means of the destination control layer; In response to determining that synchronization of the image file to be copied is completed, the source-end control layer calls the destination-end control layer to close the port opened by the destination-end control layer according to the destination-end cluster information.

4. The method according to claim 3, wherein, in response to executing the mirror replication task, the source-side control layer calls the destination-side control layer to open the mirror synchronization port according to the destination-side cluster information, comprising: Through the source-end control layer, in response to executing the mirror replication task, a request to open a mirror synchronization port is sent to the destination-end control layer according to the destination-end cluster information, so that through the destination-end control layer, at least one port is randomly opened in the target port interval according to the request to open the mirror synchronization port.

5. The method according to claim 3, in response to executing the mirror replication task, calling the destination control layer to open the mirror synchronization port according to the destination cluster information, comprises: In response to executing the mirror copy task, through the source-end control layer, according to the destination-end cluster information, a request for opening the mirror synchronization port is sent to the destination-end control layer, so that through the destination-end control layer, according to the request for opening the mirror synchronization port, an open mirror synchronization port task is generated, and the open mirror synchronization port task is written into the destination-end database, and the identifier of the open mirror synchronization port task is returned, and the open mirror synchronization port task is obtained from the destination-end database. In response to executing the open mirror synchronization port task, at least one port is opened.

6. The method according to claim 5, further comprising: Determining whether the mirror synchronization port opening task is successful according to the identifier of the mirror synchronization port opening task through the source end control layer; If it is determined that the opening is successful, the step of synchronizing the image file to be copied to the destination control layer through the source control layer based on the port opened by the destination control layer and according to the image file information to be copied is executed, so as to write the image file to be copied to the destination image storage warehouse through the destination control layer.

7. The method according to any one of claims 3 to 6, wherein the image file to be copied is synchronized to the destination control layer through the source control layer based on the port opened by the destination control layer and according to the image file information to be copied, so as to write the image file to be copied into the destination image storage warehouse through the destination control layer, comprising: Through the source-end control layer, using a file transfer tool, based on the port opened by the destination-end control layer, according to the information of the image file to be copied, the image file to be copied is synchronized, so as to detect the port opened by the destination-end control layer through the destination-end control layer and using the file transfer tool, receive the image file to be copied, and write the image file to be copied into the destination-end image storage warehouse.

8. The method according to claim 7, wherein, in response to executing the mirror replication task, the source-side control layer calls the destination-side control layer to open a mirror synchronization port according to the destination-side cluster information, comprising: Through the source-end control layer, the main process is started to execute the mirror copy task, and according to the destination-end cluster information, the destination-end control layer is called to open the mirror synchronization port; The method comprises: synchronizing the image file to be copied by using a file transfer tool through the source control layer, based on the port opened by the destination control layer and according to the image file information to be copied, including: Through the source end control layer, a subprocess is started in the main process, the file transfer tool is run in the subprocess, and based on the port opened by the destination end control layer and the image file information to be copied, the image file to be copied is synchronized.

9. The method according to claim 8, further comprising: Through the source control layer, querying the size of the synchronized image file to be copied in the main process; Obtaining the total size of the image file to be copied in the main process through the source control layer; By means of the source end control layer, in the main process, according to the size of the synchronized image file to be copied and the total size of the image file to be copied, obtaining the copy progress information of the image file to be copied; Through the source-end control layer, in the main process, task progress information corresponding to the image copy task in the source-end database is updated according to the copy progress information of the image file to be copied.

10. The method according to claim 3, wherein in response to executing the mirror replication task, calling the destination control layer to open the mirror synchronization port according to the destination cluster information through the source control layer comprises: By the source-end control layer, in response to executing the image replication task, the image layering information of the image file to be replicated is acquired from the source-end database according to the information of the image file to be replicated; By means of the source control layer, according to the image layer information of the image file to be copied and the target cluster information, the target control layer is called to query whether all layers of the image file to be copied already exist in the target image storage warehouse; Obtaining query results of the destination control layer through the source control layer; and If the source control layer determines, based on the query result, that all layers of the image file to be copied do not already exist in the destination image storage warehouse, the source control layer calls the destination control layer to open the image synchronization port based on the destination cluster information.

11. The method according to claim 2, wherein the source control layer comprises a source control layer interface, and obtaining the image replication request through the source control layer comprises: Obtaining the mirror copy request from the source access layer through the source control layer interface; The generating the mirror copy task according to the mirror copy request through the source control layer includes: Generate the image replication task according to the image replication request through the source control layer interface; The step of writing the mirror copy task and the corresponding task information into the source-end database through the source-end control layer includes: The mirror copy task and corresponding task information are written into the source database through the source control layer interface.

12. The method according to claim 11, wherein generating the mirror copy task according to the mirror copy request through the source control layer interface comprises: Parsing the image copy request through the source control layer interface to obtain image copy request parameters, where the image copy request parameters include the image file information to be copied and the destination cluster information; Through the source-end control layer interface, respectively, the image file information to be copied and the destination-end cluster information are subjected to a validity check to obtain a validity check result; If the validity check result is passed, the image copy task is generated according to the image copy request parameters through the source control layer interface.

13. The method according to any one of claims 1 to 12, wherein the image metadata in the source database is copied to the destination database via the destination access layer based on the image copy request and the image file information to be copied and the destination cluster information, comprising: Obtaining the image metadata from the source database through the source access layer according to the image file information to be copied; The mirror meta information is synchronized to the destination access layer through the source access layer according to the destination cluster information, so as to write the mirror meta information into the destination database through the destination access layer.

14. A mirror processing method, executed by a destination cluster deployed in a destination region, wherein the destination cluster is deployed with a destination access layer and a destination control layer, the method comprising: Receiving, through the destination access layer, image meta information of the image file to be copied from the source access layer of the source cluster, the source cluster being deployed in a source region, the source region being different from the destination region, the source cluster being deployed with the source access layer and the source control layer, the source cluster being deployed with a source image storage warehouse and a source database, the source image storage warehouse storing the image file to be copied, and the source database storing the image meta information; Writing the image metadata into a destination database through the destination access layer; Receiving the image file to be copied from the source control layer through the destination control layer; and The image file to be copied is written into the image storage warehouse of the destination end through the destination end control layer.

15. An image processing device, deployed in a source cluster in a source region, the device comprising a source access layer and a source control layer, the source cluster is deployed with a source image storage warehouse and a source database, the source image storage warehouse stores image files to be copied, and the source database stores image metadata of the image files to be copied; The source access layer is used to obtain an image replication request, the image replication request includes image file information to be replicated and destination cluster information, the destination cluster information corresponds to a destination cluster, the destination cluster is deployed in a destination region, the destination region is different from the source region, the destination cluster is deployed with a destination access layer and a destination control layer, based on the image replication request, according to the image file information to be replicated and the destination cluster information, the image metadata in the source database is replicated to the destination database via the destination access layer; The source-side control layer is used to obtain the image copy request, and based on the image copy request, according to the image file information to be copied and the target-side cluster information, copy the image file to be copied in the source-side image storage warehouse to the target-side image storage warehouse via the target-side control layer.

16. A mirror processing device, deployed in a destination cluster in a destination region, the device comprising a destination access layer and a destination control layer; The destination access layer is used to receive image meta information of the image file to be copied from the source access layer of the source cluster, the source cluster is deployed in the source region, the source region is different from the destination region, the source cluster is deployed with the source access layer and the source control layer, the source cluster is deployed with a source image storage warehouse and a source database, the source image storage warehouse stores the image file to be copied, and the source database stores the image meta information; The destination access layer is further used to write the mirror meta information into a destination database; The destination control layer is used to receive the image file to be copied from the source control layer, and write the image file to be copied into the destination image storage warehouse through the destination control layer.

17. An electronic device comprising: A memory, a processor, and computer-readable instructions stored in the memory and executable in the processor, wherein the processor implements the method according to any one of claims 1 to 14 when executing the computer-readable instructions.

18. A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by a processor, implement the method according to any one of claims 1 to 14.

19. A computer program product, comprising computer readable instructions, wherein when the computer readable instructions are executed by a processor, the method according to any one of claims 1 to 14 is implemented.

Citation Information

Patent Citations

  • Remote pushing method and system, server and computer readable storage medium

    CN111885122A

  • Mirror image file processing method and device, network equipment and storage medium

    CN113596162A

  • Mirror image warehouse deployment method and device, electronic equipment and computer readable medium

    CN114157658A

  • Mirror image distribution method, mirror image distribution device, electronic equipment and storage medium

    CN114238262A

  • Cloud service processing method and device, cloud server, cloud service system and storage medium

    US20220239739A1