Mirror storage method, generation method and system

CN117762552BActive Publication Date: 2026-09-22GUANGZHOU TENCENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211133944.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2026-09-22
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

这样的存储方式需要运维人员掌握一定的专业技能,人工成本和学习成本较高,而且容易出错

Benefits of technology

[0013]本申请实施例的镜像生成方法,通过镜像生成平台获取目标云环境待写入的镜像文件以及镜像文件的描述信息,然后获取镜像导入API的配置信息,并根据镜像导入API的配置信息生成镜像数据包的镜像导入程序,以便根据镜像导入程序、镜像文件以及镜像文件的描述信息生成镜像数据包,从而有效提供一种自动化的镜像数据包的生成方法,降低人为干预的成本和出错率。同时,采用本申请方法生成的镜像数据包在被云服务器执行时,镜像导入程序能够通过调用镜像导入API实现对镜像文件以及镜像文件的描述信息的自动存储,无需运维人员进行人工干预上传,有效提高云服务器的自动化程度,同时有效降低人工干预带来的出错率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117762552B_ABST
    Figure CN117762552B_ABST
Patent Text Reader

Abstract

The application discloses a mirror image storage method, a generation method and system, and the generation method comprises the following steps: acquiring, by a mirror image generation platform, a mirror image file to be written into a target cloud environment and description information of the mirror image file; acquiring configuration information of a mirror image import API, and generating a mirror image import program of the mirror image data packet according to the configuration information of the mirror image import API; the mirror image import program is used for calling the mirror image import API to write the mirror image file in the target cloud environment; and a mirror image data packet is generated according to the mirror image import program, the mirror image file and the description information, so that the mirror image data packet can be automatically generated, the cost of human intervention and the error rate are reduced, meanwhile, the cloud server for deploying a private cloud environment is used to automatically import the mirror image file and the description information of the mirror image file into the private cloud environment, so that the import cost of the mirror image file is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure generally relates to the field of data processing technology, specifically to the field of cloud server data processing, and particularly to a mirror storage method, generation method, and system. Background Technology

[0002] A private cloud is a cloud infrastructure and hardware / software resources created within a firewall so that various departments within an organization or enterprise can share the resources within the data center.

[0003] When importing image files into a private cloud environment, the operations and maintenance personnel primarily store the image file and its description information in an image storage repository and a storage address mapping information table, respectively. This storage method requires operations and maintenance personnel to possess certain professional skills, resulting in high labor and learning costs, and is also prone to errors. Summary of the Invention

[0004] In view of the above-mentioned defects or deficiencies in the existing technology, it is desirable to provide an image storage method, generation method and system that can automatically generate image data packages, reduce the cost and error rate of human intervention, and at the same time, automatically import image files and image file description information into the private cloud environment by the cloud server used to deploy the private cloud environment, thereby greatly reducing the import cost of image files.

[0005] In a first aspect, embodiments of this application provide a mirror storage method, including:

[0006] The cloud server obtains an image data package, which includes an image file and a description of the image file.

[0007] The image file is verified by calling the image import API. After the verification is successful, the image file and the description information are stored in the target cloud environment by calling the image import API. The target cloud environment is a cloud environment deployed based on the cloud server.

[0008] The image storage method proposed in this application allows the cloud server to verify the image files in the image data package by calling the image import API after obtaining the image data, ensuring the reliability of the image files to be imported. After the verification is passed, the image import API is called to store the image files and description information in the target cloud environment. Thus, the image import API enables automatic storage of image files and their description information without the need for manual intervention by maintenance personnel, effectively improving the automation level of the cloud server and reducing the error rate caused by manual intervention.

[0009] Secondly, embodiments of this application provide a mirror generation method, including:

[0010] The image file to be written to the target cloud environment and the description information of the image file are obtained through the image generation platform.

[0011] Obtain the configuration information of the image import API, and generate an image import program for the image data package based on the configuration information of the image import API; the image import program is used to call the image import API to write the image file in the target cloud environment;

[0012] An image data package is generated based on the image import program, the image file, and the description information.

[0013] The image generation method of this application embodiment obtains the image file to be written to the target cloud environment and the image file's description information through an image generation platform. Then, it obtains the configuration information of the image import API and generates an image import program for the image data package based on the image import API configuration information. This allows for the generation of the image data package based on the image import program, the image file, and the image file's description information, effectively providing an automated method for generating image data packages and reducing the cost and error rate of manual intervention. Furthermore, when the image data package generated using this method is executed by the cloud server, the image import program can automatically store the image file and its description information by calling the image import API, eliminating the need for manual uploading by operations and maintenance personnel. This effectively improves the automation level of the cloud server and significantly reduces the error rate caused by manual intervention.

[0014] Thirdly, embodiments of this application provide a mirror storage system, including a cloud server and a mirror server, wherein the cloud server is used to deploy a target cloud environment.

[0015] The image server is used to: obtain the image file to be written to the target cloud environment and the description information of the image file through the image generation platform; obtain the configuration information of the image import API; generate an image import program for the image data package based on the configuration information of the image import API; the image import program is used to call the image import API to write the image file in the target cloud environment; and generate an image data package based on the image import program, the image file, and the description information.

[0016] The cloud server is used to: obtain an image data package, the image data package including an image file and a description of the image file; call the image import API to verify the image file, and after the verification is successful, call the image import API to store the image file and the description information in the target cloud environment.

[0017] In some embodiments, the image server is configured to obtain the image file and the description information through the user configuration interface of the image generation platform, wherein the user configuration interface of the image generation platform includes at least one of image file configuration items and image metadata configuration items.

[0018] In some embodiments, the image server is used to: obtain the intermediate storage address corresponding to the target cloud environment; generate the image import program according to the configuration information of the image import API and the intermediate storage address; the image import program is used to write the image data package to the intermediate storage address and call the image import API to obtain the image data package from the intermediate storage address.

[0019] In some embodiments, the image server is further configured to: determine a fourth verification field corresponding to the image file according to a preset encryption strategy based on a third verification field contained in the image file; verify the image file based on the fourth verification field and the verification information in the description information; and determine that the image file has passed verification if the fourth verification field and the verification information are consistent.

[0020] In some embodiments, the cloud server is used to compare the historical description information in the description information and the storage address mapping information; the storage mapping information is used to record the correspondence between the image description information and the image file storage address;

[0021] If the description information is the same as the mirror identifier of the historical description information, then the mirror file is written into the storage space corresponding to the historical description information;

[0022] If the description information is different from the mirror identifier of the historical description information, then a storage space corresponding to the description information is created, and the mirror file is written into the storage space corresponding to the description information.

[0023] In some embodiments, the cloud server is configured to update the historical description information according to the description information if the description information is the same as the mirror identifier of the historical description information;

[0024] If the description information is different from the mirror identifier of the historical description information, the description information and its corresponding storage space are written into the storage address mapping information.

[0025] In some embodiments, the cloud server is used to acquire the image data package from the image generation platform via offline copying, or to receive the image data package sent by the image generation platform; the image data package further includes an import program configured with the image import API.

[0026] In some embodiments, the import program is further configured with an intermediate storage address. Before calling the image API to verify the image file, the cloud server is configured to execute the import program, store the image data package in the intermediate storage address, and call the image import API to retrieve the image data package from the intermediate storage address.

