A resource cleaning method, device and equipment for machine room network withdrawal and a medium

CN122963800APending Publication Date: 2026-10-23HANGZHOU WULIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611166736.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]有鉴于此,本发明的目的在于提供一种面向机房退网的资源清理方法、装置、设备及介质,解决了现有技术中机房退网时资源记录清理顺序不明确、跨系统资源协同释放不充分以及清理失败后恢复能力较差的技术问题

Benefits of technology

[0016]可见,本发明通过当目标域算力合约中的目标机房被移除,或者当目标域算力合约失效使所有机房均需清理时,确定目标机房关联的待清理资源记录;基于待清理资源记录之间的引用关系,确定固定分层清理顺序;其中,固定分层清理顺序为表示清理实例资源记录、网络与外设资源记录、配额与调度资源记录以及配置资源记录的顺序;按照固定分层清理顺序,对待清理资源记录执行清理控制处理,得到清理步骤;其中,清理控制处理包括,在清理存在引用关系的资源记录时执行引用保护处理,在清理存在外部系统对应资源的资源记录时执行跨系统协同释放处理,以及在清理存在释放状态依赖的资源记录时执行释放状态阻断处理;当任一清理步骤因引用校验未通过或外部系统调用失败而中断时,记录清理步骤对应的异常信息,并对处于清理中状态的清理任务进行重试;其中,在重试过程中,过滤已经删除的资源记录;当固定分层清理顺序中的清理步骤均完成后,将目标机房对应的清理任务状态更新为清理完成。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122963800A_ABST
    Figure CN122963800A_ABST
Patent Text Reader

Abstract

The application discloses a resource cleaning method, device and equipment for machine room network withdrawal, and a medium, and applies to the technical field of resource life cycle management, and comprises the following steps: determining a fixed hierarchical cleaning sequence based on the reference relationship between to-be-cleaned resource records; performing cleaning control processing including reference protection processing, cross-system cooperative release processing and release state blocking processing according to the fixed hierarchical cleaning sequence; recording abnormal information and retrying the cleaning task when the cleaning is interrupted; and updating the cleaning task state to cleaning completion after all cleaning steps are completed. Compared with ordinary sequential deletion when current resources are withdrawn, the application determines a fixed hierarchical cleaning sequence based on the reference relationship, so that resource records across instances, networks, quotas, scheduling and configuration can be sequentially cleaned, the risks of reference breakage, external resource residue and failure and inability to recover after failure are reduced, and the cleaning accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of resource lifecycle management technology, and in particular to a resource cleanup method, apparatus, equipment and medium for data center decommissioning. Background Technology

[0002] When a data center in a domain computing power contract is removed, or when the entire domain computing power contract fails and all data centers need to be cleaned up, the resource records associated with that data center need to be cleaned up. If only manual experience or ordinary deletion procedures are followed, the following problems may occur: First, the referenced resource may be deleted before the referencing resource, resulting in a break in the reference relationship between resource records; second, after the local resource record is deleted, external network resources, access routing resources, or quota resources may still remain.

[0003] It is evident that improving the accuracy of cleanup and preventing broken reference relationships and data residues are technical problems that urgently need to be solved by those skilled in the art. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a resource cleanup method, apparatus, equipment and medium for data center decommissioning, which solves the technical problems in the prior art of unclear resource record cleanup order, insufficient cross-system resource collaborative release and poor recovery capability after cleanup failure.

[0005] To address the aforementioned technical problems, this invention provides a resource cleanup method for data center decommissioning, comprising: When the target data center in the target domain computing power contract is removed, or when the target domain computing power contract expires and all data centers need to be cleaned up, determine the resource records to be cleaned up associated with the target data center; Based on the reference relationships between the resource records to be cleaned, a fixed hierarchical cleanup order is determined; wherein, the fixed hierarchical cleanup order represents the order in which instance resource records, network and peripheral resource records, quota and scheduling resource records, and configuration resource records are cleaned up; According to the fixed hierarchical cleanup order, the cleanup control process is performed on the resource records to be cleaned to obtain the cleanup steps; wherein, the cleanup control process includes performing reference protection processing when cleaning up resource records with reference relationships, performing cross-system collaborative release processing when cleaning up resource records with corresponding resources in external systems, and performing release state blocking processing when cleaning up resource records with release state dependencies. When any cleanup step is interrupted due to a failed reference check or a failed external system call, the exception information corresponding to the cleanup step is recorded, and the cleanup task in the cleanup state is retried; during the retry process, resource records that have already been deleted are filtered out. Once all the cleaning steps in the fixed layered cleaning sequence are completed, the cleaning task status corresponding to the target computer room is updated to "cleaning completed".

[0006] Optionally, the step of performing reference protection processing when cleaning up resource records with reference relationships includes: Get the cloud system instance identifier corresponding to the cloud system instance to be deleted; Based on the cloud system instance identifier, query the cloud system instance identifier field in the bare metal instance. If there is an undeleted bare metal instance referencing the cloud system instance to be deleted, retain the referenced cloud system instance.

[0007] Optionally, the step of performing cross-system collaborative release processing when cleaning up resource records that have corresponding resources in external systems includes: Before deleting the virtual private network resources associated with the target data center, call the external virtual private network management system to release the network resources corresponding to the virtual private network resources; When cleaning up access routing resources, the external access routing system is invoked to delete the access routing information associated with the target data center; When cleaning up quota resource records, the external computing power quota system is invoked to delete the competing quotas and fixed quotas associated with the target data center.

[0008] Optionally, the step of performing release state blocking processing when cleaning up resource records that have release state dependencies includes: Before deleting the startup scheme associated with the target data center, query the release status of the cloud system instance associated with the target data center; When there are unreleased cloud system instances, block the deletion of the startup scheme and record the reason why the deletion of the startup scheme was blocked; When all cloud system instances associated with the target data center have been released, delete the startup scheme and continue to clean up the quota and scheduling resource records.

