Control method of device storage, device, and storage medium

By switching cache modes in real time and selecting the appropriate cache mode based on the storage status, the problems of low data consistency and low acceleration effect in cache acceleration technology are solved, thereby improving stability and efficiency.

CN117632011BActive Publication Date: 2026-06-12CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA UNITED NETWORK COMM GRP CO LTD
Filing Date
2023-11-24
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing caching acceleration technologies suffer from low data consistency and low acceleration performance, especially when using write-back mode. Data consistency issues limit their application scenarios, while write-through mode, although secure, gradually reduces its acceleration effect.

Method used

By collecting storage information from the target device, it is determined whether the storage status meets the preset conditions. Based on the conditions, the cache mode is switched to write-back mode or write-to-direct mode to ensure that write-back mode is used to accelerate read and write operations when performance is good, and to switch to write-to-direct mode when performance is low or data consistency is required.

Benefits of technology

It achieves improved storage efficiency while ensuring the stability and data consistency of read/write acceleration, solving the problems of low data consistency and low acceleration effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117632011B_ABST
    Figure CN117632011B_ABST
Patent Text Reader

Abstract

The application provides a device storage control method, a device and a storage medium, and applies to the field of computer science. The method comprises the following steps: collecting storage information of a target device, determining a storage state of the target device based on the storage information; judging whether the storage state meets a preset condition; if yes, controlling a cache mode of the target device to be a first preset mode; and if no, controlling the cache mode of the target device to be a second preset mode. The method of the application achieves the technical effect of improving data consistency and accelerating effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer science, and more particularly to a control method, device, and storage medium for device storage. Background Technology

[0002] With the development of computer science and technology, the performance requirements of computers are increasing. Among these, improving data read and write speeds, a hallmark of computer performance, has become an important direction for development. Existing technologies utilize caching to accelerate data access speed while reducing the number of accesses to main memory and disk, thereby reducing resource consumption and improving system response speed.

[0003] Among existing caching acceleration technologies, Write Back (WB) mode accelerates both write and read operations. In WB mode, on the initial read, data is read from the backend disk and then filled back into the cache disk; subsequent reads of the same data are directly from the cache disk. When writing data, WB mode writes the data directly to the cache disk. Write Through (WT) mode only accelerates read operations, using the same acceleration method as WB mode. WT mode writes data to both the cache disk and the backend disk simultaneously during write operations, thus offering no acceleration for write operations.

[0004] In existing technologies, the primary method used in actual production environments to ensure data security is write-through mode. However, write-through mode only accelerates read operations, and its acceleration effect gradually decreases as cache disk performance improves; therefore, it cannot fully leverage the performance advantages of the cache disk. Write-back mode can accelerate both read and write operations simultaneously, and its acceleration effect gradually improves as cache disk performance increases; however, write-back mode suffers from data consistency issues, limiting its application scenarios. Therefore, existing caching acceleration technologies suffer from low data consistency and low acceleration effect. Summary of the Invention

[0005] This application provides a device storage control method, device, and storage medium to solve the technical problems of low data consistency and low acceleration effect in existing caching acceleration technologies.

[0006] In a first aspect, this application provides a device storage control method, comprising:

[0007] Collect storage information from the target device and determine the storage status of the target device based on the storage information;

[0008] Determine whether the storage status meets the preset conditions;

[0009] If yes, then the cache mode of the target device is controlled to the first preset mode; if no, then the cache mode of the target device is controlled to the second preset mode.

[0010] Optionally, the caching mode of the target device is controlled to be a first preset mode, including:

[0011] When the storage state meets the preset conditions and the target device's cache mode is write-through mode, control the target device's cache mode to write-back mode;

[0012] The write-through mode is used to accelerate read operations on the target device; the write-back mode is used to accelerate both read and write operations on the target device.

[0013] Optionally, the caching mode of the target device is controlled to be a second preset mode, including:

[0014] When the storage state does not meet the preset conditions and the target device's cache mode is write-back mode, control the target device's cache mode to write-through mode.

[0015] Optionally, the storage information of the target device is collected, and the storage status of the target device is determined based on the storage information, including:

[0016] Collect stored information from the target device;

[0017] At least one target hard drive is determined based on the number of hard drives and hard drive partitioning information in the storage information;

