Residual block equipment cleaning method and device, computer equipment, readable storage medium and program product

By obtaining and saving the block device identification and path information in the cloud platform backup system, and automatically detecting and cleaning residual block devices, the problem of inefficient cleaning of traditional backup systems is solved, and efficient block device resource management and system performance improvement is achieved.

CN119127406AActive Publication Date: 2024-12-13GUANGZHOU DINGJIA COMPUTER TECHNOLOGY CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411360990.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-13
Estimated Expiration
2044-09-27

AI Technical Summary

Technical Problem

When traditional cloud platform backup systems manage thousands of SAN block devices, the cleaning efficiency is inefficient, which easily generates block device residues, affecting system performance.

Method used

By obtaining the block device identification and path information of residual block devices in the cloud platform backup system, it is saved to the preset residual block device information record file, and the residual block device is automatically cleaned according to the identification and path information when the system is started, and using descending order Sorting and grouping priorities perform parallel cleaning to ensure cleaning efficiency.

Benefits of technology

It improves the cleaning efficiency of residual block equipment, avoids waste of equipment resources, and improves the overall operation efficiency and storage management effect of the cloud platform backup system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127406A_ABST
    Figure CN119127406A_ABST
Patent Text Reader

Abstract

The invention relates to a residual block device cleaning method and device, computer equipment, a computer readable storage medium and a computer program product, relates to a cloud platform backup technology, and can improve the cleaning efficiency of residual block devices. The method comprises the following steps: acquiring a block device identifier and path information of a residual block device in a cloud platform backup system; the path information comprises a data transmission path between the residual block device and the cloud platform backup system; storing the block device identifier and the path information to a preset residual block device information recording file; when the cloud platform backup system is started, detecting the residual block equipment information record file to obtain a detection result; and if the detection result indicates that the residual block device information record file has the block device identifier and the path information, cleaning the residual block device according to the block device identifier and the path information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cloud platform backup, and in particular to a residual block device method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the rapid development of cloud computing and virtualization technology, cloud platforms have gradually become a core component of enterprise IT architecture. In order to meet the needs of efficient operation of virtual machines (VMs), storage area network (SAN) technology has been widely used. SAN connects servers to remote storage devices through the network, provides high-performance, centralized storage services, and supports large-scale virtual resource management in cloud platforms. Block devices based on the Internet Small Computer System Interface (iSCSI) allow virtual machines to access remote storage like local hard disks, greatly improving the utilization of storage resources.

[0003] In traditional backup technology, cloud platforms use agentless backup systems to export virtual machine block devices to backup hosts through SAN networks, and manually clean up these block devices after the backup is complete. However, as the scale of cloud platforms expands, backup systems face the challenge of managing thousands of SAN block devices, and traditional cleanup methods are inefficient and prone to block device residues. Summary of the invention

[0004] Based on this, it is necessary to provide a residual block device cleaning method, apparatus, computer equipment, computer-readable storage medium and computer program product to address the above technical issues.

[0005] In a first aspect, the present application provides a residual block device cleaning method, comprising:

[0006] Obtaining a block device identifier and path information of a residual block device in a cloud platform backup system; the path information includes a data transmission path between the residual block device and the cloud platform backup system;

[0007] Saving the block device identifier and the path information to a preset residual block device information record file;

[0008] When the cloud platform backup system is started, detecting the residual block device information record file to obtain a detection result;

[0009] If the detection result indicates that the residual block device information record file contains the block device identifier and the path information, the residual block device is cleaned up according to the block device identifier and the path information.

[0010] In one of the embodiments, obtaining the block device identifier and path information of the residual block device in the cloud platform backup system includes:

[0011] After the cloud platform backup system completes the backup, obtaining the data transmission record between the residual block device and the cloud platform backup system through the block device management interface of the cloud platform backup system;

[0012] Based on the data transmission record, the block device identifier of the residual block device and the plurality of path information corresponding to the block device identifier are determined.

[0013] In one of the embodiments, the cleaning of the residual block device according to the block device identifier and the path information includes:

[0014] Determine the number of the path information corresponding to each of the block device identifiers;

[0015] Sort each of the block device identifiers in descending order according to the number of the path information to obtain a descending order;

