WO2019134222A1 - Docker mirror image library file storage method, terminal, device and storage medium - Google Patents

Docker mirror image library file storage method, terminal, device and storage medium Download PDF

Info

Publication number
WO2019134222A1
WO2019134222A1 PCT/CN2018/077126 CN2018077126W WO2019134222A1 WO 2019134222 A1 WO2019134222 A1 WO 2019134222A1 CN 2018077126 W CN2018077126 W CN 2018077126W WO 2019134222 A1 WO2019134222 A1 WO 2019134222A1
Authority
WO
WIPO (PCT)
Prior art keywords
objects
bucket
abstracted
access instruction
buckets
Prior art date
Application number
PCT/CN2018/077126
Other languages
French (fr)
Chinese (zh)
Inventor
刘俊杰
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019134222A1 publication Critical patent/WO2019134222A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/128Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/137Hash-based
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a Docker image library file storage method, a terminal, a device, and a storage medium.
  • a traditional storage method is used to store an image file of a mirrored warehouse, such as a memory storage mode or a file system storage mode, etc., because the image file is generally large, and is stored in a memory or file system manner.
  • the migration of image files is inefficient, and the storage process consumes a large amount of storage devices, resulting in excessive storage costs for image files.
  • the embodiment of the present application provides a Docker image library file storage method, a terminal, a device, and a storage medium, which implement self-management of the image and save the storage cost of the image file.
  • the embodiment of the present application provides a Docker image library file storage method, the method includes: abstracting a plurality of image files into objects; determining objects of the same logical path, and abstracting objects in the same logical path into buckets; The abstracted bucket is allocated to a different object container; if the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
  • the embodiment of the present application provides a Docker image library file storage terminal, the terminal includes: an abstracting unit for abstracting a plurality of image files into objects; and a first determining unit, configured to determine the same logical path.
  • An object, and abstracting an object under the same logical path into a bucket an allocating unit for allocating the abstracted bucket to a different object container; and a reading unit for receiving an access instruction of the user according to the access The instruction reads the abstracted bucket from the corresponding object container and sends it to the user.
  • the embodiment of the present application further provides a Docker image library file storage device, including: a memory for storing a program for implementing a Docker image library file storage method; and a processor for running the storage in the memory
  • the embodiment of the present application further provides a computer readable storage medium, where the one or more computer programs are stored, and the one or more computer programs may be one or more
  • the processor executes to implement the steps of: abstracting a plurality of image files into objects; determining objects of the same logical path, and abstracting objects under the same logical path into buckets; and allocating the abstracted buckets into different object containers; If the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
  • the embodiment of the present application abstracts several image files into objects, determines objects of the same logical path, and abstracts objects under the same logical path into buckets; assigns the abstract buckets to different object containers; if the user is received
  • the access instruction reads the abstracted bucket from the corresponding object container according to the access instruction and sends it to the user.
  • the embodiment of the present application implements self-management of the image, and saves the storage cost of the image file.
  • FIG. 1 is a schematic flow chart of a Docker image library file storage method provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a Docker image library file storage method provided by an embodiment of the present application
  • FIG. 3 is a schematic flow chart of a Docker image library file storage method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a method for storing a Docker image library file according to another embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a Docker image library file storage method according to another embodiment of the present application.
  • FIG. 6 is a schematic block diagram of a Docker image library file storage terminal provided by an embodiment of the present application.
  • FIG. 7 is another schematic block diagram of a Docker image library file storage terminal according to an embodiment of the present application.
  • FIG. 8 is another schematic block diagram of a Docker image library file storage terminal according to an embodiment of the present application.
  • FIG. 9 is another schematic block diagram of a Docker image library file storage terminal according to an embodiment of the present application.
  • FIG. 10 is another schematic block diagram of a Docker image library file storage terminal according to an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a Docker image library file storage device according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of a method for storing a Docker image library file according to an embodiment of the present application.
  • the method can be run on terminals such as smart phones (such as Android phones, IOS phones, etc.), tablets, laptops, and smart devices.
  • the Docker image library file storage method described in the embodiment of the present invention can realize self-management of the image and save the storage cost of the image file.
  • FIG. 1 is a schematic flowchart of a Docker image library file storage method provided by an embodiment of the present application. The method includes steps S101 to S104.
  • different image files are stored in the Docker image library, wherein the Docker image library includes a location where the image file and the image file are stored.
  • the Docker image library provides a registration server, and the registration server uses the registration server.
  • each warehouse can contain multiple image files with different labels; in actual use, the default repository used in the Docker image library runtime is the Docker Hub public repository; for the image files in the Docker image library Storage, there are many ways to store the storage, for example, it can be memory storage, storage in the form of file system, and so on.
  • the embodiment of the present application uses the object storage method to store the image file, and abstracts several image files into objects, such as abstracting the image file 1 into Object1 and abstracting the image file 2.
  • the abstract process can be abstracted through the programming language, and the specific abstraction process is not limited here.
  • the tomcat image in the Docker image library can be queried to get the version of the image as 8.
  • the memory of the tomcat image in the Docker image library can be divided into three layers, that is, the image has three image files, which are respectively used as image files. , image file 2, image file 3, obtain the hash value of the three image files, and read the ID number of the hash value, find the save path of the image file by the ID number of the hash value, different image files The save path is different, and the image file is abstracted by using the different save paths corresponding to different image files as the object name.
  • step S101 includes steps S201 to S203.
  • each image file corresponds to a hash value
  • the hash value is obtained by the FileHash() function.
  • the file name corresponding to the hash value is obtained by FileName.
  • the corresponding hash value is obtained by Type_, and after the function is successfully executed, the corresponding hash value is returned. Determining a corresponding ID number according to the hash value. Since each hash value corresponds to a unique ID number or a corresponding code, after determining the hash value, the hashID function may be used to obtain a hash value corresponding to the hash value. ID field, which takes the obtained ID field as the ID number of the hash value.
  • the format of the save path found by each image file is: the image name - the image version number - the hash number corresponding to the hash value is, for example, the storage of the tomcat image in the Docker image library is divided into a total of
  • the third layer that is, the image has three image files, which are mirror file 1, image file 2, and image file 3, respectively, obtain the hash values of the three image files, and read the ID number of the hash value.
  • the ID numbers read are aaa111, bbb222, and ccc333, respectively.
  • the path to find the image file by the ID number can be /myimage/tomcat/8/aaa111, /myimage/tomcat/8/bbb222, /myimage/tomcat/ 8/ccc333.
  • the save path corresponding to each image file is abstracted as an object name, and the abstract process may be abstracted by a programming language.
  • the specific abstract process is not limited herein.
  • S102 Determine an object of the same logical path, and abstract the object under the same logical path into a bucket.
  • each image warehouse includes multiple image files, and objects that are abstracted into image files of the same mirror warehouse are referred to as objects in the same logical path, and the same logic is used.
  • the object under the path is abstracted into a bucket.
  • three objects with the same logical path can be abstracted into bucket 1, or four objects with the same logical path can be abstracted into bucket 2, etc.
  • the abstract process can be through a program.
  • the design language is abstracted, and the specific abstraction process is not limited here.
  • the abstract process can be: save it as /myimage/tomcat/8/aaa111/myimage/tomcat/8/bbb222,/
  • the three objects of myimage/tomcat/8/ccc333 belong to the same /myimage path, so abstract /myimage as a bucket name into a bucket, and /myimage/tomcat/8/aaa111, /myimage/tomcat/8 /bbb22, /myimage/tomcat/8/ccc333 is used as an object in the bucket/myimage. Since the same logical path stores the object abstracted from the image file of the same repository, abstracting the objects in the same logical path into a bucket ensures the integrity of the image file.
  • the object container may be a disk, and the number of the disks may be one or more according to storage requirements.
  • the allocation manner is randomly distributed.
  • the so-called random distributed allocation refers to randomly assigning different objects in the bucket to the disk.
  • an object can be repeatedly stored in different disks, and the object is For distributed storage on different disks, for example, assigning Object1 in Bucker1 to Disk 1, you can also assign Object1 in Bucket1 to Disk 2; Assign Object1 in Bucket2 to Disk 2, or both. Assign Object1 in Bucket2 to Disk 3; assign Object1 in Bucket3 to Disk 3, or assign Object1 in Bucket 3 to Disk 4 at the same time, and so on.
  • the disk in this embodiment belongs to a storage medium for storing files and data in the self-developed storage system, and the self-developed storage system can save the processed files/data to the disk or from the disk.
  • the saved file/data is read.
  • the mirrored warehouse belongs to the external device for the self-developed storage system.
  • the mirrored warehouse can call the interface of the storage system (the interface is the port set to the external device in the self-developed storage system), and the image is mirrored.
  • the object files in the warehouse are saved by the self-developed storage system, or the corresponding object files are read from the self-developed storage system according to the object name.
  • the object container is storage hardware in the object storage system, and the storage hardware may be a disk.
  • An object storage system may include an API Gateway, a storage system, and a disk. If an access instruction of the user is received, the access instruction is required.
  • the driver can be AWS S3, Openstack Swift, Facebook Cloud Object Storage, etc., and the disk in the object storage system is required to read the abstract bucket.
  • the specific access process is: pre-connecting the driver of the mirror warehouse with the object storage system, and sending the access instruction to the disk in the object storage system through the driver, and reading the corresponding disk in the disk
  • the bucket sends the acquired bucket to the user according to the docking relationship between the mirrored warehouse and the object storage system.
  • the user access instruction may be a logical path and an object name of the object to be read, such as Bucket1 and Object1, where Bucket1 is the logical path of the object, and Object1 is the object name, and the logical path and the object name are sent to the disk. After that, you don't need to care about which disk you need to access data from, but traverse all the disks in the object storage system to read the corresponding data.
  • step S104 includes steps S301 to S304.
  • the object storage system may be a self-developed object storage system, and the mirrored warehouse and the object storage system may be connected through a compatible API of the storage drive-storage system.
  • the mirrored warehouse accesses the instruction through the storage driver.
  • the storage system After being sent to the compatible API, the storage system only needs to read and write the relevant files normally according to the information of the access instruction, and does not need to know the specific situation of the requesting party.
  • a normal read and write operation is performed in the object container according to the access instruction to read the corresponding bucket.
  • S304 Send the acquired bucket to the user according to the docking relationship between the mirrored warehouse and the object storage system.
  • the embodiment of the present application abstracts several image files into objects, determines objects of the same logical path, and abstracts objects under the same logical path into buckets; assigns the abstract buckets to different object containers; If the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
  • the embodiment of the present application implements self-management of the image, and saves the storage cost of the image file.
  • FIG. 4 is a schematic flowchart of a method for storing a Docker image library file according to an embodiment of the present application.
  • the method can be run on terminals such as smart phones (such as Android phones, IOS phones, etc.), tablets, laptops, and smart devices.
  • the method includes steps S401 to S407.
  • different image files are stored in the Docker image library, wherein the Docker image library includes a location where the image file and the image file are stored.
  • the Docker image library provides a registration server, and the registration server uses the registration server.
  • each warehouse can contain multiple image files with different labels; in actual use, the default repository used in the Docker image library runtime is the Docker Hub public repository; for the image files in the Docker image library Storage, there are many ways to store the storage, for example, it can be memory storage, storage in the form of file system, and so on.
  • the embodiment of the present application uses the object storage method to store the image file, and abstracts several image files into objects, such as abstracting the image file 1 into Object1 and abstracting the image file 2.
  • the abstract process can be abstracted through the programming language, and the specific abstraction process is not limited here.
  • S402. Determine an object of the same logical path, and abstract the object under the same logical path into a bucket.
  • each image warehouse includes multiple image files, and objects that are abstracted into image files of the same mirror warehouse are referred to as objects in the same logical path, and the same logic is used.
  • the object under the path is abstracted into a bucket.
  • three objects with the same logical path can be abstracted into bucket 1, or four objects with the same logical path can be abstracted into bucket 2, etc.
  • the abstract process can be through a program.
  • the design language is abstracted, and the specific abstraction process is not limited here.
  • the abstract process can be: save it as /myimage/tomcat/8/aaa111/myimage/tomcat/8/bbb222,/
  • the three objects of myimage/tomcat/8/ccc333 belong to the same /myimage path, so abstract /myimage as a bucket name into a bucket, and /myimage/tomcat/8/aaa111, /myimage/tomcat/8 /bbb22, /myimage/tomcat/8/ccc333 is used as an object in the bucket/myimage. Because the same logical path stores the object abstracted from the image file of the same repository, abstracting the objects in the same logical path into a bucket ensures the integrity of the image file.
  • the objects in all the buckets are scanned and obtained by using a Structured Query Language (SQL).
  • SQL Structured Query Language
  • all the buckets are obtained by using a SELECT statement, and the WHERE statement is used to obtain The name of the object in the bucket to achieve the effect of scanning the object name.
  • the identifying the naming specification corresponding to the currently scanned object name may be to identify whether there is a numerical order rule between the object names, for example, the first object name is “xx111”, The second object name is "xx222". Since there is a rule of increasing the number of digits between "111” and "222", it is possible to recognize that there is a numerical order between the object names, thereby judging the The object names have the same naming convention.
  • the identifying the naming specification corresponding to the currently scanned object name may be to identify whether there is an alphabetic order between the object names, for example, the first object name is “aaa”, and the second object name is “ Bbb", since "a” and "b" have an alphabetical order, it is possible to recognize that there is an alphabetic order between the object names, thereby judging that the object names have the same naming convention.
  • the object container may be a disk, and the number of the disks may be one or more according to storage requirements.
  • the principle of allocating different objects in the bucket to the disk may be the same naming convention.
  • the objects are allocated to the same object container. For example, the Object1 in Bucket1 is assigned to Disk 1, and Object2 in Bucket2 of the same naming convention can also be assigned to Disk 1.
  • objects of different naming conventions can be randomly assigned to different object containers, and objects of different naming conventions can also be assigned to the same object container.
  • the object container is storage hardware in the object storage system, and the storage hardware may be a disk.
  • An object storage system may include an API Gateway, a storage system, and a disk. If an access instruction of the user is received, the access instruction is required.
  • the driver can be AWS S3, Openstack Swift, Facebook Cloud Object Storage, etc., and the disk in the object storage system is required to read the abstract bucket.
  • the specific access process is: pre-connecting the driver of the mirror warehouse with the object storage system, and sending the access instruction to the disk in the object storage system through the driver, and reading the corresponding disk in the disk
  • the bucket sends the acquired bucket to the user according to the docking relationship between the mirrored warehouse and the object storage system.
  • the user access instruction may be a logical path and an object name of the object to be read, such as Bucker1, Object1, where Bucker1 is the logical path of the object, and Object1 is the object name, and the logical path and the object name are sent to the disk. After that, you don't need to care about which disk you need to access data from, but traverse all the disks in the object storage system to read the corresponding data.
  • FIG. 5 is a schematic flowchart of a method for storing a Docker image library file according to an embodiment of the present application.
  • the method can be run on terminals such as smart phones (such as Android phones, IOS phones, etc.), tablets, laptops, and smart devices.
  • the method includes steps S501 to S505.
  • different image files are stored in the Docker image library, wherein the Docker image library includes a location where the image file and the image file are stored.
  • the Docker image library provides a registration server, and the registration server uses the registration server.
  • each warehouse can contain multiple image files with different labels; in actual use, the default repository used in the Docker image library runtime is the Docker Hub public repository; for the image files in the Docker image library Storage, there are many ways to store the storage, for example, it can be memory storage, storage in the form of file system, and so on.
  • the embodiment of the present application uses the object storage method to store the image file, and abstracts several image files into objects, such as abstracting the image file 1 into Object1 and abstracting the image file 2.
  • the abstract process can be abstracted through the programming language, and the specific abstraction process is not limited here.
  • the tomcat image in the Docker image library can be queried to get the version of the image as 8.
  • the memory of the tomcat image in the Docker image library can be divided into three layers, that is, the image has three image files, which are respectively used as image files. , image file 2, image file 3, obtain the hash value of the three image files, and read the ID number of the hash value, find the save path of the image file by the ID number of the hash value, different image files The save path is different, and the image file is abstracted by using the different save paths corresponding to different image files as the object name.
  • each image warehouse includes multiple image files, and objects that are abstracted into image files of the same mirror warehouse are referred to as objects in the same logical path, and the same logic is used.
  • the object under the path is abstracted into a bucket.
  • three objects with the same logical path can be abstracted into bucket 1, or four objects with the same logical path can be abstracted into bucket 2, etc.
  • the abstract process can be through a program.
  • the design language is abstracted, and the specific abstraction process is not limited here.
  • the abstract process can be: save it as /myimage/tomcat/8/aaa111/myimage/tomcat/8/bbb222,/
  • the three objects of myimage/tomcat/8/ccc333 belong to the same /myimage path, so abstract /myimage as a bucket name into a bucket, and /myimage/tomcat/8/aaa111, /myimage/tomcat/8 /bbb22, /myimage/tomcat/8/ccc333 is used as an object in the bucket/myimage. Because the same logical path stores the object abstracted from the image file of the same repository, abstracting the objects in the same logical path into a bucket ensures the integrity of the image file.
  • the object container may be a disk, and the number of the disks may be one or more according to storage requirements, and different disks have different storage capacities, and the storage capacity of the disks is determined in advance.
  • an abstract bucket is allocated to a disk, it can be replaced/added to other storage by judging whether the disk storage is full.
  • the objects in the bucket may be allocated and stored in a planned manner, and the preset sequence may be stored according to the size of the object, from large to small rules. It can be stored according to the rules of the date when the object is abstracted, and so on.
  • the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
  • the object container is storage hardware in the object storage system, and the storage hardware may be a disk.
  • An object storage system may include an API Gateway, a storage system, and a disk. If an access instruction of the user is received, the access instruction is required.
  • the driver can be AWS S3, Openstack Swift, Facebook Cloud Object Storage, etc., and the disk in the object storage system is required to read the abstract bucket.
  • the specific access process is: pre-connecting the driver of the mirror warehouse with the object storage system, and sending the access instruction to the disk in the object storage system through the driver, and reading the corresponding disk in the disk
  • the bucket sends the acquired bucket to the user according to the docking relationship between the mirrored warehouse and the object storage system.
  • the user access instruction may be a logical path and an object name of the object to be read, such as Bucker1, Object1, where Bucker1 is the logical path of the object, and Object1 is the object name, and the logical path and the object name are sent to the disk. After that, you don't need to care about which disk you need to access data from, but traverse all the disks in the object storage system to read the corresponding data.
  • the embodiment of the present application further provides a Docker image library file storage terminal, the terminal 100 includes: an abstraction unit 101, a first determining unit 102, an allocating unit 103, The unit 104 is read.
  • the abstracting unit 101 is configured to abstract several image files into objects.
  • a first determining unit 102 configured to determine an object of the same logical path, and abstract an object under the same logical path into a bucket;
  • an allocating unit 103 configured to allocate the abstracted bucket into a different object container;
  • the reading unit 104 And if the access instruction of the user is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
  • the embodiment of the present application abstracts several image files into objects, determines objects of the same logical path, and abstracts objects under the same logical path into buckets; assigns the abstract buckets to different object containers; If the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
  • the embodiment of the present application implements self-management of the image, and saves the storage cost of the image file.
  • the abstracting unit 101 includes: a second determining unit 1011, configured to determine a hash value corresponding to the image file, and determine a corresponding ID number according to the hash value; the searching unit 1012 And searching for the save path corresponding to the image file according to the ID number; the abstract subunit 1013 is configured to abstract the plurality of image files into objects according to the saved save path.
  • the reading unit 104 includes: a docking unit 1041, configured to interface the driver of the mirror warehouse with the object storage system according to the access instruction; and the first sending unit 1042 is configured to: The object is sent to the object container in the object storage system; the reading subunit 1043 is configured to read the corresponding bucket in the object container; and the second sending unit 1044 is configured to perform the docking relationship between the mirrored warehouse and the object storage system. Send the acquired bucket to the user.
  • a docking unit 1041 configured to interface the driver of the mirror warehouse with the object storage system according to the access instruction
  • the first sending unit 1042 is configured to: The object is sent to the object container in the object storage system;
  • the reading subunit 1043 is configured to read the corresponding bucket in the object container;
  • the second sending unit 1044 is configured to perform the docking relationship between the mirrored warehouse and the object storage system. Send the acquired bucket to the user.
  • FIG. 9 corresponds to a Docker image library file storage method.
  • the embodiment of the present application further provides a Docker image library file storage terminal.
  • the terminal 200 includes an abstracting unit 201, a first determining unit 202, and a scanning unit 203.
  • the abstracting unit 201 is configured to abstract a plurality of image files into objects; the first determining unit 202 is configured to determine objects of the same logical path, and abstract objects in the same logical path into buckets; the scanning unit 203, An object name for scanning objects in all the buckets; an identifying unit 204, configured to identify a naming specification corresponding to the currently scanned object name; a third determining unit 205, configured to determine an object of the same naming convention; the first assigning subunit 206, configured to allocate the determined object of the same naming convention to the same object container; the reading unit 207 is configured to: when receiving the access instruction of the user, read from the corresponding object container according to the access instruction Abstract bucket.
  • the embodiment of the present application further provides a Docker image library file storage terminal, the terminal 300 includes: an abstraction unit 301, a first determining unit 302, and a fourth determining unit. 303.
  • the abstracting unit 301 is configured to abstract a plurality of image files into objects; the first determining unit 302 is configured to determine objects of the same logical path, and abstract objects in the same logical path into buckets; 303.
  • the second allocation subunit 304 is configured to allocate an object in the bucket according to the determined storage quantity according to the determined storage quantity.
  • the reading unit 305 is configured to use the storage unit. If the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction.
  • the above abstract unit 101, the first determining unit 102, the allocating unit 103, the reading unit 104, and the like may be embedded in the hardware processing device in hardware or in the form of software.
  • the processor calls to perform the operations corresponding to the above respective units.
  • the processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
  • the above Docker image library file storage terminal can be implemented in the form of a computer program that can be run on a computer device as shown in FIG.
  • FIG. 11 is a schematic structural diagram of a Docker image library file storage device according to the present application.
  • the device may be a terminal or a server, wherein the terminal may be a communication device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device.
  • the server can be a standalone server or a server cluster consisting of multiple servers.
  • the computer device 500 includes a processor 502, a non-volatile storage medium 503, an internal memory 504, and a network interface 505 connected by a system bus 501.
  • the non-volatile storage medium 503 of the computer device 500 can store an operating system 5031 and a computer program 5032.
  • the processor 502 can be caused to execute a Docker image library file storage method.
  • the processor 502 of the computer device 500 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
  • the internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, which when executed by the processor, causes the processor 502 to execute a Docker image library file storage method.
  • the network interface 505 of the computer device 500 is used to perform network communications, such as sending assigned tasks and the like. It will be understood by those skilled in the art that the structure shown in FIG.
  • 11 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied.
  • the specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • the processor 502 performs the following operations: abstracting a plurality of image files into objects; determining objects of the same logical path, and abstracting objects under the same logical path into buckets; assigning the abstract buckets to different object containers If the access instruction of the user is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
  • the abstracting the image file into the object includes: determining a hash value corresponding to the image file, and determining a corresponding ID number according to the hash value; searching according to the ID number The save path corresponding to the image file; abstracting several image files into objects according to the saved save path.
  • the allocating the abstracted buckets to different object containers includes: scanning object names of objects in all buckets; identifying a naming specification corresponding to the currently scanned object name; determining the same naming convention Object; assigns objects of the same naming convention that are determined to the same object container.
  • the allocating the abstracted buckets to different object containers comprises: determining an amount of storage by which the object containers are stored; and in the preset order according to the determined storage amount The object is allocated.
  • the reading the abstracted bucket from the corresponding object container according to the access instruction and sending it to the user includes: docking the driver of the mirrored warehouse with the object storage system according to the access instruction; The access instruction is sent to the object container in the object storage system; the corresponding bucket is read in the object container; and the acquired bucket is sent to the user according to the docking relationship between the mirrored warehouse and the object storage system.
  • the embodiment of the Docker image library file storage device shown in FIG. 11 does not constitute a limitation on the specific configuration of the Docker image library file storage device.
  • the Docker image library file storage device may Includes more or fewer components than shown, or combines some components, or different component arrangements.
  • the Docker image library file storage device includes only the memory and the processor. In such an embodiment, the structure and function of the memory and the processor are the same as those in the embodiment shown in FIG. .
  • the application provides a computer readable storage medium storing one or more computer programs executable by one or more processors to implement the Docker image described above Library file storage method.
  • the foregoing storage medium of the present application includes: a magnetic disk, an optical disk, a read-only memory (ROM), and the like, which can store various program codes.
  • the units in all the embodiments of the present application may be implemented by a general-purpose integrated circuit, such as a CPU (Central Processing Unit), or by an ASIC (Application Specific Integrated Circuit).
  • a general-purpose integrated circuit such as a CPU (Central Processing Unit), or by an ASIC (Application Specific Integrated Circuit).
  • the steps in the Docker image library file storage method of the embodiment of the present application may be sequentially adjusted, merged, and deleted according to actual needs.
  • the units in the Docker image library file storage terminal of the embodiment of the present application can be merged, divided, and deleted according to actual needs.