[0027] In some embodiments, the cloud server is configured to obtain the image data packet through a user configuration interface of the target cloud environment. The user configuration interface is configured to store the data received through the user configuration interface to an intermediate storage address. The user configuration interface includes at least one of an image file configuration item and a description information configuration item.

[0028] In some embodiments, before calling the image import API to verify the image file, the cloud server is used to call the image import API to obtain the image data package from the intermediate storage address.

[0029] In some embodiments, the cloud server is used to determine the second verification field corresponding to the image file according to a preset encryption strategy based on the first verification field contained in the image file.

[0030] The image file is verified based on the second verification field and the verification information in the description information;

[0031] If the second verification field and the verification information are consistent, and the image file matches the operating requirements of the target cloud environment, then the image file is determined to have passed the verification.

[0032] Fourthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the embodiments of this application.

[0033] Fifthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in embodiments of this application.

[0034] In a sixth aspect, embodiments of this application provide a computer program product, including a computer program, characterized in that, when the computer program is executed by a processor, it implements the method described in embodiments of this application.

[0035] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0036] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0037] Figure 1 The system architecture adapted to the embodiments of this application;

[0038] Figure 2 A schematic flowchart illustrating a mirror storage method provided in an embodiment of this application;

[0039] Figure 3 A schematic flowchart illustrating a mirror storage method provided in another embodiment of this application;

[0040] Figure 4 This is a schematic diagram of a configuration interface provided in one embodiment of this application;

[0041] Figure 5 A schematic flowchart illustrating a mirror storage method provided in yet another embodiment of this application;

[0042] Figure 6 A schematic flowchart illustrating a mirror generation method provided in an embodiment of this application;

[0043] Figure 7 A schematic flowchart illustrating a mirror generation method provided in another embodiment of this application;

[0044] Figure 8 A schematic diagram illustrating the principle of mirror storage provided in an embodiment of this application;

[0045] Figure 9 A schematic flowchart illustrating a mirror storage method provided in an embodiment of this application;

[0046] Figure 10 A block diagram of a mirrored storage device provided in an embodiment of this application;

[0047] Figure 11 This is a block diagram of a mirror generation apparatus provided in an embodiment of this application;

[0048] Figure 12 This is a schematic diagram of the structure of a computer system suitable for implementing electronic devices or servers according to the embodiments of this application. Detailed Implementation

[0049] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0050] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0051] Figure 1 The system architecture adapted to the embodiments of this application. Reference Figure 1 The system includes: cloud server 101 and image server 102.

[0052] Cloud server 101 is used to deploy a target cloud environment, which is used to store user data resources. For example, the target cloud environment is a private cloud environment. Cloud server 101 also provides a configuration interface, which can be accessed through a first terminal 103 within the target cloud environment to interact with the cloud server. For example, the first terminal 103 can display the configuration interface of the target cloud environment. This interface is used to receive interactive information and user-input interactive commands. The interactive information with the cloud server may include, but is not limited to, operations such as selecting an image file used to create a virtual machine.

[0053] Image server 102 is used to package the image files to be imported and their description information. Image server 102 also provides a configuration interface, which image file providers can access through a second terminal 104 to interact with image server 102. The second terminal 104 is used to display the interaction information of image server 102 and receive user input interaction commands, wherein the interaction information with image server includes, but is not limited to, uploading image files and image description information.

[0054] In the specific implementation, the manufacturer user uploads the image file to be written to the target cloud environment and its description information through the second terminal 104 via interactive commands. Then, the image server 102 obtains the configuration information and intermediate storage address of the image import API, and generates the image import program of the image data package according to the configuration information and intermediate storage address of the image import API. Then, the image file is generated according to the image import program, the image file and its description information.

[0055] After deploying the target cloud environment in cloud server 101, the interactive information of the target cloud environment is displayed through the first terminal 103, and interactive commands input by the user are received. For example, when the user needs to create a virtual machine using an image file stored in the target cloud environment, the user can select the image identifier of the target image to be used through the interactive information displayed on the first terminal 103, and download the image file from the target cloud environment according to the image identifier.

[0056] In this embodiment, when storing an image file in a target cloud environment, the cloud server 101 can call the image import API to store the image file and its description information in the target cloud environment after obtaining the image data package. Of course, the cloud server 101 can obtain the image data package provided by the image server 102 directly or indirectly. For example, the cloud server 101 can obtain the image data package from the image server 102 by communicating with it, through the cloud server 101's backend offline interface, or through the user configuration interface displayed on the first terminal 101.

[0057] Cloud server 101 and image server 102 can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The first terminal 103 and the second terminal 104 can be smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, in-vehicle terminals, etc., but are not limited to these. The terminals and servers can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this connection.

[0058] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this application provide method operation instruction steps as shown in the following embodiments or drawings, the method may include more or fewer operation instruction steps based on conventional or non-creative effort. In steps where there is no logically necessary causal relationship, the execution order of these steps is not limited to the execution order provided in the embodiments of this application. In actual processing or when the device executes the method, it may be executed sequentially or in parallel according to the method shown in the embodiments or drawings.

[0059] Please refer to Figure 2 , Figure 2 A flowchart illustrating an embodiment of the image storage method provided in this application is shown. The execution entity of this method can be the cloud server 101 described above. Figure 2 As shown, the method includes:

[0060] 201. The cloud server obtains the image data package, which includes the image file and its description.

[0061] An image file is a single file created by combining a specific set of files according to a certain format, making it convenient for users to download and use. Examples include an operating system or a game. For instance, once a game image file is run on a cloud server, it provides the complete content of the corresponding game. The image file's descriptive information records its attributes and characteristics, typically stored as image metadata in JSON format. For example, the image file's descriptive information includes the image's OS (Operating System) category, image architecture, image version, image identifier, and image MD5 value.

[0062] In one possible implementation, the image file and its description information in the image data package can be the original image file and description information provided by the image provider. That is, the original image file and description information provided by the image provider are packaged together to generate the image data package, which is then obtained by the cloud server. Thus, the image data package obtained by the cloud server contains the image file and its description information required for the image to be imported.

[0063] In one possible implementation, the image file and its description in the image data package can be a compiled image file and its description suitable for running in the target cloud environment, obtained after acquiring the original image file and description information provided by the image provider, and then tailored to the target cloud environment deployed on the cloud server. Therefore, the image data package obtained by the cloud server is more suitable for running in the target cloud environment and better meets the customized needs of users in the target cloud environment.

[0064] 202. Call the image import API to verify the image file, and after the verification is successful, call the image import API to store the image file and description information in the target cloud environment, which is a cloud environment deployed based on a cloud server.

[0065] The API (Application Programming Interface) contains predefined functions or routines. When an API has predefined routines, calling the API will automatically execute the routines to implement the corresponding interface functions. In this embodiment, the API is predefined to have routines for image import. For example, when the image import API is called, it executes predefined verification and storage routines to verify and store the image file.

[0066] In this embodiment, after receiving the image data packet, the cloud server calls the image import API to automatically import the image file and its description information using the predefined functions of the image import API. Specifically, the cloud server first calls the image import API to verify the image file. If the image file passes verification, the cloud server calls the image import API again to store the image file and description information in the target cloud environment. If the image file fails verification, the cloud server determines that the image data packet import has failed and does not call the image import API again.