[0016] Determining, according to the descending order, a cleaning priority of the residual block device corresponding to the block device identifier;

[0017] The residual block device is cleaned according to the cleanup priority of the residual block device.

[0018] In one of the embodiments, the cleaning of the residual block device according to the cleaning priority of the residual block device includes:

[0019] Grouping the residual block devices according to the cleaning priorities of the residual block devices, planning the residual block devices with the same cleaning priority as the same group, and obtaining a grouping result;

[0020] According to the grouping result, the residual block devices in the same group are cleaned up in parallel.

[0021] In one of the embodiments, after cleaning up the residual block device according to the block device identifier and the path information, the method further includes:

[0022] Performing a cleaning test on the cleaning of the residual block device to obtain a cleaning test result;

[0023] If the cleaning detection result indicates that the cleaning is successful, deleting the block device identifier and the path information corresponding to the cleaned residual block device in the residual block device information record file;

[0024] If the cleaning detection result indicates that the cleaning fails, a mark is added to the path information of the residual block device currently being cleaned and skipped, and the cleaning of the residual block device continues according to the path information with the same block device identifier and is not marked; the mark is used to prompt that the corresponding residual block device cleaning fails.

[0025] In one of the embodiments, when the cloud platform backup system is started, detecting the residual block device information record file includes:

[0026] If the cloud platform backup system is in an idle state, detecting the residual block device information record file according to a preset period;

[0027] If the cloud platform backup system is in a load state, the residual block device information record file is detected, and when the current load state switches to the next idle state, the residual block device information record file is detected again according to the preset period.

[0028] In a second aspect, the present application further provides a residual block device cleaning device, comprising:

[0029] A residual block device identification module is used to obtain a block device identifier and path information of a residual block device in a cloud platform backup system; the path information includes a data transmission path between the residual block device and the cloud platform backup system;

[0030] A residual block device information recording module, used for saving the block device identifier and the path information to a preset residual block device information recording file;

[0031] A residual block device detection module, used to detect the residual block device information record file when the cloud platform backup system is started, and obtain a detection result;

[0032] The residual block device cleaning module is used to clean up the residual block device according to the block device identifier and the path information if the detection result indicates that the residual block device information record file has the block device identifier and the path information.

[0033] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0034] Obtaining a block device identifier and path information of a residual block device in a cloud platform backup system; the path information includes a data transmission path between the residual block device and the cloud platform backup system;

[0035] Saving the block device identifier and the path information to a preset residual block device information record file;

[0036] When the cloud platform backup system is started, detecting the residual block device information record file to obtain a detection result;

[0037] If the detection result indicates that the residual block device information record file contains the block device identifier and the path information, the residual block device is cleaned up according to the block device identifier and the path information.

[0038] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0039] Obtaining a block device identifier and path information of a residual block device in a cloud platform backup system; the path information includes a data transmission path between the residual block device and the cloud platform backup system;

[0040] Saving the block device identifier and the path information to a preset residual block device information record file;

[0041] When the cloud platform backup system is started, detecting the residual block device information record file to obtain a detection result;

[0042] If the detection result indicates that the residual block device information record file contains the block device identifier and the path information, the residual block device is cleaned up according to the block device identifier and the path information.

[0043] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0044] Obtaining a block device identifier and path information of a residual block device in a cloud platform backup system; the path information includes a data transmission path between the residual block device and the cloud platform backup system;

[0045] Saving the block device identifier and the path information to a preset residual block device information record file;

[0046] When the cloud platform backup system is started, detecting the residual block device information record file to obtain a detection result;

[0047] If the detection result indicates that the residual block device information record file contains the block device identifier and the path information, the residual block device is cleaned up according to the block device identifier and the path information.

