A local image warehouse management method, device and system

Through message queue middleware and phase-out algorithm management, the problems of high maintenance costs, high network bandwidth pressure and storage space occupation are solved, and the event notification stability and mirror warehouse efficiency are improved.

CN112433814BActive Publication Date: 2024-11-22CHINA CITIC BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011329984.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-24
Publication Date
2024-11-22
Estimated Expiration
2040-11-24

AI Technical Summary

Technical Problem

In a multi-cluster container deployment environment, the remote mirror warehouse needs to maintain all local mirror warehouse addresses, resulting in high operation and maintenance costs; real-time notification of mirror update events leads to increased network bandwidth pressure; when the local mirror warehouse is offline or the network is abnormal, the event will be re-issued The mechanism is complex; and the local mirror warehouse takes up a lot of storage space but has low usage.

Method used

Introduce message queue middleware to receive and cache messages from remote mirror warehouses, subscribe to and consume queue messages for mirror management, and use LRU and other phase-up algorithms to clear images used at low frequency.

Benefits of technology

It reduces the operation and maintenance complexity of remote mirror warehouses, improves the reliability of event notifications, reduces the logical complexity of message resend, and frees up the storage space of local mirror warehouses, improving the speed of mirror search.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112433814B_ABST
    Figure CN112433814B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of cloud container technology, and in particular to a local image repository management method, device and system. The method comprises: a message queue middleware receives and caches messages sent by a remote image repository; a local image repository consumes queue messages of the middleware, and manages its stored container images according to the queue messages. The local image repository management solution disclosed in the present application optimizes the local image repository management, and prompts that the local image storage space can be released to improve the efficiency of image repository use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud container technology, and in particular to a local image repository management method, device and system. Background Art

[0002] At present, in a multi-cluster container deployment environment, a common method to improve the efficiency of container deployment is to establish a local image repository to cache the container images used by the cluster, so as to avoid each node in the cluster from downloading the container image from the remote image repository, thereby improving the deployment efficiency. At the same time, the remote image repository pushes events such as image updates and deletions to all local image repositories in real time for image maintenance of the local image repository. The current multi-cluster container deployment architecture includes a remote container cluster, a local image repository for caching used container images, and an image agent for intercepting image download requests from the container engine and redirecting them to the container image address of the local image repository. Under this architecture, if the local image repository does not have the container image requested by the container engine, the image agent first downloads the container image from the remote image repository and then redirects it to the container image address of the local image repository. The remote image repository pushes events such as image updates and deletions to all local image repositories in real time, and the local image repository performs corresponding operations such as image version updates and deletions after receiving the events. Such a technical solution mainly has the following problems:

[0003] 1. The remote image repository needs to maintain the addresses of all local image repositories. When the local image repository address is modified or the local image repository is added or deleted, the remote image repository needs to be updated synchronously, which increases the operation and maintenance costs;

[0004] 2. When there is an image update event, the remote image repository needs to notify all local image repositories in real time, and the amount of messages increases instantly, resulting in increased pressure on network bandwidth;

[0005] 3. When the local image repository is offline or the network is abnormal, resulting in the remote image repository's update events not being received in time, the remote image repository needs to maintain its own event retransmission mechanism, which increases the logic complexity;

[0006] 4. The local image repository maintains all image information. The local cluster usage of most image information is low but takes up a lot of storage space. Summary of the invention

[0007] The purpose of this application is to solve at least one of the above technical defects. The technical solution adopted by this application is as follows:

[0008] In a first aspect, an embodiment of the present application discloses a local image repository management method, the method comprising: being applied to an intelligent terminal having a local image repository, wherein the method comprises:

[0009] The message queue middleware receives and caches messages sent by the remote image repository;

[0010] The local image repository consumes the queue message of the middleware and manages the container images stored therein according to the queue message.

[0011] Furthermore, before the local image repository consumes the queue message of the middleware, the method also includes: the local image repository subscribes to the message of the middleware; when the local image repository subscribes to the message queue middleware and generates a new message, the local image repository obtains the new message for consumption.

[0012] Furthermore, managing the stored container image according to the queue message includes: when the consumed queue message is related to at least one container image stored therein; then, according to the content of the consumed queue message, performing an operation matching the content of the queue message on the associated container image.

[0013] Furthermore, performing an operation on the associated container image that matches the queue message content further includes: when the queue message content is to modify the associated container image; the local image repository requests an update of the associated container image from a remote image repository; and saving the obtained updated container image.