Abstract

Disclosed are a Docker mirror image library file storage method, a terminal, a device and a storage medium. The method comprises: abstracting several mirror image files into objects (S101); determining objects having the same logical path, and abstracting the objects in the same logical path into buckets (S102); allocating the abstracted buckets to different object containers (S103); and if an access instruction of a user is received, reading an abstracted bucket from a corresponding object container according to the access instruction, and sending same to the user (S104). The self-control of a mirror image is realized, and the storage cost of a mirror image file is reduced.

Description

Docker镜像库文件存储方法、终端、设备以及存储介质Docker image library file storage method, terminal, device, and storage medium
本申请要求于2018年1月8日提交中国专利局、申请号为CN 201810016146.3、申请名称为“Docker镜像库文件存储方法、终端、设备以及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on January 8, 2018, the Chinese Patent Office, the application number is CN 201810016146.3, and the application name is "Docker image library file storage method, terminal, device and storage medium". This is incorporated herein by reference.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种Docker镜像库文件存储方法、终端、设备以及存储介质。The present application relates to the field of computer technologies, and in particular, to a Docker image library file storage method, a terminal, a device, and a storage medium.
背景技术Background technique
现有技术中,采用传统的存储方式来存储镜像仓库的镜像文件,例如内存存储方式或者文件系统存储方式等等,由于镜像文件一般情况下较大,以内存存储或者文件系统存储的方式,导致迁移镜像文件的效率不高,并且存储过程需要消耗大量的存储设备,造成镜像文件的存储成本过高。In the prior art, a traditional storage method is used to store an image file of a mirrored warehouse, such as a memory storage mode or a file system storage mode, etc., because the image file is generally large, and is stored in a memory or file system manner. The migration of image files is inefficient, and the storage process consumes a large amount of storage devices, resulting in excessive storage costs for image files.
发明内容Summary of the invention
有鉴于此,本申请实施例提供一种Docker镜像库文件存储方法、终端、设备以及存储介质,实现镜像的自我管控,同时节省了镜像文件的存储成本。In view of this, the embodiment of the present application provides a Docker image library file storage method, a terminal, a device, and a storage medium, which implement self-management of the image and save the storage cost of the image file.
一方面,本申请实施例提供了一种Docker镜像库文件存储方法,该方法包括:将若干个镜像文件抽象成对象;确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;将所抽象的桶分配至不同的对象容器中;若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。In one aspect, the embodiment of the present application provides a Docker image library file storage method, the method includes: abstracting a plurality of image files into objects; determining objects of the same logical path, and abstracting objects in the same logical path into buckets; The abstracted bucket is allocated to a different object container; if the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
另一方面,本申请实施例提供了一种Docker镜像库文件存储终端,所述终端包括:抽象单元,用于将若干个镜像文件抽象成对象;第一确定单元,用于确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;分配单元,用于将所抽象的桶分配至不同的对象容器中;读取单元,用于若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给 用户。On the other hand, the embodiment of the present application provides a Docker image library file storage terminal, the terminal includes: an abstracting unit for abstracting a plurality of image files into objects; and a first determining unit, configured to determine the same logical path. An object, and abstracting an object under the same logical path into a bucket; an allocating unit for allocating the abstracted bucket to a different object container; and a reading unit for receiving an access instruction of the user according to the access The instruction reads the abstracted bucket from the corresponding object container and sends it to the user.
又一方面,本申请实施例还提供了一种Docker镜像库文件存储设备,其包括:存储器,用于存储实现Docker镜像库文件存储方法的程序;以及处理器,用于运行所述存储器中存储的实现Docker镜像库文件存储方法的程序,以执行如下操作:将若干个镜像文件抽象成对象;确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;将所抽象的桶分配至不同的对象容器中;若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。In another aspect, the embodiment of the present application further provides a Docker image library file storage device, including: a memory for storing a program for implementing a Docker image library file storage method; and a processor for running the storage in the memory A program that implements the Docker image library file storage method to perform the following operations: abstracting several image files into objects; determining objects of the same logical path, and abstracting objects under the same logical path into buckets; allocating abstract buckets And to the different object container; if the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
再一方面,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上计算机程序,所述一个或者一个以上计算机程序可被一个或者一个以上的处理器执行,以实现如下步骤:将若干个镜像文件抽象成对象;确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;将所抽象的桶分配至不同的对象容器中;若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。In still another aspect, the embodiment of the present application further provides a computer readable storage medium, where the one or more computer programs are stored, and the one or more computer programs may be one or more The processor executes to implement the steps of: abstracting a plurality of image files into objects; determining objects of the same logical path, and abstracting objects under the same logical path into buckets; and allocating the abstracted buckets into different object containers; If the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
本申请实施例通过将若干个镜像文件抽象成对象;确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;将所抽象的桶分配至不同的对象容器中;若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。本申请实施例实现镜像的自我管控,同时节省了镜像文件的存储成本。The embodiment of the present application abstracts several image files into objects, determines objects of the same logical path, and abstracts objects under the same logical path into buckets; assigns the abstract buckets to different object containers; if the user is received The access instruction reads the abstracted bucket from the corresponding object container according to the access instruction and sends it to the user. The embodiment of the present application implements self-management of the image, and saves the storage cost of the image file.
附图说明DRAWINGS
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings used in the description of the embodiments will be briefly described below. Obviously, the drawings in the following description are some embodiments of the present application, For the ordinary technicians, other drawings can be obtained based on these drawings without any creative work.
图1是本申请实施例提供的一种Docker镜像库文件存储方法的示意流程图;1 is a schematic flow chart of a Docker image library file storage method provided by an embodiment of the present application;
图2是本申请实施例提供的一种Docker镜像库文件存储方法的示意流程图;2 is a schematic flowchart of a Docker image library file storage method provided by an embodiment of the present application;
图3是本申请实施例提供的一种Docker镜像库文件存储方法的示意流程 图;3 is a schematic flow chart of a Docker image library file storage method provided by an embodiment of the present application;
图4是本申请另一实施例提供的一种Docker镜像库文件存储方法的示意流程图;4 is a schematic flowchart of a method for storing a Docker image library file according to another embodiment of the present application;
图5是本申请另一实施例提供的一种Docker镜像库文件存储方法的示意流程图;FIG. 5 is a schematic flowchart of a Docker image library file storage method according to another embodiment of the present application; FIG.
图6是本申请实施例提供的一种Docker镜像库文件存储终端的示意性框图;6 is a schematic block diagram of a Docker image library file storage terminal provided by an embodiment of the present application;
图7是本申请实施例提供的一种Docker镜像库文件存储终端的另一示意性框图;FIG. 7 is another schematic block diagram of a Docker image library file storage terminal according to an embodiment of the present application; FIG.
图8是本申请实施例提供的一种Docker镜像库文件存储终端的另一示意性框图;FIG. 8 is another schematic block diagram of a Docker image library file storage terminal according to an embodiment of the present application; FIG.
图9是本申请实施例提供的一种Docker镜像库文件存储终端的另一示意性框图;FIG. 9 is another schematic block diagram of a Docker image library file storage terminal according to an embodiment of the present application; FIG.
图10是本申请实施例提供的一种Docker镜像库文件存储终端的另一示意性框图;FIG. 10 is another schematic block diagram of a Docker image library file storage terminal according to an embodiment of the present application; FIG.
图11是本申请实施例提供的一种Docker镜像库文件存储设备的结构组成示意图。FIG. 11 is a schematic structural diagram of a Docker image library file storage device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。The use of the terms "comprising", "comprising", "","," The presence or addition of a plurality of other features, integers, steps, operations, elements, components, and/or collections thereof.
还应当理解,在此本发明说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本发明。如在本发明说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个” 及“该”意在包括复数形式。It is also to be understood that the terminology of the present invention is to be construed as a The singular forms "a", "the", and "the"
请参阅图1,图1为本申请实施例提供的一种Docker镜像库文件存储方法的示意流程图。该方法可以运行在智能手机(如Android手机、IOS手机等)、平板电脑、笔记本电脑以及智能设备等终端中。本申请实施例所述的Docker镜像库文件存储方法,能够实现镜像的自我管控,同时节省了镜像文件的存储成本。图1是本申请实施例提供的Docker镜像库文件存储方法的示意流程图。该方法包括步骤S101~S104。Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a method for storing a Docker image library file according to an embodiment of the present application. The method can be run on terminals such as smart phones (such as Android phones, IOS phones, etc.), tablets, laptops, and smart devices. The Docker image library file storage method described in the embodiment of the present invention can realize self-management of the image and save the storage cost of the image file. FIG. 1 is a schematic flowchart of a Docker image library file storage method provided by an embodiment of the present application. The method includes steps S101 to S104.
S101,将若干个镜像文件抽象成对象。S101, abstracting a plurality of image files into objects.
在本申请实施例中,在Docker镜像库中存储着不同的镜像文件,其中,Docker镜像库包括存储着镜像文件以及镜像文件的位置,具体的,Docker镜像库提供一个注册服务器,该注册服务器用于保存多个仓库,每个仓库又可以包含多个具备不同标签的镜像文件;在实际使用中,Docker镜像库运行中使用的默认仓库为Docker Hub公共仓库;对于Docker镜像库中的镜像文件的存储,所使用的存储方式有很多种方案,例如,可以是内存存储方式,也可以是文件系统形式的存储方式等等。In the embodiment of the present application, different image files are stored in the Docker image library, wherein the Docker image library includes a location where the image file and the image file are stored. Specifically, the Docker image library provides a registration server, and the registration server uses the registration server. For saving multiple warehouses, each warehouse can contain multiple image files with different labels; in actual use, the default repository used in the Docker image library runtime is the Docker Hub public repository; for the image files in the Docker image library Storage, there are many ways to store the storage, for example, it can be memory storage, storage in the form of file system, and so on.
需要说明的是,考虑到镜像文件的结构特性,本申请实施例使用对象存储方式对镜像文件进行存储,将若干个镜像文件抽象成对象,比如将镜像文件1抽象成Object1,将镜像文件2抽象成Object2等等,抽象的过程可以是通过程序设计语言进行抽象,具体的抽象过程在此不作限制。It should be noted that, in consideration of the structural characteristics of the image file, the embodiment of the present application uses the object storage method to store the image file, and abstracts several image files into objects, such as abstracting the image file 1 into Object1 and abstracting the image file 2. In Object2 and so on, the abstract process can be abstracted through the programming language, and the specific abstraction process is not limited here.
下面以Docker镜像库中的tomcat镜像为例,对抽象过程进行说明:Let's take the tomcat image in the Docker image library as an example to illustrate the abstraction process:
Docker镜像库中的tomcat镜像,可以查询得到该镜像的版本为8,在Docker镜像库中tomcat镜像的存储一共可以分为三层,也就是说该镜像存在三个镜像文件,分别作为镜像文件1、镜像文件2、镜像文件3,获取三个镜像文件的哈希值,并读取哈希值所应的ID号,通过哈希值的ID号查找镜像文件的保存路径,不同的镜像文件的保存路径不相同,将不同镜像文件对应的不同的保存路径作为对象的名字对镜像文件进行抽象。The tomcat image in the Docker image library can be queried to get the version of the image as 8. The memory of the tomcat image in the Docker image library can be divided into three layers, that is, the image has three image files, which are respectively used as image files. , image file 2, image file 3, obtain the hash value of the three image files, and read the ID number of the hash value, find the save path of the image file by the ID number of the hash value, different image files The save path is different, and the image file is abstracted by using the different save paths corresponding to different image files as the object name.
进一步地,如图2所示,步骤S101包括步骤S201~S203。Further, as shown in FIG. 2, step S101 includes steps S201 to S203.
S201,确定所述镜像文件对应的哈希值,并根据所述哈希值确定相对应的ID号。S201. Determine a hash value corresponding to the image file, and determine a corresponding ID number according to the hash value.
在本申请实施例中,在Docker镜像库中,每一个镜像文件都对应一个哈希 值,通过FileHash()函数获取哈希值,具体的,通过FileName得到被获取哈希值对应的文件名,通过Type_获取对应的哈希值,函数执行成功后,将返回对应的哈希值。根据所述哈希值确定相对应的ID号,由于每一个哈希值都对应一个唯一ID号,或者是对应码,通过确定所述哈希值之后,可以利用hashID函数获取与哈希值对应的ID字段,将所获取的ID字段作为哈希值的ID号。In the embodiment of the present application, in the Docker image library, each image file corresponds to a hash value, and the hash value is obtained by the FileHash() function. Specifically, the file name corresponding to the hash value is obtained by FileName. The corresponding hash value is obtained by Type_, and after the function is successfully executed, the corresponding hash value is returned. Determining a corresponding ID number according to the hash value. Since each hash value corresponds to a unique ID number or a corresponding code, after determining the hash value, the hashID function may be used to obtain a hash value corresponding to the hash value. ID field, which takes the obtained ID field as the ID number of the hash value.
S202,根据所述ID号查找出所述镜像文件相对应的保存路径。S202. Search for a save path corresponding to the image file according to the ID number.
在本申请实施例中,每个镜像文件所查找出的保存路径的格式为:镜像名-镜像版本号-哈希值对应的ID号为例如,在Docker镜像库中tomcat镜像的存储一共分为三层,也就是说该镜像存在三个镜像文件,分别作为镜像文件1、镜像文件2、镜像文件3,获取三个镜像文件的哈希值,并读取哈希值所应的ID号,所读取的ID号分别为aaa111、bbb222、ccc333,那么通过该ID号查找镜像文件的保存路径可以为/myimage/tomcat/8/aaa111、/myimage/tomcat/8/bbb222、/myimage/tomcat/8/ccc333。In the embodiment of the present application, the format of the save path found by each image file is: the image name - the image version number - the hash number corresponding to the hash value is, for example, the storage of the tomcat image in the Docker image library is divided into a total of The third layer, that is, the image has three image files, which are mirror file 1, image file 2, and image file 3, respectively, obtain the hash values of the three image files, and read the ID number of the hash value. The ID numbers read are aaa111, bbb222, and ccc333, respectively. The path to find the image file by the ID number can be /myimage/tomcat/8/aaa111, /myimage/tomcat/8/bbb222, /myimage/tomcat/ 8/ccc333.
S203,根据所查找的保存路径将若干个镜像文件抽象成对象。S203. Abstract the image files into objects according to the saved path.
在本申请实施例中,将每个镜像文件对应的保存路径作为对象的名字对镜像文件进行抽象,抽象的过程可以是通过程序设计语言进行抽象,具体的抽象过程在此不作限制。In the embodiment of the present application, the save path corresponding to each image file is abstracted as an object name, and the abstract process may be abstracted by a programming language. The specific abstract process is not limited herein.
S102,确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶。S102. Determine an object of the same logical path, and abstract the object under the same logical path into a bucket.
在本申请实施例中,在本申请实施例中,每个镜像仓库包括多个镜像文件,将同一个镜像仓库的镜像文件抽象成的对象称为相同逻辑路径下的对象,所述将同一逻辑路径下的对象抽象成桶,例如,可以是将逻辑路径相同的三个对象抽象成桶1,也可以是将逻辑路径相同的四个对象抽象成桶2等等,抽象的过程可以是通过程序设计语言进行抽象,具体的抽象过程在此不作限制。In the embodiment of the present application, in the embodiment of the present application, each image warehouse includes multiple image files, and objects that are abstracted into image files of the same mirror warehouse are referred to as objects in the same logical path, and the same logic is used. The object under the path is abstracted into a bucket. For example, three objects with the same logical path can be abstracted into bucket 1, or four objects with the same logical path can be abstracted into bucket 2, etc. The abstract process can be through a program. The design language is abstracted, and the specific abstraction process is not limited here.
下面将逻辑路径相同的三个对象抽象成桶1为例,对抽象过程进行说明,抽象的过程可以是:将分别保存为/myimage/tomcat/8/aaa111/myimage/tomcat/8/bbb222,/myimage/tomcat/8/ccc333的三个对象,均属于相同/myimage路径下的对象,因此,将/myimage作为桶名抽象成桶,而/myimage/tomcat/8/aaa111,/myimage/tomcat/8/bbb22,/myimage/tomcat/8/ccc333则作为桶/myimage中的对象。由于同一逻辑路径下存储着同一仓库的镜像文件抽象成的对象,因此,将相同逻辑路径下的对象抽象成桶保证了镜像文件的完 整性。The following is an example of abstracting three objects with the same logical path into bucket 1. The abstract process can be: save it as /myimage/tomcat/8/aaa111/myimage/tomcat/8/bbb222,/ The three objects of myimage/tomcat/8/ccc333 belong to the same /myimage path, so abstract /myimage as a bucket name into a bucket, and /myimage/tomcat/8/aaa111, /myimage/tomcat/8 /bbb22, /myimage/tomcat/8/ccc333 is used as an object in the bucket/myimage. Since the same logical path stores the object abstracted from the image file of the same repository, abstracting the objects in the same logical path into a bucket ensures the integrity of the image file.
S103,将所抽象的桶分配至不同的对象容器中。S103, assigning the abstract bucket to a different object container.
在本申请实施例中,所述对象容器可以是磁盘,该磁盘的数量根据存储需要可以是一个或者多个,在将所抽象的桶分配至不同的磁盘中时,分配的方式为随机分散分配,所谓随机分散分配指的是,将桶中的不同对象随机分配至磁盘中,需要说明的是,将对象分配至磁盘的存储方式中,一个对象可以重复存储在不同的磁盘中,而且该对象为分散存储在不同的磁盘中,例如,将Bucker1中的Object1分配至磁盘1中,也可以同时将Bucket1中的Object1分配至磁盘2中;将Bucket2中的Object1分配至磁盘2中,也可以同时将Bucket2中的Object1分配至磁盘3中;将Bucket3中的Object1分配至磁盘3中,也可以同时将Bucket3中的Object1分配至磁盘4中等等。In the embodiment of the present application, the object container may be a disk, and the number of the disks may be one or more according to storage requirements. When the abstracted buckets are allocated to different disks, the allocation manner is randomly distributed. The so-called random distributed allocation refers to randomly assigning different objects in the bucket to the disk. It should be noted that, when the object is allocated to the storage mode of the disk, an object can be repeatedly stored in different disks, and the object is For distributed storage on different disks, for example, assigning Object1 in Bucker1 to Disk 1, you can also assign Object1 in Bucket1 to Disk 2; Assign Object1 in Bucket2 to Disk 2, or both. Assign Object1 in Bucket2 to Disk 3; assign Object1 in Bucket3 to Disk 3, or assign Object1 in Bucket 3 to Disk 4 at the same time, and so on.
需要说明的是,本实施例中的磁盘属于自研存储系统中的用于存储文件、数据的存储媒介,自研存储系统可以将系统处理完的文件/数据保存至磁盘,也可以从磁盘中读取已保存的文件/数据,镜像仓库对于自研存储系统而言属于外部设备,镜像仓库可以调用存储系统的接口(该接口为设置在自研存储系统中面向外部设备的端口),将镜像仓库中的对象文件交由自研存储系统保存,或者根据对象名从自研存储系统中读取相应的对象文件。It should be noted that the disk in this embodiment belongs to a storage medium for storing files and data in the self-developed storage system, and the self-developed storage system can save the processed files/data to the disk or from the disk. The saved file/data is read. The mirrored warehouse belongs to the external device for the self-developed storage system. The mirrored warehouse can call the interface of the storage system (the interface is the port set to the external device in the self-developed storage system), and the image is mirrored. The object files in the warehouse are saved by the self-developed storage system, or the corresponding object files are read from the self-developed storage system according to the object name.
S104,若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。S104. If an access instruction of the user is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
在本申请实施例中,对象容器为对象存储系统中的存储硬件,该存储硬件可以是磁盘,一个对象存储系统可以包括API Gateway、存储系统以及磁盘,若接收到用户的访问指令,访问指令需要通过镜像仓库支持的后端存储驱动,该驱动可以是AWS S3,Openstack Swift,阿里云对象存储等等,向对象存储系统中的磁盘要求读取所抽象的桶。In the embodiment of the present application, the object container is storage hardware in the object storage system, and the storage hardware may be a disk. An object storage system may include an API Gateway, a storage system, and a disk. If an access instruction of the user is received, the access instruction is required. Through the backend storage driver supported by the mirror repository, the driver can be AWS S3, Openstack Swift, Alibaba Cloud Object Storage, etc., and the disk in the object storage system is required to read the abstract bucket.
需要说明的是,具体的访问过程为:预先将镜像仓库的驱动与对象存储系统对接,通过该驱动将所述访问指令发送至对象存储系统中的磁盘中,在所述磁盘中读取相对应的桶,根据镜像仓库与对象存储系统的对接关系将所获取的桶发送至用户。It should be noted that the specific access process is: pre-connecting the driver of the mirror warehouse with the object storage system, and sending the access instruction to the disk in the object storage system through the driver, and reading the corresponding disk in the disk The bucket sends the acquired bucket to the user according to the docking relationship between the mirrored warehouse and the object storage system.
可选的,用户的访问指令可以是所读取对象的逻辑路径和对象名,例如Bucket1、Object1,其中Bucket1为对象的逻辑路径,Object1为对象名,将该逻 辑路径和对象名发送至磁盘中后,不需要关心具体需要从哪个磁盘访问数据,而是遍历对象存储系统中的所有磁盘以读取相对应的数据。Optionally, the user access instruction may be a logical path and an object name of the object to be read, such as Bucket1 and Object1, where Bucket1 is the logical path of the object, and Object1 is the object name, and the logical path and the object name are sent to the disk. After that, you don't need to care about which disk you need to access data from, but traverse all the disks in the object storage system to read the corresponding data.
进一步地,如图3所示,步骤S104包括步骤S301~S304。Further, as shown in FIG. 3, step S104 includes steps S301 to S304.
S301,根据所述访问指令将镜像仓库的驱动与对象存储系统对接。S301. Connect the driver of the mirror warehouse to the object storage system according to the access instruction.
在本申请实施例中,所述对象存储系统可以是自研对象存储系统,镜像仓库与对象存储系统可以通过存储驱动-存储系统的兼容API进行连接。In the embodiment of the present application, the object storage system may be a self-developed object storage system, and the mirrored warehouse and the object storage system may be connected through a compatible API of the storage drive-storage system.
S302,将所述访问指令发送至对象存储系统中的对象容器中。S302. Send the access instruction to an object container in the object storage system.
在本申请实施例中,对于镜像仓库来说,只需要正常配置存储驱动,并不需要了解存储驱动背后是如何处理数据的;对于自研的存储系统来说,镜像仓库通过存储驱动将访问指令发送至兼容API之后,存储系统只需要根据访问指令的信息对相关文件进行正常的读写,不需要了解请求方的具体情况。In the embodiment of the present application, for the mirror warehouse, only the storage driver needs to be configured normally, and it is not necessary to understand how the data is processed behind the storage driver; for the self-developed storage system, the mirrored warehouse accesses the instruction through the storage driver. After being sent to the compatible API, the storage system only needs to read and write the relevant files normally according to the information of the access instruction, and does not need to know the specific situation of the requesting party.
S303,在所述对象容器中读取相对应的桶。S303. Read a corresponding bucket in the object container.
在本申请实施例中,若访问指令到达存储系统,根据该访问指令在对象容器中进行正常的读写操作,以读取相对应的桶。In the embodiment of the present application, if the access instruction reaches the storage system, a normal read and write operation is performed in the object container according to the access instruction to read the corresponding bucket.
S304,根据镜像仓库与对象存储系统的对接关系将所获取的桶发送至用户。S304: Send the acquired bucket to the user according to the docking relationship between the mirrored warehouse and the object storage system.
由以上可见,本申请实施例通过将若干个镜像文件抽象成对象;确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;将所抽象的桶分配至不同的对象容器中;若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。本申请实施例实现镜像的自我管控,同时节省了镜像文件的存储成本。It can be seen from the above that the embodiment of the present application abstracts several image files into objects, determines objects of the same logical path, and abstracts objects under the same logical path into buckets; assigns the abstract buckets to different object containers; If the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user. The embodiment of the present application implements self-management of the image, and saves the storage cost of the image file.
请参阅图4,图4是本申请实施例提供的一种Docker镜像库文件存储方法的示意流程图。该方法可以运行在智能手机(如Android手机、IOS手机等)、平板电脑、笔记本电脑以及智能设备等终端中。如图4所示,该方法包括步骤S401~S407。Please refer to FIG. 4. FIG. 4 is a schematic flowchart of a method for storing a Docker image library file according to an embodiment of the present application. The method can be run on terminals such as smart phones (such as Android phones, IOS phones, etc.), tablets, laptops, and smart devices. As shown in FIG. 4, the method includes steps S401 to S407.
S401,将若干个镜像文件抽象成对象。S401, abstracting a plurality of image files into objects.
在本申请实施例中,在Docker镜像库中存储着不同的镜像文件,其中,Docker镜像库包括存储着镜像文件以及镜像文件的位置,具体的,Docker镜像库提供一个注册服务器,该注册服务器用于保存多个仓库,每个仓库又可以包含多个具备不同标签的镜像文件;在实际使用中,Docker镜像库运行中使用的默认仓库为Docker Hub公共仓库;对于Docker镜像库中的镜像文件的存储,所 使用的存储方式有很多种方案,例如,可以是内存存储方式,也可以是文件系统形式的存储方式等等。In the embodiment of the present application, different image files are stored in the Docker image library, wherein the Docker image library includes a location where the image file and the image file are stored. Specifically, the Docker image library provides a registration server, and the registration server uses the registration server. For saving multiple warehouses, each warehouse can contain multiple image files with different labels; in actual use, the default repository used in the Docker image library runtime is the Docker Hub public repository; for the image files in the Docker image library Storage, there are many ways to store the storage, for example, it can be memory storage, storage in the form of file system, and so on.
需要说明的是,考虑到镜像文件的结构特性,本申请实施例使用对象存储方式对镜像文件进行存储,将若干个镜像文件抽象成对象,比如将镜像文件1抽象成Object1,将镜像文件2抽象成Object2等等,抽象的过程可以是通过程序设计语言进行抽象,具体的抽象过程在此不作限制。It should be noted that, in consideration of the structural characteristics of the image file, the embodiment of the present application uses the object storage method to store the image file, and abstracts several image files into objects, such as abstracting the image file 1 into Object1 and abstracting the image file 2. In Object2 and so on, the abstract process can be abstracted through the programming language, and the specific abstraction process is not limited here.
下面以Docker镜像库中的tomcat镜像为例,对抽象过程进行说明:Let's take the tomcat image in the Docker image library as an example to illustrate the abstraction process:
Docker镜像库中的tomcat镜像,可以查询得到该镜像的版本为8,在Docker镜像库中tomcat镜像的存储一共可以分为三层,也就是说该镜像存在三个镜像文件,分别作为镜像文件1、镜像文件2、镜像文件3,获取三个镜像文件的哈希值,并读取哈希值所应的ID号,通过哈希值的ID号查找镜像文件的保存路径,不同的镜像文件的保存路径不相同,将不同镜像文件对应的不同的保存路径作为对象的名字对镜像文件进行抽象。The tomcat image in the Docker image library can be queried to get the version of the image as 8. The memory of the tomcat image in the Docker image library can be divided into three layers, that is, the image has three image files, which are respectively used as image files. , image file 2, image file 3, obtain the hash value of the three image files, and read the ID number of the hash value, find the save path of the image file by the ID number of the hash value, different image files The save path is different, and the image file is abstracted by using the different save paths corresponding to different image files as the object name.
S402,确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶。S402. Determine an object of the same logical path, and abstract the object under the same logical path into a bucket.
在本申请实施例中,在本申请实施例中,每个镜像仓库包括多个镜像文件,将同一个镜像仓库的镜像文件抽象成的对象称为相同逻辑路径下的对象,所述将同一逻辑路径下的对象抽象成桶,例如,可以是将逻辑路径相同的三个对象抽象成桶1,也可以是将逻辑路径相同的四个对象抽象成桶2等等,抽象的过程可以是通过程序设计语言进行抽象,具体的抽象过程在此不作限制。In the embodiment of the present application, in the embodiment of the present application, each image warehouse includes multiple image files, and objects that are abstracted into image files of the same mirror warehouse are referred to as objects in the same logical path, and the same logic is used. The object under the path is abstracted into a bucket. For example, three objects with the same logical path can be abstracted into bucket 1, or four objects with the same logical path can be abstracted into bucket 2, etc. The abstract process can be through a program. The design language is abstracted, and the specific abstraction process is not limited here.
下面将逻辑路径相同的三个对象抽象成桶1为例,对抽象过程进行说明,抽象的过程可以是:将分别保存为/myimage/tomcat/8/aaa111/myimage/tomcat/8/bbb222,/myimage/tomcat/8/ccc333的三个对象,均属于相同/myimage路径下的对象,因此,将/myimage作为桶名抽象成桶,而/myimage/tomcat/8/aaa111,/myimage/tomcat/8/bbb22,/myimage/tomcat/8/ccc333则作为桶/myimage中的对象。由于同一逻辑路径下存储着同一仓库的镜像文件抽象成的对象,因此,将相同逻辑路径下的对象抽象成桶保证了镜像文件的完整性。The following is an example of abstracting three objects with the same logical path into bucket 1. The abstract process can be: save it as /myimage/tomcat/8/aaa111/myimage/tomcat/8/bbb222,/ The three objects of myimage/tomcat/8/ccc333 belong to the same /myimage path, so abstract /myimage as a bucket name into a bucket, and /myimage/tomcat/8/aaa111, /myimage/tomcat/8 /bbb22, /myimage/tomcat/8/ccc333 is used as an object in the bucket/myimage. Because the same logical path stores the object abstracted from the image file of the same repository, abstracting the objects in the same logical path into a bucket ensures the integrity of the image file.
S403,扫描所有桶中对象的对象名称。S403. Scan the object name of the object in all the buckets.
在本申请实施例中,通过连接数据库,使用结构化查询语言(Structured Query Language,SQL)对所有桶中的对象进行扫描并获取,具体的,使用SELECT 语句获取所有的桶,同时使用WHERE语句获取桶中的对象名称,从而达到扫描对象名称的效果。In the embodiment of the present application, by connecting to the database, the objects in all the buckets are scanned and obtained by using a Structured Query Language (SQL). Specifically, all the buckets are obtained by using a SELECT statement, and the WHERE statement is used to obtain The name of the object in the bucket to achieve the effect of scanning the object name.
S404,识别当前所扫描的对象名称所对应的命名规范。S404. Identify a naming specification corresponding to the currently scanned object name.
在本申请实施例中,所述识别当前所扫描的对象名称所对应的命名规范可以是识别所述对象名称之间是否存在数值顺序上的规律,例如,第一个对象名称为“xx111”,第二个对象名称为“xx222”,由于“111”和“222”之间存在各个位数上递增的规律,那么就可以识别出所述对象名称之间存在数值顺序上的规律,从而判断所述对象名称之间具有相同的命名规范。所述识别当前所扫描的对象名称所对应的命名规范可以是识别所述对象名称之间是否存在字母顺序上的规律,例如,第一个对象名称为“aaa”,第二个对象名称为“bbb”,由于“a”与“b”存在字母顺序上的规律,那么就可以识别出所述对象名称之间存在字母顺序上的规律,从而判断所述对象名称之间具有相同的命名规范。In the embodiment of the present application, the identifying the naming specification corresponding to the currently scanned object name may be to identify whether there is a numerical order rule between the object names, for example, the first object name is “xx111”, The second object name is "xx222". Since there is a rule of increasing the number of digits between "111" and "222", it is possible to recognize that there is a numerical order between the object names, thereby judging the The object names have the same naming convention. The identifying the naming specification corresponding to the currently scanned object name may be to identify whether there is an alphabetic order between the object names, for example, the first object name is “aaa”, and the second object name is “ Bbb", since "a" and "b" have an alphabetical order, it is possible to recognize that there is an alphabetic order between the object names, thereby judging that the object names have the same naming convention.
S405,确定相同命名规范的对象。S405. Determine an object of the same naming convention.
S406,将所确定的相同命名规范的对象分配至同一个对象容器中。S406. Assign the determined objects of the same naming convention to the same object container.
在本申请实施例中,所述对象容器可以是磁盘,该磁盘的数量根据存储需要可以是一个或者多个,将桶中的不同对象随机分配至磁盘中的分配原则可以是,将相同命名规范的对象分配至同一个对象容器中,例如,将Bucket1中的Object1分配至磁盘1中,也可以同时将相同命名规范的Bucket2中的Object2分配至磁盘1中。另外,对于不同命名规范的对象可以随机分配至不同的对象容器,也可以将不同命名规范的对象分配至同一个对象容器中。In the embodiment of the present application, the object container may be a disk, and the number of the disks may be one or more according to storage requirements. The principle of allocating different objects in the bucket to the disk may be the same naming convention. The objects are allocated to the same object container. For example, the Object1 in Bucket1 is assigned to Disk 1, and Object2 in Bucket2 of the same naming convention can also be assigned to Disk 1. In addition, objects of different naming conventions can be randomly assigned to different object containers, and objects of different naming conventions can also be assigned to the same object container.
S407,若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。S407. If an access instruction of the user is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
在本申请实施例中,对象容器为对象存储系统中的存储硬件,该存储硬件可以是磁盘,一个对象存储系统可以包括API Gateway、存储系统以及磁盘,若接收到用户的访问指令,访问指令需要通过镜像仓库支持的后端存储驱动,该驱动可以是AWS S3,Openstack Swift,阿里云对象存储等等,向对象存储系统中的磁盘要求读取所抽象的桶。In the embodiment of the present application, the object container is storage hardware in the object storage system, and the storage hardware may be a disk. An object storage system may include an API Gateway, a storage system, and a disk. If an access instruction of the user is received, the access instruction is required. Through the backend storage driver supported by the mirror repository, the driver can be AWS S3, Openstack Swift, Alibaba Cloud Object Storage, etc., and the disk in the object storage system is required to read the abstract bucket.
需要说明的是,具体的访问过程为:预先将镜像仓库的驱动与对象存储系统对接,通过该驱动将所述访问指令发送至对象存储系统中的磁盘中,在所述磁盘中读取相对应的桶,根据镜像仓库与对象存储系统的对接关系将所获取的 桶发送至用户。It should be noted that the specific access process is: pre-connecting the driver of the mirror warehouse with the object storage system, and sending the access instruction to the disk in the object storage system through the driver, and reading the corresponding disk in the disk The bucket sends the acquired bucket to the user according to the docking relationship between the mirrored warehouse and the object storage system.
可选的,用户的访问指令可以是所读取对象的逻辑路径和对象名,例如Bucker1、Object1,其中Bucker1为对象的逻辑路径,Object1为对象名,将该逻辑路径和对象名发送至磁盘中后,不需要关心具体需要从哪个磁盘访问数据,而是遍历对象存储系统中的所有磁盘以读取相对应的数据。Optionally, the user access instruction may be a logical path and an object name of the object to be read, such as Bucker1, Object1, where Bucker1 is the logical path of the object, and Object1 is the object name, and the logical path and the object name are sent to the disk. After that, you don't need to care about which disk you need to access data from, but traverse all the disks in the object storage system to read the corresponding data.
请参阅图5,图5是本申请实施例提供的一种Docker镜像库文件存储方法的示意流程图。该方法可以运行在智能手机(如Android手机、IOS手机等)、平板电脑、笔记本电脑以及智能设备等终端中。如图5所示,该方法包括步骤S501~S505。Please refer to FIG. 5. FIG. 5 is a schematic flowchart of a method for storing a Docker image library file according to an embodiment of the present application. The method can be run on terminals such as smart phones (such as Android phones, IOS phones, etc.), tablets, laptops, and smart devices. As shown in FIG. 5, the method includes steps S501 to S505.
S501,将若干个镜像文件抽象成对象。S501, abstracting several image files into objects.
在本申请实施例中,在Docker镜像库中存储着不同的镜像文件,其中,Docker镜像库包括存储着镜像文件以及镜像文件的位置,具体的,Docker镜像库提供一个注册服务器,该注册服务器用于保存多个仓库,每个仓库又可以包含多个具备不同标签的镜像文件;在实际使用中,Docker镜像库运行中使用的默认仓库为Docker Hub公共仓库;对于Docker镜像库中的镜像文件的存储,所使用的存储方式有很多种方案,例如,可以是内存存储方式,也可以是文件系统形式的存储方式等等。In the embodiment of the present application, different image files are stored in the Docker image library, wherein the Docker image library includes a location where the image file and the image file are stored. Specifically, the Docker image library provides a registration server, and the registration server uses the registration server. For saving multiple warehouses, each warehouse can contain multiple image files with different labels; in actual use, the default repository used in the Docker image library runtime is the Docker Hub public repository; for the image files in the Docker image library Storage, there are many ways to store the storage, for example, it can be memory storage, storage in the form of file system, and so on.
需要说明的是,考虑到镜像文件的结构特性,本申请实施例使用对象存储方式对镜像文件进行存储,将若干个镜像文件抽象成对象,比如将镜像文件1抽象成Object1,将镜像文件2抽象成Object2等等,抽象的过程可以是通过程序设计语言进行抽象,具体的抽象过程在此不作限制。It should be noted that, in consideration of the structural characteristics of the image file, the embodiment of the present application uses the object storage method to store the image file, and abstracts several image files into objects, such as abstracting the image file 1 into Object1 and abstracting the image file 2. In Object2 and so on, the abstract process can be abstracted through the programming language, and the specific abstraction process is not limited here.
下面以Docker镜像库中的tomcat镜像为例,对抽象过程进行说明:Let's take the tomcat image in the Docker image library as an example to illustrate the abstraction process:
Docker镜像库中的tomcat镜像,可以查询得到该镜像的版本为8,在Docker镜像库中tomcat镜像的存储一共可以分为三层,也就是说该镜像存在三个镜像文件,分别作为镜像文件1、镜像文件2、镜像文件3,获取三个镜像文件的哈希值,并读取哈希值所应的ID号,通过哈希值的ID号查找镜像文件的保存路径,不同的镜像文件的保存路径不相同,将不同镜像文件对应的不同的保存路径作为对象的名字对镜像文件进行抽象。The tomcat image in the Docker image library can be queried to get the version of the image as 8. The memory of the tomcat image in the Docker image library can be divided into three layers, that is, the image has three image files, which are respectively used as image files. , image file 2, image file 3, obtain the hash value of the three image files, and read the ID number of the hash value, find the save path of the image file by the ID number of the hash value, different image files The save path is different, and the image file is abstracted by using the different save paths corresponding to different image files as the object name.
S502,确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶。S502. Determine an object of the same logical path and abstract the object under the same logical path into a bucket.
在本申请实施例中,在本申请实施例中,每个镜像仓库包括多个镜像文件, 将同一个镜像仓库的镜像文件抽象成的对象称为相同逻辑路径下的对象,所述将同一逻辑路径下的对象抽象成桶,例如,可以是将逻辑路径相同的三个对象抽象成桶1,也可以是将逻辑路径相同的四个对象抽象成桶2等等,抽象的过程可以是通过程序设计语言进行抽象,具体的抽象过程在此不作限制。In the embodiment of the present application, in the embodiment of the present application, each image warehouse includes multiple image files, and objects that are abstracted into image files of the same mirror warehouse are referred to as objects in the same logical path, and the same logic is used. The object under the path is abstracted into a bucket. For example, three objects with the same logical path can be abstracted into bucket 1, or four objects with the same logical path can be abstracted into bucket 2, etc. The abstract process can be through a program. The design language is abstracted, and the specific abstraction process is not limited here.
下面将逻辑路径相同的三个对象抽象成桶1为例,对抽象过程进行说明,抽象的过程可以是:将分别保存为/myimage/tomcat/8/aaa111/myimage/tomcat/8/bbb222,/myimage/tomcat/8/ccc333的三个对象,均属于相同/myimage路径下的对象,因此,将/myimage作为桶名抽象成桶,而/myimage/tomcat/8/aaa111,/myimage/tomcat/8/bbb22,/myimage/tomcat/8/ccc333则作为桶/myimage中的对象。由于同一逻辑路径下存储着同一仓库的镜像文件抽象成的对象,因此,将相同逻辑路径下的对象抽象成桶保证了镜像文件的完整性。The following is an example of abstracting three objects with the same logical path into bucket 1. The abstract process can be: save it as /myimage/tomcat/8/aaa111/myimage/tomcat/8/bbb222,/ The three objects of myimage/tomcat/8/ccc333 belong to the same /myimage path, so abstract /myimage as a bucket name into a bucket, and /myimage/tomcat/8/aaa111, /myimage/tomcat/8 /bbb22, /myimage/tomcat/8/ccc333 is used as an object in the bucket/myimage. Because the same logical path stores the object abstracted from the image file of the same repository, abstracting the objects in the same logical path into a bucket ensures the integrity of the image file.
S503,确定所述对象容器进行存储的存储量。S503. Determine an amount of storage that the object container performs storage.
在本申请实施例中,所述对象容器可以是磁盘,该磁盘的数量根据存储需要可以是一个或者多个,不同的磁盘,其存储量并不相同,预先确定磁盘的存储量,当将所抽象的桶分配至磁盘中时,可以通过判断磁盘的存储量是否已满,从而更换/增加其它磁盘进行存储。In the embodiment of the present application, the object container may be a disk, and the number of the disks may be one or more according to storage requirements, and different disks have different storage capacities, and the storage capacity of the disks is determined in advance. When an abstract bucket is allocated to a disk, it can be replaced/added to other storage by judging whether the disk storage is full.
S504,根据所确定的存储量按照预设顺序对所述桶中的对象进行分配。S504. Allocate objects in the bucket according to the determined storage amount according to a preset order.
在本申请实施例中,根据磁盘的存储量,可以有计划的对所述桶中的对象进行分配并存储,所述预设顺序可以是根据对象大小,从大到小的规则进行存储,也可以是根据对象进行抽象时的日期的规则进行存储等等。In the embodiment of the present application, according to the storage capacity of the disk, the objects in the bucket may be allocated and stored in a planned manner, and the preset sequence may be stored according to the size of the object, from large to small rules. It can be stored according to the rules of the date when the object is abstracted, and so on.
S505,若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。S505. If an access instruction of the user is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
在本申请实施例中,对象容器为对象存储系统中的存储硬件,该存储硬件可以是磁盘,一个对象存储系统可以包括API Gateway、存储系统以及磁盘,若接收到用户的访问指令,访问指令需要通过镜像仓库支持的后端存储驱动,该驱动可以是AWS S3,Openstack Swift,阿里云对象存储等等,向对象存储系统中的磁盘要求读取所抽象的桶。In the embodiment of the present application, the object container is storage hardware in the object storage system, and the storage hardware may be a disk. An object storage system may include an API Gateway, a storage system, and a disk. If an access instruction of the user is received, the access instruction is required. Through the backend storage driver supported by the mirror repository, the driver can be AWS S3, Openstack Swift, Alibaba Cloud Object Storage, etc., and the disk in the object storage system is required to read the abstract bucket.
需要说明的是,具体的访问过程为:预先将镜像仓库的驱动与对象存储系统对接,通过该驱动将所述访问指令发送至对象存储系统中的磁盘中,在所述 磁盘中读取相对应的桶,根据镜像仓库与对象存储系统的对接关系将所获取的桶发送至用户。It should be noted that the specific access process is: pre-connecting the driver of the mirror warehouse with the object storage system, and sending the access instruction to the disk in the object storage system through the driver, and reading the corresponding disk in the disk The bucket sends the acquired bucket to the user according to the docking relationship between the mirrored warehouse and the object storage system.
可选的,用户的访问指令可以是所读取对象的逻辑路径和对象名,例如Bucker1、Object1,其中Bucker1为对象的逻辑路径,Object1为对象名,将该逻辑路径和对象名发送至磁盘中后,不需要关心具体需要从哪个磁盘访问数据,而是遍历对象存储系统中的所有磁盘以读取相对应的数据。Optionally, the user access instruction may be a logical path and an object name of the object to be read, such as Bucker1, Object1, where Bucker1 is the logical path of the object, and Object1 is the object name, and the logical path and the object name are sent to the disk. After that, you don't need to care about which disk you need to access data from, but traverse all the disks in the object storage system to read the corresponding data.
请参阅图6,对应上述一种Docker镜像库文件存储方法,本申请实施例还提出一种Docker镜像库文件存储终端,该终端100包括:抽象单元101、第一确定单元102、分配单元103、读取单元104。Referring to FIG. 6 , corresponding to the Docker image library file storage method, the embodiment of the present application further provides a Docker image library file storage terminal, the terminal 100 includes: an abstraction unit 101, a first determining unit 102, an allocating unit 103, The unit 104 is read.
其中,所述抽象单元101,用于将若干个镜像文件抽象成对象。第一确定单元102,用于确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;分配单元103,用于将所抽象的桶分配至不同的对象容器中;读取单元104,用于若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。The abstracting unit 101 is configured to abstract several image files into objects. a first determining unit 102, configured to determine an object of the same logical path, and abstract an object under the same logical path into a bucket; an allocating unit 103, configured to allocate the abstracted bucket into a different object container; the reading unit 104 And if the access instruction of the user is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
由以上可见,本申请实施例通过将若干个镜像文件抽象成对象;确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;将所抽象的桶分配至不同的对象容器中;若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。本申请实施例实现镜像的自我管控,同时节省了镜像文件的存储成本。It can be seen from the above that the embodiment of the present application abstracts several image files into objects, determines objects of the same logical path, and abstracts objects under the same logical path into buckets; assigns the abstract buckets to different object containers; If the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user. The embodiment of the present application implements self-management of the image, and saves the storage cost of the image file.
如图7所示,所述抽象单元101,包括:第二确定单元1011,用于确定所述镜像文件对应的哈希值,并根据所述哈希值确定相对应的ID号;查找单元1012,用于根据所述ID号查找出所述镜像文件相对应的保存路径;抽象子单元1013,用于根据所查找的保存路径将若干个镜像文件抽象成对象。As shown in FIG. 7, the abstracting unit 101 includes: a second determining unit 1011, configured to determine a hash value corresponding to the image file, and determine a corresponding ID number according to the hash value; the searching unit 1012 And searching for the save path corresponding to the image file according to the ID number; the abstract subunit 1013 is configured to abstract the plurality of image files into objects according to the saved save path.
如图8所示,所述读取单元104,包括:对接单元1041,用于根据所述访问指令将镜像仓库的驱动与对象存储系统对接;第一发送单元1042,用于将所述访问指令发送至对象存储系统中的对象容器中;读取子单元1043,用于在所述对象容器中读取相对应的桶;第二发送单元1044,用于根据镜像仓库与对象存储系统的对接关系将所获取的桶发送至用户。As shown in FIG. 8, the reading unit 104 includes: a docking unit 1041, configured to interface the driver of the mirror warehouse with the object storage system according to the access instruction; and the first sending unit 1042 is configured to: The object is sent to the object container in the object storage system; the reading subunit 1043 is configured to read the corresponding bucket in the object container; and the second sending unit 1044 is configured to perform the docking relationship between the mirrored warehouse and the object storage system. Send the acquired bucket to the user.
请参阅图9,对应上述一种Docker镜像库文件存储方法,本申请实施例还提出一种Docker镜像库文件存储终端,该终端200包括:抽象单元201、第一 确定单元202、扫描单元203、识别单元204、第三确定单元205、第一分配子单元206、读取单元207。Please refer to FIG. 9 , which corresponds to a Docker image library file storage method. The embodiment of the present application further provides a Docker image library file storage terminal. The terminal 200 includes an abstracting unit 201, a first determining unit 202, and a scanning unit 203. The identification unit 204, the third determination unit 205, the first distribution subunit 206, and the reading unit 207.
其中,所述抽象单元201,用于将若干个镜像文件抽象成对象;第一确定单元202,用于确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;扫描单元203,用于扫描所有桶中对象的对象名称;识别单元204,用于识别当前所扫描的对象名称所对应的命名规范;第三确定单元205,用于确定相同命名规范的对象;第一分配子单元206,用于将所确定的相同命名规范的对象分配至同一个对象容器中;读取单元207,用于若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶。The abstracting unit 201 is configured to abstract a plurality of image files into objects; the first determining unit 202 is configured to determine objects of the same logical path, and abstract objects in the same logical path into buckets; the scanning unit 203, An object name for scanning objects in all the buckets; an identifying unit 204, configured to identify a naming specification corresponding to the currently scanned object name; a third determining unit 205, configured to determine an object of the same naming convention; the first assigning subunit 206, configured to allocate the determined object of the same naming convention to the same object container; the reading unit 207 is configured to: when receiving the access instruction of the user, read from the corresponding object container according to the access instruction Abstract bucket.
请参阅图10,对应上述一种Docker镜像库文件存储方法,本申请实施例还提出一种Docker镜像库文件存储终端,该终端300包括:抽象单元301、第一确定单元302、第四确定单元303、第二分配子单元304、读取单元305。Referring to FIG. 10, corresponding to the Docker image library file storage method, the embodiment of the present application further provides a Docker image library file storage terminal, the terminal 300 includes: an abstraction unit 301, a first determining unit 302, and a fourth determining unit. 303. The second allocation subunit 304 and the reading unit 305.
其中,所述抽象单元301,用于将若干个镜像文件抽象成对象;第一确定单元302,用于确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;第四确定单元303,用于确定所述对象容器进行存储的存储量;第二分配子单元304,用于根据所确定的存储量按照预设顺序对所述桶中的对象进行分配;读取单元305,用于若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶。The abstracting unit 301 is configured to abstract a plurality of image files into objects; the first determining unit 302 is configured to determine objects of the same logical path, and abstract objects in the same logical path into buckets; 303. The second allocation subunit 304 is configured to allocate an object in the bucket according to the determined storage quantity according to the determined storage quantity. The reading unit 305 is configured to use the storage unit. If the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction.
在硬件实现上,以上抽象单元101、第一确定单元102、分配单元103、读取单元104等可以以硬件形式内嵌于或独立于数据处理的装置中,也可以以软件形式存储于数据处理装置的存储器中,以便处理器调用执行以上各个单元对应的操作。该处理器可以为中央处理单元(CPU)、微处理器、单片机等。In the hardware implementation, the above abstract unit 101, the first determining unit 102, the allocating unit 103, the reading unit 104, and the like may be embedded in the hardware processing device in hardware or in the form of software. In the memory of the device, so that the processor calls to perform the operations corresponding to the above respective units. The processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
上述Docker镜像库文件存储终端可以实现为一种计算机程序的形式,计算机程序可以在如图11所示的计算机设备上运行。The above Docker image library file storage terminal can be implemented in the form of a computer program that can be run on a computer device as shown in FIG.
图11为本申请一种Docker镜像库文件存储设备的结构组成示意图。该设备可以是终端,也可以是服务器,其中,终端可以是智能手机、平板电脑、笔记本电脑、台式电脑、个人数字助理和穿戴式装置等具有通信功能的电子装置。服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。参照图11,该计算机设备500包括通过系统总线501连接的处理器502、非易失性存储介质503、内存储器504和网络接口505。其中,该计算机设备500的非易失性 存储介质503可存储操作系统5031和计算机程序5032,该计算机程序5032被执行时,可使得处理器502执行一种Docker镜像库文件存储方法。该计算机设备500的处理器502用于提供计算和控制能力,支撑整个计算机设备500的运行。该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序被处理器执行时,可使得处理器502执行一种Docker镜像库文件存储方法。计算机设备500的网络接口505用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图11中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。FIG. 11 is a schematic structural diagram of a Docker image library file storage device according to the present application. The device may be a terminal or a server, wherein the terminal may be a communication device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server can be a standalone server or a server cluster consisting of multiple servers. Referring to FIG. 11, the computer device 500 includes a processor 502, a non-volatile storage medium 503, an internal memory 504, and a network interface 505 connected by a system bus 501. The non-volatile storage medium 503 of the computer device 500 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can be caused to execute a Docker image library file storage method. The processor 502 of the computer device 500 is used to provide computing and control capabilities to support the operation of the entire computer device 500. The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, which when executed by the processor, causes the processor 502 to execute a Docker image library file storage method. The network interface 505 of the computer device 500 is used to perform network communications, such as sending assigned tasks and the like. It will be understood by those skilled in the art that the structure shown in FIG. 11 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied. The specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
其中,所述处理器502执行如下操作:将若干个镜像文件抽象成对象;确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;将所抽象的桶分配至不同的对象容器中;若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。The processor 502 performs the following operations: abstracting a plurality of image files into objects; determining objects of the same logical path, and abstracting objects under the same logical path into buckets; assigning the abstract buckets to different object containers If the access instruction of the user is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
在一个实施例中,所述将若干个镜像文件抽象成对象,包括:确定所述镜像文件对应的哈希值,并根据所述哈希值确定相对应的ID号;根据所述ID号查找出所述镜像文件相对应的保存路径;根据所查找的保存路径将若干个镜像文件抽象成对象。In an embodiment, the abstracting the image file into the object includes: determining a hash value corresponding to the image file, and determining a corresponding ID number according to the hash value; searching according to the ID number The save path corresponding to the image file; abstracting several image files into objects according to the saved save path.
在一个实施例中,所述将所抽象的桶分配至不同的对象容器中,包括:扫描所有桶中对象的对象名称;识别当前所扫描的对象名称所对应的命名规范;确定相同命名规范的对象;将所确定的相同命名规范的对象分配至同一个对象容器中。In one embodiment, the allocating the abstracted buckets to different object containers includes: scanning object names of objects in all buckets; identifying a naming specification corresponding to the currently scanned object name; determining the same naming convention Object; assigns objects of the same naming convention that are determined to the same object container.
在一个实施例中,所述将所抽象的桶分配至不同的对象容器中,包括:确定所述对象容器进行存储的存储量;根据所确定的存储量按照预设顺序对所述桶中的对象进行分配。In one embodiment, the allocating the abstracted buckets to different object containers comprises: determining an amount of storage by which the object containers are stored; and in the preset order according to the determined storage amount The object is allocated.
在一个实施例中,所述根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户,包括:根据所述访问指令将镜像仓库的驱动与对象存储系统对接;将所述访问指令发送至对象存储系统中的对象容器中;在所述对象容器中读取相对应的桶;根据镜像仓库与对象存储系统的对接关系将所获取的桶发送至用户。In one embodiment, the reading the abstracted bucket from the corresponding object container according to the access instruction and sending it to the user includes: docking the driver of the mirrored warehouse with the object storage system according to the access instruction; The access instruction is sent to the object container in the object storage system; the corresponding bucket is read in the object container; and the acquired bucket is sent to the user according to the docking relationship between the mirrored warehouse and the object storage system.
本领域技术人员可以理解,图11中示出的Docker镜像库文件存储设备的实施例并不构成对Docker镜像库文件存储设备具体构成的限定,在其他实施例中,Docker镜像库文件存储设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。例如,在一些实施例中,Docker镜像库文件存储设备仅包括存储器及处理器,在这样的实施例中,存储器及处理器的结构及功能与图11所示实施例一致,在此不再赘述。It can be understood by those skilled in the art that the embodiment of the Docker image library file storage device shown in FIG. 11 does not constitute a limitation on the specific configuration of the Docker image library file storage device. In other embodiments, the Docker image library file storage device may Includes more or fewer components than shown, or combines some components, or different component arrangements. For example, in some embodiments, the Docker image library file storage device includes only the memory and the processor. In such an embodiment, the structure and function of the memory and the processor are the same as those in the embodiment shown in FIG. .
本申请提供了一种计算机可读存储介质,计算机可读存储介质存储有一个或者一个以上计算机程序,所述一个或者一个以上计算机程序可被一个或者一个以上的处理器执行,以实现上述Docker镜像库文件存储方法。The application provides a computer readable storage medium storing one or more computer programs executable by one or more processors to implement the Docker image described above Library file storage method.
本申请前述的存储介质包括:磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等各种可以存储程序代码的介质。The foregoing storage medium of the present application includes: a magnetic disk, an optical disk, a read-only memory (ROM), and the like, which can store various program codes.
本申请所有实施例中的单元可以通过通用集成电路,例如CPU(Central Processing Unit,中央处理器),或通过ASIC(Application Specific Integrated Circuit,专用集成电路)来实现。The units in all the embodiments of the present application may be implemented by a general-purpose integrated circuit, such as a CPU (Central Processing Unit), or by an ASIC (Application Specific Integrated Circuit).
本申请实施例Docker镜像库文件存储方法中的步骤可以根据实际需要进行顺序调整、合并和删减。The steps in the Docker image library file storage method of the embodiment of the present application may be sequentially adjusted, merged, and deleted according to actual needs.
本申请实施例Docker镜像库文件存储终端中的单元可以根据实际需要进行合并、划分和删减。The units in the Docker image library file storage terminal of the embodiment of the present application can be merged, divided, and deleted according to actual needs.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any equivalents can be easily conceived by those skilled in the art within the technical scope disclosed in the present application. Modifications or substitutions are intended to be included within the scope of the present application. Therefore, the scope of protection of this application should be determined by the scope of protection of the claims.