[0048] The above-mentioned residual block device cleaning method, apparatus, computer equipment, computer-readable storage medium and computer program product obtain the block device identification and path information of the residual block device in the cloud platform backup system; the path information includes the data transmission path between the residual block device and the cloud platform backup system; the block device identification and path information are saved to a preset residual block device information record file; when the cloud platform backup system is started, the residual block device information record file is detected to obtain the detection result; if the detection result indicates that the residual block device information record file has the block device identification and path information, the residual block device is cleaned up according to the block device identification and path information. In the present application, by obtaining the block device identification and path information of the residual block device, the block devices that have not been cleaned up normally in the system can be accurately identified. Saving these block device identifications and path information to the preset residual block device information record file provides a reliable storage mechanism to ensure that even if the system is restarted or after a long period of operation, this information can still be retained to avoid omissions. When the cloud platform backup system is started, the residual block device information record file is automatically detected. If the detection result shows that the file contains block device identifiers and path information, the system can accurately locate the residual block device based on the stored identifiers and path information, and call the operating system interface to perform the cleanup operation, thereby improving the cleanup efficiency of the residual block device. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0050] FIG1 is a schematic diagram of a flow chart of a residual block device cleaning method according to an embodiment;

[0051] FIG2 is a schematic flow chart of a residual block device cleaning method in another embodiment;

[0052] FIG3 is a structural block diagram of a residual block device cleaning device in one embodiment;

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

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

[0055] In order to enable those skilled in the art to better understand the present application, the relevant technology is first introduced below.

[0056] Cloud computing platforms use virtualization technology to abstract physical computing resources into virtual resources, allowing multiple virtual machines (VMs) to run in parallel on the same physical server. In order to effectively support these virtual machines, cloud platforms need to have high-performance, high-availability storage systems. Storage area networks (SANs), as the core component of such storage systems, are widely used in such scenarios.

[0057] SAN is a dedicated high-performance network designed to interconnect computing servers with storage devices (such as disk arrays, tape libraries, solid-state drives, etc.), ensuring that multiple servers can share and access storage resources through high-speed networks. SAN provides an efficient, reliable and scalable solution for centralized management of storage devices, and is particularly suitable for the storage resource requirements of large-scale cloud platforms.

[0058] Block devices are storage devices that use data blocks as the basic unit for read and write operations. Block devices based on the iSCSI protocol are one of the common implementation methods of SAN. They allow block-level data to be transmitted over the network, allowing virtual machines to access remote storage devices like accessing local hard disks. With the remote storage management capabilities provided by SAN, the backup system of the cloud platform adopts an agentless architecture design. Through SAN, the block devices used by the virtual machine are mapped to the backup host, allowing the backup software to perform backup operations using these block devices as local disks, thereby achieving efficient data backup.

[0059] In one embodiment, as shown in FIG1 , a residual block device cleaning method is provided. This embodiment uses the method applied to a server as an example for illustration. It is understandable that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0060] Step S102, obtaining the block device identifier and path information of the residual block device in the cloud platform backup system; the path information includes the data transmission path between the residual block device and the cloud platform backup system.

[0061] Among them, residual block devices refer to block devices that are not normally released or cleaned up by the system after the backup operation is completed. Residual block devices will continue to occupy system resources and affect subsequent system operations or backup performance. Block device identification refers to the unique identification code of the block device in the storage system, which is used to uniquely identify each block device. Path information refers to the data transmission path information between the system and the block device, which can indicate multiple data transmission paths of physical or logical connections, and is used to locate the specific location of the block device in the network or storage system.

[0062] Optionally, the server can directly read the unique identifier of the residual block device from the storage device through a standard storage management protocol. After obtaining the block device identifier, the server further collects the path information between each block device and the cloud platform backup system. The server can obtain the multipath information of each block device through the multipath I / O technology.

[0063] Optionally, the server may obtain the path information of the block device of the device, including the IP address, network interface information, and other details of related data transmission channels, by accessing the network storage interface in the operating system or virtualization platform.

[0064] Step S104, saving the block device identifier and path information to a preset residual block device information record file.

[0065] The residual block device information recording file is used to record the residual block devices and their path information in the cloud platform backup system, and can be a file or data structure that persistently stores device information. The file type and storage method can be configured according to system requirements, including but not limited to text files, database tables or log files.

[0066] Specifically, after the server obtains the unique identifier and path information of the block device, it writes this information into the residual block device information record file according to a predetermined format. In one embodiment, the server can also add other information, such as timestamp and device status, to each record to facilitate management and sorting during subsequent operations.

[0067] Alternatively, the server may write the information into a text file line by line through a standard file system interface, or insert the information into a specified table through a database operation program interface.