[0018] The storage status of the target hard drive is obtained based on a preset time interval and the hard drive interface information of the target hard drive;

[0019] The storage information includes: the number of hard drives in the target device, the hard drive partition information of the target device, and the hard drive interface information of the target device.

[0020] Optionally, determine whether the storage state meets preset conditions, including:

[0021] Determine whether the health status value corresponding to the storage status is greater than a preset threshold. If yes, the storage status meets the preset conditions; otherwise, the storage status does not meet the preset conditions.

[0022] Optionally, after setting the target device's cache mode to write-back mode, the method further includes:

[0023] When the target device needs to perform virtual machine hot migration, control the target device's caching mode to write-through mode.

[0024] Optionally, after setting the cache mode of the target device to write-through mode, the following is also included:

[0025] Determine if there is dirty data in the target device's cache disk. If so, update the dirty data to the backend disk corresponding to the cache disk.

[0026] The cache disk is used to store temporary data; the back-end disk is used to store long-term data and can be a solid-state drive and / or a hard disk drive.

[0027] Secondly, this application provides a control device for device storage, comprising:

[0028] The acquisition module is used to acquire the storage information of the target device and determine the storage status of the target device based on the storage information.

[0029] The judgment module is used to determine whether the storage status meets the preset conditions;

[0030] The processing module is used to control the cache mode of the target device to a first preset mode when the storage state meets the preset conditions, and to control the cache mode of the target device to a second preset mode when the storage state does not meet the preset conditions.

[0031] Optionally, the device is also used for:

[0032] When the storage state meets the preset conditions and the target device's cache mode is write-through mode, control the target device's cache mode to write-back mode;

[0033] The write-through mode is used to accelerate read operations on the target device; the write-back mode is used to accelerate both read and write operations on the target device.

[0034] Optionally, the device is also used for:

[0035] When the storage state does not meet the preset conditions and the target device's cache mode is write-back mode, control the target device's cache mode to write-through mode.

[0036] Optionally, the device is also used for:

[0037] Collect stored information from the target device;

[0038] At least one target hard drive is determined based on the number of hard drives and hard drive partitioning information in the storage information;

[0039] The storage status of the target hard drive is obtained based on a preset time interval and the hard drive interface information of the target hard drive;

[0040] The storage information includes: the number of hard drives in the target device, the hard drive partition information of the target device, and the hard drive interface information of the target device.

[0041] Optionally, the device is also used for:

[0042] Determine whether the health status value corresponding to the storage status is greater than a preset threshold. If yes, the storage status meets the preset conditions; otherwise, the storage status does not meet the preset conditions.

[0043] Optionally, the device is also used for:

[0044] When the target device needs to perform virtual machine hot migration, control the target device's caching mode to write-through mode.

[0045] Optionally, the device is also used for:

[0046] Determine if there is dirty data in the target device's cache disk. If so, update the dirty data to the backend disk corresponding to the cache disk.

[0047] The cache disk is used to store temporary data; the back-end disk is used to store long-term data and can be a solid-state drive and / or a hard disk drive.

[0048] Thirdly, this application provides a control device for device storage, comprising:

[0049] Processor and memory;

[0050] The memory stores the instructions that the computer executes;

[0051] The processor executes computer-executable instructions stored in memory, causing the device-stored control device to perform the device-stored control method of any one of the first aspects.

[0052] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement a device storage control method as described in any of the first aspects.

[0053] This application provides a device storage control method, device, and storage medium. The method includes: acquiring storage information of a target device; determining the storage state of the target device based on the storage information; determining whether the storage state meets preset conditions; if so, controlling the caching mode of the target device to a first preset mode; if not, controlling the caching mode of the target device to a second preset mode. By acquiring storage information in the target device, determining the corresponding storage state of the target device, determining the applicable caching acceleration mode for the target device based on the storage state, and switching the corresponding mode; when the storage state of the target device meets the preset conditions, the caching mode of the target device is determined to be the first preset mode; when the storage state of the target device does not meet the preset conditions, the caching mode of the target device is determined to be the second preset mode; thereby realizing real-time mode switching and improving the utilization efficiency of storage in the target device; while improving utilization efficiency, ensuring the stability of read / write acceleration and data consistency of the target device, thus achieving the technical effect of improving data consistency and acceleration effect. Attached Figure Description

