Residual Block Device Cleaning Method, Device, Computer Device, Readable Storage Medium, and Program Product

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

CN119127406BActive Publication Date: 2025-07-25GUANGZHOU DINGJIA COMPUTER TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional cloud platform backup systems are inefficient when cleaning SAN block devices, resulting in a large number of residual block devices not being cleaned up normally, occupying system resources and affecting backup performance.

Method used

By obtaining the block device identification and path information in the cloud platform backup system, it saves it to the residual block device information record file, and detects and automatically cleanses the residual block device based on this information when the system is started, and adopts the parallel cleaning mechanism of path information sorting and grouping.

Benefits of technology

It improves the cleaning efficiency of residual block equipment, ensures the effective utilization of system resources and the stability of backup performance, and avoids waste of equipment resources and performance degradation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127406B_ABST
    Figure CN119127406B_ABST
Patent Text Reader

Abstract

This application relates to a method, device, computer device, computer-readable storage medium, and computer program product for cleaning residual block devices, which relates to cloud platform backup technology and can improve the cleaning efficiency of residual block devices. The method includes: obtaining the block device identifier and path information of the residual block devices in the cloud platform backup system; the path information includes the data transmission path between the residual block devices and the cloud platform backup system; saving the block device identifier and 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 path information, cleaning the residual block devices according to the block device identifier and path information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of cloud platform backup, and particularly to a method, apparatus, computer device, computer-readable storage medium, and computer program product for residual block devices. Background Art

[0002] With the rapid development of cloud computing and virtualization technologies, cloud platforms have gradually become the core components in enterprise IT architectures. To meet the requirements of efficient operation of virtual machines (VMs), Storage Area Network (SAN) technology has been widely applied. SAN connects servers to remote storage devices through a network, providing high-performance and centralized storage management services, and supporting large-scale virtual resource management in cloud platforms. Block devices based on Internet Small Computer System Interface (iSCSI) allow virtual machines to access remote storage as if it were a local hard drive, greatly improving the utilization rate of storage resources.

[0003] In traditional backup technologies, cloud platforms use agentless backup systems to export the block devices of virtual machines to backup hosts through the SAN network and manually clean these block devices after backup. However, as the scale of cloud platforms expands, backup systems face the challenge of managing thousands of SAN block devices, and traditional cleaning methods are inefficient and prone to block device residues. Summary of the Invention

[0004] Based on this, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for cleaning residual block devices in view of the above technical problems.

[0005] In a first aspect, this application provides a method for cleaning residual block devices, including:

[0006] Obtaining the block device identifier and path information of residual block devices in a cloud platform backup system; the path information includes the 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 block device identification and the path information exist in the residual block device information record file, the residual block device is cleaned according to the block device identification and the path information.

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

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

[0012] Based on the data transmission record, determine the block device identification of the residual block device and the multiple path information corresponding to the block device identification.

[0013] In one embodiment, the cleaning the residual block device according to the block device identification and the path information includes:

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

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

[0016] According to the descending order, determine the cleaning priority of the residual block device corresponding to the block device identification;

[0017] Clean the residual block device according to the cleaning priority of the residual block device.

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

[0019] Group according to the cleaning priority of the residual block device, and plan the residual block devices with the same cleaning priority into the same group to obtain a grouping result;

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

[0021] In one embodiment, after the cleaning the residual block device according to the block device identification and the path information, it further includes:

[0022] Perform a cleaning detection on the cleaning of the residual block device to obtain a cleaning detection result;

[0023] If the cleaning detection result indicates successful cleaning, delete 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 cleaning failure, add a mark to the path information of the currently cleaned residual block device and skip it, and continue to clean the residual block device according to the path information with the same block device identifier and without a mark; the mark is used to indicate that the cleaning of the corresponding residual block device fails.

[0025] In one embodiment, 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, detect the residual block device information record file according to a preset period;

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

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

[0029] A residual block device identification module, configured to obtain 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;

[0030] A residual block device information recording module, configured to save the block device identifier and the path information to a preset residual block device information record file;

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

[0032] A residual block device cleaning module, configured to, if the detection result indicates that the block device identifier and the path information exist in the residual block device information record file, clean the residual block device according to 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, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

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

[0035] Save 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, detect the residual block device information record file to obtain a detection result;