[0009] Optionally, retrying a cleanup task that is in the process of being cleaned includes: When the target data center is removed or the target domain computing power contract expires, a cleanup data event is published, and the cleanup task is triggered based on the cleanup data event; Scanning cleanup tasks in the cleanup state according to a preset cycle, and redetermining the resource records to be cleaned based on the scanned cleanup tasks; wherein, when redetermining the resource records to be cleaned, resource records that have already been deleted are filtered out.

[0010] Optionally, the fixed layer cleaning sequence includes: The template data center configuration, bare metal instance, virtual machine instance, and cloud system instance are cleaned up sequentially; wherein, the reference protection processing is performed when cleaning up the cloud system instance; After the cloud system instance is cleaned up, the pre-scheduled configuration and virtual private network resources are cleaned up in sequence; wherein, when cleaning up the virtual private network resources, the external virtual private network management system is invoked to release network resources; After the virtual private network resources are cleaned up, the cloud system instance release verification is performed. After the cloud system instance release verification passes, the quota resource records, pre-start execution environment scheduler, access routing resources, startup scheme, startup point and data center configuration are cleaned up in sequence.

[0011] Optionally, determining the fixed hierarchical cleanup order based on the reference relationships between the resource records to be cleaned includes: Obtain the reference relationships of the resource records to be cleaned in the target domain computing power contract that were determined during the design phase; The fixed hierarchical cleanup order is determined based on the reference relationships using cleanup orchestration rules; wherein the cleanup orchestration rules include: for resource records with reference relationships, setting the cleanup order of the referencing resource record before the referenced resource record; for resource records with corresponding resources in external systems, setting the release order of the corresponding resources in external systems before the deletion order of local resource records; for resource records with release status dependencies, setting the release verification order of the dependent resource record before the deletion order of the dependent resource record.

[0012] This invention also provides a resource cleanup device for data center network decommissioning, comprising: The task retry module is used to record the exception information corresponding to any cleanup step when any cleanup step is interrupted due to reference verification failure or external system call failure, and to retry the cleanup task in the cleanup state; wherein, during the retry process, the deleted resource records are filtered out. The resource cleanup completion module is used to update the cleanup task status of the target data center to "cleanup complete" when all cleanup steps in the fixed layered cleanup sequence are completed.

[0013] This invention also provides a resource cleanup device for data center network decommissioning, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the steps of the resource cleanup method for data center decommissioning described above.

[0014] The present invention also provides a medium (i.e., a computer-readable storage medium) for storing a computer program, wherein the computer program, when executed by a processor, implements the above-described resource cleanup method for data center decommissioning.

[0015] The present invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described method.

[0016] As can be seen, this invention determines the resource records to be cleaned associated with the target data center when the target data center in the target domain computing power contract is removed, or when the target domain computing power contract expires and all data centers need to be cleaned. Based on the reference relationships between the resource records to be cleaned, a fixed hierarchical cleanup order is determined. The fixed hierarchical cleanup order represents the order of cleanup instance resource records, network and peripheral resource records, quota and scheduling resource records, and configuration resource records. Cleanup control processing is performed on the resource records to be cleaned according to the fixed hierarchical cleanup order to obtain cleanup steps. The cleanup control processing includes performing reference protection processing when cleaning resource records with reference relationships, performing cross-system collaborative release processing when cleaning resource records with corresponding external system resources, and performing release state blocking processing when cleaning resource records with release state dependencies. When any cleanup step is interrupted due to reference verification failure or external system call failure, the abnormal information corresponding to the cleanup step is recorded, and the cleanup task in the cleanup state is retried. During the retry process, deleted resource records are filtered out. When all cleanup steps in the fixed hierarchical cleanup order are completed, the cleanup task status corresponding to the target data center is updated to cleanup completed.

[0017] The beneficial effects of this invention are as follows: Compared with the current method of cleaning up data center resources by relying on manual experience or ordinary deletion process, this invention can determine a fixed hierarchical cleaning order by utilizing the reference relationship between the resource records to be cleaned. By using reference protection processing, cross-system collaborative release processing, and release status blocking processing, it controls the cleaning timing of different resource records, reduces the risk of resource reference breakage, external system resource residue, and unrecoverable failure after cleaning, thereby improving the accuracy of cleaning.

[0018] In addition, the present invention also provides a resource cleanup device, equipment and medium for data center decommissioning, which also has the above-mentioned beneficial effects. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0020] Figure 1 A flowchart illustrating a resource cleanup method for data center network decommissioning provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a resource cleanup device for data center network decommissioning provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a resource cleanup device for data center network decommissioning provided in an embodiment of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] Some terms that appear in the description of the embodiments of this application are subject to the following interpretation: DCC stands for Domain Computing Power Contract; Region stands for Target Data Center; BMI stands for Bare Metal Instance; VMI stands for Virtual Machine Instance; COSI stands for Cloud System Instance; VPC stands for Virtual Private Network.

[0023] Please refer to Figure 1 , Figure 1 A flowchart illustrating a resource cleanup method for data center network decommissioning, provided as an embodiment of the present invention. The method may include: S101, when the target data center in the target domain computing power contract is removed, or when the target domain computing power contract expires and all data centers need to be cleaned up, determine the resource records to be cleaned up associated with the target data center.

[0024] Each step in this embodiment can be executed by a designated electronic device, specifically a central terminal. The target domain computing power contract in this embodiment is the domain computing power contract that requires resource cleanup. The target data center in this embodiment is the data center removed from the target domain computing power contract, or all data centers that need to be cleaned up when the target domain computing power contract expires. The resource records to be cleaned up in this embodiment are resource records associated with the target data center. These resource records may include instance resource records, network and peripheral resource records, quota and scheduling resource records, and configuration resource records. Instance resource records may include bare metal instances, virtual machine instances, and cloud system instances. Network and peripheral resource records may include virtual private network resources, access routing resources, and pre-scheduled configurations. Quota and scheduling resource records may include contention quotas, fixed quotas, local line quotas, and pre-start execution environment schedulers. Configuration resource records may include template data center configurations, startup schemes, startup points, and data center configurations.

