Data dynamic storage method of disk array and electronic equipment
By creating hot and cold data tables in the disk array and dynamically migrating data blocks according to access frequency, the problem of uneven distribution of storage resources is solved, data read and write performance and system fault tolerance are improved, and operating costs are reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JINAN MAIWEI INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-04-21
AI Technical Summary
In large-scale data environments, hot and cold data are difficult to identify and process accurately, resulting in uneven allocation of storage resources, affecting data read and write speed and response time. The lack of an effective dynamic data migration mechanism limits system performance and makes it difficult to meet the needs of high-performance computing and big data processing.
By creating cold and hot data tables in the disk array, data blocks are dynamically identified and migrated based on their access frequency. Cold data blocks are stored on low-cost storage devices, while hot data blocks are stored on high-performance storage devices. The dynamic migration of data blocks is achieved using an access count threshold mechanism.
It improves the utilization efficiency of storage resources, reduces the access latency of hot data blocks, enhances the system's data read and write performance, reduces operating costs, strengthens the system's fault tolerance, and optimizes storage resource allocation.
Smart Images

Figure CN121900704A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, and in particular to a method and electronic device for dynamic data storage of a disk array. Background Technology
[0002] Data storage technology encompasses methods for storing, retrieving, and managing data, involving various storage systems, including hard disk drives, solid-state drives, optical storage devices, and tape drives. Furthermore, data storage technology includes data organization and formatting techniques, as well as algorithms and strategies designed to ensure data security, achieve data compression, and data backup.
[0003] In large-scale data environments, related technologies have many limitations in data management. On the one hand, hot and cold data are difficult to identify and process accurately, leading to uneven allocation of storage resources, which in turn affects data read / write speed and response time. On the other hand, the lack of an effective dynamic data migration mechanism limits system performance and significantly increases data read / write response latency in data-intensive operations. These technical shortcomings are particularly prominent in high-performance computing and big data processing scenarios, making it difficult to meet the urgent needs of modern data centers for high efficiency and low cost. Summary of the Invention
[0004] This application provides a method and electronic device for dynamic data storage of disk arrays, so as to at least solve the problems of uneven allocation of storage resources and low data read and write efficiency in related technologies.
[0005] This application provides a method for dynamically storing data in a disk array. The disk array includes a cold data storage device and a hot data storage device. The cold data storage device is used to store cold data blocks recorded in a cold data table, and the hot data storage device is used to store hot data blocks recorded in a hot data table. The method for dynamically storing data includes: In response to an access operation to a target data block in the disk array, identify the data table where the currently accessed target data block is currently located; If the target data block is neither in the hot data table nor in the cold data table, add the target data block to the header of the cold data table, update the recent access count of the target data block, and store the target data block in the cold data storage device; If the target data block is located in the hot data table, update the recent access count of the target data block and move the position of the target data block in the hot data table to the head of the hot data table; If the target data block is located in the cold data table, update the recent access count of the target data block; In response to the recent access count of the target data block in the cold data table reaching the current access count threshold, the target data block is moved from the cold data table to the hot data table, and the target data block is migrated from the cold data storage device to the hot data storage device for storage.
[0006] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described disk array dynamic data storage methods.
[0007] According to the dynamic data storage method for disk arrays in this application, in response to access operations of target data blocks in the disk array, intelligent identification of cold and hot data blocks is achieved through cold data tables and hot data tables. The recent access count of the currently accessed target data block is updated, and the target data block is dynamically migrated between the cold and hot data tables based on the recent access count. This achieves dynamic migration and storage of target data blocks between cold and hot data storage devices, improving the resource utilization efficiency of the disk array's storage resources and alleviating the problem of uneven allocation of storage resources in the disk array. By storing hot data blocks to hot data storage devices and cold data blocks to cold data storage devices based on the recent access count, the access latency of hot data blocks is reduced, improving the overall system data read and write performance. It also reduces the unnecessary occupation of high-performance storage resources by cold data blocks, enhances the system's fault tolerance, reduces operating costs, and improves storage efficiency. Attached Figure Description
[0008] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 This is a schematic diagram of the system architecture of a dynamic data storage system according to an embodiment of this application; Figure 2 A flowchart illustrating a method for dynamically storing data in a disk array, as provided in an embodiment of this application; Figure 3 This is a flowchart illustrating an access count threshold update method in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a disk array dynamic data storage device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0010] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0011] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0012] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0013] Figure 1 This is a schematic diagram of the system architecture of a dynamic data storage system according to an embodiment of this application, such as... Figure 1 As shown, the dynamic data storage system includes a server 101 and a disk array 102.
[0014] Server 101 is responsible for running the operating system and storage management software, handling data read and write requests from upper-layer services to the data stored in disk array 102, and controlling data migration, scheduling, caching, and fault handling in disk array 102.
[0015] Disk array 102 can employ a Redundant Array of Independent Disks (RAID). RAID utilizes virtualization storage technology to combine multiple hard drives into one or more disk array groups to improve performance or data redundancy. RAID combines multiple hard drives into a single logical hard drive; therefore, the operating system treats it only as a single physical hard drive.
[0016] The disk array 102 includes a cold data storage device 1021 and a hot data storage device 1022. The cold data storage device 1021 is used to store cold data in the disk array, and the hot data storage device 1022 is used to store hot data in the disk array.
[0017] Cold data refers to data in disk array 102 that is accessed infrequently and is not frequently used. This data is typically historical records, archived files, or inactive items. Although it may still have significant value in some cases, it is classified as cold data due to the lack of frequent access requirements. Cold data is usually stored on lower-cost, slower-performing storage media, such as magnetic tape or traditional hard drives, to save storage costs and resources. This classification helps optimize storage management strategies, allowing hot and cold data to be effectively allocated to appropriate storage tiers based on access frequency, thereby improving overall system performance and efficiency.
[0018] Hot data refers to data that is frequently accessed and used in a data storage system. This data is typically closely related to current business activities, such as real-time transaction records, user activity logs, or data from running applications. Due to frequent access demands, hot data is usually stored on high-performance storage media, such as solid-state drives (SSDs) or caches, to ensure fast read / write speeds and low latency. Effectively managing hot data is crucial for improving application performance, enhancing user experience, and optimizing system responsiveness. Separating hot data from cold data enables more efficient resource utilization and cost control.
[0019] In large-scale data environments, related technologies have many limitations in data management. On the one hand, hot and cold data are difficult to identify and process accurately, leading to uneven allocation of storage resources, which in turn affects data read / write speed and response time. On the other hand, the lack of an effective dynamic data migration mechanism limits system performance and significantly increases data read / write response latency in data-intensive operations. These technical shortcomings are particularly prominent in high-performance computing and big data processing scenarios, making it difficult to meet the urgent needs of modern data centers for high efficiency and low cost.
[0020] Therefore, this application provides a method and electronic device for dynamic data storage of disk arrays, which aims to effectively improve the problems of uneven allocation of storage resources and low data read and write efficiency in related technologies.
[0021] This application provides a method for dynamic data storage of a disk array, which can be applied to the aforementioned server. Figure 2 This is a flowchart illustrating a dynamic data storage method for a disk array provided in an embodiment of this application, as shown below. Figure 2 As shown, the disk array includes a cold data storage device and a hot data storage device. The cold data storage device is used to store cold data blocks recorded in the cold data table, and the hot data storage device is used to store hot data blocks recorded in the hot data table. This dynamic data storage method includes, but is not limited to, the following steps S201 to S204.
[0022] Step S201: In response to the access operation of the target data block in the disk array, identify the data table where the currently accessed target data block is located.
[0023] In this embodiment of the application, a hot data table and a cold data table are pre-created and maintained. The hot data table is used to record hot data blocks, which are data blocks whose recent access count has reached the corresponding access count threshold. The cold data table is used to record cold data blocks, which are data blocks whose recent access count is lower than the corresponding access count threshold. The recent access count refers to the number of times the data block has been accessed within the most recent time period (such as the most recent hour, 12 hours, or day).
[0024] When a user accesses data stored on a disk array through the server, in response to the access operation of the target data block in the disk array, the data table where the currently accessed target data block is located is identified, that is, whether the currently accessed target data block is located in a hot data table or a cold data table.
[0025] Step S202: If the target data block is not located in the hot data table and not located in the cold data table, add the target data block to the header of the cold data table, update the recent access count of the target data block, and store the target data block in the cold data storage device.
[0026] If the target data block is neither in a hot table nor a cold table, it means that the target data block is being accessed for the first time or has been previously removed from either the hot or cold table. Its recent access count is reset to 0, meaning it is neither a hot nor a cold data block. In this case, since the target data block is being accessed for the first time and its recent access count has not reached the corresponding access threshold, the target data block is first added to the cold table and inserted into the table header. Simultaneously, its recent access count is updated by incrementing by 1, and the target data block is then stored in the cold data storage device.
[0027] Step S203: If the target data block is located in the hot data table, update the recent access count of the target data block and move the position of the target data block in the hot data table to the head of the hot data table.
[0028] If the target data block is located in the hot data table, it means that the recent access count of the target data block has reached the corresponding access count threshold. It has been previously classified as a hot data block and stored in the hot data storage device. Therefore, it is only necessary to update the recent access count of the target data block according to the access operation of the target data block, increment the recent access count of the target data block by 1, and move the position of the target data block in the hot data table to the head of the hot data table.
[0029] Step S204: If the target data block is located in a cold data table, update the recent access count of the target data block.
[0030] If the target data block is located in a cold data table, it means that the recent access count of the target data block is lower than the corresponding access count threshold. It has been previously classified as a cold data block and stored in a cold data storage device. Therefore, it is only necessary to update the recent access count of the target data block based on the current access operation to the target data block by incrementing the recent access count of the target data block by 1.
[0031] In step S205, in response to the recent access count of the target data block in the cold data table reaching the current access count threshold, the target data block is moved from the cold data table to the hot data table, and the target data block is migrated from the cold data storage device to the hot data storage device for storage.
[0032] If the target data block is located in a cold data table, after updating the recent access count of the target data block, it is necessary to determine whether the recent access count of the target data block in the cold data table has reached the current access count threshold. If the recent access count of the target data block in the cold data table has reached the current access count threshold, it means that the recent access count of the target data block is high. Therefore, the target data block is changed from a cold data block to a hot data block, and the target data block is moved from the cold data table to the hot data table and then migrated from the cold data storage device to the hot data storage device.
[0033] According to the data dynamic storage method of this application embodiment, in response to the access operation of the target data block in the disk array, the method intelligently identifies cold and hot data blocks through cold data tables and hot data tables, updates the recent access count of the currently accessed target data block, and dynamically migrates the target data block between the cold data table and the hot data table based on the recent access count. This achieves dynamic migration and storage of the target data block between cold data storage devices and hot data storage devices, improving the resource utilization efficiency of the disk array's storage resources and alleviating the problem of uneven allocation of storage resources in the disk array. By storing hot data blocks to hot data storage devices and cold data blocks to cold data storage devices based on the recent access count, the access latency of hot data blocks is reduced, improving the overall system data read and write performance. It also reduces the unnecessary occupation of high-performance storage resources by cold data blocks, enhances the system's fault tolerance, reduces operating costs, and improves storage efficiency.
[0034] In practical applications, it has extremely important application value in enterprise-level storage scenarios with extremely high requirements for data reliability and performance, such as data centers, servers, and high-performance computing environments.
[0035] In some embodiments, if the target data block is located in a cold data table, after updating the recent access count of the target data block, the data dynamic storage method further includes: in response to the recent access count of the target data block in the cold data table being lower than the current access count threshold, moving the position of the target data block in the cold data table to the head of the cold data table.
[0036] When the recent access count of a target data block in a cold data table is lower than the current access count threshold, it means that the recent access count of that target data block has not yet met the criteria for a hot data block, and data migration is not required for the time being. Therefore, the position of the target data block in the cold data table is moved to the head of the cold data table to update the latest access time order of each data block in the cold data table. This can be understood as the most recently accessed data block in the cold data table being located at the head, while the data block whose last access time is oldest is located at the tail. Since the capacity of the cold data table is limited, to ensure that the hot / cold status of the most recently accessed data blocks can be recorded, the most recently accessed data block is moved to the head of the cold data table each time a data block is accessed. This allows the data block with the oldest last access time to be easily cleared according to the First-In-First-Out (FIFO) strategy when the number of data blocks recorded in the cold data table reaches the threshold, making room for newly added cold data blocks and improving resource utilization.
[0037] In some embodiments, in step S205 above, moving the target data block from the cold data table to the hot data table includes: checking whether the number of data blocks recorded in the hot data table has reached a first quantity threshold; in response to the number of data blocks recorded in the hot data table not reaching the first quantity threshold, performing the step of moving the target data block from the cold data table to the hot data table; in response to the number of data blocks recorded in the hot data table reaching the first quantity threshold, removing the last data block in the hot data table from the hot data table, and performing the step of moving the target data block from the cold data table to the hot data table.
[0038] To ensure the smooth data migration after cold data blocks become hot data blocks, before moving the target data block from the cold data table to the hot data table, it is necessary to check whether the number of data blocks recorded in the hot data table has reached a first threshold, i.e., whether the capacity of the hot data table has reached the threshold. When the number of data blocks recorded in the hot data table has not reached the first threshold, the target data block can be directly moved from the cold data table to the hot data table. However, when the number of data blocks recorded in the hot data table has reached the first threshold, the last data block in the hot data table (i.e., the data block whose last access time is the longest from the current time) is removed from the hot data table, and then the target data block is moved from the cold data table to the hot data table, thus ensuring the smooth data migration.
[0039] In some embodiments, after the last data block in the hot data table is removed from the hot data table, the data dynamic storage method further includes: migrating the data block removed from the hot data table from the hot data storage device to a cold data storage device for storage.
[0040] The data block removed from the hot data table refers to the data block whose last access time is the longest in the hot data table. This indicates that the data block is currently accessed less frequently. Therefore, the recent access count of the data block can be reset to zero, and the data block can be migrated from the hot data storage device to the cold data storage device to reduce the storage resources occupied by this type of data block on the hot data storage device.
[0041] In some embodiments, in step S202 above, adding the target data block to the header of the cold data table includes: checking whether the number of data blocks recorded in the cold data table has reached a second quantity threshold; in response to the number of data blocks recorded in the cold data table not reaching the second quantity threshold, performing the step of adding the target data block to the header of the cold data table; in response to the number of data blocks recorded in the cold data table reaching the second quantity threshold, removing the last data block in the cold data table from the cold data table, and performing the step of adding the target data block to the header of the cold data table.
[0042] In step S202 above, the target data block currently being accessed is neither in the hot data table nor in the cold data table, indicating that the target data block is a new cold data block and needs to be added to the cold data table. Before adding the target data block to the cold data table, it is necessary to check whether the number of data blocks recorded in the cold data table has reached the second quantity threshold, that is, whether the capacity of the cold data table has reached the threshold. When the number of data blocks recorded in the cold data table has not reached the second quantity threshold, the target data block can be directly added to the cold data table. When the number of data blocks recorded in the cold data table has reached the second quantity threshold, the last data block in the cold data table (that is, the data block whose last access time is the longest since the current time) is removed from the cold data table, and then the target data block is added to the cold data table, thereby ensuring the normal recording of the newly added cold data block.
[0043] Figure 3 This is a flowchart illustrating one method for updating the access count threshold in an embodiment of this application. In some embodiments, such as... Figure 3 As shown, the dynamic data storage method also includes: Step S301: Obtain the current data access frequency of the disk array, the storage load of the hot data storage device, and the average data migration cost.
[0044] The average data migration cost can include average data migration time, average IO utilization, etc.
[0045] In some embodiments, obtaining the current data access frequency of the disk array, the storage load of the hot data storage device, and the average data migration cost includes: periodically obtaining the current data access frequency of the disk array, the storage load of the hot data storage device, and the average data migration cost according to a preset period.
[0046] By periodically acquiring the current data access frequency of the disk array, the storage load of hot data storage devices, and the average data migration cost, the current access frequency threshold can be updated periodically.
[0047] Step S302: Determine the first threshold number corresponding to the current data access frequency based on the current data access frequency of the disk array.
[0048] A pre-configured mapping relationship between data access frequency and number threshold is provided. The higher the data access frequency, the smaller the corresponding first number threshold K1, thus avoiding the omission of hot data blocks.
[0049] In step S302, the first threshold K1 corresponding to the current data access frequency is determined based on the current data access frequency of the disk array and the mapping relationship between the data access frequency and the number threshold.
[0050] Step S303: Determine the second threshold value corresponding to the current storage load based on the storage load of the hot data storage device.
[0051] The system has a pre-configured mapping relationship between storage load and number of times threshold. The higher the storage load, the larger the corresponding second number threshold K2, which can reduce invalid data migration.
[0052] In step S303, the second number threshold K2 corresponding to the current storage load is determined based on the storage load of the hot data storage device and the mapping relationship between the storage load and the number threshold.
[0053] Step S304: Determine the threshold number of the third number corresponding to the average data migration cost based on the average data migration cost.
[0054] The system has a pre-configured mapping relationship between average data migration cost and number of migration thresholds. The higher the average data migration cost, the larger the corresponding third migration threshold K3, which can reduce the data migration frequency.
[0055] In step S304, the third threshold K3 corresponding to the average data migration cost is determined based on the average data migration cost and the mapping relationship between the average data migration cost and the number threshold.
[0056] Step S305: Determine the current access count threshold based on the first access threshold, the second access threshold, and the third access threshold.
[0057] Set a range for the current access count threshold K, for example, 1≤K≤5, balancing performance and overhead. Calculate the current access count threshold K using a preset weighting formula, which is expressed as: K = α × K1 + β × K2 + γ × K3, where α + β + γ = 1, α is the weight of the first count threshold K1, β is the weight of the second count threshold K2, and γ is the weight of the third count threshold K3, which can be preset and dynamically adjusted according to the business scenario.
[0058] When the calculated K value is not an integer, the calculated K value can be rounded down or up to obtain the current access count threshold K.
[0059] Dynamically updating the access count threshold used to distinguish between cold and hot data blocks by updating the access count threshold in the above-mentioned way can help reduce the missed detection of hot data, reduce cache pollution, and improve data migration efficiency.
[0060] In some embodiments, the disk array is a redundant disk array RAID with independent hard drives, the cold data storage device is a mechanical hard drive, and the hot data storage device is a cache solid-state drive.
[0061] For example, a mechanical hard drive is a Hard Disk Drive (HDD) based on the Serial ATA (SATA) interface, while a cache solid-state drive is a solid-state drive (SSD) based on the Non-Volatile Memory Express (NVMe) protocol.
[0062] In this embodiment of the application, the data block is the smallest unit of data processing in the LRU-K algorithm, and its specific data structure is as follows: struct LRUNode { uint32_t StartAddress; uint32_t Size; uint8_t Times; struct LRUNode *Next; struct LRUNode *Pre; }; The data structure reveals that the cold and hot data tables use doubly linked lists. `StartAddress` records the starting position of a data block within the disk array, `Size` records the block size, `Times` records the number of times the block is accessed, and `Next` and `Pre` record the adjacent blocks. When a data block is migrated from a cold to a hot table, or vice versa, its `StartAddress` changes to the new address of the migrated block, and the `StartAddress`s of adjacent blocks in the corresponding tables also change.
[0063] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0064] This embodiment also provides a dynamic data storage device for a disk array, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0065] This application embodiment also provides a dynamic data storage device for a disk array. The disk array includes a cold data storage device and a hot data storage device. The cold data storage device is used to store cold data blocks recorded in a cold data table, and the hot data storage device is used to store hot data blocks recorded in a hot data table. Figure 4 This is a schematic diagram of the structure of a disk array dynamic data storage device provided in an embodiment of this application, as shown below. Figure 4 As shown, the data dynamic storage device of the disk array includes: The hot and cold data identification module 401 is used to identify the data table where the currently accessed target data block is located in response to an access operation to a target data block in the disk array. The cold data processing module 402, if the target data block is not located in the hot data table and not located in the cold data table, adds the target data block to the header of the cold data table, updates the recent access count of the target data block, and stores the target data block in the cold data storage device. The hot data processing module 403 updates the recent access count of the target data block if the target data block is located in the hot data table, and moves the position of the target data block in the hot data table to the head of the hot data table. The cold data processing module 402 is also used to update the recent access count of the target data block if the target data block is located in a cold data table; The data migration module 404 is used to move the target data block from the cold data table to the hot data table in response to the recent access count of the target data block in the cold data table reaching the current access count threshold, and to migrate the target data block from the cold data storage device to the hot data storage device for storage.
[0066] In some embodiments, the data migration module 404 is used to check whether the number of data blocks recorded in the hot data table has reached a first quantity threshold; in response to the number of data blocks recorded in the hot data table not reaching the first quantity threshold, the step of moving the target data block from the cold data table to the hot data table is executed; in response to the number of data blocks recorded in the hot data table reaching the first quantity threshold, the last data block in the hot data table is removed from the hot data table, and the step of moving the target data block from the cold data table to the hot data table is executed.
[0067] In some embodiments, the data migration module 404 is further configured to migrate data blocks removed from the hot data table from the hot data storage device to the cold data storage device for storage.
[0068] In some embodiments, the cold data processing module 402 is further configured to: check whether the number of data blocks recorded in the cold data table reaches a second quantity threshold; in response to the number of data blocks recorded in the cold data table not reaching the second quantity threshold, perform the step of adding the target data block to the header of the cold data table; in response to the number of data blocks recorded in the cold data table reaching the second quantity threshold, remove the last data block in the cold data table from the cold data table, and perform the step of adding the target data block to the header of the cold data table.
[0069] In some embodiments, the data dynamic storage device further includes a threshold update module, which is configured to: obtain the current data access frequency of the disk array, the storage load of the hot data storage device, and the average data migration overhead; determine a first threshold corresponding to the current data access frequency based on the current data access frequency of the disk array; determine a second threshold corresponding to the current storage load based on the storage load of the hot data storage device; determine a third threshold corresponding to the current average data migration overhead based on the average data migration overhead; and determine a current access count threshold based on the first, second, and third thresholds.
[0070] In some embodiments, the threshold update module is used to periodically obtain the current data access frequency of the disk array, the storage load of the hot data storage device, and the average data migration cost according to a preset period.
[0071] In some embodiments, the cold data processing module 402 is further configured to, if the target data block is located in a cold data table, after updating the recent access count of the target data block, move the position of the target data block in the cold data table to the head of the cold data table in response to the recent access count of the target data block in the cold data table being lower than the current access count threshold.
[0072] The data dynamic storage device provided in this application embodiment can execute the data transmission method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0073] Embodiments of this application also provide an electronic device. Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 5 As shown, it includes a memory 10 and a processor 20. The memory 10 stores a computer program, and the processor 20 is configured to run the computer program to perform the steps in any of the above-described embodiments of the dynamic data storage method.
[0074] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described embodiments of the dynamic data storage method when running.
[0075] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0076] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described embodiments of the dynamic data storage method.
[0077] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described embodiments of the dynamic data storage method.
[0078] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0079] The above provides a detailed description of a dynamic data storage method for a disk array provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for dynamically storing data in a disk array, characterized in that, The disk array includes a cold data storage device and a hot data storage device. The cold data storage device is used to store cold data blocks recorded in a cold data table, and the hot data storage device is used to store hot data blocks recorded in a hot data table. The method includes: In response to an access operation to a target data block in the disk array, identify the data table where the currently accessed target data block is currently located; If the target data block is neither in the hot data table nor in the cold data table, add the target data block to the header of the cold data table, update the recent access count of the target data block, and store the target data block in the cold data storage device; If the target data block is located in the hot data table, update the recent access count of the target data block and move the position of the target data block in the hot data table to the head of the hot data table; If the target data block is located in the cold data table, update the recent access count of the target data block; In response to the recent access count of the target data block in the cold data table reaching the current access count threshold, the target data block is moved from the cold data table to the hot data table, and the target data block is migrated from the cold data storage device to the hot data storage device for storage.
2. The data dynamic storage method according to claim 1, characterized in that, Moving the target data block from the cold data table to the hot data table includes: Check whether the number of data blocks recorded in the heat data table has reached the first quantity threshold; In response to the fact that the number of data blocks recorded in the hot data table has not reached a first quantity threshold, the step of moving the target data block from the cold data table to the hot data table is executed.
3. The data dynamic storage method according to claim 2, characterized in that, After checking whether the number of data blocks recorded in the hot data table has reached a first quantity threshold, the method further includes: In response to the number of data blocks recorded in the hot data table reaching a first quantity threshold, the last data block in the hot data table is removed from the hot data table, and the step of moving the target data block from the cold data table to the hot data table is performed.
4. The data dynamic storage method according to claim 3, characterized in that, After removing the last data block from the hot data table, the method further includes: Data blocks removed from the hot data table are migrated from the hot data storage device to the cold data storage device.
5. The data dynamic storage method according to claim 1, characterized in that, Adding the target data block to the header of the cold data table includes: Check whether the number of data blocks recorded in the cold data table has reached the second quantity threshold; In response to the fact that the number of data blocks recorded in the cold data table has not reached the second quantity threshold, the step of adding the target data block to the header of the cold data table is performed.
6. The data dynamic storage method according to claim 5, characterized in that, After checking whether the number of data blocks recorded in the cold data table has reached the second quantity threshold, the method further includes: In response to the number of data blocks recorded in the cold data table reaching a second quantity threshold, the last data block in the cold data table is removed from the cold data table, and the step of adding the target data block to the header of the cold data table is performed.
7. The data dynamic storage method according to claim 1, characterized in that, The method further includes: Obtain the current data access frequency of the disk array, the storage load of hot data storage devices, and the average data migration cost; Based on the current data access frequency of the disk array, determine the first threshold number corresponding to the current data access frequency; Based on the storage load of the hot data storage device, determine the second threshold value corresponding to the current storage load; Based on the average data migration cost, determine the threshold value of the third number corresponding to the current average data migration cost; The current access count threshold is determined based on the first access count threshold, the second access count threshold, and the third access count threshold.
8. The data dynamic storage method according to claim 7, characterized in that, The acquisition of the current data access frequency of the disk array, the storage load of the hot data storage device, and the historical average data migration cost includes: According to a preset cycle, the current data access frequency of the disk array, the storage load of hot data storage devices, and the average data migration cost are obtained periodically.
9. The data dynamic storage method according to claim 1, characterized in that, If the target data block is located in a cold data table, after updating the recent access count of the target data block, the dynamic data storage method further includes: In response to the target data block in the cold data table having a recent access count lower than the current access count threshold, the target data block in the cold data table is moved to the head of the cold data table.
10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the dynamic data storage method for a disk array as described in any one of claims 1 to 9 when executing the computer program.