[0067] In one possible implementation, the image import API verifies the image file by comparing it with verification information. For example, if the image file matches the verification information, the image file is determined to have passed verification; if the image file does not match the verification information, the image file is determined to have failed verification.

[0068] In one possible implementation, the image file and its description information can be stored in different storage repositories. For example, the description information of the image file can be stored in a relational database, which is used to store mapping relationships between data, such as a MySQL database. Exemplarily, the relational database stores the mapping relationship between the description information and the storage address, where the storage address is the address where the image file is stored in the image storage repository.

[0069] In one possible implementation, both the relational database and the mirrored storage repository are deployed on a cloud server. That is, the cloud server also provides database services and storage repository services to the target cloud environment.

[0070] The image storage method proposed in this application allows the cloud server to verify the image files in the image data package by calling the image import API after obtaining the image data, ensuring the reliability of the image files to be imported. After the verification is passed, the image import API is called to store the image files and description information in the target cloud environment. Thus, the image import API enables automatic storage of image files and their description information without the need for manual intervention by maintenance personnel, effectively improving the automation level of the cloud server and reducing the error rate caused by manual intervention.

[0071] In another embodiment of this application, a specific implementation method for a cloud server to obtain image data packets is also provided. For example, the specific implementation of "cloud server obtaining image data packets" mentioned above includes: obtaining image data packets from an image generation platform, wherein the image data packets also include an image import program configured with an image import API.

[0072] In one possible implementation, after the image server generates the image data package, it can upload the image data package to the cloud server via offline copying. Based on this copying operation, the cloud server can obtain the image data package from the image generation platform. To ensure the security of the target cloud environment deployed on the cloud server, the address of the cloud server deploying the target cloud environment also needs to be hidden, for example, by not connecting it to the external internet. In this case, the cloud server needs to use an external storage device to obtain the image data packaged by the image generation platform via offline copying.

[0073] For example, after the image generation platform obtains the image data package, the operation and maintenance personnel can copy the image data package obtained by the image generation platform offline to an external storage device, and then copy the image data package stored in the external storage device offline to the cloud server, so that the cloud server can obtain the image data package provided by the image generation platform even when it is not visible to the external network.

[0074] In one possible implementation, the cloud server obtains the image data package from an image server that provides services to the image generation platform. To further reduce manual intervention, the cloud server can communicate with the image server that provides it with image data resources to obtain the image data package to be imported.

[0075] For example, after the image generation platform packages the image file and its description information to obtain an image data package, the image generation platform uploads the image data package to the image server, and then the image server forwards the image data package to the cloud server.

[0076] It should also be noted that the image data package from the image generation platform is generated by the image generation platform itself. When packaging the image data, the platform also packages an import program configured with the image import API into the image data package, enabling the cloud server to use the import program in the image data package to call the image import API. The import program configures the image import API by including its call address. For example, the import program contains API call instructions, and the API interface address in the API call instructions is the interface address of the image import API.

[0077] In one possible implementation, when the cloud server obtains the image data package via offline copying, after the cloud server obtains the image data package by reading from the external storage device, the operations and maintenance personnel can perform a trigger operation in the interactive interface of the target cloud environment to call the image import API through the trigger operation.

[0078] For example, after the operation and maintenance personnel connect the external storage device to the cloud server by means of plugging in, the cloud server obtains the image data package. The operation and maintenance personnel then use the interactive interface displayed on the first terminal to trigger the import program stored in the image data package. This causes the import program to call the image import API in the cloud server according to the interface address of its configured image import API, thereby realizing the automatic execution of image file verification and storage using the image import API.

[0079] In one possible implementation, when the cloud server obtains the image data package through the image server that provides services to the image generation platform, the cloud server can automatically detect the received data package and then trigger the import program in the data package to call the image import API based on the detection result.

[0080] For example, after the image server forwards the image data packet to the cloud server, the cloud server obtains the image data packet based on the image server's forwarding operation. Then, the cloud server determines that the image data packet is the image data packet to be imported by using the image data packet's receiving path or identifier. For example, the cloud server can predefine a function to use data packets from the image server as image data packets, or it can identify the data packet as an image data packet by recognizing the identifier information of the image data packet. The identifier information can be an image identifier or an import program. That is, the cloud server can also determine that the data packet is an image data packet based on the import program in the data packet. After the cloud server determines that the data packet from the image server is an image data packet, it executes the executable import program in the image data packet. This allows the import program to call the image import API in the cloud server according to its configured image import API interface address, thereby automatically performing the verification and storage of the image file using the image import API.

[0081] In the method provided in this application embodiment, the cloud server can obtain an image data package from the image generation platform. The image data package from the image generation platform contains an import program configured with an image import API, which enables the cloud server to call the image import API through the import program, thereby realizing the automatic import of image files and reducing manual intervention.

[0082] In another embodiment of this application, to further enhance the security of the target cloud environment, an intermediate storage device is also provided in the cloud server. By storing the image file to be imported and its description information in the intermediate storage device, an executable read address is provided for the image import API during storage, while avoiding the exposure of the real storage address of the image repository to the outside world. For example, before executing the aforementioned call to the image API to verify the image file, the method further includes: executing the import program, storing the image data package in the intermediate storage address, and calling the image import API to retrieve the image data package from the intermediate storage address.

[0083] It should be noted that the access address of the intermediate storage device can be configured in the import program so that when the import program is executed, it can store the image data package to the intermediate storage device according to the configured access address.

[0084] In other words, after the cloud server obtains the image data package from the image generation platform, it executes the import program in the image data package, stores the image data package in the intermediate storage device, obtains the intermediate storage address of the image data package in the intermediate storage device, sends the intermediate storage address of the data package in the intermediate storage device to the image import API, calls the image import API to retrieve the image data package from the intermediate storage address, and then calls the image import API to verify and store the image data package.

[0085] In one possible implementation, the image data package stored on the intermediate storage device can be an image data package provided by the image generation platform, an image file and its description information contained in the image data package, or simply the image file itself. For example, the import program can directly store the image data package on the intermediate storage device, or it can extract the image file and its description information from the image data package, then package them into a new image data package and store it on the intermediate storage device, or it can extract the image file from the image data package, package it to obtain a new image data package, and store it on the intermediate storage device.

[0086] In one possible implementation, the import program needs to verify the image data package before storing it at the intermediate storage address to ensure that the automatically imported image data package is tamper-proof. Verification can be performed using an encryption algorithm, such as MD5. MD5 (Message-Digest Algorithm) is a one-way encryption function that accepts a message of arbitrary length as input and returns a fixed-length digest value as output, used to verify the original message.

[0087] For example, before storing the image data package to the intermediate storage address, the import program calculates the MD5 value corresponding to the image file in the image data package, and then compares the calculated MD5 value with the MD5 value recorded in the description information of the image data package. If the two MD5 values ​​are the same, it is determined that the image file in the image data package has not been tampered with and can be verified and stored by the image import API. The import program then stores the image data package to the intermediate storage address. If the two MD5 values ​​are different, it is determined that the image file in the image data package has been tampered with and subsequent verification and storage steps cannot be performed.

