Image management method, device and electronic equipment

By using a hash algorithm on the mirror management node to select the target node for local cache of mirror data, the problems of slow image download speed and low cache hit rate in the prior art are solved, and efficient image management and storage are achieved.

CN111858156BActive Publication Date: 2024-11-26BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010535438.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-12
Publication Date
2024-11-26
Estimated Expiration
2040-06-12

AI Technical Summary

Technical Problem

During the existing image download process, bandwidth limitations between the image management component and the storage backend result in slow download speeds, and cache hits cannot be guaranteed in multi-node situations, resulting in waste of disk space.

Method used

The target node is selected from the image management node through a preset hash algorithm. When processing the image upload request, the image data is sent to the storage backend and cached locally. When downloading, it is directly sent from the local cache to avoid communication with the storage backend.

Benefits of technology

Improves the download speed of mirror images, avoids waste of storage space, and ensures cache hits, improving overall download efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111858156B_ABST
    Figure CN111858156B_ABST
Patent Text Reader

Abstract

The present embodiment discloses an image management method, device and electronic device, which relate to the field of cloud computing. The method comprises: obtaining an image upload request, wherein the image upload request comprises an image identifier; selecting a target node corresponding to the image identifier from at least one image management node according to a preset hash algorithm; sending a first processing instruction to the target node, wherein the first processing instruction is used to control the target node to send the image data corresponding to the image identifier to the storage backend to form storage data, and store the image data locally to form cache data. The method can avoid storage space waste and ensure image cache hits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of image management, and more particularly, to an image management method, an image management device, an electronic device, and a computer-readable storage medium. Background Art

[0002] A cloud server image is a cloud server template that includes software configurations (such as an operating system, application server, and applications). When creating a cloud server instance, users specify an image. The operating system and software provided by the image will be installed on the instance.

[0003] OpenStack is an open-source cloud computing management platform project. Its main components include the identity service module Keystone, the compute service component Nova, the image service component Glance, and the object storage service module Swift. These components, along with the compute service component and the object storage service module (also known as the storage backend), can be used together to implement functions such as image query, image upload, and image download.

[0004] Figure 1 A conventional image download method is shown. The computing management component sends a download request to the image management component. The image management component then requests image data from the storage backend based on the download request. The storage backend then sends the image data to the computing management component via the image management component, completing the image download. A drawback of this method is that the image download process relies on data transmission between the image management component and the storage backend. Therefore, the image download speed is limited by the bandwidth between the image management component and the storage backend, resulting in a lengthy download process.

[0005] Figure 2 Another existing mirror download method is shown. Figure 1 The difference between the two methods is that when the image management component processes a download request for the first time, it stores the image data locally while transmitting it to form a local cache. In this way, when downloading the image subsequently, the image management component can directly send the image data in the local cache to the computing management component without communicating with the storage backend. Figure 1 This method improves download speeds. However, this download method still has drawbacks. For example, if the image management component includes multiple image management nodes, there's no guarantee that the same node will handle each download request, making image cache hits unreliable. Furthermore, multiple copies of the same image may exist in the cache, wasting disk space. Furthermore, the initial image download still requires communication with the storage backend, resulting in a relatively slow download speed.

[0006] Therefore, it is necessary to propose a new technical solution for image management. Summary of the Invention

[0007] One purpose of the present disclosure is to provide a new technical solution for image management.

[0008] According to a first aspect of the present disclosure, there is provided a mirror management method, comprising:

[0009] Obtaining an image upload request, wherein the image upload request includes an image identifier;

[0010] Selecting a target node corresponding to the image identifier from at least one image management node according to a preset hash algorithm;

[0011] A first processing instruction is sent to the target node, wherein the first processing instruction is used to control the target node to send the mirror data corresponding to the mirror identifier to the storage backend to form storage data, and store the mirror data locally to form cache data.

[0012] Optionally, it also includes:

[0013] Obtaining an image download request, wherein the image download request includes the image identifier;

[0014] Selecting the target node from the at least one mirror management node according to the hash algorithm;

[0015] A second processing instruction is sent to the target node, wherein the second processing instruction is used to control the target node to send cached data corresponding to the mirror identifier stored in the target node to the target device.

[0016] Optionally, selecting a target node corresponding to the image identifier from at least one image management node according to a preset hash algorithm includes:

[0017] Based on the hash algorithm, obtain a hash value corresponding to the image identifier;

[0018] Calculate the remainder of the hash value relative to the total number of mirror management nodes;

[0019] The target node is determined according to the remainder.

[0020] Optionally, the hash algorithm includes at least one of a cyclic redundancy check algorithm, a message digest algorithm, and a secure hash algorithm.

[0021] According to a second aspect of the present disclosure, there is provided an image management device, comprising:

[0022] A first acquisition module is configured to acquire an image upload request sent by a first device, wherein the image upload request includes an image identifier;

[0023] A first selection module is configured to select a target node corresponding to the image identifier from at least one image management node according to a preset hash algorithm;

[0024] A first sending module is used to send a first processing instruction to the target node, wherein the first processing instruction is used to control the target node to send the mirror data corresponding to the mirror identifier to the storage backend to form storage data, and store the mirror data locally to form cache data.

[0025] Optionally, it also includes:

[0026] A second obtaining module, configured to obtain an image download request sent by a second device, wherein the image download request includes the image identifier;

[0027] A second selection module is configured to select the target node from the at least one mirror management node according to a preset hash algorithm;

[0028] The second sending module is configured to send a second processing instruction to the target node, wherein the second processing instruction is configured to control the target node to send cached data corresponding to the mirror identifier stored in the target node to the target device.

[0029] Optionally, the first selection module is further configured to:

[0030] Based on the hash algorithm, obtain a hash value corresponding to the image identifier;

[0031] Calculate the remainder of the hash value relative to the total number of mirror management nodes;

[0032] The target node is determined according to the remainder.

[0033] Optionally, the hash algorithm includes at least one of a cyclic redundancy check algorithm, a message digest algorithm, and a secure hash algorithm.

[0034] According to a third aspect of the present disclosure, there is provided an electronic device comprising a processor and a memory,

[0035] The memory stores machine-executable instructions that can be executed by the processor;

[0036] The processor executes the machine-executable instructions to implement the image management method described in the first aspect of the present disclosure.

[0037] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores executable instructions. When the executable instructions are called and executed by a processor, the executable instructions prompt the processor to implement the image management method described in the first aspect of the present disclosure.

[0038] The image management method in the embodiment of the present disclosure selects a target node from at least one image management node based on the image identifier and a preset hash algorithm, processes the image upload request through the target node, and in addition to sending the image data to the storage backend, also stores it locally. On the one hand, the same image data can be cached in the same image management node, avoiding storage space waste and ensuring image cache hits. On the other hand, since a local cache has been formed when the image is uploaded, there is no need to communicate with the storage backend when downloading the image for the first time, which improves the download speed.

[0039] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0041] Figure 1 This is a schematic diagram of an existing mirror download method.

[0042] Figure 2 This is a schematic diagram of another existing mirror download method.

[0043] Figure 3 is a schematic diagram of an electronic device that can be used to implement an embodiment of the present disclosure.

[0044] Figure 4 is a flowchart of an image management method according to an embodiment of the present disclosure.

[0045] Figure 5 Schematic diagram of an image upload process according to an embodiment of the present disclosure.

[0046] Figure 6 Schematic diagram of the image download process according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0047] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure.

[0048] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0049] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0050] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0051] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0052] <Hardware Configuration>

[0053] Figure 3 The hardware configuration of an electronic device that can be used to implement the embodiments of the present disclosure is shown.

[0054] See also Figure 3 The electronic device 1000 includes a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, and an input device 1600. The processor 1100 may be, for example, a central processing unit (CPU), a microcontroller unit (MCU), or the like. The memory 1200 may include, for example, a ROM (read-only memory), a RAM (random access memory), or a non-volatile memory such as a hard disk. The interface device 1300 may include, for example, a USB interface or a serial interface. The communication device 1400 may be, for example, a wired network card or a wireless network card. The display device 1500 may be, for example, a liquid crystal display. The input device 1600 may include, for example, a touch screen, a keyboard, a mouse, a microphone, or the like.

[0055] In the embodiments of this specification, the memory 1200 of the electronic device 1100 is used to store instructions that control the processor 1100 to perform operations to support implementation of the methods according to any of the embodiments of this specification. A skilled person can design instructions based on the solutions disclosed in this specification. How instructions control processor operations is well known in the art and will not be described in detail here.