[0054] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0055] Figure 1 Flowchart of the device storage control method provided in the embodiments of this application Figure 1 ;

[0056] Figure 2 Flowchart of the device storage control method provided in the embodiments of this application Figure 2 ;

[0057] Figure 3 The flowchart of the cache mode switching method for device storage control provided in the embodiments of this application Figure 1 ;

[0058] Figure 4 The flowchart of the cache mode switching method for device storage control provided in the embodiments of this application Figure 2 ;

[0059] Figure 5 This is a schematic diagram of the structure of the control device for device storage provided in the embodiments of this application;

[0060] Figure 6 This is a hardware structure diagram of the control device for device storage provided in the embodiments of this application.

[0061] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0062] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0063] Among existing caching acceleration technologies, Write Back (WB) mode accelerates both write and read operations. In WB mode, on the initial read, data is read from the backend disk and then filled back into the cache disk; subsequent reads of the same data are directly from the cache disk. When writing data, WB mode writes the data directly to the cache disk. Write Through (WT) mode only accelerates read operations, using the same acceleration method as WB mode. WT mode writes data to both the cache disk and the backend disk simultaneously during write operations, thus offering no acceleration for write operations. In existing technologies, the primary method used in actual production environments to ensure data security is write-through mode. However, write-through mode only accelerates read operations, and its acceleration effect gradually decreases as cache disk performance improves; therefore, it cannot fully leverage the performance advantages of the cache disk. Write-back mode can accelerate both read and write operations simultaneously, and its acceleration effect gradually improves as cache disk performance increases; however, write-back mode suffers from data consistency issues, limiting its application scenarios. Therefore, existing caching acceleration technologies suffer from low data consistency and low acceleration effect.

[0064] This application provides a device storage control method, device, and storage medium. The method includes: acquiring storage information of a target device; determining the storage state of the target device based on the storage information; determining whether the storage state meets preset conditions; if so, controlling the caching mode of the target device to a first preset mode; if not, controlling the caching mode of the target device to a second preset mode. By acquiring storage information in the target device, determining the corresponding storage state of the target device, determining the applicable caching acceleration mode of the target device based on the storage state, and switching the corresponding mode; when the storage state of the target device meets the preset conditions, the caching mode of the target device is determined to be the first preset mode; when the storage state of the target device does not meet the preset conditions, the caching mode of the target device is determined to be the second preset mode; thereby realizing real-time mode switching and improving the utilization efficiency of storage in the target device; while improving utilization efficiency, ensuring the stability of read / write acceleration and data consistency of the target device, thus achieving the technical effect of improving data consistency and acceleration effect, solving the technical problems of low data consistency and low acceleration effect in the prior art.

[0065] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0066] Figure 1 Flowchart of the device storage control method provided in the embodiments of this application Figure 1 .like Figure 1 As shown, the device storage control method provided in this application embodiment includes:

[0067] S101. Collect the storage information of the target device and determine the storage status of the target device based on the storage information;

[0068] In this embodiment, the storage information of the target device can be: the hard disk information corresponding to the cache disk in the target device and the hard disk information of the back-end disk corresponding to the cache disk in the target device. The storage status of the target device can be: the temperature, health status, lifespan prediction, error log, and health report of the hard disk in the target device.

[0069] S102. Determine whether the storage status meets the preset conditions;

[0070] In this embodiment, the health status value of the solid-state drive corresponding to the target device is obtained based on the storage status. The storage status of the target device is determined by the health status information of the solid-state drive reflected by the health status value. Since the health status value of the solid-state drive is a percentage value, the preset condition can be set to the corresponding percentage value.

[0071] S103. If yes, then control the cache mode of the target device to the first preset mode; if no, then control the cache mode of the target device to the second preset mode.

[0072] In this embodiment, the first preset mode is a write-back mode, and the second preset mode is a direct write mode. The direct write mode includes: when an application initiates a write operation, data is written to the cache disk, and the corresponding cache flag is set to a valid state, indicating that the data has been cached; after being written to the cache, the caching system based on the computer device writes the data to the backend disk to ensure data persistence; simultaneously, the write operation can only be completed after the data has been written to the backend disk. The write-back mode includes: when an application initiates a write operation, data is first written to the cache disk, and the cache marks the data as dirty data, indicating that the data has been modified but not written back to the backend disk; the caching system of the computer device determines when to write the dirty data back to the backend disk based on preset policies and conditions, and writes the dirty data back to the backend disk when a write operation is initiated.