[0068] Optionally, the server can set up a log mechanism to record each write operation. This log mechanism can ensure that when an unexpected failure occurs on the server, the system can recover the lost records through log backtracking.

[0069] Step S106, when the cloud platform backup system is started, the residual block device information record file is detected to obtain the detection result.

[0070] Specifically, when the cloud platform backup system is started, the server will first check the preset configuration in the system to confirm whether there is a residual block device information record file. If the server detects that the file exists, it will further open the file and read the content in the file. After reading and parsing the file, the server generates a detection result. The result may include whether the file exists, whether the file content is valid, and whether there is residual block device information in the file that has not been processed.

[0071] Optionally, the server can set up a data verification mechanism to ensure the integrity and correctness of the file. During detection, the server will verify the file content. In some embodiments, the server can verify the file hash value or timestamp to ensure that the recorded data is not damaged.

[0072] Optionally, if a residual block device is detected in the log file, the server can generate a warning notification based on the status of the device to remind the system administrator to further process the task. If the file does not exist or the content is empty, the server prompts that there is no residual block device in the current system and the detection result is "no operation".

[0073] Step S108: If the detection result indicates that the residual block device information record file has block device identification and path information, the residual block device is cleaned up according to the block device identification and path information.

[0074] Specifically, the server confirms whether the file contains block device identification and path information through the detection results. If the detection results show that there are unprocessed residual block devices, the server will automatically enter the cleanup process and send a cleanup instruction to the storage system through the system program interface or command line tool based on the block device identification and path information in the record file. The cleanup instruction is used to uninstall, delete or release the residual block device so that the device is no longer connected to the cloud platform backup system.

[0075] In the above residual block device cleaning method, the block device identifier and path information of the residual block device in the cloud platform backup system are obtained; the path information includes the data transmission path between the residual block device and the cloud platform backup system; the block device identifier and path information are saved to a preset residual block device information record file; when the cloud platform backup system is started, the residual block device information record file is detected to obtain the detection result; if the detection result indicates that the residual block device information record file has the block device identifier and path information, the residual block device is cleaned up according to the block device identifier and path information. In this embodiment, by obtaining the block device identifier and path information of the residual block device, the block device that has not been cleaned up normally in the system can be accurately identified. Saving these block device identifiers and path information to the preset residual block device information record file provides a reliable storage mechanism to ensure that even if the system is restarted or after a long period of operation, these information can still be retained to avoid omission. When the cloud platform backup system is started, by automatically detecting the residual block device information record file, if the detection result shows that the block device identifier and path information exist in the file, the system can accurately locate the residual block device according to the stored identifier and path information, and call the operating system interface to perform the cleaning operation. This improves the cleaning efficiency of residual block devices.

[0076] In an exemplary embodiment, obtaining block device identifiers and path information of residual block devices in a cloud platform backup system includes:

[0077] After the cloud platform backup system completes the backup, the data transmission record between the residual block device and the cloud platform backup system is obtained through the block device management interface of the cloud platform backup system; based on the data transmission record, the block device identifier of the residual block device and multiple path information corresponding to the block device identifier are determined.

[0078] Specifically, when the cloud platform backup system completes the backup task, the server enters the data management stage. In this stage, the backup task has been successfully completed, and the server starts the residual block device check program to obtain the block device information that has not been released normally.

[0079] The server directly obtains the data transfer records related to the block device through the block device management interface provided by the system. The data transfer record describes in detail the data transfer between the block device in the cloud platform backup system and the server, including but not limited to the network identification of the block device, the block device type, the block device provider information, the unique identifier of the block device and the block device path.

[0080] The server analyzes the acquired data transfer records to identify the residual block devices that have not been cleaned up normally. At this time, the server can make a judgment based on whether the block device still has an active transmission path and whether there are unfinished transmission activities or abnormal connection status on the transmission path.

[0081] After identifying the residual block device, the server will further extract the unique identifier of the device, which can include WWN (World Wide Name) or UUID (Universally Unique Identifier). On the other hand, the server obtains the path information related to the block device through the block device management interface, including detailed information such as the physical path, transmission channel, and network interface between the device and the cloud platform backup system. After obtaining the block device identifier and its path information, the server saves this information to the residual block device information record file in the system.

