Data processing method and related device
By obtaining and updating Docker image information on a scheduled basis through the image repository agent, the problem of low storage space efficiency of the image repository agent is solved, enabling flexible management and efficient use of storage space.
Patent Information
- Application Number
- CN202410649415.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2025-11-21
AI Technical Summary
The storage space of the image repository agent is inefficient and cannot adapt to different application scenarios because the expiration mechanism does not support flexible setting of the validity period. Some temporarily acquired images are stored for a long time, occupying space and becoming unusable.
By obtaining the target adjustment request, carrying the identity information and adjustment information of the target Docker image, when storing the target Docker image in the image repository agent, the agent obtains its timing information and updates its storage validity period according to the adjustment information, so as to adjust the storage validity period of the image and achieve flexible management.
It improves the storage space utilization efficiency of the image repository agent, enables on-demand setting of the expiration date of the target Docker image, and enhances the management efficiency and flexibility of storage space.
Smart Images

Figure CN120994299A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data processing method and related apparatus. Background Technology
[0002] Docker is an application container engine that enables the building, packaging, storage, and distribution of Docker images. A Docker image is a standardized encapsulation of an application and its runtime environment. To facilitate the management of Docker images, a centralized image repository is provided through the Docker Registry for the storage and distribution of Docker images.
[0003] To accelerate the download of Docker images in situations with unstable networks, image repository proxy services were developed. The image repository proxy is used as a cache for local images. When a client needs to obtain a certain Docker image, it first checks with the image repository proxy to see if it is cached. If it is, it downloads the Docker image directly from the image repository proxy; otherwise, it downloads the Docker image from the central image repository.
[0004] Image repository agents have limited storage space, while Docker images typically require a large amount of storage space. Docker images written in a short period can occupy all the data space of the image repository agent. However, the expiration mechanism in the image repository agent does not support flexible setting of the validity period. A uniform validity period is difficult to adapt to all application scenarios, causing some temporarily obtained Docker images to be stored in the image repository agent for a long time. Once the storage space of the image repository agent is fully occupied, it cannot be used anymore, resulting in low utilization efficiency of the storage space of the image repository agent. Summary of the Invention
[0005] This application provides a data processing method and related apparatus for improving the storage space utilization efficiency of a mirror repository agent.
[0006] In view of the above, the first aspect of this application provides a data processing method, comprising:
[0007] Obtain the target tuning request, which carries the identity information and tuning information of the target Docker image;
[0008] When the target Docker image is stored in the image repository agent, the timing information of the target Docker image is obtained. The timing information of the target Docker image is used to determine whether the target Docker image has expired.
[0009] The timing information of the target Docker image is updated based on the adjustment information to adjust the storage validity period of the target Docker image.
[0010] A second aspect of this application provides a data processing apparatus, comprising:
[0011] The acquisition unit is used to acquire the target adjustment request, which carries the identity information and adjustment information of the target Docker image.
[0012] The acquisition unit is also used to acquire the timing information of the target Docker image when the target Docker image is stored in the image repository agent. The timing information of the target Docker image is used to determine whether the target Docker image has expired.
[0013] The adjustment unit is used to update the timing information of the target Docker image according to the adjustment information, so as to adjust the storage validity period of the target Docker image.
[0014] In one possible implementation of the second aspect, the adjustment information instructs the deletion of the target Docker image from the image repository agent;
[0015] The adjustment unit is specifically used to adjust the timing information of the target Docker image according to the adjustment information, so that the target Docker image expires in storage;
[0016] The device also includes a deletion unit for deleting the target Docker image and the target Docker image's identity information stored in the image repository agent.
[0017] In one possible implementation of the second aspect, the acquisition unit is further configured to acquire record information, which describes information about Docker images stored in the image repository agent.
[0018] The device also includes a processing unit for adding a mapping between the identity information of the target Docker image and the target identifier to the record information, wherein the target identifier indicates that the Docker image is actively deleted.
[0019] In one possible implementation of the second aspect, the acquisition unit is further configured to acquire the number of times the target Docker image has been read;
[0020] The adjustment unit is specifically used to update the timing information of the target Docker image when the number of reads of the target Docker image is less than a threshold, so that the storage of the target Docker image expires.
[0021] In one possible implementation of the second aspect, the adjustment unit is specifically configured to update the timing information of the target Docker image when the timing information of the target Docker image indicates that the target Docker image is within the storage validity period, so that the target Docker image expires.
[0022] In one possible implementation of the second aspect, the target Docker image includes a first Docker image and a second Docker image. The identity information of the target Docker image includes the identity information of the first Docker image and the identity information of the second Docker image. The identity information of the first Docker image indicates that the first Docker image is a first version of the target Docker image, and the identity information of the second Docker image indicates that the second Docker image is a second version of the target Docker image.
[0023] In one possible implementation of the second aspect, the adjustment information indicates that the storage validity period of the target Docker image in the image repository agent be extended to a reference duration;
[0024] The adjustment unit is specifically used to update the timing information of the target Docker image based on the reference duration, so that the storage validity period of the target Docker image is extended to the reference duration.
[0025] In one possible implementation of the second aspect, the adjustment unit is specifically used for:
[0026] If the first Docker image and the second Docker image are stored in the image repository agent, update the timing information of the first Docker image so that the storage of the first Docker image expires. The timing information of the first Docker image is included in the timing information of the target Docker image. The generation time of the first Docker image is earlier than the generation time of the second Docker image.
[0027] Delete the first Docker image stored in the image repository agent;
[0028] Update the timing information of the second Docker image to extend its storage validity period to the reference duration. The timing information of the second Docker image is included in the timing information of the target Docker image.
[0029] In one possible implementation of the second aspect, the acquiring unit is further configured to:
[0030] Obtain the target read request, which carries the identity information of the target Docker image;
[0031] If the target Docker image is not stored in the image repository agent, retrieve the target Docker image from the central image repository;
[0032] The processing unit is also used to generate timing information for the target Docker image based on a preset duration, which is the system's default Docker image validity period.
[0033] In one possible implementation of the second aspect, the acquiring unit is further configured to:
[0034] Obtain the target read request, which carries the identity information of the target Docker image and the target duration;
[0035] If the target Docker image is not stored in the image repository agent, retrieve the target Docker image from the central Docker image repository;
[0036] The processing unit is also used to generate timing information for the target Docker image based on the target duration.
[0037] In one possible implementation of the second aspect, the apparatus further includes a sending unit for sending an adjustment exception signal if the target Docker image is not stored in the image repository agent.
[0038] A third aspect of this application provides a computer device, including: a memory, a processor, and a bus system;
[0039] The memory is used to store programs;
[0040] The processor is used to execute programs in memory, and the processor is used to execute the methods mentioned above according to the instructions in the program code;
[0041] Bus systems are used to connect memory and processor to enable communication between them.
[0042] The fourth aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the methods described above.
[0043] A fifth aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the above aspects.
[0044] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: The target object can send a target adjustment request to the image repository. This request carries the identity information and adjustment information of the target Docker image. If the target Docker image is stored in the image repository proxy, the timing information of the target Docker image can be obtained. This timing information is used to determine whether the target Docker image is within its storage validity period. The timing information is updated according to the adjustment information to adjust the storage validity period of the target Docker image. Based on the existing expiration mechanism of the image repository proxy, the validity period of the target Docker image can be adjusted. The validity period of the target Docker image can be flexibly set according to needs, achieving efficient management of the storage space in the image repository proxy and improving the utilization efficiency of the image repository proxy's storage space. Attached Figure Description
[0045] Figure 1 A schematic diagram of an application scenario architecture for the data processing method provided in the embodiments of this application;
[0046] Figure 2 A schematic flowchart of a data processing method provided in an embodiment of this application;
[0047] Figure 3 Another flowchart illustrating the data processing method provided in this application embodiment;
[0048] Figure 4 Another flowchart illustrating the data processing method provided in this application embodiment;
[0049] Figure 5 A schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application;
[0050] Figure 6 This is another schematic diagram of the data processing apparatus provided in the embodiments of this application;
[0051] Figure 7 This is another schematic diagram of the data processing apparatus provided in the embodiments of this application. Detailed Implementation
[0052] This application provides a data processing method and related apparatus for improving the storage space utilization efficiency of a mirror repository agent.
[0053] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding to,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0054] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0055] Docker is an application container engine that enables the building, packaging, storage, and distribution of Docker images. A Docker image is a standardized encapsulation of an application and its runtime environment. To facilitate the management of Docker images, a centralized image repository is provided through the Docker Registry for the storage and distribution of Docker images.
[0056] When using Docker images, one or more image repositories are usually configured in the Docker client to specify which image repository to obtain Docker images from. However, when the network is congested, obtaining images can take a long time. Setting up an image repository proxy between the Docker client and the image repository, which acts as a local image caching server, can speed up the download of Docker images when the network is unstable or bandwidth is limited.
[0057] Image repository agents have limited storage space, while Docker images typically require a large amount of storage space. Docker images written in a short period can occupy all the data space of the image repository agent. However, the expiration mechanism in the image repository agent does not support flexible setting of the validity period. A uniform validity period is difficult to adapt to all application scenarios, causing some temporarily obtained Docker images to be stored in the image repository agent for a long time. Once the storage space of the image repository agent is fully occupied, it cannot be used anymore, resulting in low utilization efficiency of the storage space of the image repository agent.
[0058] To address this issue, this application proposes that a target object can send a target adjustment request to the image repository. This request carries the target Docker image's identity information and adjustment information. If the target Docker image is stored in the image repository proxy, the application retrieves the target Docker image's timing information. This timing information is used to determine if the target Docker image is within its storage validity period. The timing information is updated based on the adjustment information to adjust the target Docker image's storage validity period. Building upon the existing expiration mechanism of the image repository proxy, this application adjusts the validity period of the target Docker image, allowing for flexible setting of the target Docker image's validity period as needed. This enables efficient management of storage space within the image repository proxy and improves the utilization efficiency of the proxy's storage space.
[0059] Given that this application involves some technical terms, these terms will be introduced below.
[0060] Docker: Docker is a containerization technology that packages applications and their dependencies together to create lightweight, portable, self-contained containers. By running in Docker containers, applications are decoupled from the infrastructure, achieving cross-platform compatibility, rapid deployment, scalability, and enhanced security. Kubernetes (K8s) is an open-source platform based on containerization technology for easily managing containerized applications.
[0061] Each Docker image consists of two parts: a manifest and a blob. Each Docker image comprises one or more layers. In the Docker file, each layer corresponds to instructions such as RUN, COPY, and ADD. The manifest contains the SHA256 hash value of each layer and other metadata, such as the operating system, file system type, and architecture. It also includes the image's configuration information, such as environment variables, default container commands, and ports. The Docker client can view and manage all layers of the image through the manifest file.
[0062] Manifest: Each layer of a Docker image is encapsulated into a blob file of a different size, and these are the components that make up the Docker image. The manifest is a metadata file that combines these blob files and describes how they are combined into the image.
[0063] Blob: A blob file is a file system increment used to store layers of a Docker image. These blob files are hierarchically structured, with each layer consisting of one blob file. Docker images use a layered storage mechanism, which allows each layer's file to be relatively small, and each layer can be built independently. This way, if a file hasn't changed, it can be reused in a new build without needing to be rebuilt, thus improving the speed and efficiency of container builds.
[0064] Kubernetes (K8s): K8s automates the deployment, scaling, and management of containerized applications, providing highly available, reliable, and scalable services. It automates container scheduling, load balancing, storage volume management, and automatic container recovery, reducing manual intervention and better handling high-traffic and high-load application scenarios. K8s also features a pluggable architecture, allowing users to choose and combine various infrastructure, network, and storage solutions, making it more suitable for diverse business needs.
[0065] To better understand the entities responsible for implementing the plan, please refer to [link / reference needed]. Figure 1 , Figure 1This is an optional architecture diagram of an application scenario for the data processing method provided in this application embodiment. To support a data processing method, terminal device 100 connects to server 300 via network 200, and server 300 connects to database 400. Network 200 can be a wide area network (WAN), a local area network (LAN), or a combination of both. The client for implementing the training scheme of the image segmentation model is deployed on terminal device 100. The client can run on terminal device 100 via a browser or as a standalone application (APP). The specific form of the client is not limited here. The server 300 involved in this application can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. Terminal device 100 may be a smartphone, tablet computer, laptop computer, PDA, personal computer, smart TV, smartwatch, in-vehicle device, wearable device, etc., but is not limited thereto. Terminal device 100 and server 300 may be directly or indirectly connected to network 200 via wired or wireless communication, and this application does not impose any restrictions. The number of server 300 and terminal device 100 is also not limited.
[0066] The solution provided in this application can be completed independently by the terminal device 100, independently by the server 300, or jointly by the terminal device 100 and the server 300. This application does not make any specific limitations on this.
[0067] In short, a database can be viewed as an electronic filing cabinet—a place to store electronic files, where users can perform operations such as adding, querying, updating, and deleting data. A "database" is a collection of data stored together in a certain way, shared by multiple users, with minimal redundancy, and independent of application programs. A Database Management System (DBMS) is a computer software system designed to manage databases, generally possessing basic functions such as storage, retrieval, security, and backup. DBMSs can be classified according to the database model they support, such as relational or Extensible Markup Language (XML); or according to the type of computer they support, such as server clusters or mobile phones; or according to the query language used, such as Structured Query Language (SQL) or XQuery; or according to performance priorities, such as maximum scale or maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMSs can cross categories, for example, simultaneously supporting multiple query languages. In this application, database 400 can be used to store Docker images. Of course, the storage location of Docker images is not limited to the database. For example, they can also be stored in terminal device 100, blockchain, or distributed file system of server 300.
[0068] In some embodiments, both the server 300 and the terminal device 100 can execute the data processing method provided in this application embodiment. The specific process can be as follows: The terminal device 100 obtains a target adjustment request, which carries the identity information and adjustment information of the target Docker image. If the target Docker image is stored in the image repository agent, the terminal device 100 obtains the timing information of the target Docker image, which is used to determine whether the target Docker image is within its storage validity period. Then, the terminal device 100 updates the timing information of the target Docker image according to the adjustment information to adjust the storage validity period of the target Docker image.
[0069] In another embodiment, the server 300 independently executes the data processing method provided in this application embodiment. In this embodiment, the specific process can be as follows: The server 300 obtains a target adjustment request, which carries the identity information and adjustment information of the target Docker image. If the target Docker image is stored in the image repository agent, the server obtains the timing information of the target Docker image. This timing information is used to determine whether the target Docker image is within its storage validity period. Then, the server updates the timing information of the target Docker image according to the adjustment information to adjust the storage validity period of the target Docker image.
[0070] It is understood that in the specific implementation of this application, data such as the image to be processed and the training sample set are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0071] Based on the above description, the data processing method provided in this application can be applied to situations where it is necessary to delete the target Docker image stored in the image repository agent, and situations where it is necessary to retain the target Docker image stored in the image repository agent for a long time. The following sections will explain these situations in detail:
[0072] Scenario 1: The need to delete the target Docker image stored in the image repository agent;
[0073] Please see Figure 2 One embodiment of the data processing method in this application includes:
[0074] S110. Obtain the target adjustment request. The target adjustment request carries the identity information and adjustment information of the target Docker image.
[0075] The adjustment information indicates the deletion of the target Docker image from the image repository agent. The identity information of the target Docker image can be its tag, its name, or other information used to uniquely identify the target Docker image; there are no restrictions here.
[0076] Specifically, the target adjustment information can be a deletion message for the target Docker image sent to the image repository agent via the HTTP interface forwarder when the storage space occupied by the target object exceeds a threshold. There are no restrictions here.
[0077] S120. Determine whether the target Docker image is stored in the image repository proxy;
[0078] Specifically, parsing the target adjustment request can obtain the identity information of the target Docker image, and based on the identity information of the target Docker image, it can be determined whether the target Docker image is stored in the image repository agent.
[0079] If the target Docker image is stored in the image repository agent and the target Docker image has not expired, it is assumed that the target Docker image is stored in the image repository agent, and step S130 is executed.
[0080] If the target Docker image is stored in the image repository agent and the target Docker image has expired, or if the target Docker image is not stored in the image repository agent, it is assumed that the target Docker image is not stored in the image repository agent, and step S160 is executed.
[0081] S130. If the target Docker image is stored in the image repository agent, obtain the timing information of the target Docker image;
[0082] The timing information for the target Docker image is used to determine whether the target Docker image has expired.
[0083] Specifically, the timing information of a target Docker image can take many forms. The different forms of timing information for a target Docker image will be explained below:
[0084] 1. The timing information of the target Docker image consists of the storage time of the target Docker image and the validity period of the target Docker image.
[0085] 2. The timing information of the target Docker image consists of the storage time of the target Docker image and the expiration time of the target Docker image.
[0086] 3. The timing information of the target Docker image consists of the expiration time of the target Docker image.
[0087] It is understood that the description of the timing information for the target Docker image here is only an example. In actual applications, it should be set according to the specific application scenario and specific needs. There are no restrictions here.
[0088] S140. Adjust the timing information of the target Docker image based on the adjustment information so that the target Docker image storage expires;
[0089] Specifically, depending on the format of the target Docker image's timing information, the methods for adjusting the timing information of the target Docker image will vary slightly, which will be explained below.
[0090] When the target Docker image's timing information is in form 1:
[0091] Adjust the expiration time of the target Docker image to make it expire. For example, if the target Docker image was stored on year A month 03 at 12:05:00, and its expiration time is 24 hours, and the current time is year A month 03 at 14:13:54, you can change the expiration time of the target Docker image to any duration within 21 hours 41 minutes 06 seconds; there are no restrictions here.
[0092] When the target Docker image's timing information is in form 2:
[0093] Adjust the expiration time of the target Docker image to make it expire. For example, if the target Docker image is stored on year A month 03 at 12:05:00, and its expiration time is year A month 04 at 12:05:00, and the current time is year A month 03 at 14:13:54, you can set the expiration time of the target Docker image to any time between year A month 03 at 12:05:00 and year A month 03 at 14:13:53. There are no restrictions here.
[0094] When the target Docker image's timing information is in form 3:
[0095] Adjusting the expiration time of the target Docker image is similar to the case where the timing information of the target Docker image is in form 2, and there are no restrictions here.
[0096] Furthermore, to simplify the timing information for the target Docker image, the adjustment information can also carry a valid duration of 0, or an expiration time of the current time, thereby achieving the purpose of deleting the target Docker image from the image repository agent. There are no restrictions here.
[0097] It is understood that the description of the timing information for adjusting the target Docker image here is only an example. In actual applications, it should be set according to the specific scenario, and no restrictions are imposed here.
[0098] Furthermore, to more effectively manage the data stored in the image repository proxy, the target Docker image's scheduled information will only be updated when certain conditions are met. These conditions may specifically include:
[0099] Condition 1: The number of reads of the target Docker image is less than the threshold;
[0100] To avoid deleting frequently used Docker images, a target Docker image can only be deleted if the number of reads of the target Docker image is less than a threshold.
[0101] Specifically, after receiving a target adjustment request, if the target adjustment request indicates the deletion of the target Docker image, the image repository agent obtains the number of reads of the target Docker image and determines whether the number of reads of the target Docker image is less than the threshold. If so, it updates the timing information of the target Docker image.
[0102] It is understandable that the explanation of the limitation on the number of reads of the target Docker image being less than the threshold here is only an example. In actual applications, it is also possible to limit the number of reads of the target Docker image within the target time period to less than the threshold, so that only cold data can be deleted. This is not restricted here.
[0103] In this embodiment, the deletion of the target Docker image is provided only when the number of reads of the target Docker image is less than a threshold, which avoids the situation of frequently used data being accidentally manipulated and improves the reliability of the solution.
[0104] Condition 2: The target Docker image has not expired.
[0105] In practical applications, because the image repository agent periodically processes expired Docker images stored in the image repository agent, there may be expired Docker images in the image repository agent that are still present in the image repository agent because it has not yet reached the time for the image repository agent to clean up.
[0106] Therefore, the target Docker image's timing information will only be updated to make it expire if the target Docker image's timing information indicates that the target Docker image is within its storage validity period.
[0107] In this embodiment, the deletion of the target Docker image is provided only if the target Docker image has not expired, avoiding deletion failures that may occur due to repeated operations, and effectively improving the reliability of the solution.
[0108] S150. Delete the target Docker image and its identity information stored in the image repository agent;
[0109] If the target Docker image's timed information is updated and the timed information indicates that the target Docker image has expired, delete the target Docker image and its identity information stored in the image repository agent to release the storage space occupied by the target Docker image in the image repository agent.
[0110] S160. If the target Docker image is not stored in the image repository agent, send an adjustment exception signal.
[0111] Among them, the adjustment anomaly signal indicates that the target adjustment request cannot be executed.
[0112] In this embodiment, an adjustment anomaly feedback is provided for the situation where the target Docker image is not stored in the image repository proxy. This informs the adjustment initiator that the target Docker image is not stored in the image repository proxy, which facilitates the adjustment initiator to adjust subsequent operations in a timely manner according to the needs. This improves the accuracy of image repository proxy management and enhances the completeness of the solution.
[0113] In this embodiment, by utilizing a target adjustment request carrying the identity information and adjustment information of the target Docker image, the storage validity period of the target Docker image is adjusted when the target Docker image is stored in the image repository agent. This enables flexible management of the storage validity period of the target Docker image, provides the possibility of actively deleting or retaining the target Docker image, and improves the storage flexibility of the image repository agent.
[0114] In this embodiment, when the adjustment information indicates the deletion of a target Docker image in the image repository agent, the timing information of the target Docker image can be updated to make its storage expire. The target Docker image and its identity information stored in the image repository agent are then deleted. This adjustment information allows for flexible deletion of Docker images that need to be deleted. This effectively improves the manageability of the image repository agent, enabling targeted reclamation of storage space within the agent.
[0115] The foregoing Figure 2 In the data processing method shown, the image repository agent may store multiple different versions of the same Docker image. For example, the target Docker image includes a first Docker image and a second Docker image, and the identity information of the target Docker image includes the identity information of the first Docker image and the identity information of the second Docker image.
[0116] The first Docker image is the first version of the target Docker image, and the second Docker image is the second version of the target Docker image. The first version of the target Docker image already existed before the second version of the target Docker image was generated.
[0117] If the target adjustment request instructs that the target Docker image be deleted, both the first and second Docker images will be deleted simultaneously.
[0118] In this embodiment of the application, when different versions of the target Docker image are stored in the image repository agent, deleting the target Docker image involves directly deleting all target Docker images stored in the image repository agent. This avoids the possibility of missing deletions that may occur when the image repository agent is deleting images, and improves the efficiency of data processing.
[0119] Optionally, in the foregoing Figure 2 Based on the data processing method shown, the data processing method provided in this application may further include steps S170 and S180. When executing steps S170 and S180, step S130 may also record information about stored Docker images in the image repository agent, as detailed below:
[0120] S170. Obtain record information. The record information is used to describe the information of the Docker images stored in the image repository agent.
[0121] For example, the recorded information may include the identity information of the preset Docker image, the write time of the preset Docker image, and the deletion time of the preset Docker image. In the case that the preset Docker image is actively deleted, it may also include the correspondence between the preset Docker image and the target identifier. The preset Docker image is a Docker image that has been stored in the image repository, which is not limited here.
[0122] In this embodiment, since the target Docker image is stored in the image repository agent, the record information stores the identity information of the target Docker image and the write time of the target Docker image; this is not limited here. When determining whether the target Docker image is stored in the image repository agent, the information stored in the record information can also be used for judgment; this is not limited here either.
[0123] S180. Add the mapping relationship between the identity information of the target Docker image and the target identifier to the record information.
[0124] After deleting the target Docker image and its identity information, a mapping between the target Docker image's identity information and its target identifier is added to the log information. The target identifier indicates that the Docker image was actively deleted.
[0125] In this embodiment of the application, by recording information about Docker images stored in the image repository agent in the record information, the data retained in the image repository agent is recorded and managed. When data anomalies occur, the record information can be used to help query vulnerabilities. This not only improves the data management efficiency of the image repository agent, but also improves the vulnerability query efficiency for the image repository agent.
[0126] Scenario 2: The need to extend the storage duration of the target Docker image stored in the image repository agent;
[0127] Please see Figure 3 , Figure 3 This is a schematic flowchart of a data processing method provided in an embodiment of this application.
[0128] S210. Obtain the target adjustment request. The target adjustment request carries the identity information and adjustment information of the target Docker image.
[0129] The adjustment information indicates that the storage validity period of the target Docker image in the image repository agent be extended to the target duration. The adjustment information can carry the target duration, and the identity information of the target Docker image can be the target Docker image's tag, or the target Docker image's name, etc., used to uniquely identify the target Docker image; there are no restrictions here.
[0130] For example, the iteration time of the target Docker image can be used as a reference. The reference time can be set to one year, two years or ten years, etc., depending on the needs. There is no limit here.
[0131] Specifically, the target adjustment information can be a long-term storage message for the target Docker image sent to the image repository agent through the HTTP interface forwarder when the target object recognizes the target Docker image as a commonly used Docker image. There are no restrictions here.
[0132] S220. Determine whether the target Docker image is stored in the image repository proxy;
[0133] Specifically, parsing the target adjustment request can obtain the identity information of the target Docker image, and based on the identity information of the target Docker image, it can be determined whether the target Docker image is stored in the image repository agent.
[0134] If the target Docker image is stored in the image repository agent and the target Docker image has not expired, it is assumed that the target Docker image is stored in the image repository agent, and step S230 is executed.
[0135] If the target Docker image is stored in the image repository agent and the target Docker image has expired, or if the target Docker image is not stored in the image repository agent, it is assumed that the target Docker image is not stored in the image repository agent, and step S250 is executed.
[0136] S230. If the target Docker image is stored in the image repository agent, obtain the timing information of the target Docker image.
[0137] The timing information for the target Docker image is used to determine whether the target Docker image has expired. The format of the timing information for the target Docker image is as described above. Figure 2 The steps described in step S130 are similar and will not be repeated here.
[0138] S240. Adjust the timing information of the target Docker image based on the reference duration, and extend the storage validity period of the target Docker image to the reference duration;
[0139] Specifically, depending on the format of the target Docker image's timing information, the methods for adjusting the timing information of the target Docker image will vary slightly, which will be explained below.
[0140] If the timing information of the target Docker image is in form 1, adjust the effective duration of the target Docker image to the reference duration.
[0141] If the target Docker image's expiration information is in form 2 or form 3: set the target Docker image's expiration time to the reference duration, and then there are no restrictions here.
[0142] It is understood that the description of the timing information for adjusting the target Docker image here is only an example. In actual applications, it should be set according to the specific scenario, and no restrictions are imposed here.
[0143] Furthermore, in some scenarios, the image repository agent may store multiple different versions of the same Docker image. For example, the target Docker image may include a first Docker image and a second Docker image, and the identity information of the target Docker image may include the identity information of the first Docker image and the identity information of the second Docker image.
[0144] The first Docker image is the first version of the target Docker image, and the second Docker image is the second version of the target Docker image. The first Docker image was created before the second Docker image was created.
[0145] Update the timing information of the first Docker image to make its storage expire; and update the timing information of the second Docker image based on the reference duration to extend its storage validity to the reference duration; delete the first Docker image and its identity information stored in the image repository agent.
[0146] In this embodiment of the application, when multiple versions of a target Docker image are stored in the image repository agent, while extending the validity period of the target Docker image, the older versions (other than the latest version) of the target Docker image are deleted, and the validity period of the latest version of the target Docker image is extended, thereby optimizing the storage usage in the image repository agent and improving the storage space utilization efficiency in the image repository agent.
[0147] S250: If the target Docker image is not stored in the image repository agent, send an adjustment exception signal.
[0148] Among them, the adjustment anomaly signal indicates that the target adjustment request cannot be executed.
[0149] This application provides a solution for extending the storage validity period of a target Docker image, which can flexibly extend the storage validity period of the target Docker image according to the real-time usage of the target Docker image, thereby improving the management flexibility of Docker images in the image repository agent.
[0150] Based on the foregoing Figure 2 and Figure 3 The data processing method shown below uses an image repository agent that stores the target Docker image. The following will combine... Figure 4 This section introduces the scenario of storing target Docker images through an image repository proxy.
[0151] S310. Obtain the target read request, which carries the identity information of the target Docker image;
[0152] Specifically, the identity information of the target Docker image can be the target Docker image's tag, or the target Docker image's name, etc., which are used to uniquely identify the target Docker image. There are no restrictions here.
[0153] Optionally, the target duration can also be included in the target read request; there is no restriction on this.
[0154] S320. Determine whether the target Docker image is stored in the image repository proxy;
[0155] If storing, send the target Docker image directly;
[0156] If not stored, proceed to step S330.
[0157] S330. If the target Docker image is not stored in the image repository agent, obtain the target Docker image from the central image repository.
[0158] Specifically, when retrieving the target Docker image from the image center repository, the retrieval will be successful if the target Docker image is stored in the image center repository.
[0159] Specifically, when storing the target Docker image in the image central repository, the version information of the target Docker image is first read to the local machine, and then each blob file of the target Docker image is read to the local machine according to the version information of the target Docker image. There are no restrictions here.
[0160] If the target Docker image is not stored in the central image repository, the retrieval will fail; this situation will not be considered here.
[0161] S340: Scheduled information for generating the target Docker image.
[0162] Upon completion of writing to the target Docker image, timed information for the target Docker image is generated. This timed information is similar to that described above. Figure 2 and Figure 3 The timing information for the target Docker image described in the previous section is similar and will not be repeated here.
[0163] Specifically, if the target read request only carries the identity information of the target Docker image, the timed information of the target Docker image is generated according to the preset duration. The preset duration is the system's default Docker image validity duration, and there is no restriction here.
[0164] Optionally, if the target Docker image's identity information and target duration are included in the target read request, the timing information for the target Docker image can be generated based on the target duration.
[0165] It is understood that the explanation of the generation of timing information for the target Docker image here is only an example. In actual applications, it should be set according to the specific application scenario. No restrictions are imposed here.
[0166] In this embodiment, the system's default Docker image validity period (preset duration) can be used as the basis for setting the timing information of the target Docker image, ensuring that all Docker images stored in the image repository agent have an expiration date. This avoids the inconvenience caused by only being able to erase all Docker images in the image repository agent, and improves the flexibility of data management in the image repository agent.
[0167] In this embodiment, the target duration can be carried in the target read request. In case the target Docker image is not stored in the image repository agent, after obtaining the target Docker image from the image central repository, the timing information of the target Docker image can be set according to the target duration. The timing information that meets the requirements can be set for each Docker image according to the needs, which further improves the flexibility of data management in the image repository agent.
[0168] In order to perform the aforementioned Figure 2 and Figure 3 The data processing methods in the image repository proxy include an HTTP interface forwarder, a manifest request handler, and an expiration mechanism scheduler.
[0169] The interface forwarder performs operations similar to those in steps S110 and S210, the manifest request processor performs operations similar to those in steps S120 and S220, and the expiration mechanism scheduler performs operations similar to those in steps S140, S150, and S240. No restrictions are imposed here.
[0170] The data processing apparatus in this application is described in detail below. Please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic diagram of one embodiment of the data processing apparatus in this application. The data processing apparatus 10 includes:
[0171] The acquisition unit 110 is used to acquire the target adjustment request, which carries the identity information and adjustment information of the target Docker image.
[0172] The acquisition unit 110 is also used to acquire the timing information of the target Docker image when the target Docker image is stored in the image repository agent. The timing information of the target Docker image is used to determine whether the target Docker image has expired.
[0173] The adjustment unit 120 is used to update the timing information of the target Docker image according to the adjustment information, so as to adjust the storage validity period of the target Docker image.
[0174] In this embodiment, by utilizing a target adjustment request carrying the identity information and adjustment information of the target Docker image, the storage validity period of the target Docker image is adjusted when the target Docker image is stored in the image repository agent. This enables flexible management of the storage validity period of the target Docker image, provides the possibility of actively deleting or retaining the target Docker image, and improves the storage flexibility of the image repository agent.
[0175] Optionally, the adjustment information indicates the removal of the target Docker image from the image repository agent;
[0176] The adjustment unit 120 is specifically used to adjust the timing information of the target Docker image according to the adjustment information, so that the storage of the target Docker image expires.
[0177] The device also includes a deletion unit 130 for deleting the target Docker image and the target Docker image's identity information stored in the image repository agent.
[0178] In this embodiment, when the adjustment information indicates the deletion of a target Docker image in the image repository agent, the timing information of the target Docker image can be updated to make its storage expire. The target Docker image and its identity information stored in the image repository agent are then deleted. This adjustment information allows for flexible deletion of Docker images that need to be deleted. This effectively improves the manageability of the image repository agent, enabling targeted reclamation of storage space within the agent.
[0179] Optionally, the acquisition unit 110 is also used to acquire record information, which describes information about Docker images stored in the image repository agent;
[0180] The device also includes a processing unit 140, which adds a correspondence between the identity information of the target Docker image and the target identifier to the record information, wherein the target identifier indicates that the Docker image is actively deleted.
[0181] In this embodiment of the application, by recording information about Docker images stored in the image repository agent in the record information, the data retained in the image repository agent is recorded and managed. When data anomalies occur, the record information can be used to help query vulnerabilities. This not only improves the data management efficiency of the image repository agent, but also improves the vulnerability query efficiency for the image repository agent.
[0182] Optionally, the acquisition unit 110 can also be used to acquire the number of times the target Docker image has been read;
[0183] The adjustment unit 120 is specifically used to update the timing information of the target Docker image when the number of reads of the target Docker image is less than a threshold, so that the storage of the target Docker image expires.
[0184] In this embodiment, the deletion of the target Docker image is provided only when the number of reads of the target Docker image is less than a threshold, which avoids the situation of frequently used data being accidentally manipulated and improves the reliability of the solution.
[0185] Optionally, the adjustment unit 120 is specifically used to update the timing information of the target Docker image when the timing information of the target Docker image indicates that the target Docker image is within the storage validity period, so as to make the target Docker image expire.
[0186] In this embodiment, the deletion of the target Docker image is provided only if the target Docker image has not expired, avoiding deletion failures that may occur due to repeated operations, and effectively improving the reliability of the solution.
[0187] Optionally, the target Docker image includes a first Docker image and a second Docker image. The identity information of the target Docker image includes the identity information of the first Docker image and the identity information of the second Docker image. The identity information of the first Docker image indicates that the first Docker image is the first version of the target Docker image, and the identity information of the second Docker image indicates that the second Docker image is the second version of the target Docker image.
[0188] In this embodiment of the application, when different versions of the target Docker image are stored in the image repository agent, deleting the target Docker image involves directly deleting all target Docker images stored in the image repository agent. This avoids the possibility of missing deletions that may occur when the image repository agent is deleting images, and improves the efficiency of data processing.
[0189] Optionally, the adjustment information indicates that the storage validity period of the target Docker image in the image repository agent be extended to a reference duration;
[0190] The adjustment unit 120 is specifically used to update the timing information of the target Docker image based on the reference duration, so that the storage validity period of the target Docker image is extended to the reference duration.
[0191] This application provides a solution for extending the storage validity period of a target Docker image, which can flexibly extend the storage validity period of the target Docker image according to the real-time usage of the target Docker image, thereby improving the management flexibility of Docker images in the image repository agent.
[0192] Optional, the adjustment unit 120 is specifically used for:
[0193] If the first Docker image and the second Docker image are stored in the image repository agent, update the timing information of the first Docker image so that the storage of the first Docker image expires. The timing information of the first Docker image is included in the timing information of the target Docker image. The generation time of the first Docker image is earlier than the generation time of the second Docker image.
[0194] Delete the first Docker image stored in the image repository agent;
[0195] Update the timing information of the second Docker image to extend its storage validity period to the reference duration. The timing information of the second Docker image is included in the timing information of the target Docker image.
[0196] In this embodiment of the application, when multiple versions of a target Docker image are stored in the image repository agent, while extending the validity period of the target Docker image, the older versions (other than the latest version) of the target Docker image are deleted, and the validity period of the latest version of the target Docker image is extended, thereby optimizing the storage usage in the image repository agent and improving the storage space utilization efficiency in the image repository agent.
[0197] Optionally, the acquisition unit 120 is also used for:
[0198] Obtain the target read request, which carries the identity information of the target Docker image;
[0199] If the target Docker image is not stored in the image repository agent, retrieve the target Docker image from the central image repository;
[0200] The processing unit 140 is also used to generate timing information for the target Docker image according to a preset duration, which is the system's default Docker image validity period.
[0201] In this embodiment, the system's default Docker image validity period (preset duration) can be used as the basis for setting the timing information of the target Docker image, ensuring that all Docker images stored in the image repository agent have an expiration date. This avoids the inconvenience caused by only being able to erase all Docker images in the image repository agent, and improves the flexibility of data management in the image repository agent.
[0202] Optionally, the acquisition unit 110 is also used for:
[0203] Obtain the target read request, which carries the identity information of the target Docker image and the target duration;
[0204] If the target Docker image is not stored in the image repository agent, retrieve the target Docker image from the central Docker image repository;
[0205] The processing unit 140 is also used to generate timing information for the target Docker image based on the target duration.
[0206] In this embodiment, the target duration can be carried in the target read request. In case the target Docker image is not stored in the image repository agent, after obtaining the target Docker image from the image central repository, the timing information of the target Docker image can be set according to the target duration. The timing information that meets the requirements can be set for each Docker image according to the needs, which further improves the flexibility of data management in the image repository agent.
[0207] Optionally, the apparatus also includes a sending unit 150 for sending an adjustment exception signal if the target Docker image is not stored in the image repository agent.
[0208] In this embodiment, an adjustment anomaly feedback is provided for the situation where the target Docker image is not stored in the image repository proxy. This informs the adjustment initiator that the target Docker image is not stored in the image repository proxy, which facilitates the adjustment initiator to adjust subsequent operations in a timely manner according to the needs. This improves the accuracy of image repository proxy management and enhances the completeness of the solution.
[0209] The data processing apparatus provided in this application can be used on a server; please refer to [link / reference]. Figure 6 , Figure 6This is a schematic diagram of a server structure provided in an embodiment of this application. The server 300 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 322 (e.g., one or more processors) and memory 332, and one or more storage media 330 (e.g., one or more mass storage devices) for storing application programs 342 or data 344. The memory 332 and storage media 330 can be temporary or persistent storage. The program stored in the storage media 330 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the server. Furthermore, the CPU 322 may be configured to communicate with the storage media 330 and execute the series of instruction operations stored in the storage media 330 on the server 300.
[0210] Server 300 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.
[0211] The steps performed by the server in the above embodiments can be based on this Figure 6 The server structure shown.
[0212] The data processing apparatus provided in this application can be used in terminal devices; please refer to [link / reference]. Figure 7 For ease of explanation, only the parts relevant to the embodiments of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of this application. In the embodiments of this application, a smartphone is used as an example for illustration:
[0213] Figure 7 This is a block diagram illustrating a portion of the structure of a smartphone related to the terminal device provided in the embodiments of this application. (Reference) Figure 7 The smartphone includes components such as a radio frequency (RF) circuit 410, a memory 420, an input unit 430, a display unit 440, a sensor 450, an audio circuit 460, a wireless fidelity (WiFi) module 470, a processor 480, and a power supply 490. Those skilled in the art will understand that... Figure 7The smartphone structure shown does not constitute a limitation on smartphones and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0214] The following is combined Figure 7 A detailed introduction to the various components of a smartphone:
[0215] RF circuit 410 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with processor 480; additionally, it transmits uplink data to the base station. Typically, RF circuit 410 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, RF circuit 410 can also communicate wirelessly with networks and other devices. The aforementioned wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), etc.
[0216] The memory 420 can be used to store software programs and modules. The processor 480 executes various functions and data processing of the smartphone by running the software programs and modules stored in the memory 420. The memory 420 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the smartphone (such as audio data, phonebook, etc.). In addition, the memory 420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0217] The input unit 430 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the smartphone. Specifically, the input unit 430 may include a touch panel 431 and other input devices 432. The touch panel 431, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 431), and drive the corresponding connected devices according to a pre-set program. Optionally, the touch panel 431 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 480, and can also receive and execute commands sent by the processor 480. In addition, the touch panel 431 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 431, the input unit 430 may also include other input devices 432. Specifically, other input devices 432 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0218] Display unit 440 can be used to display information input by the user or information provided to the user, as well as various menus of the smartphone. Display unit 440 may include display panel 441, optionally configured as a liquid crystal display (LCD), organic light-emitting diode (OLED), or similar form. Further, touch panel 431 may cover display panel 441. When touch panel 431 detects a touch operation on or near it, it transmits the information to processor 480 to determine the type of touch event. Subsequently, processor 480 provides corresponding visual output on display panel 441 based on the type of touch event. Although in Figure 7 In this embodiment, the touch panel 431 and the display panel 441 are two separate components to realize the input and output functions of the smartphone. However, in some embodiments, the touch panel 431 and the display panel 441 can be integrated to realize the input and output functions of the smartphone.
[0219] The smartphone may also include at least one sensor 450, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 441 according to the ambient light level, and the proximity sensor can turn off the display panel 441 and / or the backlight when the smartphone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the smartphone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, tapping), etc. Other sensors that may be configured in the smartphone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0220] Audio circuit 460, speaker 461, and microphone 462 provide an audio interface between the user and the smartphone. Audio circuit 460 converts received audio data into electrical signals and transmits them to speaker 461, where speaker 461 converts them into sound signals for output. On the other hand, microphone 462 converts collected sound signals into electrical signals, which are received by audio circuit 460, converted into audio data, and then processed by processor 480 before being transmitted via RF circuit 410 to, for example, another smartphone, or the audio data can be output to memory 420 for further processing.
[0221] WiFi is a short-range wireless transmission technology. Smartphones, through their WiFi modules (470), can help users send and receive emails, browse web pages, and access streaming media, providing wireless broadband internet access. Although Figure 7 WiFi module 470 is shown, but it is understood that it is not an essential component of a smartphone and can be omitted as needed without changing the nature of the invention.
[0222] The processor 480 is the control center of the smartphone, connecting various parts of the smartphone through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 420, and by calling data stored in the memory 420, thereby providing overall monitoring of the smartphone. Optionally, the processor 480 may include one or more processing units; optionally, the processor 480 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may also not be integrated into the processor 480.
[0223] The smartphone also includes a power supply 490 (such as a battery) that supplies power to various components. Optionally, the power supply can be logically connected to the processor 480 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.
[0224] Although not shown, smartphones may also include a camera, Bluetooth module, etc., which will not be described in detail here.
[0225] The steps performed by the terminal device in the above embodiments can be based on this Figure 7 The terminal device structure is shown.
[0226] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods described in the foregoing embodiments.
[0227] This application also provides a computer program product including a program, which, when run on a computer, causes the computer to perform the methods described in the foregoing embodiments.
[0228] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0229] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0230] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0231] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0232] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0233] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A data processing method, characterized in that, include: Obtain a target adjustment request, wherein the target adjustment request carries the identity information and adjustment information of the target Docker image; When the target Docker image is stored in the image repository agent, the timing information of the target Docker image is obtained, and the timing information of the target Docker image is used to determine whether the target Docker image has expired; The timing information of the target Docker image is updated according to the adjustment information to adjust the storage validity period of the target Docker image.
2. The method according to claim 1, characterized in that, The adjustment information indicates that the target Docker image should be deleted from the image repository agent; The step of updating the timing information of the target Docker image according to the adjustment information to adjust the storage validity period of the target Docker image includes: Update the timing information of the target Docker image to make the storage of the target Docker image expire; The method further includes: Delete the target Docker image and its identity information stored in the image repository agent.
3. The method according to claim 2, characterized in that, The method further includes: Obtain record information, which describes information about Docker images stored in the image repository agent; Add a mapping between the identity information of the target Docker image and the target identifier to the record information, wherein the target identifier indicates that the Docker image has been actively deleted.
4. The method according to claim 2, characterized in that, The method for updating the timing information of the target Docker image before the target Docker image expires also includes: Get the number of times the target Docker image has been read; The step of updating the timing information of the target Docker image to make the target Docker image expire includes: When the number of reads of the target Docker image is less than a threshold, update the timing information of the target Docker image to make the storage of the target Docker image expire.
5. The method according to claim 2, characterized in that, The step of updating the timing information of the target Docker image to make the target Docker image expire includes: If the target Docker image's timing information indicates that the target Docker image is within its storage validity period, update the target Docker image's timing information to make the target Docker image expire.
6. The method according to claim 2, characterized in that, The target Docker image includes a first Docker image and a second Docker image. The identity information of the target Docker image includes the identity information of the first Docker image and the identity information of the second Docker image. The identity information of the first Docker image indicates that the first Docker image is a first version of the target Docker image, and the identity information of the second Docker image indicates that the second Docker image is a second version of the target Docker image.
7. The method according to claim 1, characterized in that, The adjustment information indicates that the storage validity period of the target Docker image in the image repository agent be extended to a reference duration; The step of updating the timing information of the target Docker image according to the adjustment information to adjust the storage validity period of the target Docker image includes: The timing information of the target Docker image is updated based on the reference duration, thereby extending the storage validity period of the target Docker image to the reference duration.
8. The method according to claim 7, characterized in that, The step of updating the timing information of the target Docker image to extend the storage validity period of the target Docker image to the reference duration includes: When the image repository agent stores a first Docker image and a second Docker image, the timing information of the first Docker image is updated to make the storage of the first Docker image expire. The timing information of the first Docker image is included in the timing information of the target Docker image. The generation time of the first Docker image is earlier than the generation time of the second Docker image. Delete the first Docker image stored in the image repository agent; Update the timing information of the second Docker image to extend the storage validity period of the second Docker image to the reference duration. The timing information of the second Docker image is included in the timing information of the target Docker image.
9. The method according to any one of claims 1, 2, or 7, characterized in that, Before obtaining the timing information of the target Docker image, the method further includes: Obtain a target read request, wherein the target read request carries the identity information of the target Docker image; If the target Docker image is not stored in the image repository agent, the target Docker image is obtained from the central image repository; The timing information for generating the target Docker image is generated according to a preset duration, where the preset duration is the system's default Docker image validity period.
10. The method according to any one of claims 1, 2, or 7, characterized in that, Before obtaining the timing information of the target Docker image, the method further includes: Obtain a target read request, the target read request carrying the identity information and target duration of the target Docker image; If the target Docker image is not stored in the image repository agent, the target Docker image is obtained from the Docker image central repository; The timing information for the target Docker image is generated based on the target duration.
11. The method according to any one of claims 1 to 8, characterized in that, The method further includes: If the target Docker image is not stored in the image repository agent, a tuning exception signal is sent.
12. A data processing apparatus, characterized in that, include: The acquisition unit is used to acquire a target adjustment request, wherein the target adjustment request carries the identity information and adjustment information of the target Docker image; The acquisition unit is further configured to acquire the timing information of the target Docker image when the target Docker image is stored in the image repository agent, and the timing information of the target Docker image is used to determine whether the target Docker image has expired; An adjustment unit is used to update the timing information of the target Docker image according to the adjustment information, so as to adjust the storage validity period of the target Docker image.
13. A computer device, characterized in that, include: Memory, processor, and bus system; The memory is used to store programs; The processor is configured to execute a program in the memory, and the processor is configured to execute the method of any one of claims 1 to 11 according to instructions in the program code; The bus system is used to connect the memory and the processor to enable communication between the memory and the processor.
14. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method as claimed in any one of claims 1 to 11.
15. A computer program product, comprising a computer program, characterized in that, The computer program is executed by a processor using the method as described in any one of claims 1 to 11.