[0073] This application provides a device storage control method. The method includes: collecting storage information of a target device; determining the storage state of the target device based on the storage information; determining whether the storage state meets preset conditions; if yes, controlling the caching mode of the target device to a first preset mode; if no, controlling the caching mode of the target device to a second preset mode. By acquiring storage information in the target device, determining the corresponding storage state of the target device, determining the applicable caching acceleration mode of the target device based on the storage state, and switching the corresponding mode; when the storage state of the target device meets the preset conditions, the caching mode of the target device is determined to be the first preset mode; when the storage state of the target device does not meet the preset conditions, the caching mode of the target device is determined to be the second preset mode; thereby realizing real-time mode switching and improving the utilization efficiency of storage in the target device; while improving utilization efficiency, ensuring the stability of read / write acceleration and data consistency of the target device, thus achieving the technical effect of improving data consistency and acceleration effect, solving the technical problems of low data consistency and low acceleration effect in the prior art.

[0074] Figure 2 Flowchart of the device storage control method provided in the embodiments of this application Figure 2 .like Figure 2 As shown, the device storage control method provided in this application embodiment includes:

[0075] S201. Collect storage information from the target device; determine at least one target hard drive based on the number of hard drives and hard drive partition information in the storage information; obtain the storage status of the target hard drive based on a preset time interval and the hard drive interface information of the target hard drive;

[0076] In this embodiment, the storage information includes: hard disk information and partition information; wherein the hard disk information includes the number of hard disks in the target device, the hard disk capacity, the hard disk interface information, and the health status of the hard disk; for solid-state drives, the storage information also includes the remaining lifespan of the solid-state drive and read / write speed information.

[0077] The interface information for the hard drive can specify the interface type as either Serial Advanced Technology Attachment (SATA) or Non-Volatile Memory Express (NVMe).

[0078] In this embodiment, the unit of the preset time interval can be days, and the preset time interval is determined according to the hard drive's lifespan and wear rate in actual applications.

[0079] In this embodiment, by obtaining the number of hard drives in the target device, at least one target hard drive that can be used for cache mode switching is determined, and the interface of the corresponding target hard drive is called to obtain the target hard drive information, thereby determining the storage status of the target hard drive corresponding to the target device.

[0080] S202. Determine whether the health status value corresponding to the storage status is greater than the preset threshold. If yes, the storage status meets the preset conditions; otherwise, the storage status does not meet the preset conditions.

[0081] In this embodiment, the storage status of the target hard disk is determined by obtaining the health status value of the target hard disk; in the first example, the preset threshold is 20%, the health status value of the target hard disk is 80%, and the health status value of the target hard disk is greater than the preset threshold, which indicates that the storage status meets the preset conditions.

[0082] S203. When the storage state meets the preset conditions and the cache mode of the target device is write-through mode, control the cache mode of the target device to write-back mode.

[0083] In this embodiment, the direct write mode is used to accelerate read operations in the target device; the write-back mode is used to accelerate both read and write operations in the target device; and the initial cache mode of the target device is the second preset mode, namely the direct write mode.

[0084] In the second example, the health status value of the target hard drive corresponding to the storage status is 50%, the preset threshold is 20%, and the current cache mode of the target device is write-through mode. If the health status value of the target hard drive is determined to be greater than the preset threshold, it indicates that the current performance of the target hard drive is good, and write-back mode can be used as the cache mode, thereby controlling the cache mode of the target device to be write-back mode.

[0085] S204. When the target device needs to perform virtual machine hot migration, control the cache mode of the target device to write-through mode;

[0086] In this embodiment, virtual machine hot migration refers to migrating a running virtual machine from one physical host to another within a virtualization environment without interrupting its operation. During hot migration, it is crucial to ensure that no virtual machine data is lost or corrupted. The virtual machine's memory and disk state are copied to the target host during the migration process. Since memory and disk are critical components for virtual machine operation, dirty data in the cache needs to be cleared before migration to ensure data consistency.