[0056] It should be understood by those skilled in the art that although Figure 3 , multiple devices of the electronic device 1000 are shown; however, the electronic device 1000 of the embodiment of this specification may only involve some of the devices, for example, only the processor 1100, the memory 1200 and the communication device 1400.

[0057] Figure 3 The hardware configuration shown is merely illustrative and is in no way intended to limit the disclosure, its application, or uses.

[0058] <Method Example>

[0059] This embodiment provides a method for managing a set of images, for example, Figure 3 The electronic device 1000 is shown as an implementation.

[0060] like Figure 4 As shown, the method includes the following steps S1100-S1300.

[0061] In step S1100 , an image upload request is obtained, wherein the image upload request includes an image identifier.

[0062] The image management method in this embodiment can be applied to an image management client, which can interact with an image management component, and the two can jointly implement an image management service.

[0063] In this embodiment, the image management component includes at least one image management node, wherein each image management node can be a physical machine or a virtual machine.

[0064] In this embodiment, the image management client receives an upload request for a target image, that is, an image upload request, which is sent by a user terminal, for example.

[0065] In this embodiment, the upload request includes an image identifier (or image ID). The image identifier is a unique identifier for an image in the image management service, such as the image's UUID (Universally Unique Identifier).

[0066] In step S1200, a target node corresponding to the image identifier is selected from at least one image management node according to a preset hash algorithm.

[0067] In this embodiment, the image management client selects a unique target node from at least one image management node and processes the upload request through the target node.

[0068] A hash algorithm transforms an input of arbitrary length into an output of fixed length. Alternatively, it compresses a message of arbitrary length into a message digest of a fixed length. A hash algorithm converts a piece of data into a signature (hash value) that is closely associated with every byte of the source data. A hash algorithm is a broad concept that can be considered a concept. Using a hash algorithm can improve storage space utilization, enhance data query efficiency, and create digital signatures to ensure data security.

[0069] In this embodiment, the hash algorithm includes at least one of a cyclic redundancy check algorithm, a message digest algorithm, and a secure hash algorithm. Among them, the cyclic redundancy check algorithm (CRC) is a channel coding technology that generates a short fixed-bit check code based on data such as network data packets or computer files, which can be used to detect or verify errors that may occur after data transmission or storage. The message digest algorithm (Message-Digest Algorithm) is a broad family of algorithms, including MD2, MD3, MD4, MD5, etc., which are currently widely used in data integrity verification, data (message) digests, data encryption, etc. The secure hash algorithm is an important tool in cryptographic applications such as digital signatures. The most commonly used secure hash algorithm at present is the SHA-1 algorithm, which is widely used in information security fields such as e-commerce.

[0070] In one example, according to a preset hash algorithm, a target node corresponding to a mirror identifier is selected from at least one mirror management node, including: obtaining a hash value corresponding to the mirror identifier based on the hash algorithm; calculating the remainder of the hash value relative to the total number of mirror management nodes; and determining the target node based on the remainder.

[0071] In the above example, assume that the target image identifier is "51971ff4bae24e66a6370abbbd24a163" and the preset hash algorithm is the cyclic redundancy check algorithm CRC16. A CRC16 operation is performed on the first 16 bits of the target image identifier to obtain the hash value corresponding to the target image identifier, recorded as H. Assume that the total number of image management nodes is 3, namely node A, node B, and node C. Take the remainder of H relative to the total number of image management nodes, for example, the remainder is 2. It is easy to understand that a remainder of 2 indicates that the hash value H corresponds to the second image management node, so node B is the target node.

[0072] In step S1300, a first processing instruction is sent to the target node, wherein the first processing instruction is used to control the target node to send the mirror data corresponding to the mirror identifier to the storage backend to form storage data, and store the mirror data locally to form cache data.

[0073] In this embodiment, the first instruction user controls the target node to process the image upload request.

[0074] In this embodiment, when processing an image upload request, the target node receives the image data sent by the user terminal and forwards it to the storage backend to form stored data. Furthermore, the target node stores the image data locally to form cached image data. This stored data has a certain degree of stability, such as persistent storage. This cached data is temporary and, for example, may be overwritten by other data.