Claims (20)

  1. 一种Docker镜像库文件存储方法,其特征在于,所述方法包括:A Docker image library file storage method, characterized in that the method comprises:
    将若干个镜像文件抽象成对象;Abstracting several image files into objects;
    确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;Identify objects of the same logical path and abstract objects under the same logical path into buckets;
    将所抽象的桶分配至不同的对象容器中;Assign the abstracted buckets to different object containers;
    若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。If the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
  2. 如权利要求1所述的方法,其特征在于,所述将若干个镜像文件抽象成对象,包括:The method of claim 1 wherein said abstracting a plurality of image files into objects comprises:
    确定所述镜像文件对应的哈希值,并根据所述哈希值确定相对应的ID号;Determining a hash value corresponding to the image file, and determining a corresponding ID number according to the hash value;
    根据所述ID号查找出所述镜像文件相对应的保存路径;Finding, according to the ID number, a save path corresponding to the image file;
    根据所查找的保存路径将若干个镜像文件抽象成对象。Several image files are abstracted into objects based on the saved save path.
  3. 如权利要求1所述的方法,其特征在于,所述将所抽象的桶分配至不同的对象容器中,包括:The method of claim 1 wherein said assigning said abstracted buckets to different object containers comprises:
    扫描所有桶中对象的对象名称;Scan the object names of objects in all buckets;
    识别当前所扫描的对象名称所对应的命名规范;Identify the naming convention corresponding to the name of the currently scanned object;
    确定相同命名规范的对象;Identify objects of the same naming convention;
    将所确定的相同命名规范的对象分配至同一个对象容器中。Assign the objects of the same naming convention that are determined to the same object container.
  4. 如权利要求1所述的方法,其特征在于,所述将所抽象的桶分配至不同的对象容器中,包括:The method of claim 1 wherein said assigning said abstracted buckets to different object containers comprises:
    确定所述对象容器进行存储的存储量;Determining a storage amount of the object container to store;
    根据所确定的存储量按照预设顺序对所述桶中的对象进行分配。The objects in the bucket are allocated in a preset order according to the determined storage amount.
  5. 如权利要求1所述的方法,其特征在于,所述根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户,包括:The method of claim 1, wherein the reading the abstracted bucket from the corresponding object container according to the access instruction and transmitting to the user comprises:
    根据所述访问指令将镜像仓库的驱动与对象存储系统对接;Interfacing the driver of the mirrored warehouse with the object storage system according to the access instruction;
    将所述访问指令发送至对象存储系统中的对象容器中;Transmitting the access instruction to an object container in the object storage system;
    在所述对象容器中读取相对应的桶;Reading a corresponding bucket in the object container;
    根据镜像仓库与对象存储系统的对接关系将所获取的桶发送至用户。The acquired bucket is sent to the user according to the docking relationship between the mirrored warehouse and the object storage system.
  6. 一种Docker镜像库文件存储终端,其特征在于,所述终端包括:A Docker image library file storage terminal, wherein the terminal comprises:
    抽象单元,用于将若干个镜像文件抽象成对象;An abstract unit for abstracting several image files into objects;
    第一确定单元,用于确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;a first determining unit, configured to determine an object of the same logical path, and abstract the object under the same logical path into a bucket;
    分配单元,用于将所抽象的桶分配至不同的对象容器中;An allocation unit for allocating abstract buckets into different object containers;
    读取单元,用于若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。The reading unit is configured to: when receiving the access instruction of the user, read the abstract bucket from the corresponding object container according to the access instruction and send the abstract bucket to the user.
  7. 如权利要求6所述的终端,其特征在于,所述抽象单元,包括:The terminal according to claim 6, wherein the abstracting unit comprises:
    第二确定单元,用于确定所述镜像文件对应的哈希值,并根据所述哈希值确定相对应的ID号;a second determining unit, configured to determine a hash value corresponding to the image file, and determine a corresponding ID number according to the hash value;
    查找单元,用于根据所述ID号查找出所述镜像文件相对应的保存路径;a searching unit, configured to search, according to the ID number, a save path corresponding to the image file;
    抽象子单元,用于根据所查找的保存路径将若干个镜像文件抽象成对象。An abstract subunit for abstracting several image files into objects based on the saved save path.
  8. 如权利要求6所述的终端,其特征在于,所述分配单元,包括:The terminal according to claim 6, wherein the allocating unit comprises:
    扫描单元,用于扫描所有桶中对象的对象名称;A scanning unit that scans the object names of objects in all buckets;
    识别单元,用于识别当前所扫描的对象名称所对应的命名规范;a identifying unit, configured to identify a naming specification corresponding to the currently scanned object name;
    第三确定单元,用于确定相同命名规范的对象;a third determining unit, configured to determine an object of the same naming convention;
    第一分配子单元,用于将所确定的相同命名规范的对象分配至同一个对象容器中。The first allocation subunit is configured to allocate the determined objects of the same naming convention to the same object container.
  9. 如权利要求6所述的终端,其特征在于,所述分配单元,包括:The terminal according to claim 6, wherein the allocating unit comprises:
    第四确定单元,用于确定所述对象容器进行存储的存储量;a fourth determining unit, configured to determine a storage amount of the object container to store;
    第二分配子单元,用于根据所确定的存储量按照预设顺序对所述桶中的对象进行分配。And a second allocation subunit, configured to allocate objects in the bucket according to the determined storage amount in a preset order.
  10. 如权利要求6所述的终端,其特征在于,所述读取单元,包括:The terminal according to claim 6, wherein the reading unit comprises:
    对接单元,用于根据所述访问指令将镜像仓库的驱动与对象存储系统对接;a docking unit, configured to interface the driver of the mirror warehouse with the object storage system according to the access instruction;
    第一发送单元,用于将所述访问指令发送至对象存储系统中的对象容器中;a first sending unit, configured to send the access instruction to an object container in an object storage system;
    读取子单元,用于在所述对象容器中读取相对应的桶;Reading a subunit for reading a corresponding bucket in the object container;
    第二发送单元,用于根据镜像仓库与对象存储系统的对接关系将所获取的桶发送至用户。The second sending unit is configured to send the acquired bucket to the user according to the docking relationship between the mirrored warehouse and the object storage system.
  11. 一种Docker镜像库文件存储设备,其特征在于,包括:A Docker image library file storage device, comprising:
    存储器,用于存储实现Docker镜像库文件存储方法的程序;以及a memory for storing a program that implements a Docker image library file storage method;
    处理器,用于运行所述存储器中存储的实现Docker镜像库文件存储方法的 程序,以执行如下操作:And a processor, configured to run a program stored in the memory to implement a Docker image library file storage method, to perform the following operations:
    将若干个镜像文件抽象成对象;Abstracting several image files into objects;
    确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;Identify objects of the same logical path and abstract objects under the same logical path into buckets;
    将所抽象的桶分配至不同的对象容器中;Assign the abstracted buckets to different object containers;
    若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。If the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
  12. 如权利要求11所述的设备,其特征在于,所述将若干个镜像文件抽象成对象,包括:The device of claim 11, wherein the abstracting the plurality of image files into objects comprises:
    确定所述镜像文件对应的哈希值,并根据所述哈希值确定相对应的ID号;Determining a hash value corresponding to the image file, and determining a corresponding ID number according to the hash value;
    根据所述ID号查找出所述镜像文件相对应的保存路径;Finding, according to the ID number, a save path corresponding to the image file;
    根据所查找的保存路径将若干个镜像文件抽象成对象。Several image files are abstracted into objects based on the saved save path.
  13. 如权利要求11所述的设备,其特征在于,所述将所抽象的桶分配至不同的对象容器中,包括:The device of claim 11, wherein the allocating the abstracted buckets to different object containers comprises:
    扫描所有桶中对象的对象名称;Scan the object names of objects in all buckets;
    识别当前所扫描的对象名称所对应的命名规范;Identify the naming convention corresponding to the name of the currently scanned object;
    确定相同命名规范的对象;Identify objects of the same naming convention;
    将所确定的相同命名规范的对象分配至同一个对象容器中。Assign the objects of the same naming convention that are determined to the same object container.
  14. 如权利要求11所述的设备,其特征在于,所述将所抽象的桶分配至不同的对象容器中,包括:The device of claim 11, wherein the allocating the abstracted buckets to different object containers comprises:
    确定所述对象容器进行存储的存储量;Determining a storage amount of the object container to store;
    根据所确定的存储量按照预设顺序对所述桶中的对象进行分配。The objects in the bucket are allocated in a preset order according to the determined storage amount.
  15. 如权利要求11所述的设备,其特征在于,所述根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户,包括:The device according to claim 11, wherein the reading the abstracted bucket from the corresponding object container according to the access instruction and transmitting it to the user comprises:
    根据所述访问指令将镜像仓库的驱动与对象存储系统对接;Interfacing the driver of the mirrored warehouse with the object storage system according to the access instruction;
    将所述访问指令发送至对象存储系统中的对象容器中;Transmitting the access instruction to an object container in the object storage system;
    在所述对象容器中读取相对应的桶;Reading a corresponding bucket in the object container;
    根据镜像仓库与对象存储系统的对接关系将所获取的桶发送至用户。The acquired bucket is sent to the user according to the docking relationship between the mirrored warehouse and the object storage system.
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有一个或者一个以上计算机程序,所述一个或者一个以上计算机程序可被一个或者一个以上的处理器执行,以实现如下步骤:A computer readable storage medium, characterized in that the computer readable storage medium stores one or more computer programs, the one or more computer programs being executable by one or more processors to implement the following step:
    将若干个镜像文件抽象成对象;Abstracting several image files into objects;
    确定相同逻辑路径的对象,并将相同逻辑路径下的对象抽象成桶;Identify objects of the same logical path and abstract objects under the same logical path into buckets;
    将所抽象的桶分配至不同的对象容器中;Assign the abstracted buckets to different object containers;
    若接收到用户的访问指令,根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户。If the user's access instruction is received, the abstracted bucket is read from the corresponding object container according to the access instruction and sent to the user.
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述将若干个镜像文件抽象成对象,包括:The computer readable storage medium of claim 16, wherein the abstracting the plurality of image files into objects comprises:
    确定所述镜像文件对应的哈希值,并根据所述哈希值确定相对应的ID号;Determining a hash value corresponding to the image file, and determining a corresponding ID number according to the hash value;
    根据所述ID号查找出所述镜像文件相对应的保存路径;Finding, according to the ID number, a save path corresponding to the image file;
    根据所查找的保存路径将若干个镜像文件抽象成对象。Several image files are abstracted into objects based on the saved save path.
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,所述将所抽象的桶分配至不同的对象容器中,包括:The computer readable storage medium of claim 16, wherein the allocating the abstracted buckets to different object containers comprises:
    扫描所有桶中对象的对象名称;Scan the object names of objects in all buckets;
    识别当前所扫描的对象名称所对应的命名规范;Identify the naming convention corresponding to the name of the currently scanned object;
    确定相同命名规范的对象;Identify objects of the same naming convention;
    将所确定的相同命名规范的对象分配至同一个对象容器中。Assign the objects of the same naming convention that are determined to the same object container.
  19. 如权利要求16所述的计算机可读存储介质,其特征在于,所述将所抽象的桶分配至不同的对象容器中,包括:The computer readable storage medium of claim 16, wherein the allocating the abstracted buckets to different object containers comprises:
    确定所述对象容器进行存储的存储量;Determining a storage amount of the object container to store;
    根据所确定的存储量按照预设顺序对所述桶中的对象进行分配。The objects in the bucket are allocated in a preset order according to the determined storage amount.
  20. 如权利要求16所述的计算机可读存储介质,其特征在于,所述根据所述访问指令从相对应的对象容器中读取所抽象的桶并发送给用户,包括:The computer readable storage medium of claim 16, wherein the reading the abstracted bucket from the corresponding object container according to the access instruction and transmitting to the user comprises:
    根据所述访问指令将镜像仓库的驱动与对象存储系统对接;Interfacing the driver of the mirrored warehouse with the object storage system according to the access instruction;
    将所述访问指令发送至对象存储系统中的对象容器中;Transmitting the access instruction to an object container in the object storage system;
    在所述对象容器中读取相对应的桶;Reading a corresponding bucket in the object container;
    根据镜像仓库与对象存储系统的对接关系将所获取的桶发送至用户。The acquired bucket is sent to the user according to the docking relationship between the mirrored warehouse and the object storage system.