[0088] It should be understood that in this implementation, the import environment information of the image data package is configured in the import program by configuring the access address of the intermediate storage device provided by the cloud server and the interface address of the image import API. In other words, the access address of the intermediate storage device and the interface address of the image import API configured in the import program are related to the target cloud environment to be imported. When the execution of the import program fails to store the image data package in the intermediate storage device or call the image import API based on the access address of the intermediate storage device and the interface address of the image import API configured in the import program, it is determined that the target cloud environment is not the target environment for importing the image data package.

[0089] In one possible implementation, the import program can also receive status flags returned by the image import API and determine the progress of data packet import through polling. For example, after the import program calls the image import API to retrieve the image data packet from the intermediate storage address, it sends status query information to the image import API at a preset frequency and receives status flags returned by the image import API. Specifically, when the image import API is called to retrieve the image data packet from the intermediate storage address, it returns a "Importing" status flag to the import program. After storing the image data packet in the target cloud environment, the image import API returns a "Import Completed" status flag to the import program. If the image import API fails to store the image data packet in the target cloud environment, it returns a "Import Failed" status flag to the import program.

[0090] Optionally, the importer can also run a status display window in the target cloud environment to show the status indicators received from the image import API, so that operations personnel or users can view the import status.

[0091] One possible implementation is, such as Figure 3 As shown, executing the import procedure includes the following steps:

[0092] 301. Calculate the MD5 value of the image file in the image data package.

[0093] 302. Determine whether the calculated MD5 value is the same as the MD5 value in the description information.

[0094] If they are the same, it means that the image data packet has not been tampered with, and step 303 is executed;

[0095] If they are different, it means that the image data package has been tampered with, and the "import failed" status indicator will be determined and displayed.

[0096] In other words, the import program can also generate an "import failed" status flag based on its own verification process, and display the flag in a timely manner when the import fails.

[0097] 303, Store the image data package to an intermediate storage device.

[0098] The intermediate storage device can be a storage container for storing objects, such as an object storage bucket.

[0099] 304, retrieve the storage address of the data packet in the intermediate storage device, and call the image import API to retrieve the image data packet from the intermediate storage address.

[0100] After obtaining the image data package, the image import API verifies and stores the image data package and returns an import status indicator to the importing program.

[0101] 305, poll and display the status indicators returned by the image import API.

[0102] Display a "Importing" status indicator during the import process;

[0103] Display a "Import Complete" status indicator when the import is successful;

[0104] Display an "Import failed" status indicator when import fails.

[0105] The method provided in this application embodiment can provide an executable read address for the image import API at storage time through an intermediate storage address, while avoiding the exposure of the real storage address of the image repository to the outside world. Furthermore, the import program also verifies the image data package before storing it at the intermediate storage address to ensure that the image data package imported by the image import API is an undisturbed data package.

[0106] In another embodiment of this application, another specific implementation of the cloud server obtaining the image data packet is provided. The cloud server can also obtain the image data packet through the user configuration of the target cloud environment, that is, the image data packet is provided by the user of the target cloud environment. For example, the specific implementation of "cloud server obtaining image data packet" mentioned above includes: obtaining the image data packet through the user configuration interface of the target cloud environment, wherein the user configuration interface is used to store the data received through the user configuration interface to an intermediate storage address.

[0107] In other words, users in the target cloud environment upload the image data package to the user configuration interface. The cloud server obtains the image data package through the user configuration interface of the target cloud environment. At the same time, the user configuration interface also stores the received image data package to an intermediate storage address.

[0108] It should be noted that the user configuration interface of the target cloud environment can also be considered the user configuration interface of the cloud server; that is, the user configuration interface is the user configuration interface of the cloud server or the target cloud environment. The user configuration interface can be an API interface or a GUI interface. When the user configuration interface is a GUI interface, the cloud server provides a configuration interface to the user, which includes multiple GUI interfaces, such as configuration items. For example, the multiple GUI interfaces include at least one of an image file configuration item and a description information configuration item. Figure 4 A data configuration interface is shown, which provides configuration items for image files and configuration items for configuring descriptive information for image files.

[0109] In one possible implementation, after the cloud server stores the image data package to an intermediate storage address through the user configuration interface, it calls the image import API to retrieve the image data package from the intermediate storage address.

[0110] For example, a user in the target cloud environment uploads the image data package to the user configuration interface. The cloud server obtains the image data package through the user configuration interface of the target cloud environment. The user in the target cloud environment triggers a call to the image import API by clicking the "Save" button in the configuration interface.

[0111] The method proposed in this application enables the cloud server to obtain image data packets through the user configuration interface of the target cloud environment, so that image data packets that can provide image files and image description information can be stored in the target cloud environment, reducing the configuration difficulty of image data packets and increasing the possibility of image storage for users in the target cloud environment.

[0112] In another embodiment of this application, a specific implementation method for verifying image files using the image import API is also provided. For example, the specific implementation of "calling the image import API to verify the image file" mentioned above includes: determining a second verification field corresponding to the image file according to a preset encryption strategy based on a first verification field contained in the image file, and verifying the image file based on the second verification field and the verification information in the description information.

[0113] It should be noted that the first verification field can be the part of the image file that needs to be verified, it can be a part of the image file, or it can be all the fields, such as the complete image file.

[0114] In one possible implementation, the second verification field is obtained by encrypting or decrypting the first verification field. For example, it can be obtained by performing an encryption calculation using an encryption algorithm, or by performing a decryption calculation using a reverse decryption algorithm. For instance, it can be obtained by performing an MD5 encryption calculation on the first verification field to obtain the second verification field. In other words, the image file is subjected to an MD5 encryption calculation to obtain the second verification field used for verification.

[0115] In one possible implementation, if the second verification field and the verification information are consistent, and the image file matches the operating requirements of the target cloud environment, then the image file is determined to have passed the verification.

[0116] In other words, the calculated second verification field is compared with the verification information. If the second verification field and the verification information are consistent, it means that the image file has not been tampered with and can be stored for subsequent verification and storage. If the second verification field and the verification information are inconsistent, it means that the image file has been tampered with and cannot be stored, and the import is confirmed to have failed.

[0117] When the second verification field and the verification information match, the image import API further determines whether the image file meets the operational requirements of the target cloud environment. For example, whether the computing power required by the image file matches the computing power provided by the target cloud environment. For instance, if the MD5 value calculated by the image import API for the image file is the same as the MD5 value recorded in the description information, the image import API calculates the computing power required for the deployment of the image file. If the computing power required by the image file is less than or equal to the computing power control limit of the target cloud environment, the image file passes verification and can be stored. If the computing power required by the image file is greater than the computing power control limit of the target cloud environment, the image file fails verification, and the import fails.

[0118] In one possible implementation, after the image file passes verification, the image import API further initializes and installs the image file to obtain a layered image file, which is then stored so that users in the target cloud environment can download and use the image file, and provides a basis for users in the target cloud environment to customize and improve the image file.

[0119] One possible implementation is, such as Figure 5 As shown, the cloud server calls the image import API to perform the following steps:

[0120] 501, Get the intermediate storage address of the storage image data package.

[0121] When the image data package is generated by the image generation platform, the image import API can obtain the intermediate storage address of the image data package through the import program; when the image data package is not generated by the image generation platform, the image import API can obtain the intermediate storage address of the image data package through the cloud server.