[0075] The image management method in this embodiment selects a target node from at least one image management node based on the image identifier and a preset hash algorithm, processes the image upload request through the target node, and in addition to sending the image data to the storage backend, also stores it locally. On the one hand, the same image data can be cached in the same image management node, avoiding storage space waste and ensuring image cache hits. On the other hand, since a local cache has been formed when the image is uploaded, there is no need to communicate with the storage backend when downloading the image for the first time, which improves the download speed.

[0076] In one example, the image management method further includes the following steps S1400-S1600.

[0077] In step S1400 , an image download request is obtained, wherein the image download request includes an image identifier.

[0078] In this example, the image management client receives an image download request for a target image. The image download request is sent, for example, by a computing management component. After the computing management component downloads the target image, it can create a virtual machine based on it.

[0079] In this example, the image identifier included in the image download request is the same as the image identifier included in the image upload request described above.

[0080] In step S1500 , a target node is selected from at least one mirror management node according to a hash algorithm.

[0081] In this example, the image management client selects a unique target node from at least one image management node and processes the download request through the target node.

[0082] In this example, the hash algorithm used during the download process is the same as the hash algorithm used during the upload process. Therefore, for the same image identifier, the target node selected during the upload and download processes is also the same. In other words, in this embodiment, the same node handles both the upload and download requests for the same image.

[0083] In step S1600, a second processing instruction is sent to the target node, wherein the second processing instruction is used to control the target node to send cache data corresponding to the mirror identifier stored in the target node to the target device.

[0084] In this example, the second processing instruction is used to control the target node to process the image download request.

[0085] In this example, because the same node handles both upload and download requests for the target image, the target node already has a local image cache of the target image stored during the download process. When processing an image download request, the target node can search its local image cache based on the image identifier and send the cached image directly to the target device, such as the device requesting the image download.

[0086] In the above example, the target node is selected in the image download phase according to the same hash algorithm as in the image upload phase, which can ensure that the same node processes the upload request and download request for the target image, so that the node processing the download request has a local image cache of the target image (i.e., a cache hit is guaranteed), and the download can be completed without communicating with the storage backend.

[0087] Figure 5 FIG. 1 is a schematic diagram of the image upload process according to an embodiment of the present disclosure. Figure 5 As shown, the image management component includes three nodes: Node A, Node B, and Node C. First, the user terminal sends an upload request for the target image to the image management client. Second, the image management client selects a target node from the three image management nodes based on the target image identifier and a preset hash algorithm, for example, selecting Node B as the target node. The image management client then sends relevant instructions to Node B, controlling Node B to process the upload request. Node B receives the image data from the user terminal and sends it to the storage backend for storage. It also stores the image data locally to form an image cache.

[0088] Figure 6 Schematic diagram of the mirror download process according to the embodiment of the present disclosure. Figure 6 As shown, the computing management component sends a request for the target image (with Figure 5 The image client selects Node B as the target node based on the same target image identifier and hash algorithm as in the upload phase. Since Node B already has the target image cache, it sends this cache directly to the computer management component, completing the image download.

[0089] <Device Example>

[0090] This embodiment provides an image management device, including a first acquisition module, a first selection module, and a first sending module.

[0091] The first acquisition module is configured to acquire an image upload request sent by a first device, where the image upload request includes an image identifier.

[0092] The first selection module is used to select a target node corresponding to the image identifier from at least one image management node according to a preset hash algorithm.

[0093] The first sending module is used to send a first processing instruction to the target node, wherein the first processing instruction is used to control the target node to send the mirror data corresponding to the mirror identifier to the storage backend to form storage data, and store the mirror data locally to form cache data.

[0094] Optionally, the image management device further includes a second acquisition module, a second selection module and a second sending module.

[0095] The second obtaining module is configured to obtain an image download request sent by the second device, where the image download request includes an image identifier.

[0096] The second selection module is used to select a target node from at least one mirror management node according to a preset hash algorithm.

[0097] The second sending module is used to send a second processing instruction to the target node, wherein the second processing instruction is used to control the target node to send the cache data corresponding to the mirror identifier stored in the target node to the target device.

[0098] Optionally, the first selection module is further configured to: obtain a hash value corresponding to the image identifier based on a hash algorithm; calculate a remainder of the hash value relative to the total number of image management nodes; and determine a target node based on the remainder.

[0099] Optionally, the hash algorithm includes at least one of a cyclic redundancy check algorithm, a message digest algorithm, and a secure hash algorithm.

[0100] The image management device in this embodiment can implement the various steps described in the embodiment of the method disclosed herein and can also achieve the same technical effects, which will not be described in detail here.

[0101] <Electronic Equipment Example>

[0102] This embodiment provides an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the image management method described in the method embodiment of the present disclosure.

[0103] The electronic device in this embodiment can implement the various steps described in the embodiment of the method disclosed herein, and can also achieve the same technical effects, which will not be described in detail here.

[0104] <Computer-readable storage medium>

[0105] This embodiment provides a computer-readable storage medium storing executable instructions. When the executable instructions are called and executed by a processor, the executable instructions prompt the processor to implement the image management method described in the embodiment of the method disclosed herein.

[0106] The computer-readable storage medium in this embodiment can implement the various steps described in the embodiment of the method disclosed herein, and can also achieve the same technical effects, which will not be repeated here.

[0107] The present disclosure may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0108] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.