PCT/CN2018/077126 2018-01-08 2018-02-24 Docker mirror image library file storage method, terminal, device and storage medium WO2019134222A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810016146.3A CN108228842B (en) 2018-01-08 2018-01-08 Docker mirror image library file storage method, terminal, device and storage medium
CN201810016146.3 2018-01-08

Publications (1)

Publication Number Publication Date
WO2019134222A1 true WO2019134222A1 (en) 2019-07-11

Family

ID=62640183

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/077126 WO2019134222A1 (en) 2018-01-08 2018-02-24 Docker mirror image library file storage method, terminal, device and storage medium

Country Status (2)

Country Link
CN (1) CN108228842B (en)
WO (1) WO2019134222A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434254A (en) * 2021-06-30 2021-09-24 深圳平安智汇企业信息管理有限公司 Client deployment method, client deployment apparatus, computer device, and storage medium
CN113568708A (en) * 2021-07-29 2021-10-29 马上消费金融股份有限公司 Platform creation method, device and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855294A (en) * 2012-08-13 2013-01-02 北京联创信安科技有限公司 Intelligent hash data layout method, cluster storage system and method thereof
CN102932415A (en) * 2012-09-26 2013-02-13 东软集团股份有限公司 Method and device for storing mirror image document
CN103116661A (en) * 2013-03-20 2013-05-22 广东宜通世纪科技股份有限公司 Data processing method of database
CN104268159A (en) * 2014-09-03 2015-01-07 河海大学 Real-time data warehouse data pre-storage and pre-access method based on dynamic mirrors
CN106997392A (en) * 2017-04-10 2017-08-01 北京搜狐新媒体信息技术有限公司 Processing method, device and the read method and device of Docker mirror cache information

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105069353B (en) * 2015-08-11 2017-10-24 武汉大学 A kind of credible vessel safety reinforcement means based on Docker
US9639558B2 (en) * 2015-09-17 2017-05-02 International Business Machines Corporation Image building
CN106506587B (en) * 2016-09-23 2021-08-06 中国人民解放军国防科学技术大学 Docker mirror image downloading method based on distributed storage
CN107147728B (en) * 2017-05-31 2020-10-09 中山大学 Multi-tenant management method for object storage system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855294A (en) * 2012-08-13 2013-01-02 北京联创信安科技有限公司 Intelligent hash data layout method, cluster storage system and method thereof
CN102932415A (en) * 2012-09-26 2013-02-13 东软集团股份有限公司 Method and device for storing mirror image document
CN103116661A (en) * 2013-03-20 2013-05-22 广东宜通世纪科技股份有限公司 Data processing method of database
CN104268159A (en) * 2014-09-03 2015-01-07 河海大学 Real-time data warehouse data pre-storage and pre-access method based on dynamic mirrors
CN106997392A (en) * 2017-04-10 2017-08-01 北京搜狐新媒体信息技术有限公司 Processing method, device and the read method and device of Docker mirror cache information

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434254A (en) * 2021-06-30 2021-09-24 深圳平安智汇企业信息管理有限公司 Client deployment method, client deployment apparatus, computer device, and storage medium
CN113568708A (en) * 2021-07-29 2021-10-29 马上消费金融股份有限公司 Platform creation method, device and equipment
CN113568708B (en) * 2021-07-29 2022-10-04 马上消费金融股份有限公司 Platform creation method, device and equipment