[0122] 502, retrieve image data packet from intermediate storage address.

[0123] In other words, the image import API is called to download the image file from the object storage bucket.

[0124] 503, Calculate the MD5 value corresponding to the image file based on the image file.

[0125] 504, check if the MD5 value of the image file matches the MD5 value in the description information.

[0126] If they match, proceed to step 505 to continue the verification.

[0127] If there is no discrepancy, the import has failed.

[0128] 505, calculates the computing power required to deploy the image file.

[0129] 506. Determine whether the computing power required for the image file is less than or equal to the computing power control limit of the target cloud environment.

[0130] If the computing power required by the image file is less than or equal to the computing power control limit of the target cloud environment, proceed to step 507; if the computing power required by the image file is greater than the computing power control limit of the target cloud environment, confirm that the import has failed.

[0131] 507, Check if the image file contains an initialization installation file.

[0132] If an initialization installation file is included, proceed to step 408; otherwise, confirm that the import failed.

[0133] 508. Initialize the installation of the image file to obtain a layered image file.

[0134] 509. Store the layered image files in the image storage repository and store the image file description information in the MySQL database.

[0135] The method proposed in this application, when automatically importing image files using the image import API, performs tamper verification and computing power verification through the image import API, which can effectively ensure that the stored image file is an untampered image file and can be deployed and run in the target cloud environment.

[0136] In another embodiment of this application, the image import API can also employ different storage strategies based on the type of the image file. For example, the specific implementation of "calling the image import API to store image files and description information in the target cloud environment" mentioned above includes: comparing the description information with historical description information in the storage address mapping information, where the storage mapping information records the correspondence between image description information and image file storage addresses; if the image identifier of the description information is the same as that of the historical description information, then the image file is written to the storage space corresponding to the historical description information; if the image identifier of the description information is different from that of the historical description information, then a storage space corresponding to the description information is created, and the image file is written to the storage space corresponding to the description information.

[0137] It should be noted that the storage address mapping information can be stored in a database table in the form of a mapping table. The database table can be a relational database table, and the relational database can be a MySQL database.

[0138] The image identifier can be a unique identifier for the image file, such as the image file's ID or name.

[0139] In one possible implementation, the storage address mapping information can store multiple historical descriptions, meaning that multiple image files are already stored in the target cloud environment. In this case, it's determined whether the description information of the image file to be imported has the same image identifier as the multiple historical descriptions in the storage address mapping information. If the image identifier in the historical descriptions is the same as the image identifier in the description information of the image file to be imported, then the image file to be imported is considered an upgrade file; that is, compared to the image file corresponding to the historical descriptions, only the image file has been upgraded and improved. In this case, the image file to be imported can be directly written to the storage space corresponding to the historical descriptions, thus upgrading the image file. If the image identifiers in the historical descriptions are all different from the image identifiers in the description information of the image file to be imported, then the image file to be imported is considered a completely new image file. In this case, a storage space corresponding to the description information is created in the storage mapping information table, and the image file is written to the storage space corresponding to the description information, thus storing the new image file.

[0140] In one possible implementation, if the mirror identifier of the description information and the historical information is the same, the historical description information is updated based on the description information.

[0141] The methods for updating historical description information may include overwriting historical descriptions with description information, or modifying description items in historical description information that are inconsistent with the description information to be the same as the description information.

[0142] For example, when the image file is only being upgraded, the image OS category, image architecture, and image version remain unchanged; only the MD5 value of the image file changes with the upgrade. In this case, only the MD5 value in the historical description information needs to be modified. Specifically, the MD5 value can be updated directly, or each item in the description information can be compared with the historical description information. If any item in the description information differs from the historical description information, the historical description information can be modified according to the description information.

[0143] In one possible implementation, if the mirror identifier of the description information is different from that of the historical description information, the description information and its corresponding storage space are written into the storage address mapping information.

[0144] In other words, when the image identifier in the description information is different from that in the historical description information, the image file to be imported is considered to be a completely new image file. At this time, the description information is written into the storage address mapping information, and a mapping relationship between the description information and the corresponding storage space is established.

[0145] The method proposed in this application, by comparing the image identifier in historical description information with the image identifier in the description information of the image file to be imported, can effectively determine whether the image file is an upgrade file, and provides different storage strategies based on whether the image file is an upgrade file, making the automatic import of image files by the image import API more reliable. The image import API enables automatic storage of image files and their description information, eliminating the need for manual uploading by operations and maintenance personnel, effectively improving the automation level of cloud servers, and significantly reducing the error rate caused by manual intervention.

[0146] This application embodiment also provides an image generation method, the execution subject of which can be the image server 102 mentioned above, such as... Figure 6 As shown, the method includes the following steps:

[0147] 601. Obtain the image file to be written to the target cloud environment and the image file description information through the image generation platform.

[0148] An image file is a single file created by combining a specific set of files according to a certain format, making it convenient for users to download and use. Examples include an operating system or a game. For instance, once a game image file is run on a cloud server, it provides the complete content of the corresponding game. The image file's descriptive information records its attributes and characteristics, typically stored as image metadata in JSON format. For example, the image file's descriptive information includes the image's OS (Operating System) category, image architecture, image version, image identifier, and image MD5 value.

[0149] In one possible implementation, the image file and description information are obtained through the user configuration interface of the image generation platform.

[0150] It should be noted that the user configuration interface of the image generation platform can be either an API interface or a GUI interface. When the user configuration interface is a GUI interface, the image generation platform includes multiple GUI interfaces, such as configuration items. For example, the multiple GUI interfaces include at least one of the following: image file configuration items and description information configuration items.

[0151] In one possible implementation, before the image server obtains the image files to be written to the target cloud environment and their descriptions from the image generation platform, the image file provider registers with the image generation platform and builds an image file repository, storing the image files used to generate image data packages and their descriptions in the repository. The image server then retrieves the image files to be written to the target cloud environment and their descriptions from the image file repository through the image generation platform.

[0152] In one possible implementation, the image file and its description information in the image data package can be the original image file and description information provided by the image provider. That is, the original image file and description information provided by the image provider are packaged together to generate the image data package, which is then obtained by the cloud server. Thus, the image data package obtained by the cloud server contains the image file and its description information required for the image to be imported.

[0153] In one possible implementation, the image file and its description in the image data package can be a compiled image file and its description suitable for running in the target cloud environment, obtained after acquiring the original image file and description information provided by the image provider, and then tailored to the target cloud environment deployed on the cloud server. Therefore, the image data package obtained by the cloud server is more suitable for running in the target cloud environment and better meets the customized needs of users in the target cloud environment.

[0154] 602. Obtain the configuration information of the image import API, generate the image import program based on the configuration information of the image import API, and use the image import program to call the image import API to write the image file in the target cloud environment.

[0155] The API (Application Programming Interface) contains predefined functions or routines. When an API has predefined routines, calling the API will automatically execute the routines to implement the corresponding interface functionality. In this embodiment, the API is predefined to have a routine for writing image files. For example, when the image import API is called, it executes the predefined routine for writing image files to achieve automatic writing of the image file.