[0082] In one embodiment, in a system where the operating system is LINUX, the server can list detailed information of the block device connected to the backup system by executing the lsscsi --wwn operating system command, and the detailed information includes: "[3:0:0:1], disk, IET, VIRTUAL-DISK, 0x86034a11400000000048f, / dev / sdd", the SCSI ID, device type, device provider information, unique identifier WWN of the block device and device path corresponding to the residual block device.

[0083] In some embodiments, in a SAN environment, the block device has a multipath I / O (Input / Output) function, which means that there are multiple data transmission paths between the device and the server to ensure data transmission reliability, load balancing, and failover capabilities. When cleaning up residual block devices, all paths corresponding to the block device WWN need to be removed to ensure that the device is completely cleaned up from the system.

[0084] In this embodiment, the server can accurately identify and manage each residual block device by obtaining the block device identification and path information, thereby providing complete information support for subsequent cleanup operations. Based on data transmission records, it can also monitor the connection status of the block device, thereby effectively preventing the waste of device resources and improving the overall operating efficiency of the cloud platform backup system.

[0085] In an exemplary embodiment, residual block devices are cleaned up according to block device identifiers and path information, including: determining the number of path information corresponding to each block device identifier; sorting each block device identifier in descending order according to the number of path information to obtain a descending order; determining a cleanup priority of the residual block device corresponding to the block device identifier according to the descending order; and cleaning up the residual block device according to the cleanup priority of the residual block device.

[0086] Specifically, the server obtains the path information of each residual block device through the block device management interface. For each residual block device, the server will count the number of connection paths between it and the cloud platform backup system. Each residual block device can be connected to the server through multiple data transmission paths, and these path information is extracted through the multipath I / O management tool or API interface (Application Programming interface). The server executes the command, determines the number of paths for each device one by one, and records the information for subsequent sorting and priority determination.

[0087] The server sorts the block devices in descending order according to the number of paths each block device has. The residual block devices with more paths occupy relatively more system resources. In other words, they have a higher priority in the storage architecture. The residual block devices with more paths are processed first to release more resources or ensure the smooth operation of the system.

[0088] The server cleans up the residual block devices in order according to the determined cleaning priority. The server starts with the device with the highest priority and performs device unloading, release or deletion operations one by one to ensure that each device and its associated paths are completely cleaned up.

[0089] In this embodiment, by sorting in descending order according to the number of path information of block devices and determining the cleaning priority, the purpose of improving the efficiency of system resource utilization and optimizing storage management is achieved. The system reasonably allocates cleaning tasks according to the number of paths of the device, thereby achieving the effect of optimizing storage management and ensuring the smooth operation of the cloud platform backup system.

[0090] In an exemplary embodiment, the residual block devices are cleaned up according to the cleanup priorities of the residual block devices, including: grouping the residual block devices according to the cleanup priorities, planning the residual block devices with the same cleanup priority into the same group, and obtaining a grouping result; and cleaning the residual block devices in the same group in parallel according to the grouping result.

[0091] Specifically, the server first plans the residual block devices with the same priority into the same group according to the residual block device cleanup priority determined in the previous stage. Each priority represents the same type of device. Block devices of the same type have similar resource occupancy in the system and can be processed at the same time. After the grouping result is generated, the server will create a task queue for each group. The queue contains the identifiers of the block devices that need to be cleaned in the group and their corresponding transmission path information. Based on the grouping result, the server starts to clean up the devices in the same group at the same time, instead of processing individual devices sequentially.

[0092] In this embodiment, by grouping devices with the same priority, the grouped residual block devices are cleaned up in parallel, which reduces the system cleanup time and increases the speed of releasing device resources, thereby significantly improving the efficiency of the system processing capacity residual block devices.

[0093] In an exemplary embodiment, after cleaning up the residual block devices according to the block device identifier and the path information, the method further includes:

[0094] A cleaning test is performed on the cleaning of the residual block device to obtain a cleaning test result; if the cleaning test result indicates that the cleaning is successful, the block device identifier and path information corresponding to the cleaned residual block device are deleted from the residual block device information record file; if the cleaning test result indicates that the cleaning fails, a mark is added to the path information of the residual block device currently being cleaned and skipped, and the residual block device is continued to be cleaned according to the path information with the same block device identifier and not marked; the mark is used to prompt that the corresponding residual block device cleaning fails.