[0025] It should be noted that, based on any of the above embodiments, determining the resource records to be cleaned associated with the target data center may include: querying resource records directly associated with the target data center based on the domain computing power contract identifier corresponding to the target domain computing power contract and the data center identifier corresponding to the target data center; or querying resource records indirectly associated with the target data center based on the domain computing power contract identifier and the data center identifier. Direct association can be an association method in which the data center identifier is directly included in the resource record; indirect association can be a method in which the resource record is associated with the target data center through an instance identifier, cloud system instance identifier, startup scheme identifier, or quota identifier.

[0026] This embodiment does not limit the specific source that triggers resource cleanup. For example, the target data center can be removed by the contract management service; or the target data center can be automatically included in the cleanup scope when the entire target domain computing power contract fails. This embodiment will identify the cleanup resource records associated with the target data center, so that the subsequent cleanup process has a clear target, preventing the cleanup of only some local resource records while omitting external system resources or indirectly related resources.

[0027] S102, based on the reference relationships between the resource records to be cleaned, determine the fixed hierarchical cleanup order; wherein, the fixed hierarchical cleanup order represents the order in which instance resource records, network and peripheral resource records, quota and scheduling resource records, and configuration resource records are cleaned up.

[0028] In this embodiment, the reference relationships are those determined during the system design phase between the resource records to be cleaned up. These reference relationships may include references between bare metal instances and cloud system instances; or they may also include dependencies between startup schemes and the release state of cloud system instances.

[0029] The fixed hierarchical cleanup order in this embodiment is a cleanup order determined before cleanup is performed. This fixed hierarchical cleanup order is not obtained by dynamically scanning traffic data or runtime topology to temporarily discover resource dependencies, but is based on the reference relationships of various resource records in the target domain computing power contract that have been determined in the design phase.

[0030] It should be further explained that, based on any of the above embodiments, determining the fixed hierarchical cleanup order based on the reference relationships between the resource records to be cleaned can include: obtaining the reference relationships of the resource records to be cleaned in the target domain computing power contract determined during the design phase; determining the fixed hierarchical cleanup order based on the reference relationships using cleanup orchestration rules; wherein, the cleanup orchestration rules can include: for resource records with reference relationships, setting the cleanup order of the referencing resource record before the referenced resource record; for resource records with corresponding resources in external systems, setting the release order of the corresponding resources in external systems before the deletion order of the local resource record; for resource records with release state dependencies, setting the release verification order of the dependent resource record before the deletion order of the dependent resource record. This embodiment does not limit the storage method of the cleanup orchestration rules. For example, the cleanup orchestration rules can be stored in the configuration file of the central system; or the cleanup orchestration rules can also be embedded in the cleanup processor of the central system. This embodiment, through the above cleanup orchestration rules, ensures that the fixed hierarchical cleanup order is not a simple manual list, but matches the reference relationships, external system correspondences, and release state dependencies between resource records, thereby preventing reference breaks or external resource residues due to incorrect cleanup order.

[0031] S103, according to the fixed hierarchical cleanup order, perform cleanup control processing on the resource records to be cleaned up to obtain the cleanup steps; wherein, the cleanup control processing includes performing reference protection processing when cleaning up resource records with reference relationships, performing cross-system collaborative release processing when cleaning up resource records with corresponding resources in external systems, and performing release state blocking processing when cleaning up resource records with release state dependencies.

[0032] The cleanup steps in this embodiment are specific steps formed when processing resource records to be cleaned based on a fixed hierarchical cleanup order. These cleanup steps may include instance resource record cleanup steps, network and peripheral resource record cleanup steps, quota and scheduling resource record cleanup steps, and configuration resource record cleanup steps. The cleanup control processing in this embodiment is used to determine the specific cleanup steps based on the fixed hierarchical cleanup order. By defining cleanup behavior templates and orchestrating execution order through a cleanup processor abstract base class, automatic adaptation to both single-datacenter cleanup and full-contract cleanup scenarios is achieved. When an exception occurs during the cleanup process, the exception information is recorded in the corresponding field of the task record for subsequent retry processing.

[0033] It should be further explained that the reference protection processing performed when cleaning up resource records with reference relationships can include: obtaining the cloud system instance identifier corresponding to the cloud system instance to be deleted; querying the cloud system instance identifier field in the bare metal instance based on the cloud system instance identifier; and retaining the referenced cloud system instance when there is an undeleted bare metal instance referencing the cloud system instance to be deleted. In this embodiment, the cloud system instance can be a COSI record. In this embodiment, the bare metal instance can be a BMI record. In this embodiment, the cloud system instance identifier field can be the cosiId field in the bare metal instance. This embodiment will query the reference relationship between the bare metal instance and the cloud system instance to ensure that the still-referenced cloud system instance is not deleted before the bare metal instance cleanup is completed. Specifically, before deleting a cloud system instance, it is necessary to verify whether it is still referenced by an undeleted bare metal instance—that is, querying the bare metal instance table for records that reference the cloud system instance identifier to be deleted and have not been deleted, and removing the still-referenced cloud system instances to prevent the reference relationship from breaking.