[0156] It should be understood that, in order to further improve the security of the target cloud environment, the cloud server is also equipped with an intermediate storage device. The import program also needs to store the image file and its description information in the intermediate storage device to provide the image import API with an executable read address when storing, while avoiding disclosing the real storage address of the image repository to the outside world.

[0157] In one possible implementation, the intermediate storage address corresponding to the target cloud environment is obtained; an image import program is generated based on the configuration information of the image import API and the intermediate storage address. The image import program is used to write the image data package to the intermediate storage address and to call the image import API to obtain the image data package from the intermediate storage address.

[0158] In other words, the interface address of the image import API and the access address of the intermediate storage device can be configured in the import program so that when the import program is executed, it can store the image data package to the intermediate storage device according to the configured access address and call the image import API according to the interface address of the image import API.

[0159] For example, after the cloud server obtains the image data package from the image generation platform, it executes the import program in the image data package to store the image data package in the intermediate storage device. Then, it obtains the intermediate storage address of the image data package in the intermediate storage device, sends the intermediate storage address of the data package in the intermediate storage device to the image import API, calls the image import API to retrieve the image data package from the intermediate storage address, and then calls the image import API to verify and store the image data package.

[0160] It should be understood that in this implementation, the import environment information of the image data package is configured in the import program by configuring the access address of the intermediate storage device provided by the cloud server and the interface address of the image import API. In other words, the access address of the intermediate storage device and the interface address of the image import API configured in the import program are related to the target cloud environment to be imported. When the execution of the import program fails to store the image data package in the intermediate storage device or call the image import API based on the access address of the intermediate storage device and the interface address of the image import API configured in the import program, it is determined that the target cloud environment is not the target environment for importing the image data package.

[0161] 603, Generates an image data package based on the image importer, image file, and description information.

[0162] In one possible implementation, before generating the image data package based on the image importer, the image file, and the description information, the image file needs to be verified to ensure that the image file used to generate the image data package is an authentic image file. Verification can be performed using an encryption algorithm, such as MD5. MD5 (MD5 Message-Digest Algorithm) is a one-way encryption function that accepts a message of arbitrary length as input and returns a fixed-length digest value as output, used to verify the original message.

[0163] In this embodiment of the application, based on the third verification field contained in the image file, the fourth verification field corresponding to the image file is determined according to a preset encryption strategy. The image file is verified based on the fourth verification field and the verification information in the description information. If the fourth verification field and the verification information are consistent, the image file is determined to have passed the verification.

[0164] It should be noted that the third verification field can be a part of the image file that needs to be verified, it can be a part of the image file, or it can be all the fields, such as the complete image file.

[0165] In one possible implementation, the fourth verification field is obtained by encrypting or decrypting the third verification field. For example, it can be obtained by performing an encryption calculation using an encryption algorithm, or by performing a decryption calculation using a reverse decryption algorithm. For instance, it can be obtained by performing an MD5 encryption calculation on the third verification field to obtain the fourth verification field. In other words, the image file is subjected to an MD5 encryption calculation to obtain the fourth verification field used for verification.

[0166] For example, the calculated second verification field is compared with the verification information. If the second verification field and the verification information are consistent, it means that the image file has not been tampered with and data packaging can be performed. If the second verification field and the verification information are inconsistent, it means that the image file has been tampered with and data packaging cannot be performed.

[0167] In one possible implementation, after verifying that the image file can be packaged, the image file and its description are packaged into an image file package, and then the image file package and the importing program are packaged together to obtain the final image data package.

[0168] As a specific example, such as Figure 7 As shown, the process of generating the image data package includes:

[0169] 701, retrieve the image file to be written to the target cloud environment and the image file's description information.

[0170] This involves obtaining the target cloud environment image file to be written and its description information from the image generation platform. The image file and its description information can be uploaded to the image generation platform by the image vendor.

[0171] 702, determines whether the image file has been tampered with.

[0172] If the data has been tampered with, the packaging process ends; otherwise, proceed to step 703.

[0173] 703, Generate an image file package based on the image file and its description information.

[0174] 704, retrieve the source code of the import program.

[0175] 705, retrieves the API address and intermediate storage address for importing the target cloud environment's image.

[0176] 706. Based on the interface address and intermediate storage address of the image import API, the source code of the import program is compiled to obtain the import program for the target cloud environment.

[0177] 707. Based on the image file package and import program, construct the image material package.

[0178] The image generation method of this application embodiment obtains the image file to be written to the target cloud environment and the image file's description information through an image generation platform. Then, it obtains the configuration information of the image import API and generates an image import program for the image data package based on the image import API configuration information. This allows for the generation of the image data package based on the image import program, the image file, and the image file's description information, effectively providing an automated method for generating image data packages and reducing the cost and error rate of manual intervention. Furthermore, when the image data package generated using this method is executed by the cloud server, the image import program can automatically store the image file and its description information by calling the image import API, eliminating the need for manual uploading by operations and maintenance personnel. This effectively improves the automation level of the cloud server and significantly reduces the error rate caused by manual intervention.

[0179] This application also provides a mirror storage method, which is suitable for... Figure 1 The system shown involves the processes of image generation, image storage, and image retrieval. For example... Figure 8 As shown, it specifically includes:

[0180] The image server obtains the image file to be written to the target cloud environment and the image file description information through the image generation platform.

[0181] It should be noted that before the image server obtains the image files to be written to the target cloud environment and their descriptions from the image generation platform, the image file provider registers with the image generation platform and builds an image file repository, storing the image files used to generate image data packages and their descriptions in the repository. The image server then pulls the image files to be written to the target cloud environment and their descriptions from the image file repository through the image generation platform.

[0182] The image server generates an image file package based on the image file and its description information, and then generates an image import program based on the image import API configuration information and intermediate storage address. Finally, the image server generates an image data package based on the image import program and the image file package.

[0183] The configuration information for the image import API and the intermediate storage address are the image import API and intermediate storage address provided by the cloud server for the target cloud environment.

[0184] The cloud server obtains the image data package and executes the import program to store the image data package in an intermediate storage address.

[0185] The intermediate storage address is the object storage bucket provided by the cloud server for the target cloud environment.

[0186] The image import API is called to retrieve the image data package from the intermediate storage address. Specifically, the import program sends the intermediate storage address to the image import API when calling it.

[0187] Then, the image import API verifies the image file, and after successful verification, it calls the image API to store the image file and description information in the target cloud environment.

[0188] When users need to build virtual machines using image files, they access the target cloud environment through its interactive interface, select the image file to be used through the scheduling layer, determine the storage address of the image file through storage mapping information, download the image file from the image storage address using the host machine, and then run the image file to generate the corresponding virtual machine.

[0189] This application also provides a mirror storage method. This method is applicable to... Figure 1 The system shown. (As shown) Figure 9 As shown, the method includes the following steps:

[0190] 901, The second terminal displays the image generation platform provided by the image server and the user configuration interface of the image generation platform.

[0191] 902. The second terminal receives the image file uploaded by the user of the image generation platform and the image file description information through the user configuration interface.

[0192] The users of the image generation platform are the manufacturers that provide the image files. The manufacturers that provide the image files can register an account on the image generation platform, create an image storage repository, and then upload the image files and their description information to the image generation platform through the configuration interface.