[0037] If the detection result indicates that the block device identifier and the path information exist in the residual block device information record file, clean up the residual block devices according to the block device identifier and the path information.

[0038] In a fourth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

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

[0040] Save 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, detect the residual block device information record file to obtain a detection result;

[0042] If the detection result indicates that the block device identifier and the path information exist in the residual block device information record file, clean up the residual block devices according to the block device identifier and the path information.

[0043] In a fifth aspect, the present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the following steps are implemented:

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

[0045] Save 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, detect the residual block device information record file to obtain a detection result;

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

[0048] The above-mentioned method, device, computer device, computer-readable storage medium and computer program product for cleaning residual block devices obtain the block device identifier and path information of the residual block devices 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; save the block device identifier and path information to a preset residual block device information record file; when the cloud platform backup system is started, detect the residual block device information record file to obtain a detection result; if the detection result indicates that the block device identifier and path information exist in the residual block device information record file, the residual block device is cleaned according to the block device identifier and path information. In this application, by obtaining the block device identifier and path information of the residual block device, the block devices that are not normally cleaned in the system can be accurately identified. Saving these block device identifiers and path information to a preset residual block device information record file provides a reliable storage mechanism to ensure that these information can still be retained even after the system restarts or runs for a long time, avoiding 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 there are block device identifiers and path information in the file, the system can accurately locate the residual block device according to the stored identifiers and path information, and call the operating system interface to perform the cleaning operation. Thus, the cleaning efficiency of the residual block device is improved. 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 following will briefly introduce the drawings required for describing the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related drawings can be obtained based on these drawings.

[0050] Figure 1 It is a schematic flowchart of a method for cleaning residual block devices in an embodiment;

[0051] Figure 2 It is a schematic flowchart of a method for cleaning residual block devices in another embodiment;

[0052] Figure 3 It is a structural block diagram of a device for cleaning residual block devices in an embodiment;

[0053] Figure 4 It is an internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0054] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to 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 related technologies will be introduced first below.

[0056] The cloud computing platform adopts virtualization technology to abstract physical computing resources into virtual resources, enabling multiple virtual machines (VMs) to run in parallel on the same physical server. In order to effectively support these virtual machines, the cloud platform needs to have a high-performance and highly available storage system. As a core component of such a storage system, the storage area network (SAN) is 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 a high-speed network. SAN provides an efficient, reliable and scalable solution for centralized management of storage devices, which is particularly suitable for the storage resource requirements of large-scale cloud platforms.

[0058] A block device is a storage device that performs read and write operations in units of data blocks. A block device based on the iSCSI protocol is one of the common implementations of SAN. It allows block-level data to be transmitted over the network, enabling virtual machines to access remote storage devices as if they were 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 virtual machines are mapped to the backup host, enabling backup software to perform backup operations on these block devices as local disks, thereby achieving efficient data backup.

[0059] In one embodiment, as Figure 1 shown, a method for cleaning residual block devices is provided. In this embodiment, the method is exemplified by being applied to a server. It can be understood 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, obtain the block device identifier and path information of the residual block devices in the cloud platform backup system; the path information includes the data transmission path between the residual block devices and the cloud platform backup system.

[0061] Among them, a residual block device refers to a block device that has not been properly released or cleared by the system after the backup operation is completed. Residual block devices continue to occupy system resources and affect subsequent system operations or backup performance. A block device identifier refers to the unique identification code of a 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 position 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 Multipath I / O technology.

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

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

[0065] Among them, the residual block device information record 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 for persistent storage of device information. The type and storage method of the file can be configured according to system requirements, including but not limited to text files, database tables, or log files, etc.