[0095] Specifically, after the Dangdang server performs a cleanup operation on a residual block device and its path information, it immediately starts to detect the cleanup result. The server checks the cleanup status of the device through the block device management interface or system log, including confirming whether the device has been uninstalled from the system and whether the path has been correctly deleted.

[0096] If the cleaning test result indicates that the device has been successfully cleaned, the server deletes the residual block device information from the residual block device information record file to ensure that the device is no longer processed in the future. If the cleaning test result indicates that the device has failed to be cleaned, the server adds a mark to the path information of the device, marking that the path of the device has not been successfully cleaned. This mark is used to prompt the system or administrator to continue processing the remaining paths of the device in the subsequent steps.

[0097] For those paths marked as failed to be cleaned, the server will continue to process other unmarked path information based on the same block device identifier, try to clean up the residual block devices through the remaining paths, and finally clean up the block device identifiers and path information in the residual block device record file.

[0098] In this embodiment, by performing a cleaning detection step after cleaning the residual block device, the effect of confirming whether the device and its path have been successfully cleaned is achieved. Through the detection results, for the residual block device that has been successfully cleaned, the cleaning process can be effectively managed to ensure that the successfully cleaned device is no longer processed repeatedly; for the residual block device that has not been successfully cleaned, the marking mechanism helps the system record the path information that has not been successfully cleaned, so as to facilitate the subsequent operation to continue to try to clean, and prevent the device or path from being missed during the cleaning process. Thereby achieving the effect of improving the resource management and fault handling capabilities of the cloud platform backup system.

[0099] In an exemplary embodiment, when the cloud platform backup system is started, detecting the residual block device information record file includes:

[0100] If the cloud platform backup system is in an idle state, the residual block device information record file is detected according to a preset period; if the cloud platform backup system is in a load state, the residual block device information record file is detected, and when the current load state switches to the next idle state, the residual block device information record file is detected again according to the preset period.

[0101] Specifically, when the cloud platform backup system starts, the server will start the detection task of the residual block device information record file. This detection task is executed based on the current operating status of the system. At the first moment of system startup, the server will judge the system load status to determine whether to perform file detection immediately.

[0102] If the cloud platform backup system is currently in an idle state, the server detects the residual block device information record file according to a preset detection period. The detection period can be a preset time interval (such as every 15 minutes or 1 hour) for regularly checking and cleaning up the residual block devices that have not been processed.

[0103] If the cloud platform backup system is in a load state, which may be a backup task or a large amount of data processing, the server immediately performs the detection operation of the residual block device information record file. The system will wait for the current task to be completed and the load state to switch to an idle state, and then perform the detection according to the preset period.

[0104] Optionally, the server will perform residual block device detection at a preset period in an idle state, and the detection interval can be dynamically adjusted according to system requirements. For example, during periods of light task load, the server can shorten the detection period, and during periods of high load, the detection period can be extended.

[0105] In this embodiment, when the cloud platform backup system is started, whether the system is in a load state or an idle state, the residual block device information record file can be effectively detected, thereby ensuring that the residual block device is detected and processed in a timely manner. In particular, under a load state, the system can immediately perform a detection, realize rapid processing of the residual block device, prevent the device from continuing to occupy system resources under a high load, and avoid system performance degradation.

[0106] In order to enable those skilled in the art to better understand the above steps, the embodiment of the present application is illustrated below by using an example, but it should be understood that the embodiment of the present application is not limited to this.

[0107] In one embodiment, as shown in Figure 2, after the cloud platform backup system completes the backup task, the server obtains the residual block devices currently connected to the system and their path information by executing the lsscsi--wwn command. The lsscsi--wwn command lists the residual block devices connected to the system and displays their unique identifiers (WWNs) and corresponding device paths.

[0108] The server records the obtained block device identification and path information into a preset record file residual_block_devices.txt. This file stores the WWN of each device and the corresponding multiple transmission paths. This step ensures that when the cloud platform backup system is started, the server can quickly determine whether the block device is a residual block device based on this file.