[0014] Furthermore, performing an operation of matching the queue message content on the associated container image further includes:

[0015] When the queue message content is to delete the associated container image, the local image repository executes a process of deleting the associated container image.

[0016] Furthermore, managing the stored container images according to the queue message also includes: when the consumed queue message is irrelevant to all the stored container images, ignoring the queue message.

[0017] Furthermore, the method also includes: constructing the local image repository elimination algorithm according to the usage frequency of the container image; wherein the elimination algorithm includes but is not limited to LRU, LRU-K, LFU, ARC, and FIFO algorithms; according to the elimination algorithm, deleting the target container image of the local image repository; wherein the target container image is a container image that satisfies the elimination algorithm.

[0018] In a second aspect, an embodiment of the present application provides a local image repository management device, which is applied to an intelligent terminal having a local image repository, and the device includes: a message queue middleware, a storage module, a consumption module and a processing module; wherein:

[0019] The message queue middleware is used to receive and cache messages sent by the remote image repository;

[0020] The storage module is used to store the local image repository;

[0021] The consumption module is used to control the local image repository to consume the queue messages of the middleware;

[0022] The processing module is used to control the local image repository to manage the stored container images according to the queue message.

[0023] In a third aspect, the embodiment of the present application provides a local image warehouse management system, a container cloud cluster and an intelligent terminal; wherein the intelligent terminal includes a message queue middleware and a local image warehouse; wherein,

[0024] The container cloud cluster is used to build and store remote image repositories;

[0025] The message queue middleware of the intelligent terminal receives and caches the messages sent by the remote image repository;

[0026] The local image repository of the smart terminal consumes the queue message of the middleware and manages the container image stored therein according to the queue message.

[0027] In a fourth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory;

[0028] The memory is used to store operation instructions;

[0029] The processor is used to execute the method described in any of the above embodiments by calling the operation instruction.

[0030] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described in any of the above embodiments is implemented.

[0031] The embodiment of the present application provides a local image repository management solution that achieves at least one of the following beneficial effects of the present application by introducing a message queue middleware and performing elimination algorithm management on the local image repository:

[0032] (1) By introducing a message queue, the remote image repository does not need to maintain all local image repository addresses, reducing the complexity of operation and maintenance;

[0033] (2) By introducing message queues, the reliability of event notifications is improved and the logical complexity of message retransmission is reduced;

[0034] (3) By introducing elimination algorithms such as LRU, we can remove images with low local usage frequency, free up storage space in the local image repository, and improve the image search speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0036] Figure 1 A flowchart of a local image repository management method provided in an embodiment of the present application;

[0037] Figure 2 A schematic diagram of a local image repository management device provided in an embodiment of the present application;

[0038] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present invention.

[0040] Those skilled in the art can understand that, unless otherwise stated, the singular forms "one", "an", "said" and "the" used herein may also include plural forms, and the "first", "second", etc., are only used to distinguish and define objects for the purpose of introducing the scheme clearly, and do not limit the objects themselves. Of course, the objects defined by "first" and "second" may be the same terminal, device, user, etc., or the same type of terminal, device and user. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0041] In addition, it should be understood that in the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c can be single or multiple.

[0042] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0043] The following introduces some concepts, terms or devices that may be used in the following embodiments or used to assist in explaining the technical solutions of the embodiments:

[0044] The LRU (Least Recently Used) algorithm, which is the least recently used algorithm, eliminates data based on its historical access records.

[0045] The K in LRU-K stands for the number of times it has been used recently. The judgment standard of "used once recently" is expanded to "used K times recently", which solves the "cache pollution" problem of the LRU algorithm. LRU-K reduces the problem caused by "cache pollution" and has a higher hit rate than LRU.

[0046] The FIFO algorithm is an algorithm that is relatively easy to implement. Its idea is first-in-first-out (FIFO, queue), which is the simplest and fairest idea. That is, if a piece of data is the first to enter, it can be considered that it is unlikely to be accessed in the future. When the space is full, the first data to enter will be replaced (eliminated) first.

[0047] LFU (Least Frequently Used) is also a common cache algorithm. As the name suggests, the idea of ​​the LFU algorithm is: if a piece of data is rarely accessed in the recent period, then it can be considered that the possibility of it being accessed in the future is also small. Therefore, when the space is full, the data with the least frequent access will be eliminated first.

