Mirror image layer cleaning method and device, computer equipment and readable storage medium

By obtaining and analyzing the associated information and weight information of the Docker image layer, determining the cleaning priority and cleaning, the problem of poor Docker image cleaning in the prior art is solved, and more efficient storage management and resource conservation are achieved.

CN119473513APending Publication Date: 2025-02-18CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411737129.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing Docker image cleaning method has poor cleaning effect, and it is easy to accidentally delete the image layer in use, resulting in service interruption and system failure, and at the same time, it is impossible to effectively free up storage space.

Method used

By acquiring multiple image layers to be cleaned on the target user side, the target association information and target weight information of each image layer to be cleaned are obtained using the pre-constructed target user-level image layer information library, the cleaning priority is determined based on this information, and cleaning is carried out. , until the mirror storage amount on the target user side reaches the preset threshold.

Benefits of technology

It effectively avoids the risk of accidentally deleting important mirror layers, retains high-used but unused mirror layers, improves storage utilization, and saves time and network bandwidth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473513A_ABST
    Figure CN119473513A_ABST
Patent Text Reader

Abstract

The invention relates to a mirror image layer cleaning method and device, computer equipment and a readable storage medium. The method comprises the steps that multiple to-be-cleaned mirror image layers on a target user side are obtained, and the to-be-cleaned mirror image layers are unused mirror image layers in all mirror image layers stored on the target user side; obtaining target associated information and target weight information of each to-be-cleaned mirror image layer from a pre-constructed target user-level mirror image layer information base; and cleaning the to-be-cleaned mirror image layer according to the target associated information and the target weight information. The cleaning effect of the method is good.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image cleaning technology, and in particular to an image layer cleaning method, device, computer equipment and readable storage medium. Background Art

[0002] A Docker image is a lightweight, independent, executable software package that contains everything needed to run an application. Since the release of Docker in 2013, Docker images have been widely used in software development, deployment, and operations. Through Docker images, developers can quickly build, deploy, and scale applications, which has promoted changes in software development and operations.

[0003] However, the Docker image cleaning method in the related art has the problem of poor cleaning effect. Summary of the invention

[0004] Based on this, it is necessary to provide an image cleaning layer method, device, computer equipment and readable storage medium that can improve the cleaning effect in response to the above technical problems.

[0005] In a first aspect, the present application provides an image layer cleaning method, the method comprising:

[0006] Acquire multiple image layers to be cleaned up on the target user side, wherein the image layers to be cleaned up are unused image layers among all image layers stored on the target user side;

[0007] Obtain target association information and target weight information of each image layer to be cleaned from a pre-built target user-level image layer information library;

[0008] The image layer to be cleaned is cleaned according to the target association information and the target weight information.

[0009] In one of the embodiments, the target user-level image layer information library includes a target user-level image layer association library and a target user-level image layer weight library; the step of determining the target association information and the target weight information of each image layer to be cleaned according to the pre-built target user-level image layer information library includes:

[0010] Obtaining target association information of each of the image layers to be cleaned from the target user-level image layer association library, wherein the target association information is used to indicate the degree of association between the image layer to be cleaned and the remaining image layers on the user side;

[0011] The target weight information of each of the to-be-cleaned image layers is obtained from the target user-level image layer weight library, wherein the target weight information is used to indicate the utilization rate of the target image layer.

[0012] In one embodiment, the target user-level image layer information library is constructed in the following manner:

[0013] Obtain parameter information of all images stored on the target user side;

[0014] Generate a first image layer relationship diagram according to parameter information of each image stored on the target user side;

[0015] Input the first image layer relationship graph into the trained lightweight graph neural network to obtain an initial user-level image layer information library;

[0016] A target user-level image layer information library is constructed according to the initial user-level image layer information library, the pre-constructed system-level image layer information library, and the preset weight relationship.

[0017] In one embodiment, the system-level image layer information library is constructed in the following manner:

[0018] Obtain parameter information of all images in the image warehouse through the system-side processing device;

[0019] Generate a second image layer relationship graph according to the parameter information of each image in the image warehouse through a system-side processing device;

[0020] The second image layer relationship graph is input into the trained system-level graph neural network through the system-side processing device to build the system-level image layer information library.