[0034] It should be further explained that, based on any of the above embodiments, the cross-system collaborative release process performed when clearing resource records corresponding to external system resources may include: before deleting the virtual private network resources associated with the target data center, calling the external virtual private network management system to release the network resources corresponding to the virtual private network resources; when clearing access routing resources, calling the external access routing system to delete the access routing information associated with the target data center; and when clearing quota resource records, calling the external computing power quota system to delete the contested quotas and fixed quotas associated with the target data center. In this embodiment, the external virtual private network management system is used to manage the real network resources associated with the target data center. In this embodiment, the external access routing system is used to manage the access routing information associated with the target data center. In this embodiment, the external computing power quota system is used to manage the contested quotas and fixed quotas associated with the target data center. This embodiment uses cross-system collaborative release processing to ensure that the deletion of local resource records and the release of real resources in the external system complement each other. Specifically, deleting competitive and fixed quotas requires invoking an external computing power quota system; deleting virtual private network (VPN) resources requires first invoking an external virtual private network management system to release real network resources; and deleting access routing resources requires invoking an external access routing system. Without cross-system coordinated release, external network resources, access routing resources, or quota resources may remain after local resource records are deleted. This embodiment does not limit the interface form of the external system. For example, the external VPN management system can be invoked via remote procedure call; or the external computing power quota system or external access routing system can be invoked via a gateway interface. The key is to trigger the release of external system resources during the local resource record cleanup process.

[0035] It should be further explained that, based on any of the above embodiments, the above-mentioned execution of release status blocking processing when cleaning up resource records that depend on release status may include: querying the release status of cloud system instances associated with the target data center before deleting the startup scheme associated with the target data center; blocking the deletion of the startup scheme when there are unreleased cloud system instances, and recording the reason for the blocking of the startup scheme deletion; deleting the startup scheme when all cloud system instances associated with the target data center have been released, and continuing to execute the cleanup of quota and scheduling resource records. In this embodiment, the startup scheme is the configuration resource used for instance startup under the target domain computing power contract. In this embodiment, the release status of the cloud system instance is used to indicate whether the cloud system instance has been released. This embodiment will query the release status of the cloud system instance before deleting the startup scheme to ensure that the startup scheme is not deleted before its associated cloud system instance is released. If the release status blocking processing is not executed, it may cause the subsequent instance startup processing that depends on the startup scheme to fail. This embodiment does not limit the status value of the release status. For example, the release status of the cloud system instance may include normal, releasing in progress, and released; or the release status of the cloud system instance may also include pending release, release failed, and released. The only requirement is that the deletion of a startup scheme can be determined based on its release status. Specifically, before deleting a startup scheme, it must be confirmed that all COSIs have been completely released; otherwise, subsequent instances relying on that scheme will fail to start. A COSI release check is performed before deleting the startup scheme; if any unreleased COSIs remain, the deletion will be blocked.

[0036] It should be further explained that, based on any of the above embodiments, the fixed layered cleanup order may include: sequentially cleaning up template data center configurations, bare metal instances, virtual machine instances, and cloud system instances; wherein, reference protection processing is performed when cleaning up cloud system instances; after cleaning up cloud system instances, pre-scheduled configurations and virtual private network resources are cleaned up sequentially; wherein, when cleaning up virtual private network resources, an external virtual private network management system is invoked to release network resources; after cleaning up virtual private network resources, cloud system instance release verification is performed, and after the cloud system instance release verification passes, quota resource records, pre-start execution environment schedulers, access routing resources, startup schemes, startup points, and data center configurations are cleaned up sequentially. In this embodiment, the template data center configuration refers to the configuration records related to the target data center on the template side. In this embodiment, the pre-scheduled configuration refers to the pre-scheduled data related to the target data center. In this embodiment, the pre-start execution environment scheduler is a PXE (Pre-Start Execution Environment) scheduler. In this embodiment, the startup point is the startup position or startup node configuration in the startup scheme. This embodiment uses the aforementioned fixed hierarchical cleanup order to ensure that instance resource records, network and peripheral resource records, quota and scheduling resource records, and configuration resource records are cleaned up in a predetermined order. Specifically, when the target data center is removed, data center (numbered 10) is removed from contract (numbered 100). Step 1 (Pre-cleanup verification): Perform a running instance count verification to confirm that there are no running bare metal instances or virtual machine instances under data center 10. After the verification passes, a cleanup task is created at the data center level, and the task status is marked as "cleaning in progress". Step 2 (Configuration removal and event publication): Call the "Remove Data Center" method in the contract domain service to mark the target data center as logically deleted and publish a cleanup data event to trigger the subsequent asynchronous cleanup process. Step 3 (Cleanup Chain Execution): The cleanup processor first performs data center-level cleanup, executing the following steps in a fixed order: template data center configuration cleanup, bare metal instance cleanup, virtual machine instance cleanup, cloud system instance cleanup (including reference verification: querying the reference relationships between bare metal instances and cloud system instance identifiers, and removing cloud system instances that are still referenced), pre-scheduled configuration cleanup, virtual private network resource cleanup (calling the external virtual private network management system to release network resources), cloud system instance release verification, quota resource cleanup (calling the external computing power quota system), pre-startup execution environment scheduler cleanup, access routing resource cleanup, startup scheme cleanup, and data center configuration archiving. If any step fails due to an external system call (e.g., virtual private network resource deletion fails and the contract is still valid), an exception interruption is thrown, and the exception information is written to the remarks field of the task record, waiting for periodic polling for retry. After all steps are completed, the cleanup task is marked as completed. When a batch of data centers are taken offline, for example, three data centers (numbered 10, 20, and 30) are taken offline simultaneously.The batch cleanup interface performs batch operations on all tenant-related tables: instance tables (setting the status of bare metal instances and virtual machine instances to stopped and marking them as logically deleted), running record tables (terminating ongoing running records to completed status and marking the release reason as "automatic release due to data center shutdown"), release status tables (marking records that are not released or are in the process of being released as released), and configuration tables (marking them as logically deleted). Logs (table name and number of affected rows) are recorded after each table is processed for unified auditing and tracing. It should be noted that before deleting a data center, it is necessary to confirm that there are no running bare metal instances or virtual machine instances under that data center to prevent forced shutdown during business operations from affecting tenants. This requires performing a running instance count check before cleanup. The running instance count check is used to check whether there are any running bare metal instances or virtual machine instances under the target data center.