[0048] ARC eviction algorithm, this cache algorithm stores the most recently used entries near the top of the cache. When a new entry is accessed, LRU places it at the top of the cache. When the cache reaches its limit, entries that were accessed earlier are removed from the bottom of the cache. This uses an expensive algorithm, and it requires recording "age bits" to accurately show when the entry was accessed.

[0049] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0050] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0051] Figure 1 A schematic diagram of a process of local image repository management provided by an embodiment of the present application is shown, such as Figure 1 As shown, the method may mainly include:

[0052] S101, applied to a smart terminal having a local image repository, characterized in that the method comprises:

[0053] S102, the message queue middleware receives and caches the message sent by the remote image repository;

[0054] In a further optional embodiment, before step S103, the method further includes: the local image repository subscribing to the message of the middleware; when the local image repository subscribes to the message queue middleware and generates a new message, the local image repository obtains the new message for consumption.

[0055] S103: The local image repository consumes the queue message of the middleware, and manages the container image stored therein according to the queue message.

[0056] In a further optional embodiment, the implementation method of managing the stored container image according to the queue message is:

[0057] Step 1: When the queue message consumed is related to at least one container image stored in it;

[0058] Step 2: Based on the content of the consumption queue message, an operation matching the content of the queue message is performed on the associated container image.

[0059] In a further optional embodiment, performing an operation on the associated container image that matches the queue message content further includes: when the queue message content is to modify the associated container image; the local image repository requests an update of the associated container image from a remote image repository; and saving the obtained updated container image.

[0060] In a further optional embodiment, performing an operation on the associated container image that matches the queue message content further includes: when the queue message content is to delete the associated container image, the local image repository executes a process for deleting the associated container image.

[0061] In a further optional embodiment, managing the stored container images according to the queue message further includes: when the consumed queue message is irrelevant to all the stored container images, ignoring the queue message.

[0062] The above-mentioned embodiment scheme of the present application introduces a message queue so that the remote image repository does not need to maintain all local image repository addresses, thereby reducing the complexity of operation and maintenance, while improving the reliability of event notification and reducing the logical complexity of message retransmission.

[0063] In a further optional embodiment, the method also includes: constructing a local image repository elimination algorithm according to the usage frequency of the container image; wherein the elimination algorithm includes but is not limited to LRU, LRU-K, LFU, ARC, and FIFO algorithms; according to the elimination algorithm, deleting the target container image of the local image repository; wherein the target container image is a container image that satisfies the elimination algorithm, and by introducing elimination algorithms such as LRU to clear local images with low usage frequency, the local image repository storage space is released, and the image search speed is improved.

[0064] In summary, this application mainly optimizes the event notification mechanism of the remote image repository to the local image repository and the local image repository management by introducing the message queue middleware and the local image repository elimination mechanism. When the remote image repository is updated or deleted through this method, the corresponding event will be sent to the message queue. The local image repository consumes the events in the message queue through the subscription mechanism, which reduces the complexity of event notification and improves the stability of event notification. Through the LRU and other image elimination mechanisms, the local warehouse is prevented from fully synchronizing the remote warehouse, and only the frequently used images are saved to reduce the local image storage space and improve the efficiency of image warehouse use.

[0065] based on Figure 1 The local image warehouse management method shown in the embodiment of the present application provides a local image warehouse management device, which is applied to an intelligent terminal with a local image warehouse. Figure 2As shown, it may include: 201 message queue middleware, 202 storage module, 203 consumption module and 204 processing module; wherein,

[0066] The 201 message queue middleware is used to cache messages sent by the remote image repository;

[0067] The storage module 202 is used to store the local image repository;

[0068] The 203 consumption module is used to control the local image repository to consume the queue message of the middleware;

[0069] The 204 processing module is used to control the local image repository to manage the stored container images according to the queue message.

[0070] In a third aspect, the embodiment of the present application provides a local image warehouse management system, a container cloud cluster and an intelligent terminal; wherein the intelligent terminal includes a message queue middleware and a local image warehouse; wherein,

[0071] The container cloud cluster is used to build and store remote image repositories;

[0072] The message queue middleware of the intelligent terminal receives and caches the messages sent by the remote image repository;

[0073] The local image repository of the smart terminal consumes the queue message of the middleware and manages the container image stored therein according to the queue message.