[0021] In one of the embodiments, the cleaning of the image layer to be cleaned according to the target association information and the target weight information includes:

[0022] Determine the cleaning priority of each of the to-be-cleaned image layers according to the target association information, the target weight information, and a preset proportional relationship between the target association information and the target weight information;

[0023] The image layers to be cleaned are cleaned up according to the cleaning priorities of the image layers to be cleaned up until the image storage capacity of the target user side is less than or equal to a first preset threshold.

[0024] In one of the embodiments, the cleaning of the image layers to be cleaned up according to the cleaning priorities of the image layers to be cleaned up until the image storage amount on the target user side is less than or equal to a first preset threshold value includes:

[0025] Cleaning each of the image layers to be cleaned up one by one in the order of the cleaning priorities from high to low;

[0026] When one of the image layers to be cleaned is cleaned, obtaining the current image storage capacity of the target user side;

[0027] When the current image storage amount is less than or equal to a first preset threshold, the cleaning is stopped;

[0028] When the current image storage volume is greater than the first preset threshold, the next-level image layer to be cleaned is cleaned until the corresponding current image storage volume after cleaning is less than or equal to the first preset threshold, and the cleaning is stopped.

[0029] In one embodiment, the method further comprises:

[0030] Obtaining the image storage capacity of the target user side;

[0031] When the image storage amount is greater than or equal to the second preset threshold, the step of acquiring a plurality of image layers to be cleaned up on the target user side is performed to clean up the image layers to be cleaned up.

[0032] In a second aspect, the present application provides an image layer cleaning device, the device comprising:

[0033] A first acquisition module is used to acquire multiple image layers to be cleaned up on the target user side, wherein the image layers to be cleaned up are unused image layers among all image layers stored on the target user side;

[0034] A first determination module is used to obtain target association information and target weight information of each image layer to be cleaned from a pre-built target user-level image layer information library;

[0035] The first cleaning module is used to clean the image layer to be cleaned according to the target association information and the target weight information.

[0036] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the image cleaning method described in any one of the above embodiments are implemented.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the image cleaning method described in any one of the above embodiments are implemented.

[0038] The above-mentioned image cleaning layer method, device, computer equipment and readable storage medium first sort out the unused image layers in the multiple images stored on the target user side, and mark them as image layers to be cleaned. Since an image is composed of multiple image layers, different images may share some image layers. Therefore, in this application, by sorting out the unused image layers, it is possible to avoid accidentally deleting the image layers that are in use when cleaning the unused images, thereby avoiding service interruptions and system failures. In addition, this application determines the target association information and target weight information of each image layer to be cleaned according to the pre-constructed target user-level image layer information library, and then cleans the image layer to be cleaned according to the target association information and target weight information, so that some image layers with high usage rates but currently in an unused state can be retained as much as possible, ensuring that the subsequent target user does not need to repeatedly download the image layer when using the image, thereby saving time and saving network bandwidth. In summary, the cleaning effect of the image cleaning layer method of the present application is good. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0040] FIG1 is a schematic diagram of a flow chart of a method for cleaning an image layer in one embodiment;

[0041] FIG2 is a schematic diagram of a flow chart of step S102 in one embodiment;

[0042] FIG3 is a schematic diagram of a process for constructing a target user-level image layer information library in one embodiment;

[0043] FIG4 is a schematic diagram of a flow chart of a method for constructing a system-level image layer information library in one embodiment;

[0044] FIG5 is a schematic diagram of a flow chart of step S103 in one embodiment;

[0045] FIG6 is a schematic diagram of a flow chart of step S502 in one embodiment;

[0046] FIG7 is a schematic flow chart of a method for cleaning an image layer in another embodiment;

[0047] FIG8 is a structural block diagram of an image layer cleaning device in one embodiment;

[0048] FIG. 9 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0050] A Docker image is a lightweight, independent, executable software package that contains everything needed to run an application. Since the release of Docker in 2013, Docker images have been widely used in software development, deployment, and operations. Through Docker images, developers can quickly build, deploy, and scale applications, which has promoted changes in software development and operations.