[0087] In this embodiment, before processing dirty data in the cache disk, the current cache mode needs to be determined as write-through mode.

[0088] S205. When the storage state does not meet the preset conditions and the cache mode of the target device is write-back mode, control the cache mode of the target device to write-through mode.

[0089] In the third example, the health status value of the target hard drive corresponding to the storage status is 10%, the preset threshold is 20%, and the current cache mode of the target device is write-back mode; if the health status value of the target hard drive is determined to be less than the preset threshold, it indicates that the performance of the current target hard drive is low, and the write-back mode will cause data inconsistency, thereby controlling the cache mode of the target device to write-through mode.

[0090] S206. Determine whether there is dirty data in the cache disk of the target device. If so, update the dirty data to the backend disk corresponding to the cache disk.

[0091] In this embodiment, the cache disk is used to store temporary data. The types of cache disks include: solid-state drive cache disks, non-volatile memory expansion cache disks, hybrid cache disks, and random access memory cache disks. The back-end disk is used to store long-term data, which refers to the disk device that actually stores data on the virtual machine or physical server. The main types include: hard disk drives, solid-state drives, non-volatile memory expansion disks, and network storage.

[0092] In this embodiment, dirty data refers to data that has been modified but has not yet been written to the backend disk. The dirty data is cleared by writing it back to the backend disk, thus ensuring data consistency.

[0093] By executing S201 to S206, the health status value of the target hard disk in the target device and the preset threshold are used to determine the caching mode applicable to the current target device, and the caching mode is switched, thereby achieving the technical effect of improving data consistency and speeding up the process.

[0094] Figure 3 The flowchart of the cache mode switching method for device storage control provided in the embodiments of this application Figure 1 , Figure 4 The flowchart of the cache mode switching method for device storage control provided in the embodiments of this application Figure 2 .like Figure 3 and Figure 4 As shown in the embodiment of this application, the cache mode switching method for device storage control includes: This application provides cache acceleration software for switching cache modes; the cache modes include write-through mode and write-back mode. In this embodiment, the target hard drive of the target device is determined to be a non-volatile memory extended solid-state drive, and the back-end drive is a mechanical hard drive or block storage. The cache acceleration software is deployed on the target device. When the cache acceleration software is started, the cache mode is set to write-through mode; the health status of the solid-state drive is periodically checked and a health status value is obtained. When the health status value is greater than 20%, the cache mode is switched to write-back mode and the device enters a sleep state; when the software runtime reaches a fixed preset time interval, the health status of the solid-state drive is checked again. If the health status value is still greater than 20%, the cache mode remains in write-back mode; if the health status value is less than or equal to 20%, the cache mode is switched to write-through mode; and it is determined whether there is dirty data in the cache disk. If so, the dirty data is written back to the back-end drive. Solid-state drives are referred to as NVMe SSDs, hard disk drives as HDDs, block storage as RBDs, cache acceleration software as OCFs, write-through mode as WTs, and write-back mode as WBs.

[0095] This application provides a device storage control method. The method includes: collecting storage information in a target device; determining at least one target hard disk based on the number of hard disks and hard disk partition information in the storage information; obtaining the storage status of the target hard disk based on a preset time interval and the hard disk interface information of the target hard disk; determining whether the health status value corresponding to the storage status is greater than a preset threshold; if so, the storage status meets the preset conditions; if not, the storage status does not meet the preset conditions; when the storage status meets the preset conditions and the cache mode of the target device is write-on-demand mode, controlling the cache mode of the target device to write-back mode; when the storage status does not meet the preset conditions and the cache mode of the target device is write-back mode, controlling the cache mode of the target device to write-on-demand mode. By acquiring the storage information of the target device, determining the target hard drive within the target device based on the access information, and obtaining the storage status corresponding to the target hard drive based on the interface information of the target hard drive; obtaining a health status value based on the storage status, and determining whether the health status value is greater than a preset threshold, thereby determining whether the storage status corresponding to the target device meets preset conditions; when the storage status of the target device meets the preset conditions, controlling the cache mode of the target device to write-back mode, thereby accelerating write and read operations when the target hard drive performance is good; when the target device needs to undergo virtual machine hot migration or when the storage status of the target device does not meet the preset conditions, controlling the cache mode of the target device to write-through mode; when the target hard drive performance is low, write-through mode can maintain the consistency of data between the cache disk and the backend disk corresponding to the target hard drive; at the same time, maintaining data consistency can ensure data security during virtual machine hot migration; thus, it achieves the technical effect of improving data consistency and accelerating performance, and solves the technical problems of low data consistency and low acceleration performance in existing technologies.