[0037] Specifically, it can include: (1) Instance release layer: template data center configuration cleanup, bare metal instance data center configuration cleanup and instance deletion, virtual machine instance deletion, cloud system instance deletion (including cloud system instance and bare metal instance reference verification - query the bare metal instance table for records that reference the cloud system instance identifier to be deleted and have not been deleted, and remove the cloud system instances that are still referenced).

[0038] (2) Network and peripheral device unbinding layer: deletion of pre-scheduled configuration, deletion of virtual private network resources (first call the external virtual private network management system to release network resources, and decide whether to block or continue when failure occurs based on the validity of the contract), and deletion of access routing resources.

[0039] (3) Quota and scheduling cleanup layer: deletion of external competitive quotas and fixed quotas, deletion of local line quotas and pre-start execution environment schedulers.

[0040] (4) Configure the archive layer: Logical deletion of startup scheme, startup point and target computer room configuration.

[0041] The contract validity check in this embodiment is used to determine whether the target domain computing power contract is still valid. Each step in this embodiment filters deleted data through a data query encapsulator, and completed steps are automatically skipped during retries. Deleting competitive and fixed quotas requires calling an external computing power quota system; deleting virtual private network (VPN) resources requires first calling an external VPN management system to release real network resources; and deleting access routing resources requires calling an external access routing system. If an external system call fails, the current contract status determines whether to block the cleanup or record the failure and continue.

[0042] S104. When any cleanup step is interrupted due to a failed reference check or a failed external system call, the exception information corresponding to the cleanup step is recorded, and the cleanup task in the cleanup state is retried; during the retry process, the resource records that have already been deleted are filtered out.

[0043] This embodiment can perform abnormal entry and write the reason for the cleanup interruption into the task record remarks field. The cleanup task in this embodiment is the resource cleanup task corresponding to the target data center. The abnormal information in this embodiment can include the reason for the reference verification failure, or the reason for the failure of the external system call. The reason for the reference verification failure can be that there is still an undeleted bare metal instance referencing the cloud system instance to be deleted. The reason for the failure of the external system call can be the failure of the external virtual private network management system call, the failure of the external access routing system call, or the failure of the external computing power quota system call. Specifically, (1) Cleanup task record: record the domain computing power contract identifier, data center identifier, cleanup type, cleanup status, number of retries and remarks information. (2) Event-driven channel: when the contract expires or the data center is removed, a cleanup data event is published, and the event listener receives it asynchronously and triggers the cleanup immediately. (3) Timed polling channel: the timed cleanup task periodically scans the tasks in the cleanup state, sorts them by cleanup type, and retryes them one by one. Unsuccessful tasks are automatically retried each time they are executed. The cleanup progress and failure reasons are tracked through the persistent cleanup task record, and failure retry recovery is performed through the dual channels of event-driven and timed polling.

[0044] It should be further explained that, based on any of the above embodiments, the retrying of cleanup tasks in a cleanup state can include: publishing a cleanup data event when the target data center is removed or the target domain computing power contract expires, and triggering a cleanup task based on the cleanup data event; scanning cleanup tasks in a cleanup state according to a preset period, and re-determining the resource records to be cleaned based on the scanned cleanup tasks; wherein, when re-determining the resource records to be cleaned, filtering out resource records that have already been deleted. In this embodiment, the cleanup data event is used to trigger the cleanup task corresponding to the target data center. This cleanup data event can be published by the central system when the target data center is removed; or the cleanup data event can also be published by the central system when the target domain computing power contract expires. The preset period in this embodiment can be set according to actual needs. For example, the preset period can be five minutes; or the preset period can also be ten minutes. This embodiment does not limit the specific value of the preset period, as long as the periodic scanning can detect cleanup tasks in a cleanup state. The filtering of deleted resource records in this embodiment can be implemented through a query encapsulator. This query encapsulator can filter resource records already marked as deleted when re-determining the resource records to be cleaned. This embodiment does not limit the specific implementation of the query wrapper. For example, the query wrapper can be a query object generated based on database query conditions; or the query wrapper can also be a resource query service in the central system. This embodiment filters deleted resource records, allowing the retry process to continue executing resource records that have not yet been cleaned up. When a contract expires or a data center is removed, a cleanup data event is published, and the event listener receives it asynchronously and immediately triggers cleanup; a scheduled cleanup task periodically scans tasks in the cleanup state, sorts them by cleanup type, and retryes them one by one; unsuccessful tasks are automatically retried each time the scheduled execution occurs; each step filters deleted data through the data query wrapper, and completed steps are automatically skipped during retries.

[0045] It should be further explained that if any cleanup step is interrupted due to a failed external system call, the central system can determine whether to block the cleanup based on the current state of the target domain computing power contract. For example, if the target domain computing power contract is still valid and the external virtual private network management system fails to release network resources, the central system can block the cleanup and write the exception information into the cleanup task; or, if the target domain computing power contract has completely failed and the failure of the external system call does not affect subsequent local record archiving, the central system can record the call failure information and continue to perform subsequent cleanup. This embodiment does not limit the specific rules for processing based on the current state of the target domain computing power contract, as long as it can determine whether to block the cleanup or record and continue based on the current state of the target domain computing power contract.

[0046] S105, once all the cleaning steps in the fixed layered cleaning sequence are completed, update the cleaning task status corresponding to the target data center to "cleaning completed".

[0047] This embodiment can mark the cleanup as complete, used to update the cleanup task status to "completed". In this embodiment, "cleanup complete" indicates that all cleanup steps in the fixed-layer cleanup sequence corresponding to the target data center have been completed, and the resource records to be cleaned associated with the target data center have been processed according to the corresponding cleanup control procedures. This embodiment can update the cleanup task status from "cleaning" to "cleanup complete".