[0193] 903. The image generation platform uploads the image file and its description information to the image server.

[0194] 904, the mirror server checks whether the image file has been tampered with.

[0195] If the image file has not been tampered with, proceed to step 905; if the image file has been tampered with, the process ends.

[0196] The mirror server calculates the MD5 value of the image file and then compares the calculated MD5 value with the MD5 value in the image file's description information. If they are the same, it is determined that the image file has not been tampered with; if they are different, it is determined that the image file has been tampered with.

[0197] 905, The image server generates an image file package based on the image file and its description information.

[0198] 906, Obtain the source code of the import program from the mirror server.

[0199] 907, The image server obtains the interface address and intermediate storage address of the image import API for the target cloud environment.

[0200] 908. The image server compiles the importer source code based on the interface address and intermediate storage address of the image import API to obtain the importer program.

[0201] 909. The mirror server generates a mirror data package based on the image file package and the import program.

[0202] 910, the image server uploads the image data package to the cloud server.

[0203] The image server can send image data packets to the cloud server via data communication, or copy the image data packets offline to the cloud server to improve the security of the cloud server.

[0204] 911, the cloud server executes the import program in the image data package to determine whether the image file in the image data package has been tampered with.

[0205] If the code has not been tampered with, proceed to step 912; if it has been tampered with, end the process.

[0206] The cloud server executes an import program to calculate the MD5 value of the image file in the image data package. Then, it compares the calculated MD5 value with the MD5 value in the description information of the image file. If they are the same, it is determined that the image file has not been tampered with; if they are different, it is determined that the image file has been tampered with.

[0207] 912, the cloud server executes the import program, which stores the image data package to an intermediate storage address.

[0208] The image data package uploaded to the intermediate storage address can be a complete image data package (including the image file, its description information, and the import program), an image file package (including the image file and its description information) within the image data package, or simply an image file in compressed form.

[0209] 913, the cloud server executes the import program in the image data package, and calls the image import API to obtain the image data package from the intermediate storage address.

[0210] 914, the cloud server calls the image import API to determine whether the image data package has been tampered with.

[0211] If the code has not been tampered with, proceed to step 915; if it has been tampered with, end the process.

[0212] The cloud server calls the image import API to calculate the MD5 value of the image file in the image data package. Then, it compares the calculated MD5 value with the MD5 value in the description information of the image file. If they are the same, it is determined that the image file has not been tampered with; if they are different, it is determined that the image file has been tampered with.

[0213] 915, the cloud server calls the image import API to determine whether the image file meets the operating requirements of the target cloud environment.

[0214] If the image file meets the operating requirements of the target cloud environment, proceed to step 916; otherwise, the process ends.

[0215] 916, the cloud server calls the image import API to determine whether the image file contains initialization installation files.

[0216] If an initialization installation file is provided, proceed to step 917; otherwise, the process ends.

[0217] 917, the cloud server calls the image import API to initialize and install the image file, resulting in a layered image file.

[0218] 918, the cloud server calls the image import API to store the layered image files to the image storage repository, and stores the image file description information to the MySQL database.

[0219] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the training rule determination method described in this application. For example, it can execute... Figures 2-5 Each step of any of the methods shown.

[0220] This application provides a computer program product containing instructions that are implemented by a processor at runtime. Figures 2-5 Each step of any of the methods shown.

[0221] It should be noted that although the operation of the method of the present invention is described in a specific order in the accompanying drawings, this does not require or imply that the operations must be performed in that specific order, or that all the operations shown must be performed in order to achieve the desired result.

[0222] Figure 10 This is a block diagram of a mirror storage device according to an embodiment of this application. The mirror storage device can be deployed on a cloud server. (Reference) Figure 10 The image storage device includes an acquisition module 11 and a calling module 12.

[0223] The acquisition module 11 is used to acquire the image data package, which includes the image file and the description information of the image file;

[0224] Module 12 is used to call the image import API to verify the image file, and after the verification is successful, call the image import API to store the image file and the description information in the target cloud environment, wherein the target cloud environment is a cloud environment deployed based on the cloud server.

[0225] In one embodiment, the acquisition module 11 is specifically used to acquire the image data package from the image generation platform, the image data package further including an import program, the import program being configured with the image import API.

[0226] In one embodiment, the calling module 12 is specifically used to execute the import program and store the image data package to an intermediate storage address;

[0227] The image import API is invoked to retrieve the image data package from the intermediate storage address.

[0228] In one embodiment, the acquisition module 11 is specifically used to acquire the image data packet through the user configuration interface of the target cloud environment, wherein the user configuration interface is used to store the data received through the user configuration interface to an intermediate storage address.

[0229] In one embodiment, the user configuration interface includes at least one of an image file configuration item and a description information configuration item.

[0230] In one embodiment, module 12 is specifically used to call the image import API to obtain the image data package from the intermediate storage address.

[0231] In one embodiment, the calling module 12 is specifically used to determine the second verification field based on the first verification field of the image file;

[0232] The image file is verified based on the second verification field and the verification information in the description information.

[0233] In one embodiment, the calling module 12 is specifically used to determine that the image file passes the verification if the second verification field and the verification information are consistent, and the image file matches the operating requirements of the target cloud environment.

[0234] In one embodiment, the calling module 12 is specifically used to compare the historical description information in the description information with the storage address mapping information; the storage mapping information is used to record the correspondence between the image description information and the image file storage address;

[0235] If the description information is the same as the mirror identifier of the historical description information, then the mirror file is written into the storage space corresponding to the historical description information;

[0236] If the description information is different from the mirror identifier of the historical description information, then a storage space corresponding to the description information is created, and the mirror file is written into the storage space corresponding to the description information.

[0237] In one embodiment, the calling module 12 is specifically used to update the historical description information according to the description information when the description information is the same as the mirror identifier of the historical description information.

[0238] In this embodiment, after the cloud server obtains the image data, it can verify the image file in the image data package by calling the image import API to ensure the reliability of the image file to be imported. After the verification is passed, the image import API is called to store the image file and description information in the target cloud environment. Thus, the image import API can realize the automatic storage of the image file and the image file description information without the need for manual intervention by operation and maintenance personnel to upload, which effectively improves the automation level of the cloud server and effectively reduces the error rate caused by manual intervention.

[0239] Figure 11 This is a block diagram of an image generation apparatus according to an embodiment of this application. The image generation apparatus can be deployed on an image server. (Reference) Figure 11 The image generation device includes a first acquisition module 21, a second acquisition module 22, and a generation module 23.

[0240] The first acquisition module 21 is used to acquire the image file to be written to the target cloud environment and the description information of the image file through the image generation platform;

[0241] The second acquisition module 22 is used to acquire the configuration information of the image import API, and generate an image import program for the image data package based on the configuration information of the image import API; the image import program is used to call the image import API to write the image file in the target cloud environment;

[0242] The generation module 23 is used to generate an image data package based on the image import program, the image file, and the description information.

[0243] In one embodiment, the first acquisition module 21 is specifically used to acquire the image file and the description information through the user configuration interface of the image generation platform.

[0244] In one embodiment, the user configuration interface of the image generation platform includes at least one of image file configuration items and image metadata configuration items.