[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 in a predetermined format. In one embodiment, the server can also add other information to each record, such as a timestamp and device status, for easy management and sorting during subsequent operations.

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

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

[0069] Step S106, when the cloud platform backup system starts, detect the residual block device information record file to obtain a detection result.

[0070] Specifically, when the cloud platform backup system starts, 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 the existence of this file, it will further open the file and read the content therein. After reading and parsing the file, the server generates a detection result. This result can include whether the file exists, whether the file content is valid, and whether there is unprocessed residual block device information in the file.

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

[0072] Optionally, if residual block devices are detected in the record file, the server can generate a warning notification according to the status of the devices to remind the system administrator of further processing tasks. If the file does not exist or the content is empty, the server will prompt that there are no residual block devices 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 contains block device identifiers and path information, clean the residual block devices according to the block device identifiers and path information.

[0074] Specifically, the server confirms whether the file contains block device identifiers and path information through the detection result. If the detection result shows that there are unprocessed residual block devices, the server will automatically enter the cleaning process. According to the block device identifiers and path information in the record file, it will send a cleaning instruction to the storage system through the system program interface or command line tool. This cleaning instruction is used to unmount, delete, or release the residual block devices so that the devices are 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 a detection result; if the detection result indicates that the residual block device information record file contains the block device identifier and path information, the residual block device is cleaned 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 devices that are not normally cleaned in the system can be accurately identified. Saving these block device identifiers and path information to a preset residual block device information record file provides a reliable storage mechanism to ensure that these information can still be retained even after the system restarts or runs for a long time, avoiding 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 file contains the block device identifier and path information, 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. Thereby improving the cleaning efficiency of the residual block device.

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

[0077] After the cloud platform backup system completes the backup, through the block device management interface of the cloud platform backup system, obtain the data transmission record of the residual block device and 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.

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

[0079] The server directly obtains the data transmission record related to the block device through the block device management interface provided by the system. The data transmission record details the data transmission situation between the block devices in the cloud platform backup system and the server, including but not limited to the network identifier 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 obtained data transmission record to identify the residual block devices that have not been normally cleaned. At this time, the server can make a judgment according to two conditions: 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 a residual block device, the server further extracts the unique identifier of the device, which may include the 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 into the residual block device information record file in the system.

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

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

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

[0085] In an exemplary embodiment, cleaning up the residual block devices according to the block device identifier and path information includes: 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 the descending order; determining the cleaning priority of the residual block device corresponding to the block device identifier according to the descending order; and cleaning up the residual block devices according to the cleaning priority of the residual block devices.

[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 counts the number of connection paths to the cloud platform backup system. Each residual block device can be connected to the server through multiple data transfer paths, and this path information is extracted through the multipath I / O management tool or the API interface (Application Programming interface). The server executes commands to determine the number of paths of each device one by one and records this information for subsequent sorting and priority determination.

[0087] The server sorts the block devices in descending order according to the number of paths owned by each block device. For residual block devices with more paths, they 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 preferentially to release more resources or ensure the stable operation of the system.

[0088] The server sequentially clears the residual block devices according to the determined cleaning priorities. The server starts from the device with the highest priority and performs device unloading, releasing, or deleting operations one by one to ensure that each device and its associated paths are completely cleared.

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

[0090] In an exemplary embodiment, cleaning the residual block devices according to the cleaning priorities of the residual block devices includes: grouping according to the cleaning priorities of the residual block devices, planning the residual block devices with the same cleaning priority into the same group to obtain the 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 cleaning priorities of the residual block devices determined in the previous stage. Each priority represents the same type of device, and the same type of block devices have similar resource occupancy in the system and can be processed simultaneously. After the grouping result is generated, the server creates a task queue for each group, and the queue contains the identifiers of the block devices to be cleaned in the group and their corresponding transmission path information. The server starts to clean the devices in the same group simultaneously according to the grouping result instead of processing individual devices sequentially.

[0092] In this embodiment, by grouping devices with the same priority and cleaning the residual block devices in the group in parallel, the system cleaning time is reduced and the speed of device resource release is increased, thereby significantly improving the efficiency of the system in processing residual block devices.

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

[0094] Performing a cleaning detection on the cleaning of the residual block devices to obtain a cleaning detection result; if the cleaning detection result indicates successful cleaning, deleting the block device identifier and path information corresponding to the cleaned residual block device in the residual block device information record file; if the cleaning detection result indicates cleaning failure, adding a mark to the path information of the currently cleaned residual block device and skipping it, and continuing to clean the residual block devices according to the path information with the same block device identifier and without a mark; the mark is used to indicate that the cleaning of the corresponding residual block device fails.

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

[0096] If the cleaning detection 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 not processed subsequently. If the cleaning detection result indicates that the device cleaning fails, the server adds a mark to the path information of the device to indicate 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 path of the device in subsequent steps.

[0097] For those paths marked as cleaning failures, the server will continue to process other unmarked path information with the same block device identifier, attempt to clean the residual block devices through the remaining paths, and finally clean the block device identifier and path information in the residual block device record file.

[0098] In this embodiment, by performing the step of cleaning detection after cleaning the residual block devices, the effect of confirming whether the device and its path have been successfully cleaned is achieved. Through the detection result, for the residual block devices that have been successfully cleaned, the cleaning process can be effectively managed to ensure that the successfully cleaned devices are not processed repeatedly; for the residual block devices that have not been successfully cleaned, the marking mechanism helps the system record the path information that has not been successfully cleaned, facilitating subsequent operations to continue attempting to clean, and at the same time preventing the omission of devices or paths during the cleaning process. Thus, the effect of improving the resource management and fault handling capabilities of the cloud platform backup system is achieved.

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

[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 loaded state, the residual block device information record file is detected, and when the current loaded 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 is started, the server will start the detection task of the residual block device information record file. This detection task determines when to execute according to the current running state of the system. At the first moment of system startup, the server will judge the system load state to determine whether to immediately perform file detection.

[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. This detection period can be a preset time interval (such as every 15 minutes or 1 hour) for regularly checking and cleaning unprocessed residual block devices.

[0103] If the cloud platform backup system is in a loaded state, which can be when a backup task is in progress or a large amount of data is being processed, the server immediately performs the detection operation of the residual block device information record file. The system will wait for the current task to complete, and after the loaded state switches to the idle state, it will be detected according to the preset period.

[0104] Optionally, the server will perform residual block device detection at a preset period in the idle state, and the detection time interval can be dynamically adjusted according to system requirements. For example, during a period with a light task load, the server can shorten the detection period, while during a period with a 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 loaded state or an idle state, the residual block device information record file can be effectively detected, achieving the effect of ensuring that the residual block device is detected and processed in a timely manner. Especially in the loaded state, the system can immediately perform detection, realizing the rapid processing of the residual block device, preventing the device from continuing to occupy system resources under high load, and avoiding system performance degradation.

[0106] To enable those skilled in the art to better understand the above steps, the following gives an exemplary illustration of the embodiments of the present application through an example, but it should be understood that the embodiments of the present application are not limited thereto.

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

[0108] The server records the obtained block device identifiers and path information into a preset record file, residual_block_devices.txt. This file stores the WWN of each device and the corresponding multiple transfer paths. This step ensures that when the cloud platform backup system starts, the server can quickly determine whether a 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 not detected, the system will continue to execute the detection process to ensure that the device information that may become residual block devices is completely recorded in the residual_block_devices.txt file. If all residual block devices have been detected, the server enters the next step, starting the cloud platform backup system.

[0110] After the cloud platform backup system starts, the server first accesses the residual_block_devices.txt file to read the device identifiers and path information therein. By reading this file, the server can determine the residual block devices still existing in the system and then initiate subsequent cleanup operations. During the operation of the system, the server combines a 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 decides the execution time of the detection and cleanup operations based on the current load status of the system. If the system is idle, the cleanup task will be executed according to the preset period; 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 can perform the cleaning operation through a path management tool, which can be using the Linux command "echo 1 > / sys / block / sdX / device / delete". This command is used to unmount the residual block device and ensure that its transmission path is completely removed. After the device cleaning is completed, 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 judge the status of each device in real time. If the cleaning is successful, the server will delete the corresponding device information from the residual_block_devices.txt file to avoid repeated cleaning. If the cleaning fails, the system will mark the path information of the device and continue to try to clean the unmarked paths.

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

[0113] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the indication of the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily have to be executed at the same time, but can be executed at different times. The execution order of these steps or stages does not necessarily have to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0114] Based on the same inventive concept, the embodiments of the present application also provide a residual block device cleaning device for implementing the above-mentioned residual block device cleaning method. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more of the following embodiments of the residual block device cleaning device can refer to the limitations on the residual block device cleaning method in the above text, and will not be repeated here.

[0115] In an exemplary embodiment, as Figure 3As shown in the figure, a residual block device cleaning device is provided, including: 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, where:

[0116] The residual block device identification module 310 is configured to obtain 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.

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

[0118] The residual block device detection module 330 is configured to detect the residual block device information recording 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, if the detection result indicates that the block device identifier and the path information exist in the residual block device information recording file, clean the residual block device according to the block device identifier and the path information.

[0120] In one embodiment, the residual block device identification module 310 is configured to: after the cloud platform backup system completes a 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 configured to: determine the number of the path information corresponding to each block device identifier; perform a descending order sorting on each block device identifier 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 configured to: group according to the cleaning priority of the residual block device, and plan the residual block devices with the same cleaning priority into the same group to obtain a grouping result; and perform parallel cleaning on the residual block devices in the same group according to the grouping result.

[0123] In one embodiment, the residual block device cleaning module 340 is configured to: perform a cleaning detection on the cleaning of the residual block device to obtain a cleaning detection result; if the cleaning detection result indicates successful cleaning, 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 detection result indicates cleaning failure, add a mark to the path information of the currently cleaned residual block device and skip it, and continue to clean the residual block device according to the path information with the same block device identifier and without a mark; the mark is used to indicate that the cleaning of the corresponding residual block device fails.

[0124] In one embodiment, the residual block device detection module 330 is configured 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, and their combination. The above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to the above respective modules.

[0126] In an exemplary embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 4 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, 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. Among them, 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 the residual block device information record file. The input / output interface of the computer device is used to exchange information between the processor and external devices. 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 can understand, Figure 4The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0128] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

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

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

[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 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 need to comply with relevant regulations.

[0132] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing related hardware through a computer program. 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 methods. Among them, any reference to a 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), magnetoresistive 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. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.

[0133] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as within the scope recorded in the present application.

[0134] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the patent of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. A method for cleaning a residual block device, characterized in that The method includes: Obtaining the block device identifier and path information of the residual block devices in the cloud platform backup system; the path information includes the data transmission path between the residual block devices 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 block device identifier and the path information exist in the residual block device information record file, cleaning the residual block devices according to the block device identifier and the path information; Performing a cleaning detection on the cleaning of the residual block devices to obtain a cleaning detection result; If the cleaning detection result indicates successful cleaning, deleting the block device identifier and the path information corresponding to the cleaned residual block devices in the residual block device information record file; If the cleaning detection result indicates cleaning failure, adding a mark to the path information of the currently cleaned residual block device and skipping it, and continuing to clean the residual block devices according to the path information with the same block device identifier and without a mark; the mark is used to indicate that the cleaning of the corresponding residual block device fails.

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

3. The method according to claim 1, characterized in that, The cleaning the residual block devices according to the block device identifier and the path information includes: Determining the number of the path information corresponding to each block device identifier; Performing a descending sort on each block device identifier according to the number of the path information to obtain a descending order; According to the descending order, determining the cleaning priority of the residual block devices corresponding to the block device identifier; Cleaning the residual block devices according to the cleaning priority of the residual block devices.

4. The method according to claim 3, wherein The cleaning the residual block devices according to the cleaning priority of the residual block devices includes: Grouping according to the cleaning priority of the residual block devices, and planning the residual block devices with the same cleaning priority into the same group to obtain a grouping result; According to the grouping result, cleaning the residual block devices in the same group in parallel.

5. The method according to any one of claims 1 to 4, characterized in that The detecting the residual block device information record file when the cloud platform backup system is started 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, detecting the residual block device information record file, and when the current load state switches to the next idle state, detecting the residual block device information record file again according to the preset period.

6. A residual block device cleaning device, characterized in that, The device includes: A residual block device identification module, configured to obtain 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; A residual block device information recording module, configured to save the block device identifier and the path information to a preset residual block device information recording file; A residual block device detection module, configured to detect the residual block device information recording file when the cloud platform backup system is started, and obtain a detection result; A residual block device cleaning module, configured to, if the detection result indicates that the block device identifier and the path information exist in the residual block device information recording file, clean the residual block device according to the block device identifier and the path information; perform a cleaning detection on the cleaning of the residual block device, and obtain a cleaning detection result; if the cleaning detection result indicates successful cleaning, delete the block device identifier and the path information corresponding to the cleaned residual block device in the residual block device information recording file; if the cleaning detection result indicates cleaning failure, add a mark to the path information of the currently cleaned residual block device and skip it, and continue to clean the residual block device according to the path information with the same block device identifier and without a mark; the mark is used to prompt that the cleaning of the corresponding residual block device fails.

7. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. 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 5 are implemented.

9. 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 5 are implemented.

Citation Information

Patent Citations

  • 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