Also Published As

Publication number Publication date
CN108228842B (en) 2020-09-25
CN108228842A (en) 2018-06-29

Similar Documents

Publication Publication Date Title
WO2019136800A1 (en) Service processing method, apparatus and device, and computer-readable storage medium
US11075991B2 (en) Partitioning data according to relative differences indicated by a cover tree
US20130246357A1 (en) Managing redundant immutable files using deduplication in storage clouds
US20150339168A1 (en) Work queue thread balancing
WO2017201984A1 (en) Data processing method, associated apparatus, and data storage system
CN111078410B (en) Memory allocation method and device, storage medium and electronic equipment
WO2019223136A1 (en) Data acquisition method and apparatus, and computer device and storage medium
WO2021086693A1 (en) Management of multiple physical function non-volatile memory devices
WO2019134222A1 (en) Docker mirror image library file storage method, terminal, device and storage medium
CN113010265A (en) Pod scheduling method, scheduler, memory plug-in and system
CN115421787A (en) Instruction execution method, apparatus, device, system, program product, and medium
CN109032753B (en) Heterogeneous virtual machine hard disk hosting method and system, storage medium and Nova platform
US10701159B2 (en) Method and apparatus for implementing device sharing
CN107329798B (en) Data replication method and device and virtualization system
CN112596669A (en) Data processing method and device based on distributed storage
WO2022206170A1 (en) Data processing method, server and system
WO2022227561A1 (en) Apparatus and method for data reading, chip, computer device, and storage medium
CN115562871A (en) Memory allocation management method and device
US20230029728A1 (en) Per-service storage of attributes
CN113342270A (en) Volume unloading method and device and electronic equipment
US20170364293A1 (en) Method and apparatus for data processing
US9456024B1 (en) Content sharing in mobile ad hoc networks
CN111866093B (en) Service data distribution method and device
CN113986134B (en) Method for storing data, method and device for reading data
CN113704274B (en) Data reading method and electronic equipment

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 15.10.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18898703

Country of ref document: EP

Kind code of ref document: A1