[0109] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0110] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions. The electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0111] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0112] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0113] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0114] The flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of an instruction, and a part of the module, program segment or instruction contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.

[0115] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, their practical applications, or technical improvements in the marketplace, or to enable other persons skilled in the art to understand the embodiments disclosed herein. The scope of the present disclosure is defined by the appended claims.

Claims

1. A mirror management method, characterized in that: include: Obtaining an image upload request, wherein the image upload request includes an image identifier; According to a preset hash algorithm, select a target node corresponding to the image identifier from at least one image management node; A first processing instruction is sent to the target node, wherein the first processing instruction is used to control the target node to send the mirror data corresponding to the mirror identifier to the storage backend to form storage data, and store the mirror data locally in the target node to form cache data.

2. The method according to claim 1, characterized in that: Also includes: Obtaining an image download request, wherein the image download request includes the image identifier; Selecting the target node from the at least one mirror management node according to the hash algorithm; A second processing instruction is sent to the target node, wherein the second processing instruction is used to control the target node to send the cache data corresponding to the mirror identifier stored in the target node to the target device.

3. The method according to claim 1, characterized in that The step of selecting a target node corresponding to the image identifier from at least one image management node according to a preset hash algorithm includes: Based on the hash algorithm, obtain a hash value corresponding to the image identifier; Calculate the remainder of the hash value relative to the total number of mirror management nodes; The target node is determined according to the remainder.

4. The method according to claim 1, characterized in that: The hash algorithm includes at least one of a cyclic redundancy check algorithm, a message digest algorithm, and a secure hash algorithm.

5. An image management device, characterized in that: include: A first acquisition module, configured to acquire an image upload request sent by a first device, wherein the image upload request includes an image identifier; A first selection module, configured to select a target node corresponding to the image identifier from at least one image management node according to a preset hash algorithm; The first sending module is used to send a first processing instruction to the target node, wherein the first processing instruction is used to control the target node to send the mirror data corresponding to the mirror identifier to the storage backend to form storage data, and store the mirror data locally in the target node to form cache data.

6. The device according to claim 5, characterized in that Also includes: A second acquisition module, configured to acquire an image download request sent by a second device, wherein the image download request includes the image identifier; A second selection module, configured to select the target node from the at least one mirror management node according to a preset hash algorithm; The second sending module is used to send a second processing instruction to the target node, wherein the second processing instruction is used to control the target node to send the cache data corresponding to the mirror identifier stored in the target node to the target device.

7. The device according to claim 5, characterized in that The first selection module is also used for: Based on the hash algorithm, obtain a hash value corresponding to the image identifier; Calculate the remainder of the hash value relative to the total number of mirror management nodes; The target node is determined according to the remainder.

8. The device according to claim 5, characterized in that The hash algorithm includes at least one of a cyclic redundancy check algorithm, a message digest algorithm, and a secure hash algorithm.

9. An electronic device, characterized in that: including a processor and memory, The memory stores machine executable instructions that can be executed by the processor; The processor executes the machine executable instructions to implement the image management method according to any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores executable instructions, and when the executable instructions are called and executed by the processor, the executable instructions prompt the processor to implement the image management method according to any one of claims 1 to 4.