[0048] This invention provides a resource cleanup method for data center decommissioning, which may include: when a target data center is removed from a target domain computing power contract, or when a target domain computing power contract expires and all data centers need to be cleaned up, determining the resource records to be cleaned up associated with the target data center; determining a fixed hierarchical cleanup order based on the reference relationships between the resource records to be cleaned up; wherein the fixed hierarchical cleanup order represents the order of cleanup instance resource records, network and peripheral resource records, quota and scheduling resource records, and configuration resource records; and performing cleanup control processing on the resource records to be cleaned up according to the fixed hierarchical cleanup order to obtain the cleanup steps; wherein the cleanup control processing... This includes performing reference protection processing when cleaning up resource records with reference relationships, performing cross-system collaborative release processing when cleaning up resource records with corresponding resources in external systems, and performing release state blocking processing when cleaning up resource records with release state dependencies. When any cleanup step is interrupted due to a failed reference check or a failed external system call, the corresponding exception information for the cleanup step is recorded, and the cleanup task in the cleanup state is retried. During the retry process, deleted resource records are filtered out. Once all cleanup steps in the fixed-layer cleanup sequence are completed, the cleanup task status corresponding to the target data center is updated to cleanup complete. Therefore, compared to the current ordinary resource deletion process, this invention can determine the fixed-layer cleanup sequence based on the reference relationships between the resource records to be cleaned, ensuring that resource records with reference relationships, corresponding resources in external systems, and release state dependencies are controlled in their respective cleanup steps. This prevents premature deletion of referenced resources, omission of external resource releases, and premature deletion of configuration resources when the release state is not met, thereby improving the accuracy of the cleanup. Furthermore, this invention records exception information when cleanup is interrupted and retryes cleanup tasks that are in the process of cleanup. During the retry process, it filters out resource records that have already been deleted, which can reduce repeated cleanup and improve the recovery capability after cleanup failure.

[0049] The following describes a resource cleanup device for data center decommissioning provided by an embodiment of the present invention. The resource cleanup device for data center decommissioning described below can be referred to in correspondence with the resource cleanup method for data center decommissioning described above.

[0050] Please refer to the details. Figure 2 , Figure 2A schematic diagram of a resource cleanup device for data center network decommissioning provided in an embodiment of the present invention may include: The pending cleanup resource record determination module 100 is used to determine the pending cleanup resource records associated with the target data center when the target data center in the target domain computing power contract is removed, or when the target domain computing power contract expires and all data centers need to be cleaned up. The fixed-layer cleanup order determination module 200 is used to determine a fixed-layer cleanup order based on the reference relationships between the resource records to be cleaned up; wherein, the fixed-layer cleanup order represents the order in which cleanup instance resource records, network and peripheral resource records, quota and scheduling resource records, and configuration resource records are cleaned up; The cleanup step determination module 300 is used to perform cleanup control processing on the resource records to be cleaned according to the fixed hierarchical cleanup order to obtain cleanup steps; wherein, the cleanup control processing includes performing reference protection processing when cleaning up resource records with reference relationships, performing cross-system collaborative release processing when cleaning up resource records with corresponding resources in external systems, and performing release state blocking processing when cleaning up resource records with release state dependencies. The task retry module 400 is used to record the exception information corresponding to any cleanup step when any cleanup step is interrupted due to a reference verification failure or an external system call failure, and to retry the cleanup task in the cleanup state; wherein, during the retry process, the deleted resource records are filtered out. The resource cleanup completion module 500 is used to update the cleanup task status of the target data center to "cleanup complete" when all cleanup steps in the fixed layered cleanup sequence are completed.

[0051] Furthermore, based on any of the above embodiments, performing reference protection processing when cleaning up resource records with reference relationships may include: obtaining the cloud system instance identifier corresponding to the cloud system instance to be deleted; querying the cloud system instance identifier field in the bare metal instance based on the cloud system instance identifier; and retaining the referenced cloud system instance when there is an undeleted bare metal instance referencing the cloud system instance to be deleted.

[0052] Furthermore, based on any of the above embodiments, performing cross-system collaborative release processing when clearing resource records with corresponding external system resources may include: before deleting the virtual private network resources associated with the target data center, calling an external virtual private network management system to release the network resources corresponding to the virtual private network resources; when clearing access routing resources, calling an external access routing system to delete the access routing information associated with the target data center; and when clearing quota resource records, calling an external computing power quota system to delete the contested quotas and fixed quotas associated with the target data center.

[0053] Furthermore, based on any of the above embodiments, performing release status blocking processing when cleaning up resource records that depend on release status may include: querying the release status of cloud system instances associated with the target data center before deleting the startup scheme associated with the target data center; blocking the deletion of the startup scheme when there are unreleased cloud system instances, and recording the reason for the blocking of the startup scheme deletion; deleting the startup scheme when all cloud system instances associated with the target data center have been released, and continuing to clean up the quota and scheduling resource records.

[0054] Furthermore, based on any of the above embodiments, the task retry module 400 may include: The cleanup task determination unit is used to publish a cleanup data event and trigger the cleanup task based on the cleanup data event when the target data center is removed or the target domain computing power contract expires. The unit for re-determining resource records to be cleaned is used to scan cleanup tasks in the cleanup state according to a preset period, and re-determine the resource records to be cleaned based on the scanned cleanup tasks; wherein, when re-determining the resource records to be cleaned, resource records that have been deleted are filtered out.

[0055] Further, based on any of the above embodiments, the fixed layered cleanup order includes: sequentially cleaning up template data center configurations, bare metal instances, virtual machine instances, and cloud system instances; wherein, when cleaning up the cloud system instances, the reference protection processing is performed; after cleaning up the cloud system instances, the pre-scheduled configurations and virtual private network resources are cleaned up sequentially; wherein, when cleaning up the virtual private network resources, an external virtual private network management system is invoked to release network resources; after cleaning up the virtual private network resources, cloud system instance release verification is performed, and after the cloud system instance release verification passes, quota resource records, pre-start execution environment schedulers, access routing resources, startup schemes, startup points, and data center configurations are cleaned up sequentially.