[0245] In one embodiment, the second acquisition module 22 is specifically used to generate the image import program based on the configuration information of the image import API and the intermediate storage address, and the image import program is used to write the image data package to the intermediate storage address.

[0246] In one embodiment, the second acquisition module 22 is further configured to determine a fourth verification field based on the third verification field of the image file;

[0247] The image file is verified based on the fourth verification field and the verification information in the description information.

[0248] In this embodiment, an image file to be written to the target cloud environment and its description information are obtained through an image generation platform. Then, the configuration information of the image import API is obtained, and an image import program for the image data package is generated based on the image import API configuration information. This allows for the generation of image data packages based on the image import program, the image file, and its description information, effectively providing an automated method for generating image data packages and reducing the cost and error rate of manual intervention. Furthermore, when the image data package generated using this method is executed by the cloud server, the image import program can automatically store the image file and its description information by calling the image import API, eliminating the need for manual uploading by operations and maintenance personnel. This effectively improves the automation level of the cloud server and significantly reduces the error rate caused by manual intervention.

[0249] The following is for reference. Figure 12 , Figure 12 A schematic diagram of the structure of a computer system suitable for implementing the embodiments of this application is shown.

[0250] like Figure 12 As shown, the computer system includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1202 or programs loaded from storage section 1208 into random access memory (RAM) 1203. RAM 1203 also stores various programs and data required for the system's operating instructions. CPU 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. Input / output (I / O) interface 1205 is also connected to bus 1204.

[0251] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to I / O interface 1205 as needed. Removable media 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1210 as needed so that computer programs read from them can be installed into storage section 1208 as needed.

[0252] Specifically, according to embodiments of this application, the flowchart above refers to... Figure 2 The described process can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program contains program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 1209, and / or installed from removable medium 1211. When the computer program is executed by central processing unit (CPU) 1201, it performs the functions defined in the system of this application.

[0253] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0254] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operational instructions of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two connected blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified functions or operational instructions, or using a combination of dedicated hardware and computer instructions.

[0255] The units or modules described in the embodiments of this application can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, a processor can be described as including an acquisition module and a calling module. The names of these units or modules do not necessarily limit the unit or module itself; for example, an acquisition module can also be described as "acquiring an image data package, the image data package including an image file and descriptive information of the image file."

[0256] In another aspect, this application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments, or may exist independently and not assembled into the electronic device. The aforementioned computer-readable storage medium stores one or more programs that, when used by one or more processors, execute the image storage method and image generation method described in this application.

[0257] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A method for generating an image, characterized in that, include: The image file to be written to the target cloud environment and the description information of the image file are obtained through the image generation platform. Obtain the configuration information of the image import API, and generate an image import program that generates an image data package based on the configuration information of the image import API; The image import program is used to call the image import API to write the image file in the target cloud environment; The configuration information for the image import API includes the API call address; An image data package is generated based on the image import program, the image file, and the description information.

2. The method according to claim 1, characterized in that, The step of obtaining the image file to be written to the target cloud environment and the description information of the image file through the image generation platform includes: The image file and the description information are obtained through the user configuration interface of the image generation platform, wherein the user configuration interface of the image generation platform includes at least one of the image file configuration items and the image metadata configuration items.

3. The method according to claim 1 or 2, characterized in that, The image import program that generates the image data package based on the configuration information of the image import API includes: Obtain the intermediate storage address corresponding to the target cloud environment; The image import program is generated based on the configuration information of the image import API and the intermediate storage address. The image import program is used to write the image data package to the intermediate storage address and to call the image import API to retrieve the image data package from the intermediate storage address.

4. The method according to claim 1, characterized in that, The method further includes: Based on the third verification field contained in the image file, the fourth verification field corresponding to the image file is determined according to a preset encryption strategy; The image file is verified based on the fourth verification field and the verification information in the description information; If the fourth verification field matches the verification information, the image file verification is deemed successful.

5. A mirror storage method, characterized in that, include: The cloud server obtains an image data package, which includes an image file and a description of the image file. The cloud server is used to deploy the target cloud environment; The image file is verified by calling the image import API, and after the verification is successful, the description information is compared with the historical description information in the storage address mapping information; the storage address mapping information is used to record the correspondence between the image description information and the storage address of the image file; If the description information is the same as the mirror identifier of the historical description information, then the mirror file is written into the storage space corresponding to the historical description information; If the description information is different from the mirror identifier of the historical description information, then a storage space corresponding to the description information is created, and the mirror file is written into the storage space corresponding to the description information.

6. The method according to claim 5, characterized in that, The method further includes: If the description information is the same as the mirror identifier of the historical description information, the historical description information is updated according to the description information; If the description information is different from the mirror identifier of the historical description information, the description information and its corresponding storage space are written into the storage address mapping information.

7. The method according to claim 5, characterized in that, The cloud server obtains the image data package, including: The image data package is obtained from the image generation platform via offline copying, or the image data package is received from the image generation platform; the image data package also includes an import program configured with the image import API.

8. The method according to claim 7, characterized in that, The import program is also configured with an intermediate storage address. Before calling the image API to verify the image file, the method further includes: The import procedure is executed to store the image data package to the intermediate storage address; The image import API is invoked to retrieve the image data package from the intermediate storage address.

9. The method according to claim 5, characterized in that, The cloud server obtains the image data package, including: The image data packet is obtained through the user configuration interface of the target cloud environment. The user configuration interface is used to store the data received through the user configuration interface to an intermediate storage address. The user configuration interface includes at least one of the image file configuration item and the description information configuration item.

10. The method according to claim 9, characterized in that, Before calling the image import API to verify the image file, the method further includes: The image import API is invoked to retrieve the image data package from the intermediate storage address.

11. The method according to any one of claims 5-10, characterized in that, The step of calling the image import API to verify the image file includes: Based on the first verification field contained in the image file, the second verification field corresponding to the image file is determined according to a preset encryption strategy; The image file is verified based on the second verification field and the verification information in the description information; If the second verification field and the verification information are consistent, and the image file matches the operating requirements of the target cloud environment, then the image file is determined to have passed the verification.

12. A mirrored storage system, characterized in that, This includes cloud servers and image servers, wherein the cloud servers are used to deploy the target cloud environment. The image server is used to obtain the image file to be written to the target cloud environment and the description information of the image file through the image generation platform; Obtain the configuration information of the image import API, and generate an image import program that generates an image data package based on the configuration information of the image import API; The image import program is used to call the image import API to write the image file in the target cloud environment; An image data package is generated based on the image import program, the image file, and the description information; The configuration information for the image import API includes the API call address; The cloud server is used to obtain an image data package, the image data package including an image file and description information of the image file; The image file is verified by calling the image import API, and after the verification is successful, the image import API is called to store the image file and the description information in the target cloud environment.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the image storage method as described in any one of claims 5-11, or the image generation method as described in any one of claims 1-4.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the image storage method as described in any one of claims 5-11, or the image generation method as described in any one of claims 1-4.

15. A computer product, wherein the computer program product includes instructions, characterized in that, The instructions are executed by the processor to implement the image storage method as described in any one of claims 5-11, or the image generation method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Method, devices and system for obtaining mirror image in cloud environment

    CN106487850A

  • Method for uploading local mirror image to multi-region private mirror image warehouse

    CN111294410A