[0051] With the widespread use of Docker images, how to clean up unused Docker images to improve storage utilization has become an issue worthy of in-depth study. Currently, there are two main ways to clean up Docker images: 1. Manual cleanup. Users can directly use the commands provided by Docker to clean up all unused Docker images. This manual cleanup method is flexible but requires manual intervention and is only suitable for small-scale or infrequent cleanup operations; 2. Scheduled cleanup: By setting regular tasks (such as cron jobs), cleanup commands can be automatically executed, or managed by configuring the automatic cleanup options of the Docker daemon. This method can automatically clean up in the background, reducing the need for manual intervention. In addition, DockerRegistry also provides the function of scheduled cleanup of unused images to help automatically manage image storage.

[0052] However, the above two Docker image cleaning methods still have some challenges and potential problems in actual operation when cleaning unused images: First, excessive cleaning or improper cleaning strategies. Improper cleaning strategies may mistakenly delete images in use or dependent resources, resulting in service interruptions and system failures. Second, frequent operations consume system resources. Frequent cleaning operations will increase the I / O load and CPU consumption of the system, especially during the peak period of container operation, which may affect the performance of running containers and reduce the stability and response speed of the system. Third, the complexity of large-scale use. In an environment where Docker is used on a large scale, a simple cleaning strategy may cause some images to be frequently deleted and re-downloaded, failing to effectively release storage space, and may even waste more storage and bandwidth resources. Fourth, indiscriminate cleaning of all images. Indiscriminate cleaning of all unused images may cause commonly used images to be deleted. When these images are needed again, they must be downloaded again, which is not only time-consuming, but also consumes network bandwidth, especially when network resources are limited or the pull speed is limited, which will become a performance bottleneck.

[0053] To solve the above technical problem, in an exemplary embodiment, please refer to FIG. 1 , the present application provides an image layer cleaning method, which includes steps S101 to S103 .

[0054] S101: Acquire multiple image layers to be cleaned up at a target user side, wherein the image layers to be cleaned up are unused image layers among all image layers stored at the target user side.

[0055] It can be understood that there are many images stored in the image warehouse. When the user side needs to use the image, the image that the user side does not have can be downloaded from the image warehouse. As the user side continues to download images from the image warehouse, the number of images stored on the user side increases, occupying the storage space on the user side. Since an image is composed of multiple image layers, there may be a shared image layer between different images. For example, image A is composed of image layer 1, image layer 2, and image layer 3, and image B is composed of image layer 1, image layer 4, and image layer 5, that is, image A and image B share image layer 1. In the present application, when it is necessary to clean up the image stored on the target user side, first obtain all the image layers that are not in use in the image stored on the target user side, and determine them as the image layers to be cleaned. The present application does not simply obtain all the images that are not in use. By obtaining the unused image layers, the image layers that are in use can be avoided, thereby avoiding service interruptions and system failures on the target user side.

[0056] S102: Obtain target association information and target weight information of each image layer to be cleaned from a pre-built target user-level image layer information library.

[0057] After determining each image layer to be cleaned, the target association information and target weight information of each image layer to be cleaned can be found according to the preset target user-level image layer information library, where the target association information is used to indicate the degree of association between the image layer to be cleaned and the remaining image layers on the user side, and the target weight information is used to indicate the utilization rate of the target image layer.

[0058] S103: Clean up the image layer to be cleaned up according to the target association information and the target weight information.

[0059] According to the target association information and target weight information of each image layer to be cleaned, the importance of each image layer to be cleaned can be calculated, and the image layers to be cleaned are sorted according to their importance, and unimportant image layers to be cleaned are cleaned first.

[0060] The above-mentioned image cleaning layer method first sorts out the unused image layers in the multiple images stored on the target user side, and marks them as image layers to be cleaned. Since an image is composed of multiple image layers, different images may share some image layers. Therefore, in this application, by sorting out the unused image layers, it is possible to avoid accidentally deleting the image layers that are in use when cleaning the unused images, thereby avoiding service interruptions and system failures. In addition, this application determines the target association information and target weight information of each image layer to be cleaned according to the pre-constructed target user-level image layer information library, and then cleans the image layers to be cleaned according to the target association information and target weight information, so that some image layers with high usage rates but currently in an unused state can be retained as much as possible, ensuring that the image layer does not need to be downloaded repeatedly when the target user side uses the image later, thereby saving time and saving network bandwidth. In summary, the cleaning effect of the image cleaning layer method of the present application is better.

[0061] In an exemplary embodiment, referring to FIG. 2 , step S102 , obtaining target association information and target weight information of each image layer to be cleaned from a pre-built target user-level image layer information library, includes steps S201 and S202 .

[0062] S201: Obtain target association information of each image layer to be cleaned from a target user-level image layer association library.

[0063] Among them, the target user-level image layer information library includes a target user-level image layer association library, and the target user-level image layer association library stores the association information of all image layers stored on the target user side, and the association information of the image layer indicates the degree of association between the image layer and the remaining image layers on the target user side. In this application, it is necessary to obtain the target association information of the image layer to be cleaned from the target user-level image layer association library, and the target association information is used to indicate the degree of association between the image layer to be cleaned and the remaining image layers on the target user side.

[0064] S202: Obtain target weight information of each image layer to be cleaned from a target user-level image layer weight library.

[0065] The target user-level image layer information library also includes a target user-level image layer weight library, which stores the weight information of all image layers stored on the user side, and the weight information of the image layer represents the utilization rate of the image layer. In this application, it is necessary to obtain the target weight information of the image layer to be cleaned from the target user-level image layer weight library, and the target association information is used to represent the utilization rate of the image layer to be cleaned.

[0066] In an exemplary embodiment, referring to FIG. 3 , a target user-level image layer information library is constructed by the following method, and the method for constructing the target user-level image layer information library includes steps S301 to S304 .

[0067] S301: Acquire parameter information of all images stored on the target user side.

[0068] First, parameter information of all images stored on the target user side is obtained, where the parameter information of the image is used to indicate which image layers the image is specifically composed of.

[0069] S302: Generate a first image layer relationship graph according to parameter information of each image stored at the target user side.

[0070] After obtaining the parameter information of each image, a first image layer relationship graph can be generated according to the parameter information of each image. The first image layer relationship graph includes nodes and edges. One node represents one image layer. Two nodes are connected by an edge. The edge represents the association between the corresponding two image layers. The coefficient of the edge depends on the probability that the two image layers appear in one image at the same time.

[0071] S303: Input the first image layer relationship graph into the trained lightweight graph neural network to obtain an initial user-level image layer information library.

[0072] By inputting the first image layer relationship graph into the trained lightweight graph neural network, the lightweight graph neural network can analyze the first image layer relationship graph to generate an initial user-level image layer information library, which includes an initial user-level image layer association library and an initial user-level image layer weight library.

[0073] S304: construct a target user-level image layer information library according to the initial user-level image layer information library, the pre-constructed system-level image layer information library, and the preset weight relationship.

[0074] In this embodiment, the system-level image layer information library includes a system-level image layer association library and a system-level image layer weight library. The association information of each image layer stored on the target user side on the system side can be found from the system-level image layer association library, and the weight information of each image layer stored on the target user side on the system side can be found from the system-level image layer weight library. Afterwards, based on the association information of each image layer stored on the target user side on the system side and the weight information of each image layer stored on the user side on the system side found out, combined with the set weight relationship between the system level and the user level, the initial user-level image layer association library and the initial user-level image layer weight library are updated respectively to obtain the target user-level image layer association library and the target user-level image layer weight library, that is, the target user-level image layer information library. Among them, the system-level image layer information library is used to indicate the association information and weight information of each image layer in the image warehouse.

[0075] The present application not only determines the importance of each image layer to be cleaned up according to the degree of association between the image layers stored on the target user side and the utilization rate of each image layer on the target user side, but also comprehensively determines the importance of these image layers to be cleaned up in combination with the association and utilization rate of these image layers in the image warehouse, which can further avoid accidental deletion of important image layers.

[0076] In an exemplary embodiment, referring to FIG. 4 , the system-level image layer information library is constructed in the following manner. The method for constructing the system-level image layer information library includes step S401 and step S403 .

[0077] S401: Obtain parameter information of all images in the image repository through a system-side processing device.

[0078] Similar to the method of building the initial user-level image layer information library, when building the system-level image layer information library, it is first necessary to obtain the parameter information of all images in the image warehouse through the system-side processing device. The parameter information of the image is used to indicate which image layers the image is composed of.

[0079] S402: Generate a second image layer relationship graph according to parameter information of each image in the image repository through a system-side processing device.

[0080] Next, the system-side processing device generates a second image layer relationship graph according to the parameter information of each image. The second image layer relationship graph also includes nodes and edges. One node represents one image layer. Two nodes are connected by an edge. The edge represents the association between the corresponding two image layers. The coefficient of the edge depends on the probability that the two image layers appear in one image at the same time.

[0081] S403: Input the second image layer relationship graph into the trained system-level graph neural network through the system-side processing device to build a system-level image layer information library.

[0082] The system-side processing device inputs the second image layer relationship graph into the trained system-level graph neural network, and the system-level graph neural network can analyze the second image layer relationship graph to generate a system-level image layer information library, which includes a system-level image layer association library and a system-level image layer weight library.

[0083] It should be understood that when the number of images stored in the image repository increases or decreases, it is necessary to update the system-level image layer information library according to the above-mentioned system-level image layer information library construction method, and update the target user-level image layer information library according to the updated system-level image layer information library.

[0084] In an exemplary embodiment, referring to FIG. 5 , step S103 , cleaning the image layer to be cleaned according to the target association information and the target weight information includes step S501 and step S502 .

[0085] S501: Determine the cleaning priority of each to-be-cleaned image layer according to target association information, target weight information, and a ratio between preset target association information and target weight information.

[0086] After finding the target association information and target weight information of each image layer to be cleaned, the cleaning priority of each image layer to be cleaned can be calculated according to the set proportional relationship between the target association information and the target weight information, wherein the lower the importance of the image layer to be cleaned, the higher the cleaning priority.

[0087] S502: Clean up the image layers to be cleaned up according to the cleaning priority of each image layer to be cleaned up until the image storage capacity at the target user side is less than or equal to a first preset threshold.

[0088] Afterwards, the image layers can be cleaned up according to the cleaning priority of each image layer to be cleaned up, until all the image layers to be cleaned up are cleaned up, or the image storage capacity on the user side is less than or equal to the first preset threshold, then the cleaning is stopped.

[0089] In an exemplary embodiment, please refer to FIG. 6 , step S502 , cleaning the image layers to be cleaned according to the cleaning priority of each image layer to be cleaned until the image storage amount on the target user side is less than or equal to the first preset threshold, including steps S601 to S604 .

[0090] S601: Clean up each of the image layers to be cleaned up one by one in descending order of the cleaning priorities.

[0091] It can be understood that the lower the importance of the image layer to be cleaned, the higher its cleaning priority, so the image layers to be cleaned can be cleaned in descending order of cleaning priority.

[0092] S602: When one of the image layers to be cleaned is cleaned, the current image storage capacity of the target user side is obtained.

[0093] Whenever a to-be-cleaned image layer is cleaned up, the image storage capacity of one side may be calculated, and cleaning is stopped until all to-be-cleaned image layers are cleaned up or it is detected that the image storage capacity is less than or equal to a first preset threshold.

[0094] S603: When the image storage capacity of the user is less than or equal to the first preset threshold, stop cleaning.

[0095] S604: When the current image storage capacity is greater than the first preset threshold, clean up the next-level image layer to be cleaned up until the current image storage capacity corresponding to the cleaned up image is less than or equal to the first preset threshold, and then stop cleaning.

[0096] In the application, you can also directly determine the target cleaning image layer from the image layers to be cleaned in descending order of cleaning priority according to the difference between the image storage capacity when the image layer starts to be cleaned and the first preset threshold, and directly clean the target cleaning image layer according to the memory occupied by each image layer to be cleaned.

[0097] In an exemplary embodiment, referring to FIG. 7 , the image cleaning method further includes step S701 and step 702 .

[0098] S701: Obtain the image storage capacity of the target user side.

[0099] S702: When the image storage amount is greater than or equal to the second preset threshold, a step of acquiring a plurality of image layers to be cleaned up on the target user side is performed to clean up the image layers to be cleaned up.

[0100] In the application, the image storage capacity of each user side can be monitored in real time. When the image storage capacity of a user side is greater than or equal to the second preset threshold, it indicates that the image stored on the current user side occupies too much storage space and needs to be cleaned up. The image storage capacity greater than or equal to the second preset threshold can be marked as the target user side, and cleaned up according to the image layer cleaning method in this application to release the storage space on the target user side. Among them, the second preset threshold is greater than the first preset threshold. By setting the second preset threshold greater than the first preset threshold, it is possible to avoid frequent execution of cleaning operations to reduce the stability and response speed of the user side operation.

[0101] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0102] Based on the same inventive concept, the embodiment of the present application also provides an image layer cleaning device for implementing the image layer cleaning method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more image layer cleaning device embodiments provided below can refer to the limitations of the image layer cleaning method above, and will not be repeated here.

[0103] In an exemplary embodiment, please refer to FIG. 8 , the present application further provides an image layer cleaning device, which includes: a first acquisition module 801 , a first determination module 802 , and a first cleaning module 803 .

[0104] The first acquisition module 801 is used to acquire multiple image layers to be cleaned up at the target user side, wherein the image layers to be cleaned up are unused image layers among all image layers stored at the target user side.

[0105] The first determining module 802 is used to obtain target association information and target weight information of each image layer to be cleaned from a pre-built target user-level image layer information library.

[0106] The first cleaning module 803 is used to clean the image layer to be cleaned according to the target association information and the target weight information.

[0107] In an exemplary embodiment, the target user-level image layer information library includes a target user-level image layer association library and a target user-level image layer weight library; the first determination module 802 includes:

[0108] A first acquisition submodule obtains target association information of each image layer to be cleaned from a target user-level image layer association library, wherein the target association information is used to indicate the degree of association between the image layer to be cleaned and the remaining image layers on the user side;

[0109] The second acquisition submodule acquires target weight information of each image layer to be cleaned from a target user-level image layer weight library, wherein the target weight information is used to indicate the utilization rate of the target image layer.

[0110] In an exemplary embodiment, the image layer cleaning device further includes a target user-level image layer information library construction module, and the target user-level image layer information library construction module includes:

[0111] The second acquisition submodule is used to acquire parameter information of all images stored on the target user side.

[0112] The first execution submodule is used to generate a first image layer relationship diagram according to parameter information of each image stored on the target user side.

[0113] The third acquisition submodule is used to input the first image layer relationship graph into the trained lightweight graph neural network to obtain an initial user-level image layer information library.

[0114] The first construction submodule is used to construct a target user-level image layer information library according to the initial user-level image layer information library, the pre-constructed system-level image layer information library and the preset weight relationship.

[0115] In an exemplary embodiment, the image layer cleaning device further includes a system-level image layer information library construction device, and the system-level image layer information library construction device includes:

[0116] The fourth acquisition submodule is used to acquire parameter information of all images in the image repository through the system-side processing device.

[0117] The second execution submodule is used to generate a second image layer relationship diagram according to the parameter information of each image in the image repository through the system-side processing device.

[0118] The fifth acquisition submodule is used to input the second image layer relationship graph into the trained system-level graph neural network through the system-side processing device to build a system-level image layer information library.

[0119] In an exemplary embodiment, the first cleaning module 803 includes:

[0120] The first determination submodule is used to determine the cleaning priority of each to-be-cleaned image layer according to the target association information, the target weight information, and the ratio between the preset target association information and the target weight information.

[0121] The first cleaning submodule is used to clean up the image layers to be cleaned according to the cleaning priority of each image layer to be cleaned, until the image storage amount on the target user side is less than or equal to a first preset threshold.

[0122] In an exemplary embodiment, the first cleaning submodule includes:

[0123] The first cleaning unit is used to clean each of the image layers to be cleaned one by one in the order of the cleaning priority from high to low.

[0124] The first calculation unit is used to obtain the current image storage capacity of the target user side when one of the image layers to be cleaned is cleaned.

[0125] The first execution unit is used to stop cleaning when the image storage capacity of the user is less than or equal to a first preset threshold.

[0126] The second cleaning unit is used to clean up the next-level image layer to be cleaned up when the current image storage capacity is greater than the first preset threshold value, until the corresponding current image storage capacity after cleaning is less than or equal to the first preset threshold value, and then stop cleaning.

[0127] In an exemplary embodiment, the apparatus further comprises:

[0128] The second acquisition submodule is used to acquire the image storage capacity on the target user side.

[0129] The second execution submodule is used to execute the step of obtaining multiple image layers to be cleaned up on the target user side when the image storage amount is greater than or equal to the second preset threshold, so as to clean up the image layers to be cleaned up.

