CN113127430B - Mirror image information processing method, mirror image information processing device, computer readable medium and electronic equipment - Google Patents

Mirror image information processing method, mirror image information processing device, computer readable medium and electronic equipment Download PDF

Info

Publication number
CN113127430B
CN113127430B CN201911394079.XA CN201911394079A CN113127430B CN 113127430 B CN113127430 B CN 113127430B CN 201911394079 A CN201911394079 A CN 201911394079A CN 113127430 B CN113127430 B CN 113127430B
Authority
CN
China
Prior art keywords
mirror image
cache node
mirror
node
original
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201911394079.XA
Other languages
Chinese (zh)
Other versions
CN113127430A (en
Inventor
谢骏斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yiyiyun Technology Co ltd
Original Assignee
Beijing Yiyiyun Technology Co ltd
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 Beijing Yiyiyun Technology Co ltd filed Critical Beijing Yiyiyun Technology Co ltd
Priority to CN201911394079.XA priority Critical patent/CN113127430B/en
Publication of CN113127430A publication Critical patent/CN113127430A/en
Application granted granted Critical
Publication of CN113127430B publication Critical patent/CN113127430B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • 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/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files

Landscapes

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

Abstract

The present disclosure provides a mirror image information processing method, a mirror image information processing apparatus, a computer readable medium, and an electronic device; relates to the technical field of containers. The method comprises the following steps: if the file space of the original mirror image warehouse meets the preset condition, determining a first mirror image cache node of the original mirror image warehouse, and sharing a first storage catalog of the first mirror image cache node to the original mirror image warehouse; if the file space corresponding to the first storage catalog meets the preset condition, generating a second mirror image cache node, and sharing the second storage catalog of the second mirror image cache node to the original mirror image warehouse; associating the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node to obtain node association information; and providing mirror image service through the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node according to the node association information. The method disclosed by the invention can overcome the limitation of the disk space of the mirror warehouse on the service to a certain extent.

Description

Mirror image information processing method, mirror image information processing device, computer readable medium and electronic equipment
Technical Field
The present disclosure relates to the field of container technologies, and in particular, to a mirrored information processing method, a mirrored information processing apparatus, a computer readable medium, and an electronic device.
Background
Container technology effectively partitions resources managed by a single operating system into isolated groups to better balance resource usage requirements among the groups. An application can be run in each container, different containers are isolated from each other, and a communication mechanism can be established between the containers, so that data interaction can be performed. Because the creation and stopping of containers are very fast, the resource requirements are far lower than virtual machines.
The mirror image may be considered a special file system that contains some configuration parameters (e.g., anonymous volumes, environment variables, users, etc.) prepared for the runtime, in addition to the files that are needed to provide the programs, libraries, resources, configurations, etc. that are needed by the runtime of the container. The mirror does not contain any dynamic data, nor does its content change after construction. The image can be easily run on the current host after the image construction is completed, but if the image needs to be used on other servers, a service capable of providing centralized storage and distributing the image, namely an image warehouse, is needed. However, the storage capacity of the mirror warehouse depends on the disk, and in the case of increasing data volume, it is necessary to expand the disk or replace the disk with a larger storage space, and the flow is too complicated.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The disclosure aims to provide a mirror image information processing method, a mirror image information processing device, a computer readable medium and an electronic device, which can overcome the problem of insufficient storage space of a mirror image file to a certain extent, thereby improving storage efficiency.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a mirror image information processing method including:
if the file space of the original mirror image warehouse meets a preset condition, determining a first mirror image cache node of the mirror image warehouse, and sharing a first storage catalog of the first mirror image cache node to the mirror image warehouse;
If the file space corresponding to the first storage catalog meets the preset condition, generating a second mirror image cache node, and sharing the second storage catalog of the second mirror image cache node to the mirror image warehouse;
associating the mirror image warehouse, the first mirror image cache node and the second mirror image cache node to obtain node association information;
And providing mirror image service through the mirror image warehouse, the first mirror image cache node and the second mirror image cache node according to the node association information.
In an exemplary embodiment of the disclosure, the associating the original mirrored repository, the first mirrored cache node, and the second mirrored cache node includes:
And associating the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node through the first address information of the original mirror image warehouse and the second address information of the first mirror image cache node.
In an exemplary embodiment of the disclosure, the associating the original mirrored repository, the first mirrored cache node, and the second mirrored cache node includes:
determining first address information of the original mirror image warehouse as a cache address corresponding to the first mirror image cache node so as to correlate the original mirror image warehouse with the first mirror image cache node;
And determining the second address information of the first mirror cache node as a cache address corresponding to the second mirror cache node, so as to correlate the first mirror cache node with the second mirror cache node.
In an exemplary embodiment of the present disclosure, the providing, according to the node association information, a mirror service through the original mirror repository, the first mirror cache node, and the second mirror cache node includes:
receiving a mirror image downloading requirement, and searching a mirror image file to be downloaded in the second mirror image cache node;
If the image file to be downloaded does not exist in the second image cache node, searching the image file to be downloaded in the first image cache node according to the node association information;
And if the image file to be downloaded does not exist in the first image cache node, searching the image file to be downloaded in the original image warehouse according to the node association information.
In an exemplary embodiment of the present disclosure, the providing, according to the node association information, a mirror service through the original mirror repository, the first mirror cache node, and the second mirror cache node includes:
And receiving an image uploading requirement, and uploading the image file to be uploaded to the first storage catalog or the second storage catalog through the original image warehouse.
In an exemplary embodiment of the present disclosure, the determining the first address information of the original mirror repository as the cache address corresponding to the first mirror cache node includes:
and determining the first address information of the original mirror image warehouse as the cache address of the first mirror image cache node through the configuration file of the first mirror image cache node.
In an exemplary embodiment of the present disclosure, the first mirrored cache node and the second mirrored cache node are mirrored warehouses that are started in a cache mode.
According to a second aspect of the present disclosure, there is provided a mirrored information processing apparatus including: the system comprises a first node acquisition module, a second node acquisition module, a node association module and a mirror image service module, wherein:
the first node acquisition module is used for determining a first mirror image cache node of the mirror image warehouse if the file space of the original mirror image warehouse meets a preset condition, and sharing a first storage catalog of the first mirror image cache node to the original mirror image warehouse.
And the second node acquisition module is used for generating a second mirror image cache node and sharing the second storage catalog of the second mirror image cache node to the original mirror image warehouse if the file space corresponding to the first storage catalog meets the preset condition.
And the node association module is used for associating the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node to acquire node association information.
And the mirror image service module is used for providing mirror image service through the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node according to the node association information.
In one exemplary embodiment of the present disclosure, the node association module may be specifically configured to: and associating the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node through the first address information of the original mirror image warehouse and the second address information of the first mirror image cache node.
In an exemplary embodiment of the present disclosure, the node association module may specifically include a first association module and a second association module, where:
and the first association module is used for determining the first address information of the original mirror image warehouse as a cache address corresponding to the first mirror image cache node so as to associate the original mirror image warehouse with the first mirror image cache node.
And the second association module is used for determining the second address information of the first mirror image cache node as a cache address corresponding to the second mirror image cache node so as to associate the first mirror image cache node with the second mirror image cache node.
In an exemplary embodiment of the present disclosure, the mirroring service module may specifically include a download requirement obtaining module, a first lookup module, and a second lookup module, where:
And the downloading demand acquisition module is used for receiving the mirror image downloading demand and searching the mirror image file to be downloaded in the second mirror image cache node.
And the first searching module is used for searching the image file to be downloaded in the first image cache node according to the node association information if the image file to be downloaded does not exist in the second image cache node.
And the second searching module is used for searching the image file to be downloaded in the original image warehouse according to the node association information if the image file to be downloaded does not exist in the first image cache node.
In an exemplary embodiment of the present disclosure, the image service module may specifically include an image upload service module, configured to receive an image upload request, and upload, through the original image repository, an image file to be uploaded to the first storage directory or the second storage directory.
In an exemplary embodiment of the present disclosure, the first association module may be specifically configured to: and determining the first address information of the original mirror image warehouse as the cache address of the first mirror image cache node through the configuration file of the first mirror image cache node.
In an exemplary embodiment of the present disclosure, the first mirrored cache node and the second mirrored cache node are mirrored warehouses that are started in a cache mode.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of any of the above via execution of the executable instructions.
According to a fourth aspect of the present disclosure, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method of any of the above.
Exemplary embodiments of the present disclosure may have some or all of the following advantages:
In the mirror image information processing method provided by an example embodiment of the present disclosure, when a file space of a mirror image warehouse is insufficient, a first mirror image cache node may be generated, and by sharing a storage directory with the first mirror image cache node, the file space of the mirror image warehouse may be increased, so as to achieve an effect of expanding a disk space of the mirror image warehouse; in addition, the complex operation of disk capacity expansion or disk replacement is not needed, the operation complexity can be reduced, and the operation efficiency is improved; meanwhile, the service stop during disk capacity expansion or replacement can be avoided, and the risk of mirror image warehouse service can be reduced; in addition, when the file space of the first mirror image cache node is insufficient, the storage space can be increased by adding the mirror image cache node again, so that the storage space of the mirror image warehouse can be expanded, the storage space can be flexibly changed according to the needs of a user, and the stability of the mirror image warehouse can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 schematically illustrates a flow diagram of a mirrored information processing method according to one embodiment of the disclosure;
FIG. 2 schematically illustrates a flow chart of a mirrored information processing method according to another embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart of a mirrored information processing method according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a block diagram of a mirrored information processing apparatus according to one embodiment of the disclosure;
FIG. 5 schematically illustrates a system architecture diagram for implementing a mirrored information processing method according to one embodiment of the disclosure;
Fig. 6 shows a schematic diagram of a computer system suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. One skilled in the relevant art will recognize, however, that the aspects of the disclosure may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
The following describes the technical scheme of the embodiments of the present disclosure in detail:
the present exemplary embodiment first provides a mirror information processing method. Referring to fig. 1, the image information processing method may include the steps of:
Step S110: if the file space of the original mirror image warehouse meets the preset condition, determining a first mirror image cache node of the mirror image warehouse, and sharing a first storage catalog of the first mirror image cache node to the mirror image warehouse.
Step S120: and if the file space corresponding to the first storage catalog meets the preset condition, generating a second mirror image cache node, and sharing the second storage catalog of the second mirror image cache node to the original mirror image warehouse.
Step S130: and associating the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node to obtain node association information.
Step S140: and providing mirror image service through the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node according to the node association information.
In the mirror image information processing method provided by an example embodiment of the present disclosure, when a file space of an original mirror image warehouse is insufficient, a first mirror image cache node may be generated, and by sharing a storage directory with the first mirror image cache node, the file space of the original mirror image warehouse may be increased, so as to achieve an effect of expanding a disk space of the mirror image warehouse; in addition, the complex operation of disk capacity expansion or disk replacement is not needed, the operation complexity can be reduced, and the operation efficiency is improved; meanwhile, the service stop during disk capacity expansion or replacement can be avoided, and the risk of mirror image warehouse service can be reduced; in addition, when the file space of the first mirror image cache node is insufficient, the storage space can be increased by adding the mirror image cache node again, so that the storage space of the mirror image warehouse can be expanded, the storage space can be flexibly changed according to the needs of a user, and the stability of the mirror image warehouse can be improved.
Next, the above steps of the present exemplary embodiment will be described in more detail.
In step S110, if the file space of the original mirror image repository meets a preset condition, determining a first mirror image cache node of the mirror image repository, and sharing a first storage directory of the first mirror image cache node to the mirror image repository.
The file space refers to a storage space of a file, and an image in an original image warehouse needs to be stored in a disk, so that the file space can comprise the available capacity of the disk and also can comprise the size of the occupied space of the image file. The image warehouse can provide service of image uploading or downloading, and as a user operates the image warehouse, the space occupied by image files is larger and larger, and the available capacity of a disk is smaller and smaller. The preset condition may refer to a condition that the space occupied by the image file or the available capacity of the disk needs to be met, and exemplary, the preset condition may include that the available capacity of the disk is smaller than a specific value, for example, the available capacity of the disk is smaller than 10M; it may also include that the space occupied by the image file is beyond a certain range, for example, the space occupied by the image file is beyond 99% of the disk size; in addition, the preset conditions may include other conditions, for example, a file space greater than 100G, a file space less than 100M, and the like, which is not particularly limited in this embodiment.
In this embodiment, the file space is exemplified by the available capacity of the disk on which the image file is located. For example, if the file space of the mirror repository is less than 5%, it may be determined that the preset condition is satisfied, a first mirror cache node of the original mirror repository is generated. The original mirror image warehouse is a mirror image warehouse to be processed, the first mirror image cache node can be another mirror image warehouse, the first mirror image cache node can be obtained by starting a mirror image warehouse newly, and the new mirror image warehouse can be started in a cache mode. In this embodiment, the original image repository may be started in a normal mode, the first image cache node may be started in a cache mode, the image repository started in the normal mode may provide image upload and download services, and the image repository started in the cache mode may download an image, but may not upload an image. Similarly, the second mirrored cache node may also be obtained by restarting a new mirrored repository in the cache mode.
When the mirror image warehouse is newly built, a file directory for storing mirror images can be configured, and the first storage directory is the file directory for storing mirror images of the first mirror image cache node. Therefore, when the first mirror image cache node is generated, the file directory input by the user can be obtained as a first storage directory of the first mirror image cache node; or a file directory may be predetermined as the first storage directory. The user can configure the first storage directory through the configuration file when the first mirror cache node is newly built, and then the configuration file can be loaded to determine the first storage directory when the first mirror cache node is started; or the embodiment may provide a graphical user interface, and the user may input a file directory in the graphical user interface, and further save the file directory after the user confirms the file directory as the first storage directory of the first cache node. After the first storage directory is determined, the first storage directory can be shared with the original mirror image warehouse, and specifically, the file directory of the original mirror image warehouse can be changed into the first storage directory, or a subdirectory is created in the first storage directory to be used as the file directory of the original mirror image warehouse; the read-write permission of the first storage directory can be bound to the original mirror image warehouse, so that the original mirror image warehouse and the first mirror image cache node can share the same storage directory, and the mirror image can be written into or read from the first storage directory together. Therefore, when the file space of the original mirror image warehouse for storing the mirror images is insufficient, the storage catalog is shared with the first mirror image cache node, so that the original mirror image warehouse can continue to provide the service of downloading or uploading the mirror images, the storage space can be increased under the condition that the disk of the original mirror image warehouse is not required to be replaced, the problem that the service of the original mirror image warehouse is stopped due to disk replacement or disk expansion can be avoided, and the service stability can be ensured.
In step S120, if the file space corresponding to the first storage directory meets the preset condition, a second mirror image cache node is generated, and the second storage directory of the second mirror image cache node is shared to the original mirror image repository.
Similarly, if the file space corresponding to the first storage directory is insufficient, a mirror image warehouse can be newly built again, so that a second mirror image cache node is obtained. And the file catalogue of the original mirror image warehouse can be changed, the second storage catalogue of the second mirror image cache node can be shared to the original mirror image warehouse, and at the moment, the sharing of the first storage catalogue of the original mirror image warehouse and the first mirror image cache node can be stopped. For example, the original image repository may be set to share only one file at a time, and when the second image cache node is started, the sharing with the first storage directory may be stopped first, and then the sharing with the second storage directory may be established.
For example, an image warehouse a is started first as an original image warehouse, at this time, a may provide an image service for a user, when the space of a is insufficient, an image warehouse B is started as a first image cache node, then a file storage directory of a and B is shared, so that a file of a can be stored under the storage directory of B, when the space of B is insufficient again, an image warehouse C may be started again as a second image cache node, and the file directories of a and C are shared, and so on, the problem of insufficient space of the original image warehouse can be solved by continuously starting a new image cache node, so that the capacity of the image warehouse is not limited by the size of a disk, and the requirement of the user can be met.
In step S130, the original mirror repository, the first mirror cache node, and the second mirror cache node are associated to obtain node association information.
The mirror image warehouse can be connected and accessed through the address where the mirror image warehouse is located, so that the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node can be associated through the addresses corresponding to the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node respectively, and node association information is obtained. Specifically, first address information of the original mirror image warehouse can be determined, and then the first mirror image cache node is associated with the original mirror image warehouse through the first address information, for example, the first address information is written into a configuration file of the first mirror image cache node, so that the first mirror image cache node can access the original mirror image warehouse; and then, after the second mirror image cache node is started, determining second address information of the first mirror image cache node, and writing the second address information in a configuration file of the second mirror image cache node, so that the second mirror image cache node can access to the first mirror image cache node according to the configuration file. The first address information and the second address information may include identification information of the mirror warehouse, for example, an IP address, a port number, and the like, which is not particularly limited in this embodiment. The chain mirror image warehouse service architecture can be formed by associating the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node, and a new mirror image cache node can be expanded after the second mirror image cache node, so that an expandable mirror image warehouse service group is formed through the chain structure.
The first mirror cache node and the second mirror cache node may serve a mirror repository that is started in a cache mode, and when the mirror repository is started in the cache mode, an address of a remote mirror repository needs to be specified, so that when there is no mirror to be pulled in the mirror cache node, the mirror to be pulled may be searched from the remote mirror repository. The mirrored repository, the first mirrored cache node and the second mirrored cache node may be mirrored by addresses specified in the cache mode. As shown in fig. 2, the method may include the following step S201 and step S202, specifically:
In step S201, the first address information of the original mirror repository is determined as a cache address corresponding to the first mirror cache node, so that the original mirror repository is mirror-associated with the first mirror cache node. For example, when the mirror image repository is started, the resources required by the operation, such as environment variables, library files and the like, and the cache address required in the cache mode are determined according to the configuration file, so that the cache address in the configuration file of the first cache node can be set as the first address information of the original mirror image repository, and when the first mirror image cache node provides the mirror image repository service, the required mirror image can be obtained from the original mirror image repository corresponding to the first address information.
In step S202, the second address information of the first mirrored cache node is determined as the corresponding cache address of the second mirrored cache node, and the first mirrored cache node and the second mirrored cache node have been associated. Similarly, the cache address in the configuration file of the second mirror image cache node can be set according to the second address information of the first mirror image cache node, so that the second mirror image cache node can acquire the mirror image in the first mirror image cache node.
After the mirror image warehouse is associated, node association information can be obtained. The node association information refers to information representing association relation between mirror image warehouses, and specifically may include address information of an original mirror image warehouse and address information of a first mirror image cache node, and may further include address information of a second mirror image cache node; in addition, the node association information may further include a configuration file of the mirror cache node, or other information generated by other association methods, for example, after the first mirror cache node is associated with the original mirror cache, and the second mirror cache node is associated with the first mirror cache, the key-value information may be used as node association information. In other embodiments of the present disclosure, the mirror warehouse may also be associated in other manners, for example, associating data in a custom format, such as a linked list, so that the data in the custom format is used as node association information, which also belongs to the protection scope of the present disclosure.
In step S140, according to the node association information, mirror service is provided through the original mirror repository, the first mirror cache node, and the second mirror cache node.
In this embodiment, according to the node association information, one of the original mirror image repository, the first mirror image cache node, and the second mirror image cache node may be selected as the mirror image repository for providing the mirror image service. Specifically, the original mirror repository may be determined as the head node before the first mirror cache node is generated, mirror services may be provided through the head node, and the head node may be updated after the first mirror cache node is generated, that is, the first mirror cache node may be used as the head node, and similarly, the second mirror cache node may be used as the head node after the second mirror cache node is generated. The time spent for switching the catalogs is far less than the time required by the disk expansion operation, so that the problem of service interruption caused by insufficient disk space can be greatly relieved, and the stability and the safety of mirror image service can be ensured.
For example, a mirror warehouse a in a normal mode is started first, at this time, a is used as a head node for providing service, when the space of a is about to run out, a mirror warehouse B in a cache mode is started again, and a cache address is set as the address of the first mirror warehouse a, at this time, B is a head node for providing service, if the space of B is about to run out, a mirror warehouse C in a cache mode is started again, and a cache address is set as the address of B, at this time, C is used as a head node for providing service.
In an exemplary embodiment, the method may include steps S301 to S303, as shown in fig. 3, wherein:
In step S301, an image download requirement is received, and an image file to be downloaded is searched for in the second image cache node. The image downloading requirement can include identification information or attribute information of the image file to be downloaded, for example, a file name, a version number, a label and the like of the image file to be downloaded; or may include other information, for example, a destination address for storing the image file to be downloaded, which is not particularly limited in this embodiment. For example, the image downloading requirement of the user may be acquired through a graphical user interface, for example, the tag of the image file to be downloaded input by the user may be acquired through an input box, and if information is acquired from the input box, it may be determined that the image downloading requirement is received. If the image file to be downloaded is obtained from the image downloading requirement, the image to be downloaded can be searched in the second image cache node, and specifically, the image to be downloaded can be searched in a second storage directory corresponding to the second image cache node.
In step S302, if the image file to be downloaded does not exist in the second image cache node, the image file to be downloaded is searched for in the first image cache node according to the node association information. The method includes the steps that an image to be downloaded can be searched in a second storage directory according to identification information of the image file to be downloaded, if the image to be downloaded is not searched, address information of an image warehouse associated with a second image cache node, namely, address information of a first image cache node is determined according to node association information, then the first image cache node is accessed according to the address information, and the image file to be downloaded is continuously searched in the first storage directory corresponding to the first image cache node. If the image file to be downloaded is found in the second image cache node, the image file to be downloaded can be pulled from the storage space of the second image cache node and provided for the user.
In step S303, if the image file to be downloaded does not exist in the first image cache node, the image file to be downloaded is searched in the original image repository according to the node association information. If the image file to be downloaded is not found in the first storage directory corresponding to the first image cache node, the address information of the original image warehouse associated with the first image cache node can be determined according to the node association information, then the original image warehouse is accessed according to the address information, and the image file to be downloaded is continuously found in the storage space corresponding to the original image warehouse, so that the image file to be downloaded is obtained from the original image warehouse.
It can be understood that there are more than two mirror image warehouses in the cache mode in this embodiment, in other words, this embodiment may include third, fourth, fifth and other mirror image cache nodes, and new mirror image cache nodes may be continuously started according to actual needs, so as to obtain three, four or more mirror image warehouses, and form a chained mirror image warehouse architecture. When downloading the mirror image, the file to be downloaded is firstly searched in the head node, the head node is the last started mirror image warehouse, if the mirror image to be downloaded is not in the mirror image stored in the head node, the mirror image to be downloaded which is required to be searched in the mirror image warehouse pointed by the head node is searched according to the cache address, and the like, recursive searching is performed in the chained mirror image warehouse framework until the original mirror image warehouse is finally searched, so that the stability of the mirror image downloading service is ensured.
Because the first mirror image cache node and the second mirror image cache node are mirror image warehouses running in a cache mode, mirror image uploading service cannot be provided on the first mirror image cache node and the second mirror image cache node, and therefore, for mirror image uploading requirements, a mirror image uploading function can be achieved through an original mirror image warehouse. Specifically, when the image uploading requirement is received, the image file to be uploaded can be obtained through the image uploading requirement, for example, a file path where the image file to be uploaded is located is analyzed from the image uploading requirement, for example, an uploading interface can be provided, the image file to be uploaded is obtained through the interface, and the like, then the original image warehouse can be traced back to the original image warehouse according to the node association relationship, and the original image warehouse is used as an image warehouse for providing services, and the image file to be uploaded is uploaded through the original image warehouse. The original mirror image warehouse can share the same catalog with the latest mirror image cache node, so that the mirror image file to be uploaded through the original mirror image warehouse can be stored in the storage catalog corresponding to the latest mirror image cache node, the problem that the original mirror image warehouse is insufficient in space can be solved, and the problem that the mirror image cache node in the cache mode cannot upload the mirror image can be solved.
Further, in this exemplary embodiment, there is also provided a mirror image information processing apparatus configured to execute the above-described mirror image information processing method of the present disclosure. The device can be applied to a server or terminal equipment.
Referring to fig. 4, the image information processing apparatus 400 may include: a first node acquisition module 410, a second node acquisition module 420, a node association module 430, and a mirror service module 440, wherein:
A first node obtaining module 410, configured to determine a first mirror image cache node of an original mirror image repository if a file space of the original mirror image repository meets a preset condition, and share a first storage directory of the first mirror image cache node to the original mirror image repository;
the second node obtaining module 420 is configured to generate a second mirror image cache node if the file space corresponding to the first storage directory meets the preset condition, and share the second storage directory of the second mirror image cache node to the original mirror image repository;
The node association module 430 is configured to associate the original mirror repository, the first mirror cache node, and the second mirror cache node to obtain node association information;
And the mirror service module 440 is configured to provide mirror service through the original mirror repository, the first mirror cache node, and the second mirror cache node according to the node association information.
In one exemplary embodiment of the present disclosure, the node association module 430 may be specifically configured to: and associating the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node through the first address information of the original mirror image warehouse and the second address information of the first mirror image cache node.
In an exemplary embodiment of the present disclosure, the node association module 430 may specifically include a first association module and a second association module, where:
and the first association module is used for determining the first address information of the original mirror image warehouse as a cache address corresponding to the first mirror image cache node so as to associate the original mirror image warehouse with the first mirror image cache node.
And the second association module is used for determining the second address information of the first mirror image cache node as a cache address corresponding to the second mirror image cache node so as to associate the first mirror image cache node with the second mirror image cache node.
In an exemplary embodiment of the present disclosure, the image service module 440 may specifically include a download requirement acquisition module, a first lookup module, and a second lookup module, where:
And the downloading demand acquisition module is used for receiving the mirror image downloading demand and searching the mirror image file to be downloaded in the second mirror image cache node.
And the first searching module is used for searching the image file to be downloaded in the first image cache node according to the node association information if the image file to be downloaded does not exist in the second image cache node.
And the second searching module is used for searching the image file to be downloaded in the original image warehouse according to the node association information if the image file to be downloaded does not exist in the first image cache node.
In an exemplary embodiment of the present disclosure, the image service module 440 may specifically include an image upload service module, configured to receive an image upload request, and upload, through the original image repository, an image file to be uploaded to the first storage directory or the second storage directory.
In an exemplary embodiment of the present disclosure, the first association module may be specifically configured to: and determining the first address information of the original mirror image warehouse as the cache address of the first mirror image cache node through the configuration file of the first mirror image cache node.
In an exemplary embodiment of the present disclosure, the first mirrored cache node and the second mirrored cache node are mirrored warehouses that are started in a cache mode.
Since each functional module of the image information processing apparatus according to the exemplary embodiment of the present disclosure corresponds to a step of the exemplary embodiment of the image information processing method described above, for details not disclosed in the embodiment of the apparatus of the present disclosure, please refer to the embodiment of the image information processing method described above in the present disclosure.
Referring to fig. 5, fig. 5 is a schematic diagram showing a system architecture of an exemplary application environment to which a mirrored information processing method and a mirrored information processing apparatus according to an embodiment of the present disclosure can be applied.
As shown in fig. 5, the system architecture 500 may include one or more of terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used as a medium to provide communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The terminal devices 501, 502, 503 may be various electronic devices with display screens including, but not limited to, desktop computers, portable computers, smart phones, tablet computers, and the like. It should be understood that the number of terminal devices, networks and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, the server 505 may be a server cluster formed by a plurality of servers.
The image information processing method provided by the embodiment of the present disclosure is generally executed by the server 505, and accordingly, the image information processing apparatus is generally provided in the server 505. However, it will be readily understood by those skilled in the art that the image information processing method provided in the embodiment of the present disclosure may be performed by the terminal devices 501, 502, 503, and accordingly, the image information processing apparatus may be provided in the terminal devices 501, 502, 503, which is not particularly limited in the present exemplary embodiment.
Fig. 6 shows a schematic diagram of a computer system suitable for use in implementing embodiments of the present disclosure.
It should be noted that, the computer system 600 of the electronic device shown in fig. 6 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present disclosure.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present disclosure, the processes described below with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The computer program, when executed by a Central Processing Unit (CPU) 601, performs the various functions defined in the method and apparatus of the present application.
It should be noted that the computer readable medium shown in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; or may exist alone without being incorporated into the electronic device. The computer-readable medium carries one or more programs which, when executed by one of the electronic devices, cause the electronic device to implement the methods described in the embodiments below. For example, the electronic device may implement the steps shown in fig. 1 and 2, and so on.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (9)

1. A mirror image information processing method, characterized by comprising:
If the file space of the original mirror image warehouse meets a preset condition, determining a first mirror image cache node of the original mirror image warehouse, and sharing a first storage catalog of the first mirror image cache node to the original mirror image warehouse;
If the file space corresponding to the first storage catalog meets the preset condition, generating a second mirror image cache node, and sharing the second storage catalog of the second mirror image cache node to the original mirror image warehouse;
determining first address information of the original mirror image warehouse as a cache address corresponding to the first mirror image cache node so as to correlate the original mirror image warehouse with the first mirror image cache node;
Determining second address information of the first mirror cache node as a cache address corresponding to the second mirror cache node, so as to correlate the first mirror cache node with the second mirror cache node to obtain node correlation information;
and providing mirror image service through the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node according to the node association information.
2. The method of claim 1, wherein the associating the original mirrored repository, the first mirrored cache node, and the second mirrored cache node comprises:
And associating the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node through the first address information of the original mirror image warehouse and the second address information of the first mirror image cache node.
3. The method of claim 1, wherein providing mirror services through the original mirror repository, the first mirror cache node, and the second mirror cache node based on the node association information comprises:
receiving a mirror image downloading requirement, and searching a mirror image file to be downloaded in the second mirror image cache node;
If the image file to be downloaded does not exist in the second image cache node, searching the image file to be downloaded in the first image cache node according to the node association information;
And if the image file to be downloaded does not exist in the first image cache node, searching the image file to be downloaded in the original image warehouse according to the node association information.
4. The method of claim 1, wherein providing mirror services through the original mirror repository, the first mirror cache node, and the second mirror cache node based on the node association information comprises:
And receiving an image uploading requirement, and uploading the image file to be uploaded to the first storage catalog or the second storage catalog through the original image warehouse.
5. The method of claim 1, wherein determining the first address information of the original mirrored repository as the cache address corresponding to the first mirrored cache node comprises:
and determining the first address information of the original mirror image warehouse as the cache address of the first mirror image cache node through the configuration file of the first mirror image cache node.
6. The method of claim 1, wherein the first mirrored cache node and the second mirrored cache node are mirrored warehouses that are started in a cache mode.
7. A mirrored information processing apparatus, comprising:
The first node acquisition module is used for determining a first mirror image cache node of the mirror image warehouse and sharing a first storage catalog of the first mirror image cache node to the original mirror image warehouse if the file space of the original mirror image warehouse meets a preset condition;
the second node obtaining module is used for generating a second mirror image cache node and sharing the second storage catalog of the second mirror image cache node to the original mirror image warehouse if the file space corresponding to the first storage catalog meets the preset condition;
the node association module is used for determining the first address information of the original mirror image warehouse as a cache address corresponding to the first mirror image cache node so as to associate the original mirror image warehouse with the first mirror image cache node; determining second address information of the first mirror cache node as a cache address corresponding to the second mirror cache node, so as to correlate the first mirror cache node with the second mirror cache node to obtain node correlation information;
And the mirror image service module is used for providing mirror image service through the original mirror image warehouse, the first mirror image cache node and the second mirror image cache node according to the node association information.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any of claims 1-6.
9. An electronic device, comprising:
A processor; and
A memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1-6 via execution of the executable instructions.
CN201911394079.XA 2019-12-30 2019-12-30 Mirror image information processing method, mirror image information processing device, computer readable medium and electronic equipment Active CN113127430B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911394079.XA CN113127430B (en) 2019-12-30 2019-12-30 Mirror image information processing method, mirror image information processing device, computer readable medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911394079.XA CN113127430B (en) 2019-12-30 2019-12-30 Mirror image information processing method, mirror image information processing device, computer readable medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113127430A CN113127430A (en) 2021-07-16
CN113127430B true CN113127430B (en) 2024-05-03

Family

ID=76768049

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911394079.XA Active CN113127430B (en) 2019-12-30 2019-12-30 Mirror image information processing method, mirror image information processing device, computer readable medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113127430B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785770A (en) * 2022-04-01 2022-07-22 京东科技信息技术有限公司 Mirror layer file sending method and device, electronic equipment and computer readable medium
CN114900485B (en) * 2022-05-06 2024-05-31 阿里巴巴(中国)有限公司 Method, electronic equipment and system for accessing network file storage

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003067279A (en) * 2001-08-28 2003-03-07 Nec Corp Contents dynamic mirroring system
US7996608B1 (en) * 2005-10-20 2011-08-09 American Megatrends, Inc. Providing redundancy in a storage system
CN102629941A (en) * 2012-03-20 2012-08-08 武汉邮电科学研究院 Caching method of a virtual machine mirror image in cloud computing system
CN102750364A (en) * 2012-06-13 2012-10-24 华为技术有限公司 Method, compiler and system for distributing memory address space for image files
CN103927215A (en) * 2013-12-17 2014-07-16 哈尔滨安天科技股份有限公司 kvm virtual machine scheduling optimization method and system based on memory disk and SSD disk
WO2016080953A1 (en) * 2014-11-17 2016-05-26 Hitachi, Ltd. Method and apparatus for data cache in converged system
CN105653394A (en) * 2014-11-14 2016-06-08 腾讯科技(深圳)有限公司 Data backup method and device
CN108322496A (en) * 2017-01-17 2018-07-24 北京京东尚科信息技术有限公司 Image file distribution method and system, computer readable storage medium, electronic equipment
CN109814980A (en) * 2019-01-25 2019-05-28 新华三云计算技术有限公司 Image file acquisition methods and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005293315A (en) * 2004-03-31 2005-10-20 Nec Corp Data mirror type cluster system and synchronous control method for it
CN104735119B (en) * 2013-12-23 2018-05-04 伊姆西公司 The method and apparatus avoided for data copy
US10776267B2 (en) * 2017-12-11 2020-09-15 Red Hat, Inc. Mirrored byte addressable storage

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003067279A (en) * 2001-08-28 2003-03-07 Nec Corp Contents dynamic mirroring system
US7996608B1 (en) * 2005-10-20 2011-08-09 American Megatrends, Inc. Providing redundancy in a storage system
CN102629941A (en) * 2012-03-20 2012-08-08 武汉邮电科学研究院 Caching method of a virtual machine mirror image in cloud computing system
CN102750364A (en) * 2012-06-13 2012-10-24 华为技术有限公司 Method, compiler and system for distributing memory address space for image files
CN103927215A (en) * 2013-12-17 2014-07-16 哈尔滨安天科技股份有限公司 kvm virtual machine scheduling optimization method and system based on memory disk and SSD disk
CN105653394A (en) * 2014-11-14 2016-06-08 腾讯科技(深圳)有限公司 Data backup method and device
WO2016080953A1 (en) * 2014-11-17 2016-05-26 Hitachi, Ltd. Method and apparatus for data cache in converged system
CN108322496A (en) * 2017-01-17 2018-07-24 北京京东尚科信息技术有限公司 Image file distribution method and system, computer readable storage medium, electronic equipment
CN109814980A (en) * 2019-01-25 2019-05-28 新华三云计算技术有限公司 Image file acquisition methods and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Hadoop分布式集群的自动化容器部署研究;李杰等;《计算机应用研究》;第3404-3407+3445页 *
MFS: A Lightweight Block-level Local Mirror of Remote File System;Chunxia Zhang等;《Journal of Software》;第1459-1470页 *
面向云计算平台的网络缓存系统的实现;张建惠;《中国优秀硕士学位论文全文数据库 信息科技辑》;I137-60 *

Also Published As

Publication number Publication date
CN113127430A (en) 2021-07-16

Similar Documents

Publication Publication Date Title
KR102240557B1 (en) Method, device and system for storing data
CN109976667B (en) Mirror image management method, device and system
CN111078147B (en) Processing method, device and equipment for cache data and storage medium
JP6542909B2 (en) File operation method and apparatus
CA2964461C (en) Composite partition functions
US20190050421A1 (en) Fast Recovery Using Self-Describing Replica Files In A Distributed Storage System
US10585760B2 (en) File name level based file search and restoration from block level backups of virtual machines
CN110389786B (en) Kernel management method, electronic device and computer-readable storage medium
CN110520844A (en) Cloud management platform, virtual machine management method and its system
CN112965761B (en) Data processing method, system, electronic equipment and storage medium
CN104268229A (en) Resource obtaining method and device based on multi-process browser
CN113127430B (en) Mirror image information processing method, mirror image information processing device, computer readable medium and electronic equipment
CN111966631A (en) Mirror image file generation method, system, equipment and medium capable of being rapidly distributed
CN111857539A (en) Method, apparatus and computer program product for managing a storage system
CN110990356B (en) Real-time automatic capacity expansion method and system for logical mirror image
CN110489162B (en) Method, device, medium and equipment for simplifying installation package SO (storage and retrieval) file
CN113779004A (en) Data verification method and device
CN112395437B (en) 3D model loading method and device, electronic equipment and storage medium
CN117435569A (en) Dynamic capacity expansion method, device, equipment, medium and program product for cache system
US20240061701A1 (en) Memory sharing method and device for virtual machines
CN115562871A (en) Memory allocation management method and device
CN110609728A (en) Page generation method and device and electronic equipment
CN115484149B (en) Network switching method, network switching device, electronic equipment and storage medium
US9251101B2 (en) Bitmap locking using a nodal lock
CN113996066A (en) Game application updating method and device, storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant