Method and system for implementing dynamic cleaning of product library customization
By using customized rules and intelligent priority scheduling algorithms, the artifact repository is accurately cleaned up, which solves the problem of insufficient flexibility in the artifact repository cleanup mechanism, improves storage efficiency and service stability, and reduces operation and maintenance costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI TONGLIAN FINANCIAL SERVICES CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-09
AI Technical Summary
The existing artifact cleanup mechanism lacks flexibility, resulting in resource waste and high operation and maintenance costs. It cannot adapt to the differentiated storage needs of different types of artifacts, and the static cleanup rules are difficult to cope with load fluctuations and changes in business requirements.
By adopting customized rule configuration and time priority scheduling algorithms, combined with dynamic load perception and intelligent priority determination, the system achieves accurate cleanup of the artifact library through the collaborative work of the business layer and the execution layer. This includes scenario logic implementation, cleanup rule setting, and artifact verification, and supports a multi-level verification mechanism to verify whether the artifact meets the rules before the cleanup operation.
While ensuring the security of core artifacts, we maximize the release of storage space, reduce operation and maintenance costs, improve storage efficiency and service stability, and adapt to the dynamic load and business needs changes of the artifact library.
Smart Images

Figure CN122173028A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of dynamic cleanup technology for product databases, and particularly to a method and system for implementing customized dynamic cleanup of product databases. Background Technology
[0002] Existing technologies suffer from technical problems such as insufficient flexibility, resource waste, and high operation and maintenance costs in artifact repository (such as software package repositories, image repositories, and document resource repositories) cleanup mechanisms.
[0003] Furthermore, existing artifact cleanup solutions mostly use fixed rules (such as fixed retention time and fixed retention quantity), which cannot adapt to the differentiated storage needs of different types of artifacts (such as core business artifacts, test artifacts, and temporary artifacts): core artifacts may be accidentally deleted due to fixed-duration cleanup, non-core artifacts are over-stored and occupy storage space, and static cleanup rules are difficult to respond to dynamic scenarios such as artifact library load fluctuations and changes in business requirements.
[0004] Therefore, it is necessary to provide a method and system for customized dynamic cleanup of artifact databases, so as to achieve precise cleanup of artifact databases, maximize the release of storage space, reduce operation and maintenance costs, and improve the storage efficiency and service stability of artifact databases while ensuring the security of core artifacts. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for customized dynamic cleanup of an artifact library, enabling precise cleanup of the artifact library, maximizing the release of storage space, reducing operation and maintenance costs, and improving the storage efficiency and service stability of the artifact library while ensuring the security of core artifacts.
[0006] To address the problems existing in the prior art, this invention provides a method for implementing customized dynamic cleanup of an artifact library, comprising the following steps:
[0007] S1: The business layer is responsible for implementing the scenario logic and has user-defined system type, environment, and time range.
[0008] S2: Set cleanup rules and use a time priority scheduling algorithm to arrange the execution order of cleanup tasks based on the execution priority of the tasks and the current load status of the artifact library;
[0009] S3: The execution layer is responsible for filtering out artifacts that need to be cleaned up in the logic layer and cleaning up the artifacts by calling system-level commands.
[0010] Optionally, in the method for implementing customized dynamic cleanup of the artifact library, the execution priority of tasks in S2 is that the priority of the space emergency cleanup task is higher than that of the regular time cleanup task.
[0011] Optionally, in the method for implementing customized dynamic cleanup of the product library, before cleaning up the products in S3, the following steps are also included: verifying the products that need to be cleaned and cleaning up the products that pass the verification.
[0012] Optionally, in the implementation method of customized dynamic cleanup of the artifact library, the artifact cleanup is performed in the following way:
[0013] Depending on the type of artifact storage engine, the corresponding cleanup interface is called to perform the deletion operation.
[0014] Optionally, in the implementation method of customized dynamic cleanup of the artifact library, the deletion operation includes directly deleting files in local storage, deleting fragmented data in distributed storage, and deleting objects by calling APIs in cloud storage.
[0015] This invention also provides a system for implementing customized dynamic cleanup of a product library. The system, established using the aforementioned method, includes:
[0016] The business layer is responsible for implementing the scenario logic and includes user-defined system type, environment, and time range.
[0017] The execution layer is configured to set cleanup rules and adopt a time priority scheduling algorithm to arrange the execution order of cleanup tasks based on the execution priority of the tasks and the current load status of the artifact library. It is also configured to be responsible for filtering out artifacts that need to be cleaned in the logic layer and performing artifact cleanup by calling system-level commands.
[0018] Compared with the prior art, the present invention has the following advantages:
[0019] (1) This invention achieves precise cleanup of the artifact library through customized rule configuration, dynamic load perception and intelligent priority determination. Under the premise of ensuring the security of core artifacts, it maximizes the release of storage space, reduces operation and maintenance costs, and improves the storage efficiency and service stability of the artifact library.
[0020] (2) This invention breaks through the limitations of existing fixed cleanup rules and supports users in configuring personalized cleanup rules based on artifact lifecycle (such as creation time, last access time) and environment priority (test environment, pre-production environment, production environment). A multi-level verification mechanism is set up to verify whether the artifact meets the cleanup rules and whether it is marked as "uncleanable" (e.g., exceeding the set time range) before the cleanup operation is executed. A lightweight architecture is adopted, and the core modules can be deployed independently or integrated into existing artifact repository systems (such as Nexus) without requiring large-scale modifications to the original system, and it is compatible with mainstream artifact types (such as Jar packages, Docker images, RPM packages, and documentation files). Attached Figure Description
[0021] Figure 1 A flowchart illustrating the implementation method of customized dynamic cleanup of the artifact library provided in this embodiment of the invention. Detailed Implementation
[0022] The specific embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. The advantages and features of the present invention will become clearer from the following description. It should be noted that the drawings are all in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the present invention.
[0023] In the following, if the methods described herein include a series of steps, the order of these steps presented herein is not necessarily the only order in which these steps can be performed, and some of the steps described may be omitted and / or some other steps not described herein may be added to the method.
[0024] Existing technologies suffer from technical problems such as insufficient flexibility, resource waste, and high operation and maintenance costs in artifact repository (such as software package repositories, image repositories, and document resource repositories) cleanup mechanisms.
[0025] In order to solve the problems existing in the prior art, such as Figure 1 As shown, this invention provides a method for implementing customized dynamic cleanup of an artifact library, including the following steps:
[0026] S1: The business layer is responsible for implementing the scenario logic and has user-defined system type, environment, and time range.
[0027] S2: Set cleanup rules, periodically scan the rule database, and filter out rules in the enabled state; adopt a time priority scheduling algorithm to arrange the execution order of cleanup tasks according to the execution priority of tasks (e.g., the priority of urgent space cleanup tasks is higher than that of regular time cleanup tasks) and the current load status of the artifact library, so as to avoid executing a large number of cleanup tasks at the same time and consuming too many resources.
[0028] S3: The execution layer is responsible for filtering out artifacts that need to be cleaned up in the logic layer, verifying the filtered artifacts, and cleaning up the artifacts that pass the verification. The artifact cleanup is performed by calling system-level commands. The artifact cleanup method is as follows: according to the type of artifact library storage engine, the corresponding cleanup interface is called to perform the deletion operation. The deletion operation includes directly deleting files in local storage, deleting sharded data in distributed storage, and deleting objects by calling API in cloud storage.
[0029] This invention leverages the ease of development with Python and the high performance of Shell to efficiently automate cleanup tasks. It improves work efficiency and resolves the problems of missed or incorrect cleanup that often occur with manual processing.
[0030] This invention also provides a system for implementing customized dynamic cleanup of a product library. The system, established using the aforementioned method, includes:
[0031] The business layer is responsible for implementing the scenario logic and includes user-defined system type, environment, and time range.
[0032] The execution layer is configured to set cleanup rules and adopt a time priority scheduling algorithm to arrange the execution order of cleanup tasks based on the execution priority of the tasks and the current load status of the artifact library. It is also configured to be responsible for filtering out artifacts that need to be cleaned in the logic layer and performing artifact cleanup by calling system-level commands.
[0033] In summary, compared with the prior art, the present invention has the following advantages:
[0034] (1) This invention achieves precise cleanup of the artifact library through customized rule configuration, dynamic load perception and intelligent priority determination. Under the premise of ensuring the security of core artifacts, it maximizes the release of storage space, reduces operation and maintenance costs, and improves the storage efficiency and service stability of the artifact library.
[0035] (2) This invention breaks through the limitations of existing fixed cleanup rules and supports users in configuring personalized cleanup rules based on artifact lifecycle (such as creation time, last access time) and environment priority (test environment, pre-production environment, production environment). A multi-level verification mechanism is set up to verify whether the artifact meets the cleanup rules and whether it is marked as "uncleanable" (e.g., exceeding the set time range) before the cleanup operation is executed. A lightweight architecture is adopted, and the core modules can be deployed independently or integrated into existing artifact repository systems (such as Nexus) without requiring large-scale modifications to the original system, and it is compatible with mainstream artifact types (such as Jar packages, Docker images, RPM packages, and documentation files).
[0036] The above are merely preferred embodiments of the present invention and do not constitute any limitation on the present invention. Any equivalent substitutions or modifications made by those skilled in the art to the technical solutions and content disclosed in the present invention without departing from the scope of the present invention shall be deemed to have remained within the protection scope of the present invention.
Claims
1. A method for implementing customized dynamic cleanup of a product library, characterized in that, Includes the following steps: S1: The business layer is responsible for implementing the scenario logic and has user-defined system type, environment, and time range. S2: Set cleanup rules and use a time priority scheduling algorithm to arrange the execution order of cleanup tasks based on the execution priority of the tasks and the current load status of the artifact library; S3: The execution layer is responsible for filtering out artifacts that need to be cleaned up in the logic layer and cleaning up the artifacts by calling system-level commands.
2. The method for implementing customized dynamic cleanup of the product library as described in claim 1, characterized in that, In S2, the execution priority of the space emergency cleanup task is higher than that of the regular time cleanup task.
3. The method for implementing customized dynamic cleanup of the product library as described in claim 1, characterized in that, Before cleaning the products in S3, the following steps are also included: verifying the products that need to be cleaned and cleaning the products that pass the verification.
4. The method for implementing customized dynamic cleanup of the product library as described in claim 3, characterized in that, The following are the methods for cleaning the products: Depending on the type of artifact storage engine, the corresponding cleanup interface is called to perform the deletion operation.
5. The method for implementing customized dynamic cleanup of the product library as described in claim 1, characterized in that, Deletion operations include deleting files directly from local storage, deleting sharded data from distributed storage, and deleting objects by calling the API from cloud storage.
6. A system for implementing customized dynamic cleanup of a product warehouse, characterized in that, A system for implementing customized dynamic cleanup of an artifact library is established using the method described in any one of claims 1-5, the system comprising: The business layer is responsible for implementing the scenario logic and includes user-defined system type, environment, and time range. The execution layer is configured to set cleanup rules and adopt a time priority scheduling algorithm to arrange the execution order of cleanup tasks based on the execution priority of the tasks and the current load status of the artifact library. It is also configured to be responsible for filtering out artifacts that need to be cleaned in the logic layer and performing artifact cleanup by calling system-level commands.