[0056] Furthermore, based on any of the above embodiments, the fixed layer cleaning order determination module 200 may include: The reference relationship determination unit is used to obtain the reference relationship of the resource record to be cleaned in the target domain computing power contract determined in the design phase; A fixed-layer cleanup order determination unit is used to determine the fixed-layer cleanup order based on the reference relationship using cleanup orchestration rules; wherein, the cleanup orchestration rules include: for resource records with reference relationships, setting the cleanup order of the referencing resource record before the referenced resource record; for resource records with corresponding resources in external systems, setting the release order of the corresponding resources in external systems before the deletion order of local resource records; for resource records with release status dependencies, setting the release verification order of the dependent resource record before the deletion order of the dependent resource record.

[0057] It should be noted that the order of the modules and units in the above-mentioned resource cleanup device for data center decommissioning can be changed without affecting the logic.

[0058] The resource cleanup device for data center decommissioning provided in this embodiment of the invention may include: a resource record determination module 100, used to determine the resource records to be cleaned associated with the target data center when the target data center in the target domain computing power contract is removed, or when the target domain computing power contract expires and all data centers need to be cleaned; a fixed hierarchical cleanup order determination module 200, used to determine a fixed hierarchical cleanup order based on the reference relationship between the resource records to be cleaned; a cleanup step determination module 300, used to perform cleanup control processing on the resource records to be cleaned according to the fixed hierarchical cleanup order to obtain cleanup steps; a task retry module 400, used to record the abnormal information corresponding to the cleanup step when any cleanup step is interrupted, and to retry the cleanup task in the cleanup state; and a resource cleanup completion module 500, used to update the cleanup task status corresponding to the target data center to cleanup completion when all cleanup steps in the fixed hierarchical cleanup order are completed. As can be seen, compared with the current ordinary resource deletion process, the present invention can determine a fixed hierarchical cleanup order based on the reference relationship between the resource records to be cleaned up. This allows resource records with reference relationships, corresponding external system resources, and release status dependencies to be controlled in the corresponding cleanup steps. This prevents referenced resources from being deleted prematurely, external resource releases from being missed, and configuration resources from being deleted prematurely when the release status is not met. Furthermore, it can reduce the recovery risk after cleanup failure through retry processing, thereby improving the accuracy of cleanup.

[0059] The following describes a resource cleanup device for data center decommissioning provided by an embodiment of the present invention. The resource cleanup device for data center decommissioning described below can be referred to in correspondence with the resource cleanup method for data center decommissioning described above.

[0060] Please refer to Figure 3 , Figure 3 A schematic diagram of a resource cleanup device for data center decommissioning provided in an embodiment of the present invention may include: Memory 10 is used to store computer programs; Processor 20 is used to execute computer programs to implement the above-mentioned resource cleanup method for data center decommissioning.

[0061] The memory 10, processor 20, and communication interface 30 all communicate with each other through the communication bus 40.

[0062] In this embodiment of the invention, the memory 10 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment of the invention, the memory 10 may store programs for implementing the following functions: When the target data center in the target domain computing power contract is removed, or when the target domain computing power contract expires and all data centers need to be cleaned up, determine the resource records to be cleaned up associated with the target data center; Based on the reference relationships between the resource records to be cleaned, a fixed hierarchical cleanup order is determined; wherein, the fixed hierarchical cleanup order represents the order in which instance resource records, network and peripheral resource records, quota and scheduling resource records, and configuration resource records are cleaned up; According to a fixed hierarchical cleanup order, cleanup control processing is performed on the resource records to be cleaned up to obtain cleanup steps; wherein, the cleanup control processing includes performing reference protection processing when cleaning up resource records with reference relationships, performing cross-system collaborative release processing when cleaning up resource records with corresponding resources in external systems, and performing release state blocking processing when cleaning up resource records with release state dependencies. When any cleanup step is interrupted due to a failed reference check or a failed external system call, the corresponding exception information for the cleanup step is recorded, and the cleanup task in the cleanup state is retried; during the retry process, resource records that have already been deleted are filtered out. Once all the cleaning steps in the fixed layered cleaning sequence are completed, the cleaning task status corresponding to the target data center will be updated to "cleaning complete".

[0063] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during use.

[0064] Furthermore, memory 10 may include read-only memory and random access memory, providing instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores operating systems and operating instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and handling hardware-based tasks.

[0065] Processor 20 can be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic device. Processor 20 can be a microprocessor or any conventional processor. Processor 20 can call programs stored in memory 10.

[0066] The communication interface 30 can be an interface for the communication module, used to connect with other devices or systems.

[0067] Of course, it should be noted that, Figure 3 The structure shown does not constitute a limitation on the resource cleanup equipment for data center decommissioning in the embodiments of the present invention. In practical applications, resource cleanup equipment for data center decommissioning may include more than [other types of equipment]. Figure 3 More or fewer components as shown, or combinations of certain components.

[0068] The following describes the computer-readable storage medium provided in the embodiments of the present invention. The computer-readable storage medium described below can be referred to in correspondence with the resource cleanup method for data center decommissioning described above.

[0069] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the resource cleanup method for data center decommissioning described above.

[0070] The computer-readable storage medium may include 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.