[0096] Figure 5 This is a schematic diagram of the control device for device storage provided in an embodiment of this application. The device in this embodiment can be in the form of software and / or hardware. Figure 5 As shown in the figure, an embodiment of this application provides a device storage control device 500, including: a data acquisition module 501, a judgment module 502, and a processing module 503.

[0097] The acquisition module 501 is used to acquire the storage information of the target device and determine the storage status of the target device based on the storage information.

[0098] The judgment module 502 is used to determine whether the storage state meets the preset conditions;

[0099] The processing module 503 is used to control the cache mode of the target device to a first preset mode when the storage state meets the preset conditions, and to control the cache mode of the target device to a second preset mode when the storage state does not meet the preset conditions.

[0100] In one possible implementation, the device is also used for:

[0101] When the storage state meets the preset conditions and the target device's cache mode is write-through mode, control the target device's cache mode to write-back mode;

[0102] The write-through mode is used to accelerate read operations on the target device; the write-back mode is used to accelerate both read and write operations on the target device.

[0103] In one possible implementation, the device is also used for:

[0104] When the storage state does not meet the preset conditions and the target device's cache mode is write-back mode, control the target device's cache mode to write-through mode.

[0105] In one possible implementation, the device is also used for:

[0106] Collect stored information from the target device;

[0107] At least one target hard drive is determined based on the number of hard drives and hard drive partitioning information in the storage information;

[0108] The storage status of the target hard drive is obtained based on a preset time interval and the hard drive interface information of the target hard drive;

[0109] The storage information includes: the number of hard drives in the target device, the hard drive partition information of the target device, and the hard drive interface information of the target device.

[0110] In one possible implementation, the device is also used for:

[0111] Determine whether the health status value corresponding to the storage status is greater than a preset threshold. If yes, the storage status meets the preset conditions; otherwise, the storage status does not meet the preset conditions.

[0112] In one possible implementation, the device is also used for:

[0113] When the target device needs to perform virtual machine hot migration, control the target device's caching mode to write-through mode.

[0114] In one possible implementation, the device is also used for:

[0115] Determine if there is dirty data in the target device's cache disk. If so, update the dirty data to the backend disk corresponding to the cache disk.

[0116] The cache disk is used to store temporary data; the back-end disk is used to store long-term data and can be a solid-state drive and / or a hard disk drive.

[0117] This application provides a device for controlling device storage. The device includes: a data acquisition module for acquiring storage information in a target device; determining at least one target hard drive based on the number of hard drives and hard drive partition information in the storage information; obtaining the storage status of the target hard drive based on a preset time interval and the hard drive interface information of the target hard drive; a judgment module for judging whether the health status value corresponding to the storage status is greater than a preset threshold; if so, the storage status meets the preset conditions; if not, the storage status does not meet the preset conditions; and a processing module for controlling the cache mode of the target device to write-back mode when the storage status meets the preset conditions and the cache mode of the target device is write-back mode; and controlling the cache mode of the target device to write-back mode when the storage status does not meet the preset conditions and the cache mode of the target device is write-back mode. By acquiring the storage information of the target device, determining the target hard drive within the target device based on the access information, and obtaining the storage status corresponding to the target hard drive based on the interface information of the target hard drive; obtaining a health status value based on the storage status, and determining whether the health status value is greater than a preset threshold, thereby determining whether the storage status corresponding to the target device meets preset conditions; when the storage status of the target device meets the preset conditions, controlling the cache mode of the target device to write-back mode, thereby accelerating write and read operations when the target hard drive performance is good; when the target device needs to undergo virtual machine hot migration or when the storage status of the target device does not meet the preset conditions, controlling the cache mode of the target device to write-through mode; when the target hard drive performance is low, write-through mode can maintain the consistency of data between the cache disk and the backend disk corresponding to the target hard drive; at the same time, maintaining data consistency can ensure data security during virtual machine hot migration; thus, it achieves the technical effect of improving data consistency and accelerating performance, and solves the technical problems of low data consistency and low acceleration performance in existing technologies.