[0109] The server determines whether all residual block devices have been detected based on the obtained device information. If there are still residual block devices that have not been detected, the system will continue to execute the detection process to ensure that the device information that may become residual block devices is fully recorded in the residual_block_devices.txt file. If all residual block devices have been detected, the server enters the next step and starts the cloud platform backup system.

[0110] After the cloud platform backup system is started, the server will first access the residual_block_devices.txt file and read the device identification and path information therein. By reading this file, the server can determine the residual block devices that still exist in the system, and then start the subsequent cleanup operation. During the operation of the system, the server combines the periodic detection mechanism to regularly check the residual_block_devices.txt file to determine whether there are residual block devices that have not been cleaned up. The server determines the execution time of the detection and cleanup operations based on the current system load status. If the system is idle, the cleanup task will be executed according to the preset cycle; if the system is under load, the detection will still be performed immediately, but the cleanup task will be postponed until the system is idle to reduce the impact on system performance.

[0111] After identifying the device that needs to be cleaned, the server performs the cleanup operation through the path management tool, which can be the Linux command "echo 1 > / sys / block / sdX / device / delete". This command is used to uninstall the residual block device and ensure that its transmission path is completely removed. After the device is cleaned, the server will perform a detection operation to confirm whether the device and its path have been successfully cleaned. Through the device management interface, the server can determine the status of each device in real time. If the cleanup is successful, the server will delete the corresponding device information from the residual_block_devices.txt file to avoid repeated cleanups. If the cleanup fails, the system will mark the path information of the device and continue to try to clean up the unmarked paths.

[0112] In this embodiment, by obtaining device identification and path information, regular detection, grouping and parallel cleaning, and failure handling mechanism, it is ensured that residual block devices can be efficiently cleaned up to avoid long-term occupation of system resources. The path quantity sorting mechanism further optimizes the cleaning order, gives priority to devices that occupy more resources, and improves the resource utilization efficiency of the system. The regular detection mechanism enables the system to continuously track uncleaned devices to avoid the impact of device accumulation on system performance. The stability and efficiency of system operation have been significantly improved.

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

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

[0115] In an exemplary embodiment, as shown in FIG3 , a residual block device cleaning apparatus is provided, comprising: a residual block device identification module 310, a residual block device information recording module 320, a residual block device detection module 330 and a residual block device cleaning module 340, wherein:

[0116] The residual block device identification module 310 is used to obtain the block device identification and path information of the residual block device in the cloud platform backup system; the path information includes the data transmission path between the residual block device and the cloud platform backup system.

[0117] The residual block device information recording module 320 is used to save the block device identifier and the path information to a preset residual block device information recording file;

[0118] A residual block device detection module 330 is used to detect the residual block device information record file when the cloud platform backup system is started, and obtain a detection result;

[0119] The residual block device cleaning module 340 is configured to clean up the residual block device according to the block device identifier and the path information if the detection result indicates that the residual block device information record file contains the block device identifier and the path information.

[0120] In one embodiment, the residual block device identification module 310 is used to: after the cloud platform backup system completes the backup, obtain the data transmission record between the residual block device and the cloud platform backup system through the block device management interface of the cloud platform backup system; based on the data transmission record, determine the block device identifier of the residual block device and the multiple path information corresponding to the block device identifier.

[0121] In one embodiment, the residual block device cleaning module 340 is used to: determine the number of the path information corresponding to each of the block device identifiers; sort the block device identifiers in descending order according to the number of the path information to obtain a descending order; determine the cleaning priority of the residual block device corresponding to the block device identifier according to the descending order; and clean the residual block device according to the cleaning priority of the residual block device.

[0122] In one embodiment, the residual block device cleaning module 340 is used to: group the residual block devices according to the cleaning priorities, plan the residual block devices with the same cleaning priorities into the same group, and obtain a grouping result; and clean the residual block devices in the same group in parallel according to the grouping result.

[0123] In one embodiment, the residual block device cleaning module 340 is used to: perform a cleaning test on the residual block device to obtain a cleaning test result; if the cleaning test result indicates that the cleaning is successful, delete the block device identifier and the path information corresponding to the cleaned residual block device in the residual block device information record file; if the cleaning test result indicates that the cleaning fails, add a mark to the path information of the residual block device currently being cleaned and skip it, and continue to clean the residual block device according to the path information with the same block device identifier and unmarked; the mark is used to prompt that the corresponding residual block device cleaning fails.