[0074] It can be understood that the above-mentioned components of the local image warehouse management device and system in this embodiment have the function of realizing Figure 1 The functions of the corresponding steps of the method in the embodiment shown in . The function can be implemented by hardware, or by hardware executing the corresponding software. The hardware or software includes one or more modules or systems corresponding to the above functions. The above modules and systems can be software and / or hardware, and the above modules and systems can be implemented separately or integrated with multiple modules and systems. For the functional description of the above modules and systems, please refer to Figure 1 The corresponding description of the method in the embodiment shown in , therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding method provided above, which will not be repeated here.

[0075] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the specific structure of the local image repository management device and system. In other embodiments of the present application, the local image repository management device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0076] An embodiment of the present application provides an electronic device, including a processor and a memory;

[0077] A memory, used for storing operation instructions;

[0078] The processor is used to execute the local image repository management method provided in any embodiment of the present application by calling an operation instruction.

[0079] As an example, Figure 3 A schematic diagram of the structure of an electronic device applicable to the embodiment of the present application is shown. Figure 3 As shown, the electronic device 300 includes: a processor 301 and a memory 303. Among them, the processor 301 and the memory 303 are connected, such as being connected through a bus 302. Optionally, the electronic device 300 may also include a transceiver 304. It should be noted that in actual applications, the transceiver 304 is not limited to one. It is understandable that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the specific structure of the electronic device 300. In other embodiments of the present application, the electronic device 300 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. Optionally, the electronic device may also include a display screen 305 for displaying images, or receiving user operation instructions when necessary.

[0080] The processor 301 is applied in the embodiment of the present application to implement the method shown in the above method embodiment. The transceiver 304 may include a receiver and a transmitter. The transceiver 304 is applied in the embodiment of the present application to implement the function of the electronic device of the embodiment of the present application communicating with other devices when executed.

[0081] Processor 301 may be a CPU (Central Processing Unit), a general purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0082] The processor 301 may also include one or more processing units, for example, the processor 301 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processor (NPU). Among them, different processing units may be independent devices or integrated into one or more processors. Among them, the controller may be the nerve center and command center of the electronic device 300. The controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. A memory may also be set in the processor 301 for storing instructions and data. In some embodiments, the memory in the processor 301 is a high-speed cache memory. The memory may store instructions or data that the processor 301 has just used or circulated. If the processor 301 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 301 is reduced, and the efficiency of the system is improved.

[0083] The processor 301 can run the local image warehouse management method provided in the embodiment of the present application to reduce the user's operation complexity, improve the intelligence of the terminal device, and enhance the user experience. The processor 301 can include different devices. For example, when the CPU and GPU are integrated, the CPU and GPU can cooperate to execute the local image warehouse management method provided in the embodiment of the present application. For example, part of the algorithm in the local image warehouse management method is executed by the CPU, and the other part of the algorithm is executed by the GPU to obtain faster processing efficiency.

[0084] The bus 302 may include a path to transmit information between the above components. The bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0085] The memory 303 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or may include a high-speed random access memory, or may include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.

[0086] Optionally, the memory 303 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the local image repository management method provided in any embodiment of the present application.

[0087] The memory 303 can be used to store computer executable program codes, which include instructions. The processor 301 executes various functional applications and data processing of the electronic device 300 by running the instructions stored in the memory 303. The memory 303 may include a program storage area and a data storage area. Among them, the program storage area may store the code of the operating system, application program, etc. The data storage area may store data created during the use of the electronic device 300 (such as images, videos, etc. collected by the camera application), etc.

[0088] The memory 303 may also store one or more computer programs corresponding to the local image repository management method provided in the embodiment of the present application. The one or more computer programs are stored in the above-mentioned memory 303 and are configured to be executed by the one or more processors 301. The one or more computer programs include instructions, and the above-mentioned instructions can be used to execute each step in the above-mentioned corresponding embodiment.

[0089] Of course, the code of the local image warehouse management method provided in the embodiment of the present application can also be stored in an external memory. In this case, the processor 301 can run the code of the local image warehouse management method stored in the external memory through the external memory interface, and the processor 301 can control the operation of the local image warehouse management process.

[0090] The display screen 305 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 300 may include 1 or N display screens 305, where N is a positive integer greater than 1. The display screen 305 can be used to display information input by a user or information provided to a user and various graphical user interfaces (GUI). For example, the display screen 305 can display photos, videos, web pages, or files.

[0091] The electronic device provided in the embodiment of the present application is applicable to any embodiment of the above method. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, which will not be repeated here.