[0071] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0072] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0073] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0074] The above provides a detailed description of a resource cleanup method, apparatus, equipment, and medium for data center network decommissioning provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A resource cleanup method for data center decommissioning, characterized in that, include: When the target data center in the target domain computing power contract is removed, or when the target domain computing power contract expires and all data centers need to be cleaned up, determine the resource records to be cleaned up associated with the target data center; Based on the reference relationships between the resource records to be cleaned, a fixed hierarchical cleanup order is determined; wherein, the fixed hierarchical cleanup order represents the order in which instance resource records, network and peripheral resource records, quota and scheduling resource records, and configuration resource records are cleaned up; According to the fixed hierarchical cleanup order, the cleanup control process is performed on the resource records to be cleaned to obtain the cleanup steps; wherein, the cleanup control process includes performing reference protection processing when cleaning up resource records with reference relationships, performing cross-system collaborative release processing when cleaning up resource records with corresponding resources in external systems, and performing release state blocking processing when cleaning up resource records with release state dependencies. When any cleanup step is interrupted due to a failed reference check or a failed external system call, the exception information corresponding to the cleanup step is recorded, and the cleanup task in the cleanup state is retried; during the retry process, resource records that have already been deleted are filtered out. Once all the cleaning steps in the fixed layered cleaning sequence are completed, the cleaning task status corresponding to the target computer room is updated to "cleaning completed".

2. The resource cleanup method for data center decommissioning according to claim 1, characterized in that, When cleaning up resource records with reference relationships, perform reference protection processing, including: Get the cloud system instance identifier corresponding to the cloud system instance to be deleted; Based on the cloud system instance identifier, query the cloud system instance identifier field in the bare metal instance. If there is an undeleted bare metal instance referencing the cloud system instance to be deleted, retain the referenced cloud system instance.

3. The resource cleanup method for data center decommissioning according to claim 1, characterized in that, When cleaning up resource records that correspond to resources in external systems, perform cross-system collaborative release processing, including: Before deleting the virtual private network resources associated with the target data center, call the external virtual private network management system to release the network resources corresponding to the virtual private network resources; When cleaning up access routing resources, the external access routing system is invoked to delete the access routing information associated with the target data center; When cleaning up quota resource records, the external computing power quota system is invoked to delete the competing quotas and fixed quotas associated with the target data center.

4. The resource cleanup method for data center decommissioning according to claim 1, characterized in that, Perform release state blocking processing when cleaning up resource records that have release state dependencies, including: Before deleting the startup scheme associated with the target data center, query the release status of the cloud system instance associated with the target data center; When there are unreleased cloud system instances, block the deletion of the startup scheme and record the reason why the deletion of the startup scheme was blocked; When all cloud system instances associated with the target data center have been released, delete the startup scheme and continue to clean up the quota and scheduling resource records.

5. The resource cleanup method for data center decommissioning according to any one of claims 1 to 4, characterized in that, Retry cleanup tasks that are in the process of being cleaned, including: When the target data center is removed or the target domain computing power contract expires, a cleanup data event is published, and the cleanup task is triggered based on the cleanup data event; Scanning cleanup tasks in the cleanup state according to a preset cycle, and redetermining the resource records to be cleaned based on the scanned cleanup tasks; wherein, when redetermining the resource records to be cleaned, resource records that have already been deleted are filtered out.

6. The resource cleanup method for data center decommissioning according to claim 1, characterized in that, The fixed layer cleaning sequence includes: The template data center configuration, bare metal instance, virtual machine instance, and cloud system instance are cleaned up sequentially; wherein, the reference protection processing is performed when cleaning up the cloud system instance; After the cloud system instance is cleaned up, the pre-scheduled configuration and virtual private network resources are cleaned up in sequence; wherein, when cleaning up the virtual private network resources, the external virtual private network management system is invoked to release network resources; After the virtual private network resources are cleaned up, the cloud system instance release verification is performed. After the cloud system instance release verification passes, the quota resource records, pre-start execution environment scheduler, access routing resources, startup scheme, startup point and data center configuration are cleaned up in sequence.

7. The resource cleanup method for data center decommissioning according to claim 1, characterized in that, Based on the reference relationships between the resource records to be cleaned, a fixed hierarchical cleanup order is determined, including: Obtain the reference relationships of the resource records to be cleaned in the target domain computing power contract that were determined during the design phase; The fixed hierarchical cleanup order is determined based on the reference relationships using cleanup orchestration rules; wherein the cleanup orchestration rules include: for resource records with reference relationships, setting the cleanup order of the referencing resource record before the referenced resource record; for resource records with corresponding resources in external systems, setting the release order of the corresponding resources in external systems before the deletion order of local resource records; for resource records with release status dependencies, setting the release verification order of the dependent resource record before the deletion order of the dependent resource record.

8. A resource cleanup device for decommissioning data centers, characterized in that, include: The module for determining the resource records to be cleaned is used to determine the resource records to be cleaned associated with the target data center when the target data center in the target domain computing power contract is removed, or when the target domain computing power contract expires and all data centers need to be cleaned. The fixed-layer cleanup order determination module is used to determine the fixed-layer cleanup order based on the reference relationships between the resource records to be cleaned up; wherein, the fixed-layer cleanup order represents the order in which instance resource records, network and peripheral resource records, quota and scheduling resource records, and configuration resource records are cleaned up; The cleanup step determination module is used to perform cleanup control processing on the resource records to be cleaned according to the fixed hierarchical cleanup order to obtain cleanup steps; wherein, the cleanup control processing includes performing reference protection processing when cleaning up resource records with reference relationships, performing cross-system collaborative release processing when cleaning up resource records with corresponding resources in external systems, and performing release state blocking processing when cleaning up resource records with release state dependencies. The task retry module is used to record the exception information corresponding to any cleanup step when any cleanup step is interrupted due to reference verification failure or external system call failure, and to retry the cleanup task in the cleanup state; wherein, during the retry process, the deleted resource records are filtered out. The resource cleanup completion module is used to update the cleanup task status of the target data center to "cleanup complete" when all cleanup steps in the fixed layered cleanup sequence are completed.

9. A resource cleanup device for decommissioning data centers, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the resource cleanup method for data center decommissioning as described in any one of claims 1 to 7.

10. A medium, characterized in that, The medium stores a computer program, which, when executed by a processor, implements the steps of the resource cleanup method for data center decommissioning as described in any one of claims 1 to 7.