Mirror distribution method, electronic device, and storage medium
By identifying and distributing the data storage locations of each layer of the image file during the image distribution process, the problems of low image distribution efficiency and poor stability are solved, and efficient and stable image file transmission is achieved.
Patent Information
- Application Number
- CN202010618603.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-30
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2040-06-30
AI Technical Summary
Current image distribution technologies are inefficient and unstable, especially prone to file conflicts when distributing multiple image files.
By identifying the storage location of each layer of data in the source image repository, the data of each layer is directly distributed to the target image repository, avoiding the need to pull the complete image file to the local machine, thus ensuring the efficiency and stability of the image distribution process.
It significantly improves the efficiency of image distribution, reduces network bandwidth consumption, avoids file conflicts, and enhances the stability of the distribution process.
Smart Images

Figure CN113872999B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of communications, and in particular to a mirror image distribution method, a server and a storage medium. BACKGROUND
[0002] With the rapid development of IT technology, due to the characteristics of convenience, simplicity, low cost and high security, virtualization technology is applied in a wider and wider range in the field of computers. Among them, the mirror image warehouse is an important network element in the virtualization technology, and its role is to store various mirror image files (Image) of users. The mirror image is stored in layers in the mirror image warehouse, and different mirror images are identified through different reference relationships (links). That is, a mirror image is not stored as a file, but as a series of layers and links in the mirror image warehouse. This is a special file structure that can share data in each layer and reduce storage space.
[0003] In the use process of the mirror image, users often need to distribute mirror images between multiple mirror image warehouses. In the prior art, a kind of open source application container engine, namely docker system, is often used to complete mirror image distribution: first, a mirror image file is pulled from a source mirror image warehouse, the mirror image is tagged, and then the mirror image file is pushed to the target mirror image warehouse corresponding to the new tag. Since this method is used to distribute mirror images, the complete mirror image file needs to be pulled to the local, so the network bandwidth is occupied, and the distribution efficiency is low. In addition, since the mirror image file often needs to be stored in the local for a certain period of time, when multiple distribution tasks correspond to the same mirror image file, the mirror image file is prone to conflict. SUMMARY
[0004] Embodiments of the present application aim to provide a mirror image distribution method, a server and a storage medium, which improve the efficiency and stability of the mirror image distribution process through a new mirror image distribution method.
[0005] To solve the above technical problems, embodiments of the present application provide a mirror image distribution method, comprising: obtaining a distribution request of a mirror image file; identifying a storage location of the mirror image file from a source mirror image warehouse of the mirror image file; and distributing the mirror image file to a target mirror image warehouse according to the storage location of the mirror image file.
[0006] Embodiments of the present application also provide a server, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above-mentioned application distribution method.
[0007] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the application distribution method.
[0008] Compared with the prior art, the embodiment of the present application acquires a distribution request of the mirror image file, identifies first storage positions of each layer data of the mirror image file in a source mirror image warehouse, and distributes each layer data of the mirror image file from the source mirror image warehouse to a target mirror image warehouse according to the first storage positions. When mirror image distribution is needed, the mirror image distribution is performed after the storage positions of each layer data of the mirror image file are identified, so that the mirror image distribution is performed without pulling the mirror image to the local and then pushing to the target mirror image warehouse, the efficiency of the mirror image distribution is significantly improved, and the file conflict caused after the mirror image file is pulled to the local is avoided, and the stability of the mirror image distribution process is improved. BRIEF DESCRIPTION OF DRAWINGS
[0009] One or more embodiments are illustrated by way of example with reference to the drawings, which are not intended to be limiting of the embodiments.
[0010] Figure 1 is a flow chart of the mirror image distribution method according to the first embodiment of the present application;
[0011] Figure 2 is a flow chart of the mirror image distribution method according to the second embodiment of the present application;
[0012] Figure 3 is a flow chart of the mirror image distribution method according to the third embodiment of the present application;
[0013] Figure 4 is a structural schematic diagram of the mirror image distribution device according to the fourth embodiment of the present application;
[0014] Figure 5 is a structural schematic diagram of the mirror image distribution device according to the fourth embodiment of the present application;
[0015] Figure 6 is a structural schematic diagram of the server according to the fifth embodiment of the present application. DETAILED DESCRIPTION
[0016] For the purposes of making the objectives, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below with reference to the drawings. However, those skilled in the art can understand that, in the embodiments of the present application, many technical details are presented in order to make the readers better understand the present application. However, the technical solutions claimed by the present application can be implemented even without these technical details and based on various changes and modifications of the following embodiments. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation modes of the present application, and the embodiments can be combined and referenced with each other on the premise of no contradiction.
[0017] The first embodiment of the present application relates to a mirror image distribution method, obtaining a distribution request of a mirror image file; identifying the first storage position of each layer data of the mirror image file in a source mirror image warehouse; and distributing each layer data of the mirror image file from the source mirror image warehouse to a target mirror image warehouse according to the first storage position. When mirror image distribution is needed, the storage position of each layer data of the mirror image file is identified and then mirror image distribution is performed, so that the mirror image is not needed to be pulled to the local and then pushed to the target mirror image warehouse, the efficiency of mirror image distribution is significantly improved, and at the same time, file conflicts that may be caused after the mirror image file is pulled to the local are avoided, and the stability of the mirror image distribution process is improved.
[0018] The implementation details of the electronic seal application method of the present embodiment will be described below. The following content is only provided for the implementation details for the convenience of understanding, and is not necessary for implementing the present solution.
[0019] The specific process of the present embodiment is shown in Figure 1 and specifically includes the following steps:
[0020] Step 101, obtaining a distribution request of a mirror image file.
[0021] Specifically, the mirror image file mentioned in the embodiment is a mirror image file requested in a distribution request, i.e., a mirror image file to be distributed. When a user needs to distribute a mirror image among multiple mirror image repositories, the user sends a distribution request of the mirror image file to the IDServer (ImageDistribute Server, mirror image distribution system server) through the DClient (ImageDistribute Client, mirror image distribution system client). The IDClient that can be used includes a Web (web client), an App (mobile terminal application program), a command line binary program, a command line script, and the like. The execution subject in the embodiment is the IDServer, which can be deployed on the same virtual node or the same virtual machine node as the IDClient, and functions to manage and control the mirror image repository. In the mirror image distribution request, at least the name of the mirror image file to be distributed or a mirror image list including the names of multiple mirror image files to be distributed, and the address of the source mirror image repository and the address of the target mirror image repository are carried.
[0022] In step 102, the first storage location of the layer data of the mirror image file in the source mirror image repository is identified.
[0023] Specifically, after receiving the distribution request of the mirror image file from the IDServer, the mirror image in the source mirror image repository is identified, i.e., the mirror image file name in the distribution request and the address of the source mirror image repository are parsed, and at the same time, the storage location of the layer data of the mirror image file to be distributed in the source mirror image repository, i.e., the first storage location, is identified from the mirror image repository in combination with the special storage structure of the mirror image in the mirror image repository. The layer data of the mirror image file, i.e., the bottom layer data, is determined by the special storage structure of the mirror image file in the mirror image repository, and the bottom layer data includes but is not limited to repositories, blobs, layers, manifests, and the like. The repositories are used to store the basic information of the mirror image, including tenants, tags, reference relationships, and the like; the blobs are used to store the actual data of each layer of the mirror image; the layers are used to store the reference relationship of the actual data layer of a certain mirror image; and the manifests are used to store the tags of a certain mirror image and the reference relationship of the actual data layer to each tag. After identifying the bottom layer data of the mirror image file in the source mirror image repository, the bottom layer data of the mirror image file is locked, i.e., the bottom layer data is saved.
[0024] In one example, the saving of the underlying data can be temporary, for example, the underlying data is written into the random access memory RAM of the server, that is, volatile memory, and the memory space occupied thereby is released after the current mirroring distribution operation is performed; in addition, the underlying data can also be persistent, for example, the underlying data is written into a database, a local disk of the server, a cloud storage space or other non-volatile memory, so that the subsequent verification process of the mirror file or other distribution operations of the mirror file do not need to identify the storage location of the mirror file again, thereby improving the efficiency of mirror file distribution.
[0025] Step 103, according to the first storage location, distributing the layer data of the mirror file from the source mirror warehouse to the target mirror warehouse.
[0026] Specifically, when the mirror file is distributed, the file data distributed to the target mirror warehouse still conforms to the specific structure of mirror storage, that is, the mirror file distributed to the target mirror warehouse maintains the same storage structure as the mirror file in the source mirror warehouse, and the underlying data is also consistent.
[0027] Therefore, the first embodiment of the present application provides a mirror distribution method, which obtains a distribution request of a mirror file, identifies a first storage location of layer data of the mirror file in a source mirror warehouse, and distributes the layer data of the mirror file from the source mirror warehouse to a target mirror warehouse according to the first storage location. When mirror distribution is needed, the storage location of the layer data of the mirror file is identified, and then the mirror distribution is performed, so that the mirror file does not need to be pulled to the local and then pushed to the target mirror warehouse, the processing efficiency of the mirror distribution system server for the distribution request is significantly improved when multiple mirror distribution request tasks are performed at the same time, and file conflicts that may be generated after the mirror file is pulled to the local are avoided, and the stability of the mirror distribution process is improved.
[0028] The second embodiment of the present application relates to a mirror distribution method, and the second embodiment is substantially the same as the first embodiment. In this embodiment, before the layer data of the mirror file is distributed from the source mirror warehouse to the target mirror warehouse, it is identified whether the target mirror warehouse does not have a mirror file identical to the mirror file to be distributed. When the identification result is yes, the layer data of the mirror file is distributed from the source mirror warehouse to the target mirror warehouse; otherwise, the mirror file distribution operation is not performed. By auditing the mirror file in the target mirror warehouse, unnecessary data transmission operations during mirror distribution are avoided.
[0029] The specific flowchart of the electronic seal application method in this embodiment is shown in Figure 2 The specific flowchart of the electronic seal application method in this embodiment is shown in
[0030] Step 201, obtaining a distribution request of a mirror file.
[0031] Step 202, identify the first storage location of each layer data of the mirror file in the source mirror repository.
[0032] Steps 201 and 202 in the embodiment are the same as steps 101 and 102 in the first embodiment of the application, and the relevant implementation details have been specifically described in the first embodiment, which will not be repeated here.
[0033] Step 203, determine whether the target mirror repository exists the same mirror file as the mirror file; if the target mirror repository does not exist the same mirror file as the mirror file, execute step 204, according to the first storage location, distribute each layer data of the mirror file from the source mirror repository to the target mirror repository; otherwise, end the mirror distribution process.
[0034] Specifically, when the target mirror repository exists the same mirror file as the mirror file to be distributed, it indicates that the mirror repository already exists the mirror file requested by the user, so there is no need to perform the mirror distribution operation, which saves the transmission resources in the virtual machine environment, reduces the bandwidth occupation, and further improves the speed of mirror distribution. When multiple mirror distribution request tasks are performed simultaneously, the processing efficiency of the mirror distribution system server for distribution requests is significantly improved.
[0035] In one example, the manner of determining that the target mirror repository does not exist the same mirror file as the mirror file is as follows:
[0036] First, search the mirror name of the mirror file to be distributed in the target mirror repository, that is, identify whether the target mirror repository exists the mirror file with the same name as the mirror file to be distributed. When the target mirror repository does not exist the mirror file with the same name as the mirror file, it is determined that the target mirror repository does not exist the same mirror file as the mirror file to be distributed, and at this time, according to the first storage location, each layer data of the mirror file is distributed from the source mirror repository to the target mirror repository.
[0037] When the target mirror repository exists the mirror file with the same name as the mirror file, it is necessary to further identify the storage location of each layer data of the mirror file with the same name as the mirror file in the target mirror repository, that is, the second storage location. Then compare each layer data stored in the second storage location with each layer data stored in the first storage location. If each layer data stored in the second storage location does not match each layer data stored in the first storage location, it is determined that the target mirror repository does not exist the same mirror file as the mirror file to be distributed, and at this time, according to the first storage location, each layer data of the mirror file is distributed from the source mirror repository to the target mirror repository. Otherwise, it is finally determined that the target mirror repository exists the same mirror file as the mirror file to be distributed, and the mirror distribution process is ended.
[0038] Further, the file features of the mirror image file are obtained from the layer data of the mirror image file, and when the file features of the mirror image file with the same name as the mirror image file to be distributed in the target mirror image warehouse are consistent with the file features of the mirror image file to be distributed, it is determined that the two are the same mirror image file. The file features compared here include but are not limited to the data quantity, size, md5 code, sha256 code, etc. of the mirror image file. When any of the file features is different, it is determined that the two are different mirror image files.
[0039] In one example, according to the first storage location, the specific operation of distributing the layer data of the mirror image file from the source mirror image warehouse to the target mirror image warehouse can be as follows: copying the layer data of the mirror image file to be distributed from the first storage location, and storing the copied layer data of the mirror image file in the second storage location in an overwriting manner. When the mirror image distribution is performed in this way, the data distributed to the target mirror image warehouse still automatically conforms to the specific structure of the mirror image storage.
[0040] Therefore, the embodiment provides a mirror image distribution method, which identifies the mirror image file with the same name as the mirror image file to be distributed in the target mirror image warehouse before mirror image distribution, and when there is an exactly same mirror image file, does not perform the mirror image distribution operation, thereby reducing the bandwidth occupied by data transmission, significantly improving the processing efficiency when multiple distribution requests are concurrent, and also avoiding the file conflict problem of the same mirror image file in the target mirror image warehouse after the distribution is completed.
[0041] In addition, those skilled in the art can understand that the step division of the above various methods is only for the purpose of clear description, and when implemented, one step can be combined or some steps can be split and decomposed into multiple steps, as long as the same logical relationship is included, all within the protection scope of the patent; adding insignificant modifications or introducing insignificant designs in the algorithm or process, but not changing the core design of the algorithm and process, are within the protection scope of the patent.
[0042] The third embodiment of the application relates to a mirror image distribution method, and the third embodiment is substantially the same as the first embodiment. In the embodiment, after the layer data of the mirror image file is distributed from the source mirror image warehouse to the target mirror image warehouse, the third storage location of the layer data of the distributed mirror image file is checked with the first storage location, and if the two match, it is identified that the mirror image distribution is successful, and the mirror image distribution process is ended; if the two do not match, it indicates that an error occurs in the mirror image file during the distribution, and then the layer data of the mirror image file is distributed from the source mirror image warehouse to the target mirror image warehouse according to the first storage location. The embodiment checks the distributed file, guarantees the accuracy of the mirror image distribution, and further improves the stability of the mirror image distribution process.
[0043] The specific flowchart of the mirror image distribution method in the embodiment is as shown in Figure 3 and specifically includes the following steps:
[0044] Step 301, obtaining a distribution request of a mirror image file.
[0045] Step 302, identifying a first storage location of each layer data of the mirror image file in a source mirror image warehouse.
[0046] Step 303, judging whether there is a mirror image file identical to the mirror image file in a target mirror image warehouse. If there is no mirror image file identical to the mirror image file in the target mirror image warehouse, step 304 is executed to distribute each layer data of the mirror image file from the source mirror image warehouse to the target mirror image warehouse according to the first storage location; otherwise, the mirror image distribution flow is ended.
[0047] Steps 301 to 304 in the embodiment are substantially the same as steps 301 to 304 in the second embodiment, and the related implementation details have been specifically described in the second embodiment, which will not be repeated here.
[0048] Step 305, verifying whether each layer data stored in a third storage location of the distributed mirror image file matches each layer data stored in the first storage location. If it is verified that each layer data stored in the third storage location does not match each layer data stored in the first storage location, the distribution flow is ended; otherwise, step 304 is re-executed to distribute each layer data of the mirror image file from the source mirror image warehouse to the target mirror image warehouse according to the first storage location.
[0049] Specifically, after the distribution of the mirror image file is completed, a third storage location of each layer data of the distributed mirror image file in the target mirror image warehouse is identified. Then, it is verified whether each layer data stored in the third storage location matches each layer data stored in the first storage location. If it is verified that each layer data stored in the third storage location does not match each layer data stored in the first storage location, step 304 is re-executed. By verifying the stored data of the distributed mirror image file, it is ensured that there is no loss or error of the data of the distributed mirror image file, and the stability of the mirror image file in the mirror image distribution process is further improved.
[0050] Further, the verification of each layer data of the mirror image file in the embodiment is similar to the verification process in the second embodiment, and it is also to compare file features of two mirror image files, such as the number of data, size, md5 code, sha256 code, etc. When there is any difference in any item of file features between the distributed mirror image file in the target mirror image warehouse and the mirror image file in the source mirror image warehouse, it indicates that the stored data of the two does not match.
[0051] In addition, the user can set an upper limit of the number of times of re-distribution of the image in the image distribution system server, when the image distribution fails multiple times, it is considered that the system may have a problem, and an error message is pushed to the administrator for checking whether there is other error in the system, so as to avoid the image distribution process from being in a loop error and wasting system resources.
[0052] In one example, when it is necessary to persistently save the storage address information of the image file, after identifying the first storage position of the layer data of the image file in the source image warehouse, and after identifying the second storage position of the layer data of the image file with the same name as the image file in the target image warehouse, the first storage position and the second storage position are written into the non-volatile memory, such as a database, a local disk of the server, a cloud storage space, etc.
[0053] Further, when step 304 is re-executed after the judgment in step 305, the saved first storage position is first obtained from the non-volatile memory. In addition to directly identifying the third storage position of the distributed image file in the target image warehouse, the previously saved second storage position can also be obtained from the non-volatile memory, and then it is verified whether the layer data stored in the first storage position is consistent with the layer data stored in the second storage position or the third storage position, so as to complete the verification process of the distributed image file. When the layer data stored in the first storage position is consistent with the layer data stored in the second storage position or the third storage position, the data distribution process is ended; otherwise, step 304 is re-executed again.
[0054] Therefore, the embodiment provides an image distribution method, after the image distribution is completed, it is verified whether the layer data of the distributed image file in the target image warehouse is consistent with the layer data of the image file in the source image warehouse, so as to ensure the accuracy of the image file distribution, and further improve the stability of the image distribution process.
[0055] The fourth embodiment of the present application provides an image distribution device, as shown in the figure, comprising: Figure 4
[0056] The receiving module 401 is used for obtaining the distribution request of the image file, and sending the image name to the control module after analyzing the image name.
[0057] The control module 402 is used for identifying the first storage position of the layer data of the image file to be distributed in the source image warehouse.
[0058] In one example, it is also used for identifying the second storage position of the layer data of the image file with the same name as the image file to be distributed in the target image warehouse.
[0059] In one example, the mirror image device is further configured to identify the third storage location of the layer data of the distributed mirror image file in the target mirror image repository.
[0060] In one example, the mirror image device is further configured to, after identifying the first storage location of the layer data of the mirror image file in the source mirror image repository, and after identifying the second storage location of the layer data of the mirror image file with the same name as the mirror image file in the target mirror image repository, write the first storage location and the second storage location into a non-volatile storage, such as a database, a local disk of the server, a cloud storage, etc.
[0061] The checking module 403 is configured to determine that the target mirror image repository does not have the mirror image file with the same name as the mirror image file according to the first storage location and the second storage location identified by the control module 402, and send the checking result to the distribution module 404.
[0062] In one example, the mirror image device is further configured to obtain the first storage location and / or the second storage location from the non-volatile storage.
[0063] In one example, the mirror image device is further configured to check whether the third storage location of the layer data of the distributed mirror image file matches the first storage location, and send the checking result to the distribution module 404.
[0064] The distribution module 404 is configured to distribute the layer data of the mirror image file from the source mirror image repository to the target mirror image repository according to the checking result sent by the checking module and the first storage location.
[0065] In a specific application, the structure and interaction relationship of the mirror image device in the embodiment are as shown in Figure 5 The receiving module 501 is connected with the client, and is configured to receive the mirror image distribution request issued by the user through the client.
[0066] The control module 502, the checking module 503, and the distribution module 504 are all simultaneously in communication connection with the source mirror image repository and the target mirror image repository.
[0067] It can be found that the embodiment is a device embodiment corresponding to the first, second, or third embodiment, and the embodiment can be implemented in cooperation with the first or second embodiment. The related technical details mentioned in the first, second, or third embodiment are still valid in the embodiment. In order to reduce repetition, they will not be described here. Correspondingly, the related technical details mentioned in the embodiment can also be applied in the first, second, or third embodiment.
[0068] It is worth mentioning that each module involved in the embodiment is a logical module, and in actual application, one logical unit can be one physical unit, or a part of one physical unit, or realized in combination of multiple physical units. In addition, in order to highlight the innovative part of the present application, units not closely related to solving the technical problems proposed by the present application are not introduced in the embodiment, but this does not mean that there are no other units in the embodiment.
[0069] The fifth embodiment of the present application relates to a server, as shown in the figure, comprising: at least one processor 601; and a memory 602 connected in communication with the at least one processor 601; wherein the memory 602 stores instructions executable by the at least one processor 601, and the instructions are executed by the at least one processor 601 to enable the at least one processor 601 to perform the electronic seal application method described above. Figure 6
[0070] The memory and the processor are connected in a bus mode, the bus can include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripheral devices, voltage stabilizers and power management circuits together, which are well known in the art, and therefore, they will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, which provide a unit for communicating with various other devices on the transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives data and transmits the data to the processor.
[0071] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management and other control functions. And the memory can be used to store the data used by the processor in the execution operation.
[0072] The fifth embodiment of the present application relates to a computer readable storage medium, which stores a computer program. The computer program is executed by the processor to realize the method embodiment described above.
[0073] That is, a person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment methods can be completed by instructing relevant hardware through a program stored in a storage medium, including a plurality of instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0074] A person of ordinary skill in the art can understand that the above-mentioned embodiments are specific embodiments for implementing the present application, and in actual applications, various changes can be made in form and details without departing from the spirit and scope of the present application.
Claims
1. A mirror distribution method, characterized by, The application is applied to a mirror distribution system server, comprising: acquiring a distribution request of a mirror file sent by a mirror distribution system client, the distribution request at least carrying a name of a mirror file to be distributed or a mirror list comprising names of multiple mirror files to be distributed, and an address of a source mirror repository and an address of a target mirror repository; identifying a first storage position of each layer data of the mirror file in the source mirror repository; copying each layer data of the mirror file from the first storage position and storing the copied each layer data of the mirror file in the target mirror repository; wherein, after the first storage position of each layer data of the mirror file in the source mirror repository is identified, further comprising: writing the first storage position into a non-volatile memory, so as to acquire the saved first storage position from the non-volatile memory when each layer data of the mirror file is distributed again from the source mirror repository to the target mirror repository.
2. The mirror distribution method according to claim 1, characterized in that, before the each layer data of the mirror file is copied from the first storage position and the copied each layer data of the mirror file is stored in the target mirror repository, further comprising: determining that the target mirror repository does not exist the same mirror file as the mirror file.
3. The mirror distribution method according to claim 2, characterized in that, the determination that the target mirror repository does not exist the same mirror file as the mirror file comprises: identifying whether the target mirror repository exists a mirror file with the same name as the mirror file; if the target mirror repository does not exist the mirror file with the same name as the mirror file, determining that the target mirror repository does not exist the same mirror file as the mirror file.
4. The mirror distribution method according to claim 3, characterized in that, the determination that the target mirror repository does not exist the same mirror file as the mirror file further comprises: if the target mirror repository exists the mirror file with the same name as the mirror file, identifying a second storage position of each layer data of the mirror file with the same name as the mirror file in the target mirror repository; if each layer data stored in the second storage position does not match each layer data stored in the first storage position, determining that the target mirror repository does not exist the mirror file.
5. The mirror distribution method according to any one of claims 1 to 3, characterized in that, after the each layer data of the mirror file is copied from the first storage position and the copied each layer data of the mirror file is stored in the target mirror repository, further comprising: identifying a third storage position of each layer data of the distributed mirror file in the target mirror repository; if it is verified that each layer data stored in the third storage position does not match each layer data stored in the first storage position, re-executing the step of copying each layer data of the mirror file from the first storage position and storing the copied each layer data of the mirror file in the target mirror repository.
6. The mirror distribution method according to claim 5, wherein, in the re-executed step of copying each layer data of the mirror file from the first storage position and storing the copied each layer data of the mirror file in the target mirror repository, the first storage position is acquired from the non-volatile memory.
7. The mirror distribution method according to claim 4, characterized by, copying the layer data of the image file from the first storage location and storing the copied layer data of the image file in the target image repository, comprising: copying the layer data of the image file from the first storage location and storing the copied layer data of the image file in the target image repository in an overwriting manner.
8. The mirror distribution method according to claim 7, characterized in that, after the identifying the second storage location of the layer data of the image file with the same name as the image file in the target image repository, further comprising: writing the second storage location into the non-volatile memory; after the copying the layer data of the image file from the first storage location and storing the copied layer data of the image file in the target image repository, further comprising: acquiring the second storage location from the non-volatile memory; if the layer data stored in the second storage location is verified to be not matched with the layer data stored in the first storage location, re-executing the copying the layer data of the image file from the first storage location and storing the copied layer data of the image file in the target image repository.
9. A server, characterized by comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the image distribution method according to any one of claims 1 to 8.
10. A computer readable storage medium storing a computer program, characterized in that, the computer program is executed by the processor to implement the image distribution method according to any one of claims 1 to 8. the computer program is executed by the processor to implement the image distribution method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Mirror image file processing method and device
CN107357691A
Mirror image distribution method, mirror image acquisition method and device
CN108667884A
Mirror image distribution method and system in virtualization environment based on P2P network
CN110740192A