[0124] In one embodiment, the residual block device detection module 330 is used to: if the cloud platform backup system is in an idle state, detect the residual block device information record file according to a preset period; if the cloud platform backup system is in a load state, detect the residual block device information record file, and when the current load state switches to the next idle state, detect the residual block device information record file again according to the preset period.

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

[0126] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG4. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store residual block device information record files. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a residual block device cleaning method is implemented.

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

[0128] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0129] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0130] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

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

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

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

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

Claims

1. A method for cleaning a residual block device, characterized in that: The method comprises: Obtaining a block device identifier and path information of a residual block device in a cloud platform backup system; the path information includes a data transmission path between the residual block device and the cloud platform backup system; Saving the block device identifier and the path information to a preset residual block device information record file; When the cloud platform backup system is started, detecting the residual block device information record file to obtain a detection result; If the detection result indicates that the residual block device information record file contains the block device identifier and the path information, the residual block device is cleaned up according to the block device identifier and the path information.

2. The method according to claim 1, characterized in that The step of obtaining the block device identifier and path information of the residual block device in the cloud platform backup system includes: After the cloud platform backup system completes the backup, obtaining the data transmission record between the residual block device and the cloud platform backup system through the block device management interface of the cloud platform backup system; Based on the data transmission record, the block device identifier of the residual block device and the plurality of path information corresponding to the block device identifier are determined.

3. The method according to claim 1, characterized in that The cleaning up the residual block device according to the block device identifier and the path information includes: Determine the number of the path information corresponding to each of the block device identifiers; Sort each of the block device identifiers in descending order according to the number of the path information to obtain a descending order; Determining, according to the descending order, a cleanup priority of the residual block device corresponding to the block device identifier; The residual block device is cleaned according to the cleanup priority of the residual block device.

4. The method according to claim 3, characterized in that The cleaning of the residual block device according to the cleaning priority of the residual block device includes: Grouping the residual block devices according to the cleaning priorities of the residual block devices, planning the residual block devices with the same cleaning priority as the same group, and obtaining a grouping result; According to the grouping result, the residual block devices in the same group are cleaned up in parallel.

5. The method according to claim 1, characterized in that After the residual block device is cleaned up according to the block device identifier and the path information, the method further includes: Performing a cleaning test on the cleaning of the residual block device to obtain a cleaning test result; If the cleaning detection result indicates that the cleaning is successful, deleting the block device identifier and the path information corresponding to the cleaned residual block device in the residual block device information record file; If the cleaning detection result indicates that the cleaning fails, a mark is added to the path information of the residual block device currently being cleaned and skipped, and the cleaning of the residual block device continues according to the path information with the same block device identifier and is not marked; the mark is used to prompt that the corresponding residual block device cleaning fails.

6. The method according to any one of claims 1 to 5, characterized in that When the cloud platform backup system is started, detecting the residual block device information record file includes: If the cloud platform backup system is in an idle state, detecting the residual block device information record file according to a preset period; If the cloud platform backup system is in a load state, the residual block device information record file is detected, and when the current load state switches to the next idle state, the residual block device information record file is detected again according to the preset period.

7. A residual block device cleaning device, characterized in that: The device comprises: A residual block device identification module is used to obtain a block device identifier and path information of a residual block device in a cloud platform backup system; the path information includes a data transmission path between the residual block device and the cloud platform backup system; A residual block device information recording module, used for saving the block device identifier and the path information to a preset residual block device information recording file; A residual block device detection module, used to detect the residual block device information record file when the cloud platform backup system is started, and obtain a detection result; The residual block device cleaning module is used to clean up the residual block device according to the block device identifier and the path information if the detection result indicates that the residual block device information record file has the block device identifier and the path information.

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

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

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Reliable data file storage method

    CN108388658A

  • Cloud platform abnormal disk cleaning and repairing method, system and device and medium

    CN111988169A

  • Method, device and equipment for cleaning residual paths at host end

    CN113238719A

  • File cleaning method and system based on cloud platform log record monitoring

    CN115374065A

  • Cloud storage control method and device and cloud storage system

    CN116962441A