[0130] Each module in the above-mentioned image cleaning device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0131] In an exemplary embodiment, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the image cleaning method described in any of the above embodiments are implemented.

[0132] The computer device may be a terminal, and its internal structure diagram may be shown in FIG9. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a mirror layer cleaning method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0133] Those skilled in the art will understand that the structure shown in FIG. 9 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0134] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the image layer cleaning method described in any of the above embodiments are implemented.

[0135] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps of the image layer cleaning method described in any of the above embodiments.

[0136] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0137] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0138] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0139] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for cleaning an image layer, characterized in that: The method comprises: Acquire multiple image layers to be cleaned up on the target user side, wherein the image layers to be cleaned up are unused image layers among all image layers stored on the target user side; Obtain target association information and target weight information of each image layer to be cleaned from a pre-built target user-level image layer information library; The image layer to be cleaned is cleaned according to the target association information and the target weight information.

2. The image layer cleaning method according to claim 1, characterized in that: The target user-level image layer information library includes a target user-level image layer association library and a target user-level image layer weight library; The determining the target association information and target weight information of each image layer to be cleaned according to the pre-built target user-level image layer information library includes: Obtaining target association information of each of the image layers to be cleaned from the target user-level image layer association library, wherein the target association information is used to indicate the degree of association between the image layer to be cleaned and the remaining image layers on the user side; The target weight information of each of the to-be-cleaned image layers is obtained from the target user-level image layer weight library, wherein the target weight information is used to indicate the utilization rate of the target image layer.

3. The image layer cleaning method according to claim 1, characterized in that: The target user-level image layer information library is constructed in the following way: Obtain parameter information of all images stored on the target user side; Generate a first image layer relationship diagram according to parameter information of each image stored on the target user side; Input the first image layer relationship graph into the trained lightweight graph neural network to obtain an initial user-level image layer information library; A target user-level image layer information library is constructed according to the initial user-level image layer information library, the pre-constructed system-level image layer information library, and the preset weight relationship.

4. The image layer cleaning method according to claim 3, characterized in that: The system-level image layer information library is constructed in the following way: Obtain parameter information of all images in the image warehouse through the system-side processing device; Generate a second image layer relationship graph according to the parameter information of each image in the image warehouse through a system-side processing device; The second image layer relationship graph is input into the trained system-level graph neural network through the system-side processing device to build the system-level image layer information library.

5. The image layer cleaning method according to claim 1, characterized in that: The cleaning of the image layer to be cleaned according to the target association information and the target weight information includes: Determine the cleaning priority of each of the to-be-cleaned image layers according to the target association information, the target weight information, and a preset proportional relationship between the target association information and the target weight information; The image layers to be cleaned are cleaned up according to the cleaning priorities of the image layers to be cleaned up until the image storage capacity of the target user side is less than or equal to a first preset threshold.

6. The image layer cleaning method according to claim 5, characterized in that: The cleaning of the image layers to be cleaned up according to the cleaning priority of each of the image layers to be cleaned up until the image storage amount on the target user side is less than or equal to a first preset threshold value includes: Cleaning each of the image layers to be cleaned up one by one in the order of the cleaning priorities from high to low; When one of the image layers to be cleaned is cleaned, obtaining the current image storage capacity of the target user side; When the current image storage amount is less than or equal to a first preset threshold, the cleaning is stopped; When the current image storage volume is greater than the first preset threshold, the next-level image layer to be cleaned is cleaned until the corresponding current image storage volume after cleaning is less than or equal to the first preset threshold, and the cleaning is stopped.

7. The image layer cleaning method according to claim 1, characterized in that: The method further comprises: Obtaining the image storage capacity of the target user side; When the image storage amount is greater than or equal to the second preset threshold, the step of acquiring a plurality of image layers to be cleaned up on the target user side is performed to clean up the image layers to be cleaned up.

8. An image layer cleaning device, characterized in that: The device comprises: A first acquisition module is used to acquire multiple image layers to be cleaned up on the target user side, wherein the image layers to be cleaned up are unused image layers among all image layers stored on the target user side; A first determination module is used to obtain target association information and target weight information of each image layer to be cleaned from a pre-built target user-level image layer information library; The first cleaning module is used to clean the image layer to be cleaned according to the target association information and the target weight information.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.