[0092] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the local image repository management method shown in the above method embodiment is implemented.

[0093] The computer-readable storage medium provided in the embodiment of the present application is applicable to any embodiment of the above-mentioned method. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, which will not be repeated here.

[0094] The embodiment of the present application also provides a computer program product, which, when executed on a computer, enables the computer to execute the above-mentioned related steps to implement the method in the above-mentioned embodiment. The computer program product provided in the embodiment of the present application is applicable to any embodiment of the above-mentioned method, and therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, which will not be repeated here.

[0095] The local image warehouse management solution disclosed in the above embodiment of the present application optimizes the event notification mechanism of the remote image warehouse to the local image warehouse and the local image warehouse management by introducing the message queue middleware and the local image warehouse elimination mechanism. When the remote image warehouse is updated or deleted by this method, the corresponding event will be sent to the message queue. The local image warehouse consumes the events in the message queue through the subscription mechanism, which reduces the complexity of event notification and improves the stability of event notification; through the LRU and other image elimination mechanisms, the local warehouse is prevented from fully synchronizing the remote warehouse, and only the images that are used frequently are saved, so as to reduce the local image storage space and improve the efficiency of image warehouse use.

[0096] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be discarded or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0097] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0098] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0099] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0100] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0101] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, and can also make some improvements and modifications. These changes, substitutions, improvements and modifications should also be considered to be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A local image repository management method, applied to a smart terminal with a local image repository, characterized in that: The method comprises: The message queue middleware receives and caches messages sent by the remote image repository; The local image repository consumes the queue message of the middleware and manages the container image stored therein according to the queue message; Before the local image repository consumes the queue message of the middleware, the method further includes: The local image repository subscribes to messages from the middleware; When the local image warehouse subscribes to the message queue middleware to generate a new message, the local image warehouse obtains the new message for consumption.

2. The local image repository management method according to claim 1, characterized in that: Managing the stored container image according to the queue message includes: When the queue message consumed is associated with at least one container image stored in it; Then, according to the content of the consumption queue message, an operation matching the content of the queue message is performed on the associated container image.

3. The local image repository management method according to claim 2, characterized in that: Performing an operation on the associated container image that matches the queue message content further includes: When the queue message content is to modify the associated container image; The local image repository requests an update of the associated container image from the remote image repository; Save the updated container image you fetched.

4. The local image repository management method according to claim 2, characterized in that: Performing an operation on the associated container image that matches the queue message content further includes: When the queue message content is to delete the associated container image, the local image repository executes a process of deleting the associated container image.

5. The local image repository management method according to claim 3 or 4, characterized in that: Managing the stored container image according to the queue message also includes: When the queue message consumed is not related to the container image it stores, the queue message is ignored.

6. The local image repository management method according to claim 5, characterized in that: The method further comprises: According to the usage frequency of the container image, the local image repository elimination algorithm is constructed; wherein the elimination algorithm is not limited to LRU, LRU-K, LFU, ARC, and FIFO algorithms; According to the elimination algorithm, the target container image of the local image repository is deleted; wherein the target container image is a container image that satisfies the elimination algorithm.

7. A local image repository management device, characterized in that: The device comprises: a message queue middleware, a storage module, a consumption module and a processing module; wherein, The message queue middleware is used to receive and cache messages sent by the remote image repository; The storage module is used to store the local image repository; The consumption module is used to control the local image repository to consume the queue messages of the middleware; The processing module is used to control the local image repository to manage the container image stored therein according to the queue message; Before the local image repository consumes the queue message of the middleware, the method further includes: The local image repository subscribes to messages from the middleware; When the local image repository subscribes to the message queue middleware to generate a new message, the local image repository obtains the new message for consumption.

8. A local image warehouse management system, characterized in that: The system includes: a container cloud cluster and an intelligent terminal; wherein the intelligent terminal includes a message queue middleware and a local image repository; wherein, The container cloud cluster is used to build and store remote image repositories; The message queue middleware of the intelligent terminal is used to receive and cache messages sent by the remote image repository; The local image repository of the smart terminal consumes the queue message of the middleware and manages the container image stored therein according to the queue message; Before the local image repository consumes the queue message of the middleware, the method further includes: The local image repository subscribes to messages from the middleware; When the local image repository subscribes to the message queue middleware to generate a new message, the local image repository obtains the new message for consumption.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store operation instructions; The processor is used to execute the method according to any one of claims 1 to 6 by calling the operation instruction.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.