[0118] Figure 6 This is a hardware structure diagram of the control device for device storage provided in an embodiment of this application. (See diagram below.) Figure 6 As shown, the control device 600 stored in the device includes:

[0119] Processor 601 and memory 602;

[0120] The memory stores the instructions that the computer executes;

[0121] The processor executes computer execution instructions stored in memory 602, causing the control device stored in the device storage to perform the control method stored in the device storage as described above.

[0122] It should be understood that the processor 601 described above can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The memory 602 may include high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.

[0123] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement a control method for device storage.

[0124] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0125] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0126] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.

[0127] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.

[0128] When an integrated unit / module is implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, the storage unit can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc.

[0129] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0130] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

[0131] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0132] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A control method for device storage, characterized in that, include: The storage information of the target device is collected. Based on the number of hard drives in the storage information, the target hard drive that can be used for cache mode switching is determined, and the interface of the corresponding target hard drive is called to determine the storage status of the target hard drive corresponding to the target device. Determine whether the health status value corresponding to the storage state is greater than a preset threshold; If yes, then when the storage state meets the preset conditions and the cache mode of the target device is write-through mode, the cache mode of the target device is controlled to be write-back mode; if no, then when the storage state does not meet the preset conditions and the cache mode of the target device is write-back mode, the cache mode of the target device is controlled to be write-through mode. The direct write mode writes data to both the cache disk and the back-end disk simultaneously, while the write-back mode writes data directly to the cache disk. The cache disk is a solid-state drive (SSD) and the back-end disk is a hard disk drive (HDD).

2. The method according to claim 1, characterized in that, in, The direct write mode is used to accelerate read operations in the target device; the write-back mode is used to accelerate both read and write operations in the target device.

3. The method according to claim 1, characterized in that, The storage information includes: the number of hard drives in the target device, the hard drive partition information in the target device, and the hard drive interface information of the target device. The step of determining the target hard drive that can be used for cache mode switching based on the number of hard drives in the storage information, and calling the interface of the corresponding target hard drive to determine the storage status of the target hard drive corresponding to the target device, includes: At least one target hard drive is determined based on the number of hard drives and hard drive partitioning information in the storage information; Based on a preset time interval and the hard drive interface information of the target hard drive, the corresponding interface of the target hard drive is called to obtain the storage status of the target hard drive.

4. The method according to claim 1, characterized in that, After setting the cache mode of the target device to write-back mode, the method further includes: When the target device needs to perform virtual machine hot migration, the cache mode of the target device is controlled to be the write-through mode.

5. The method according to claim 1 or 4, characterized in that, After setting the cache mode of the target device to the write-through mode, the method further includes: Determine whether there is dirty data in the cache disk of the target device. If so, update the dirty data to the backend disk corresponding to the cache disk. The cache disk is used to store temporary data; the backend disk is used to store long-term data.

6. A control device for device storage, characterized in that, include: The acquisition module is used to acquire the storage information of the target hard drive of the target device, determine the target hard drive that can be used for cache mode switching based on the number of hard drives in the storage information, and call the interface of the corresponding target hard drive to determine the storage status of the target hard drive corresponding to the target device. The judgment module is used to determine whether the health status value corresponding to the storage state is greater than a preset threshold. The processing module is configured to control the cache mode of the target device to write-back mode when the storage state meets the preset conditions and the cache mode of the target device is write-through mode; and to control the cache mode of the target device to write-through mode when the storage state does not meet the preset conditions and the cache mode of the target device is write-back mode. The direct write mode writes data to both the cache disk and the back-end disk simultaneously, while the write-back mode writes data directly to the cache disk. The cache disk is a solid-state drive (SSD) and the back-end disk is a hard disk drive (HDD).

7. A control device for device storage, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the device storage control method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the device storage control method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Background migration of virtual storage

    CN102741820A

  • Hard disk health state monitoring method and hard disk health state monitoring device

    CN104951383A

  • Systems, devices and methods using solid state devices as a caching medium with adaptive striping and mirroring regions

    US10019362B1