A data management method, device, medium and program product

By dynamically adjusting the enable status of the two-layer system cache based on the characteristic information of the target volume, the storage performance degradation caused by the cached large amount of data communication between the two-layer system is solved, and more efficient storage performance is achieved.

CN119556864BActive Publication Date: 2025-05-23INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411958343.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-05-23
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

Due to the complicated message notification mechanism of the two-layer system cache architecture, multiple message communication is required when data is cached from the upper layer to the lower layer cache, which reduces storage performance.

Method used

Based on the characteristic information of the target volume, determine whether to enable two-layer system cache through preset judgment rules. If the storage method corresponding to the target volume is to disable the two-tier system cache, directly write the data to or read the data from the disk to avoid multiple message communication.

Benefits of technology

By flexibly configuring the storage method, the performance reduction caused by cached large amounts of data communication between the two-layer system is avoided, and the performance of the storage system is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119556864B_ABST
    Figure CN119556864B_ABST
Patent Text Reader

Abstract

The present application discloses a data management method, device, medium and program product, which relate to the field of cache technology. The method includes: according to the characteristic information of the created target volume, determining the storage method corresponding to the target volume through preset judgment rules; the characteristic information includes the volume type and / or the current business scenario; if the storage method corresponding to the target volume is to disable the two-layer system cache, then according to the read / write request corresponding to the target volume, the data to be stored is directly written to the disk, or the data is directly read from the disk; if the storage method corresponding to the target volume is to enable the two-layer system cache, then the read / write request corresponding to the target volume is executed based on the two-layer system cache. According to the volume type and business scenario corresponding to the target volume, a suitable storage method is flexibly and dynamically configured for the target volume to improve the performance of the storage system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cache technology, and in particular to a data management method, device, medium and program product. Background Art

[0002] The existence of cache can improve IO read and write performance. However, with the increasing storage demand, the impact on storage IO read and write performance is also increasing. In order to reduce the impact on performance, the related technology further proposes a two-layer system cache technology. The two-layer system cache is divided into an upper cache and a lower cache. The upper cache is allocated with less memory, and the lower cache is allocated with a larger memory. After the IO is written to the upper cache, the upper cache submits the IO to the lower cache. When the lower cache is full, the cached data will be written to the disk. However, the two-layer cache architecture has a complicated message notification mechanism. It may take 8 message communications for data to be written from the upper cache to the lower cache. If all data uses the two-layer system cache mechanism, the large amount of data communication generated will reduce storage performance. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a data management method, device, medium and program product, which can improve the performance of the storage system. The specific scheme is as follows:

[0004] In a first aspect, the present application discloses a data management method, comprising:

[0005] According to the characteristic information of the created target volume, the storage mode corresponding to the target volume is determined by a preset judgment rule; the characteristic information includes the volume type and / or the current business scenario; the storage mode includes enabling the two-layer system cache and disabling the two-layer system cache;

[0006] If the storage mode corresponding to the target volume is to disable two-layer system cache, the data to be stored is directly written to the disk, or the data is directly read from the disk according to the read / write request corresponding to the target volume;

[0007] If the storage mode corresponding to the target volume is to enable two-layer system cache, the read / write request corresponding to the target volume is executed based on the two-layer system cache.

[0008] Optionally, according to the characteristic information of the created target volume, determining the storage mode corresponding to the target volume by using a preset judgment rule includes:

[0009] Identify the volume type of the target volume, and determine whether the target volume is a non-advanced feature volume according to the volume type; the non-advanced feature volume includes a self-thin volume, a compressed volume, a mirror volume, and a thin pool thin volume;

[0010] If the target volume is a non-advanced feature volume, determining that the storage mode corresponding to the target volume is to enable two-layer system cache;

[0011] If the target volume does not belong to a non-advanced feature volume, it is determined that the storage mode corresponding to the target volume is to disable two-layer system cache.

[0012] Optionally, according to the characteristic information of the created target volume, determining the storage mode corresponding to the target volume by using a preset judgment rule includes:

[0013] Monitoring the current business scenario corresponding to the target volume;

[0014] The storage mode corresponding to the target volume is determined according to the current business scenario and the correspondence between the preconfigured business scenario and the storage mode.

[0015] Optionally, according to the characteristic information of the created target volume, determining the storage mode corresponding to the target volume by using a preset judgment rule includes:

[0016] Monitoring the current business scenario, and determining a preliminary storage method corresponding to the target volume according to the current business scenario;

[0017] If the preliminary storage mode is to enable two-layer system cache, determining that the storage mode corresponding to the target volume is to enable two-layer system cache;

[0018] If the initial storage mode is to disable two-layer system cache, the storage mode corresponding to the target volume is determined according to the volume type of the target volume.

[0019] Optionally, determining a preliminary storage mode corresponding to the target volume according to the current business scenario includes:

[0020] If the current business scenario is snapshot startup, determining that the preliminary storage mode corresponding to the target volume is to enable two-layer system cache;

[0021] If the current business scenario is snapshot stop, it is determined that the initial storage mode corresponding to the target volume is to disable two-layer system cache.

[0022] Optionally, determining a preliminary storage mode corresponding to the target volume according to the current business scenario includes:

[0023] If the current business scenario is adding a mirrored volume, determining that the initial storage mode corresponding to the target volume is to enable two-layer system cache;

[0024] If the current business scenario is image volume deletion, it is determined that the initial storage mode corresponding to the target volume is to disable two-layer system cache.

[0025] Optionally, the data management method further includes:

[0026] Get the storage mode configured by the user for the target volume.

[0027] Optionally, after determining the storage mode corresponding to the target volume by using a preset judgment rule, the method further includes:

[0028] Update the cache flag corresponding to the target volume according to the storage mode; the cache flag is used to represent the storage mode;

[0029] A read / write request corresponding to the target volume is obtained, and a corresponding identifier is added to the read / write request according to the cache flag, so as to process the read / write request accordingly according to the identifier.

[0030] Optionally, directly reading data from the disk according to the read request corresponding to the target volume includes:

[0031] Obtaining a read request corresponding to the target volume, and determining, according to an identifier corresponding to the read request, whether the read request corresponds to disabling a two-layer system cache;

[0032] If the read request corresponds to disabling two layers of system cache, directly reading data from the disk according to the read request;

[0033] Optionally, according to the write request corresponding to the target volume, directly writing the data to be stored to the disk includes:

[0034] Obtaining a write request corresponding to the target volume, and determining, according to an identifier corresponding to the write request, whether the write request corresponds to disabling a two-layer system cache;

[0035] If the write request corresponds to disabling two layers of system cache, the data to be stored included in the write request is directly written to the disk.

[0036] Optionally, according to the read / write request corresponding to the target volume, directly writing the data to be stored to the disk includes:

[0037] Obtaining an input / output request for the target volume;

[0038] The input / output request is split according to size granularity, and the sub-input / output requests obtained by the split are used as the read / write request.

[0039] Optionally, before directly writing the data to be stored to the disk, the following steps are also included:

[0040] Performing a dirty data flushing operation on the target volume;

[0041] After all dirty data is flushed, the data to be stored is directly written to the disk.

[0042] In a second aspect, the present application discloses an electronic device, comprising:

[0043] Memory, used to store computer programs;

[0044] The processor is used to execute the computer program to implement the aforementioned data management method.

[0045] In a third aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program implements the aforementioned data management method when executed by a processor.

[0046] In a third aspect, the present application discloses a computer program product, including a computer program, which implements the aforementioned data management method when executed by a processor.

[0047] In the present application, according to the characteristic information of the created target volume, the storage method corresponding to the target volume is determined by a preset judgment rule; the characteristic information includes the volume type and / or the current business scenario; if the storage method corresponding to the target volume is to disable the two-layer system cache, then according to the read / write request corresponding to the target volume, the data to be stored is directly written to the disk, or the data is directly read from the disk; if the storage method corresponding to the target volume is to enable the two-layer system cache, then the read / write request corresponding to the target volume is executed based on the two-layer system cache. It can be seen that according to the volume type and business scenario corresponding to the target volume, a suitable storage method can be flexibly and dynamically configured for the target volume, that is, whether to enable the two-layer system cache, and use the two-layer system cache when necessary, otherwise the two-layer system cache can be directly bypassed to write the data to the disk, and the data can be directly read from the disk, thereby avoiding the process of multiple message communications, solving the problem of storage performance degradation caused by the two-layer system caching a large amount of data, and improving the performance of the storage system. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0049] Figure 1 A flow chart of a data management method provided for this application;

[0050] Figure 2 A flowchart of a specific method for enabling and disabling two-layer system cache according to volume type provided by this application;

[0051] Figure 3A schematic diagram of a specific method for disabling two-layer system caching according to a snapshot service provided in this application;

[0052] Figure 4 A schematic diagram of a specific user-specified method for enabling and disabling a two-layer system cache provided in this application;

[0053] Figure 5 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] In the related art, the two-layer cache architecture has a complicated message notification mechanism. It may take 8 message communications to store data from the upper cache to the lower cache. A large amount of data communication reduces the storage performance. To overcome the above technical problems, this application proposes a data management method that can improve the performance of the storage system.

[0056] The present application discloses a data management method. Figure 1 As shown, the method may include the following steps:

[0057] Step S11: According to the characteristic information of the created target volume, the storage mode corresponding to the target volume is determined by a preset judgment rule; the characteristic information includes the volume type and / or the current business scenario.

[0058] It is understandable that the emergence of advanced features such as self-thinning volumes, mirror volumes, and snapshots in related technologies has a great impact on storage IO read and write performance. In order to reduce the impact of advanced features on performance, a two-layer system cache technology has emerged. The two-layer system cache is divided into an upper cache and a lower cache. The upper cache allocates less memory. After the IO is written to the upper cache, the IO can be terminated. The upper cache then submits the IO to the lower cache. The lower cache allocates a larger memory and can cache more data. After a certain proportion of the lower cache memory is used, the cached data will be written to the disk. However, with the advent of the all-flash era, the two-layer cache architecture has a bottleneck in improving storage performance due to the complicated message notification mechanism. In the two-layer cache architecture, in order to ensure data security, the cache data between the dual-control nodes is backed up. After receiving the write request, the upper cache will send the data to the backup node. After the backup node completes the write, it will notify the local node of the write completion message. After receiving the completion message, the local node will write the data to the local controller. After the upper cache submits the data to the lower cache, the lower cache will repeat the above actions. Thus, a write request requires four message communications. In addition, after the upper cache submits data to the lower cache, it will also notify the peer node of the invalid data. After the local node data of the lower cache is stored on the disk, it will also notify the peer node of the invalid data. For data to be stored from the upper cache to the lower cache, eight message communications are required. The double-layer cache architecture caches too many message communications between the two nodes. With the increase of advanced features, the number of message interactions between the two nodes is increasing, but the number of resources supporting communication between the two nodes is limited. A large number of message interactions will increase the waiting time for communication between the nodes, resulting in reduced IO performance. And with the upgrading of solid-state drive technology, the system caches a large amount of data communication between the two nodes, which reduces storage performance.

[0059] Therefore, in this embodiment, the storage mode of the target volume is first determined based on the characteristic information of the target volume, wherein the storage mode includes enabling two-layer system cache and disabling two-layer system cache, that is, whether to use two-layer system cache. Among them, the characteristic information of the target volume includes the volume type and / or the current business scenario, and the volume type and business scenario can reflect the impact on storage performance, that is, different types of volumes and different business scenarios have different impacts on storage performance. The above-mentioned preset judgment rules are generated according to the degree of impact on performance; for example, by determining which type of volume has a greater impact on performance, a judgment rule for the volume type is formulated; by determining which business scenario has a greater impact on performance, a judgment rule for the business scenario is formulated.

[0060] In some embodiments, according to the characteristic information of the created target volume, the storage mode corresponding to the target volume is determined by a preset judgment rule, which may include: identifying the volume type of the target volume, and judging whether the target volume is a non-advanced feature volume according to the volume type; the non-advanced feature volume includes a self-thinning volume, a compressed volume, a mirror volume, and a thin pool thin volume; if the target volume belongs to a non-advanced feature volume, then the storage mode corresponding to the target volume is determined to enable two-layer system cache; if the target volume does not belong to a non-advanced feature volume, then the storage mode corresponding to the target volume is determined to disable two-layer system cache. In other words, the impact of advanced feature volumes on the storage system is greater. If the target volume belongs to an advanced feature volume, two-layer system cache needs to be used to avoid affecting the storage system; if the target volume does not belong to an advanced feature volume, it indicates that the read and write requests corresponding to the volume have a greater impact on the storage system. At this time, the use of two-layer system cache will increase the number of information communications and reduce storage performance. Therefore, in this case, the present embodiment adopts the method of disabling two-layer system cache, that is, bypassing the two-layer system cache and directly accessing the disk.

[0061] For example Figure 2 As shown, it is a flow chart of the method for enabling and disabling two-layer system cache according to volume type. Specifically, when creating a volume, the type of volume created by the user can be identified. If the volume type is a self-thin volume, a compressed volume, a mirror volume, and a thin volume of a thin pool, the two-layer system cache is not disabled, and a flag for enabling the two-layer system cache is set for the volume. The configuration end notifies the business end of the flag for enabling the two-layer system cache. If the volume type is other types, the two-layer cache is disabled and notified to the business end of the volume.

[0062] In some embodiments, based on the characteristic information of the created target volume, determining the storage method corresponding to the target volume through a preset judgment rule may include: monitoring the current business scenario corresponding to the target volume; determining the storage method corresponding to the target volume according to the current business scenario and the correspondence between the preconfigured business scenario and the storage method. It is understandable that the snapshot start and snapshot stop scenarios have different impacts on the system, so different cache methods can be selected, and the mirror volume addition and mirror volume deletion scenarios also have different impacts on the system, so different cache methods can also be selected.

[0063] Furthermore, the storage method can be determined in combination with the volume type and the business scenario. The above-mentioned determination of the storage method corresponding to the target volume according to the characteristic information of the created target volume by the preset judgment rules may include: monitoring the current business scenario, and determining the preliminary storage method corresponding to the target volume according to the current business scenario; if the preliminary storage method is to enable the two-layer system cache, then determining the storage method corresponding to the target volume is to enable the two-layer system cache; if the preliminary storage method is to disable the two-layer system cache, then determining the storage method corresponding to the target volume according to the volume type of the target volume. That is, first determine the storage method according to the business scenario, if the storage method initially determined is to enable the two-layer system cache, then directly enable the two-layer system cache, if the storage method initially determined is to disable the two-layer system cache, then further determine whether it is necessary to enable the two-layer system cache according to the volume type, if the target volume needs to enable the two-layer system cache, then use the two-layer system cache, if the target volume does not need it, then disable the two-layer system cache.

[0064] Wherein, determining the initial storage mode corresponding to the target volume according to the current business scenario includes: if the current business scenario is snapshot startup, determining the initial storage mode corresponding to the target volume is to enable two-layer system cache; if the current business scenario is snapshot stop, determining the initial storage mode corresponding to the target volume is to disable two-layer system cache. Wherein, determining the initial storage mode corresponding to the target volume according to the current business scenario includes: if the current business scenario is mirror volume addition, determining the initial storage mode corresponding to the target volume is to enable two-layer system cache; if the current business scenario is mirror volume deletion, determining the initial storage mode corresponding to the target volume is to disable two-layer system cache. Specifically, for the scenario of configuring snapshot business, when the snapshot is started, the two-layer system cache of the volume that starts the snapshot data synchronization can be turned on, and after the snapshot data synchronization is completed, the two-layer system cache of the volume that starts the snapshot data synchronization can be disabled according to the volume type; in the scenario of adding a volume copy to a non-mirrored volume to become a mirror volume, the two-layer system cache of the volume is turned on; in the scenario of deleting a volume copy from a mirror volume, the two-layer system cache is disabled according to the type of the remaining subvolume.

[0065] In some embodiments, the above method also includes: obtaining the storage mode configured by the user for the above target volume. That is, this embodiment also supports the user to manually specify the activation or deactivation of the two-layer cache function. For example, the user manually specifies the activation or deactivation of the two-layer system cache for a certain volume. When the user creates a volume, the user is allowed to set the two-layer cache status of the volume. At the volume management configuration end, the switch setting of the two-layer cache at the configuration level is completed by identifying the volume type and business type, or by manual setting by the user, so that the two-layer cache can be enabled in the specified scenario according to the needs, and the two-layer cache can be disabled in other scenarios to achieve the purpose of performance optimization.

[0066] Step S12: If the storage mode corresponding to the target volume is to disable two-layer system cache, the data to be stored is directly written to the disk, or the data is directly read from the disk according to the read / write request corresponding to the target volume.

[0067] If it is determined that the storage mode corresponding to the labeled volume is to disable the two-layer system cache, the subsequent read / write requests received for the above target volume will be processed according to the operations of directly writing the data to be stored to the disk and directly reading the data from the disk.

[0068] In some embodiments, before directly writing the data to be stored to the disk, it may also include: flushing the dirty data on the target volume; after all dirty data is flushed, writing the data to be stored directly to the disk. It is understandable that after the business end receives the message to disable the two-layer system cache, it flushes the original dirty data in the volume. The reason for flushing the dirty data is that after the two-layer system cache is disabled, Qingniu is in a write-through state after passing through the system cache module. If it is not flushed, the data in the system cache are all old data, and data consistency problems will occur; therefore, in order to ensure data consistency, the dirty data in the target volume is deleted before the data is written.

[0069] For example Figure 3 The figure shows a method for disabling two-layer system cache for snapshot services. After the snapshot service is stopped, if the control end determines that the storage method is to disable two-layer system cache according to the volume type, the service end, that is, the storage end, flushes the dirty data in the target volume. After the flush is completed, the data is written to the disk through write-through. Figure 4 The figure shows a schematic diagram of a method for enabling or disabling the two-layer system cache specified by a user. The user issues a command to enable or disable the two-layer system cache, and the configuration end (i.e., the client) notifies the business end of the command. Taking the disabling of the two-layer system cache as an example, the business end manages the two-layer system cache according to the command, flushes the dirty data in the target volume, and then implements write-through.

[0070] In some embodiments, after determining the storage mode corresponding to the target volume by a preset judgment rule, the method may further include: updating the cache flag corresponding to the target volume according to the storage mode; the cache flag is used to characterize the storage mode; obtaining the read / write request corresponding to the target volume, and adding a corresponding identifier to the read / write request according to the cache flag, so as to process the read / write request accordingly according to the identifier. It can be understood that the storage mode of the volume is specifically identified by the cache flag, and then after receiving the request corresponding to the volume, the corresponding identifier is added to the request according to the cache flag, so as to select the corresponding processing mode according to the identifier of the request when processing the request. For example, according to the on / off setting of the user command, the deactivation of the two-layer system cache is turned on and off, and the deactivation of the two-layer system cache flag of the volume is set to false when on, and the deactivation of the two-layer system cache flag of the volume is set to true when off. The service end receives the message from the configuration end notifying the volume to turn on and deactivate the two-layer system cache. If the two-layer system cache is deactivated, the judgment of the deactivation of the two-layer system cache identifier of the volume is added to the condition for judging whether the volume has dirty data. If the volume has an identifier for disabling the two-layer system cache, subsequent write requests will not pass the message that the volume has dirty data to the configuration end; after the dirty data in the volume is flushed, an identifier for disabling the two-layer system cache is set for subsequent requests.

[0071] In some embodiments, according to the read / write request corresponding to the target volume, before directly writing the data to be stored to the disk, it may also include: obtaining the input / output request for the target volume; splitting the input / output request according to the size granularity, and using the sub-input / output request obtained by the split as the read / write request. That is, the upper-layer system cache also has the function of copying data. The upper-layer system cache receives the submitted input / output (IO) request, splits the input / output request according to a certain granularity, applies for resources to transmit data with the driver, and after the data is transmitted, sets an identifier for disabling the two-layer system cache for the split sub-input / output request.

[0072] Wherein, according to the read request corresponding to the target volume, directly reading data from the disk may include: obtaining the read request corresponding to the target volume, judging whether the read request corresponds to disabling the two-layer system cache according to the identifier corresponding to the read request; if the read request corresponds to disabling the two-layer system cache, directly reading data from the disk according to the read request. Wherein, according to the write request corresponding to the target volume, directly writing the data to be stored to the disk may include: obtaining the write request corresponding to the target volume, judging whether the write request corresponds to disabling the two-layer system cache according to the identifier corresponding to the write request; if the write request corresponds to disabling the two-layer system cache, directly writing the data to be stored contained in the write request to the disk. That is, if the sub-input and output request has an identifier for disabling the two-layer system cache, the data will not be written to the system cache for the write request, and the hash table will not be queried for the read request to determine whether there is a data hit, and the sub-input and output requests will be aggregated and submitted to the lower-level module. For the lower-level system cache, if the volume has an identifier for disabling the two-layer system cache, the request will be directly submitted to the lower-level module regardless of the read and write requests.

[0073] Step S13: If the storage mode corresponding to the target volume is to enable two-layer system cache, the read / write request corresponding to the target volume is executed based on the two-layer system cache.

[0074] In this embodiment, if it is determined that the storage mode corresponding to the target volume is to enable the two-layer system cache, the read / write request corresponding to the target volume is executed based on the two-layer system cache, that is, according to the two-layer system cache mode, data is first read and written based on the cache. Specifically, when the service end receives the message from the configuration end notifying the volume to open the two-layer system cache, the identifier set for the volume to disable the two-layer system cache is canceled, and the subsequent request notifies the configuration end of the message that there is dirty data in the volume. The write request writes the data to the system cache space, and the read request queries the hash table to determine whether there is a hit in the system cache. If there is a hit, the data is read from the system cache, and if there is no hit, the data is read from the disk. It can be seen that the impact of a large amount of data in the two-layer system cache on performance can be solved, and the original functions and requirements can be met through the control of scenarios and conditions. That is, the activation and deactivation of the cache are balanced to avoid the impact of data on storage performance while avoiding data communication in the two-layer cache from reducing storage performance.

[0075] Furthermore, if the storage method corresponding to the target volume is to enable two-layer system cache, it can also include: obtaining the performance requirements of the target volume; determining the detailed storage method corresponding to the target volume according to the performance requirements; the detailed storage method includes a first-level cache and a second-level cache. Make full use of the difference between the first-level cache and the second-level cache. Compared with the first-level cache, the second-level cache has a pre-reading function, and the second-level cache is refreshed at water level or idle time, which can provide performance acceleration for IO; therefore, the detailed storage method corresponding to the target volume can be determined according to the performance requirements of the target volume, that is, whether to use the first-level cache or the second-level cache. Using the second-level cache means using both the first-level cache and the second-level cache. For example, if volume A has requirements for write performance, only the first-level cache can be enabled, and the IO is completed after being written to the first-level cache; if volume B has fewer write requests and more read requests, the first-level cache can guarantee the write performance, and the second-level cache can guarantee the read performance. That is, it can be further configured according to the functional characteristics of the first-level cache and the second-level cache and the demand characteristics of the volume, so as to improve the storage performance while ensuring that the demand is met.

[0076] This application aims at the problem that the current two-layer system caches a large number of data images, which leads to reduced performance. Depending on whether the volume has advanced features, the two-layer system cache is turned on and off when the volume is created; when a snapshot service is started, the two-layer system cache is dynamically turned on for the volume that starts the snapshot service; when the snapshot service is stopped, the two-layer system cache is dynamically turned off for the volume that stops the snapshot service; at the same time, in the process of deactivating the system cache, all dirty data in the volume must be flushed first, and a write-through identifier is set for the volume to ensure data consistency. The problem of storage performance degradation caused by a large number of data images cached in the two-layer system can be solved. The opening and closing of the two-layer system cache can be adjusted dynamically according to different volume types and business configurations, and the storage performance data can be adjusted more flexibly. When the snapshot service is started, the system cache is dynamically turned on to reduce the impact of the snapshot service on the performance. When the service is stopped, the two-layer system cache is dynamically turned off to improve performance.

[0077] As can be seen from the above, in this embodiment, according to the characteristic information of the created target volume, the storage method corresponding to the above target volume is determined by the preset judgment rules; the above characteristic information includes the volume type and / or the current business scenario; the above storage method includes enabling the two-layer system cache and disabling the two-layer system cache; if the storage method corresponding to the above target volume is disabling the two-layer system cache, then according to the read / write request corresponding to the above target volume, the data to be stored is directly written to the disk, or the data is directly read from the disk; if the storage method corresponding to the above target volume is enabling the two-layer system cache, then the read / write request corresponding to the above target volume is executed based on the two-layer system cache. It can be seen that according to the volume type and business scenario corresponding to the target volume, the target volume can be flexibly and dynamically configured with a suitable storage method, that is, whether to enable the two-layer system cache, and use the two-layer system cache to undertake when necessary, otherwise the two-layer system cache can be directly bypassed, and the data can be written to the disk, and the data can be directly read from the disk, thereby avoiding the process of multiple message communications, solving the problem of storage performance degradation caused by the two-layer system caching a large amount of data, and improving the performance of the storage system.

[0078] Accordingly, the embodiment of the present application further discloses a data management device, which includes:

[0079] A storage mode determination module, used to determine the storage mode corresponding to the target volume according to the characteristic information of the created target volume by a preset judgment rule; the characteristic information includes the volume type and / or the current business scenario;

[0080] A disk read / write module, configured to directly write the data to be stored to the disk, or directly read the data from the disk, according to a read / write request corresponding to the target volume, if the storage mode corresponding to the target volume is to disable the two-layer system cache;

[0081] The cache module is used to execute the read / write request corresponding to the target volume based on the two-layer system cache if the storage mode corresponding to the target volume is to enable the two-layer system cache.

[0082] As can be seen from the above, in this embodiment, according to the characteristic information of the created target volume, the storage mode corresponding to the target volume is determined by the preset judgment rules; the characteristic information includes the volume type and / or the current business scenario; the storage mode includes enabling the two-layer system cache and disabling the two-layer system cache; if the storage mode corresponding to the target volume is disabling the two-layer system cache, then according to the read / write request corresponding to the target volume, the data to be stored is directly written to the disk, or the data is directly read from the disk; if the storage mode corresponding to the target volume is enabling the two-layer system cache, then the read / write request corresponding to the target volume is executed based on the two-layer system cache. It can be seen that according to the volume type and business scenario corresponding to the target volume, the target volume is flexibly and dynamically configured with a suitable storage mode, that is, whether to enable the two-layer system cache, and use the two-layer system cache to undertake when necessary, otherwise the two-layer system cache can be directly bypassed, and the data can be written to the disk, and the data can be directly read from the disk, thereby avoiding the process of multiple message communications, solving the problem of storage performance degradation caused by the two-layer system caching a large amount of data, and improving the performance of the storage system.

[0083] In some specific embodiments, the storage mode determination module may specifically include:

[0084] A volume type identification unit, used to identify the volume type of the target volume, and determine whether the target volume is a non-advanced feature volume according to the volume type; the non-advanced feature volume includes a self-thin volume, a compressed volume, a mirror volume, and a thin pool thin volume;

[0085] A first storage mode determining unit, configured to determine that the storage mode corresponding to the target volume is to enable two-layer system cache if the target volume is a non-advanced feature volume;

[0086] The second storage mode determining unit is configured to determine that the storage mode corresponding to the target volume is to disable two-layer system cache if the target volume does not belong to a non-advanced feature volume.

[0087] In some specific embodiments, the storage mode determination module may specifically include:

[0088] A business scenario determination unit, configured to monitor a current business scenario corresponding to the target volume;

[0089] The storage mode determining unit is used to determine the storage mode corresponding to the target volume according to the current business scenario and the pre-configured correspondence between the business scenario and the storage mode.

[0090] In some specific embodiments, the storage mode determination module may specifically include:

[0091] A preliminary storage mode determining unit, configured to monitor a current business scenario and determine a preliminary storage mode corresponding to the target volume according to the current business scenario;

[0092] a two-layer system cache enabling determination unit, configured to determine that the storage mode corresponding to the target volume is to enable the two-layer system cache if the preliminary storage mode is to enable the two-layer system cache;

[0093] The storage mode determining unit is configured to determine the storage mode corresponding to the target volume according to the volume type of the target volume if the preliminary storage mode is to disable the two-layer system cache.

[0094] In some specific embodiments, the preliminary storage mode determination unit may specifically include:

[0095] A first preliminary storage mode determining unit, configured to determine that the preliminary storage mode corresponding to the target volume is to enable two-layer system cache if the current business scenario is snapshot startup;

[0096] The second preliminary storage mode determining unit is configured to determine that the preliminary storage mode corresponding to the target volume is to disable two-layer system cache if the current business scenario is snapshot stop.

[0097] In some specific embodiments, the preliminary storage mode determination unit may specifically include:

[0098] A third preliminary storage mode determination unit, configured to determine that the preliminary storage mode corresponding to the target volume is to enable two-layer system cache if the current business scenario is mirror volume addition;

[0099] The fourth preliminary storage mode determining unit is configured to determine that the preliminary storage mode corresponding to the target volume is to disable two-layer system cache if the current business scenario is deletion of the mirror volume.

[0100] In some specific embodiments, the data management device may further include:

[0101] The storage mode acquisition unit is used to acquire the storage mode configured by the user for the target volume.

[0102] In some specific embodiments, the data management device may specifically include:

[0103] A flag bit updating unit, configured to update a cache flag bit corresponding to the target volume according to the storage mode after determining the storage mode corresponding to the target volume through a preset judgment rule; the cache flag bit is used to represent the storage mode;

[0104] The identifier adding unit is used to obtain the read / write request corresponding to the target volume, and add a corresponding identifier to the read / write request according to the cache flag, so as to process the read / write request accordingly according to the identifier.

[0105] In some specific embodiments, the disk read-write module may specifically include:

[0106] a read request acquisition unit, configured to acquire a read request corresponding to the target volume, and determine, according to an identifier corresponding to the read request, whether the read request corresponds to disabling a two-layer system cache;

[0107] The data reading unit is used to read data directly from the disk according to the read request if the read request corresponds to disabling the two-layer system cache.

[0108] In some specific embodiments, the disk read-write module may specifically include:

[0109] a write request acquisition unit, configured to acquire a write request corresponding to the target volume, and determine, according to an identifier corresponding to the write request, whether the write request corresponds to disabling a two-layer system cache;

[0110] The data writing unit is used to directly write the to-be-stored data contained in the write request to the disk if the write request corresponds to disabling the two-layer system cache.

[0111] In some specific embodiments, the data management device may specifically include:

[0112] An input / output request acquisition unit, configured to acquire an input / output request for the target volume before directly writing the data to be stored to the disk according to the read / write request corresponding to the target volume;

[0113] The request splitting unit is used to split the input / output request according to size granularity, and use the sub-input / output requests obtained by splitting as the read / write request.

[0114] In some specific embodiments, the disk read-write module may specifically include:

[0115] A dirty data flushing unit, used for performing a dirty data flushing operation on the target volume before directly writing the data to be stored to the disk;

[0116] The execution unit is used to directly write the data to be stored to the disk after all dirty data is flushed.

[0117] Furthermore, the present application also discloses an electronic device, see Figure 5 As shown, the contents in the drawings should not be considered as any limitation on the scope of use of the present application.

[0118] Figure 5The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the data management method disclosed in any of the aforementioned embodiments.

[0119] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0120] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222, and data 223 including a storage method, etc. The storage method can be temporary storage or permanent storage.

[0121] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the data management method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0122] Furthermore, an embodiment of the present application also discloses a computer storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the steps of the data management method disclosed in any of the aforementioned embodiments are implemented.

[0123] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0124] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0125] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0126] The above is a detailed introduction to a data management method, device, medium and program product provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A data management method, characterized in that: include: According to the characteristic information of the created target volume, a storage mode corresponding to the target volume is determined by a preset judgment rule; The characteristic information includes volume type and / or current business scenario; If the storage mode corresponding to the target volume is to disable two-layer system cache, the data to be stored is directly written to the disk, or the data is directly read from the disk according to the read / write request corresponding to the target volume; If the storage mode corresponding to the target volume is to enable two-layer system cache, executing the read / write request corresponding to the target volume based on the two-layer system cache; Wherein, executing the read / write request corresponding to the target volume based on the two-layer system cache includes: writing the read / write request to the upper-layer cache, the upper-layer cache submitting the read / write request to the lower-layer cache, and the lower-layer cache storing the data on the disk after being full; After the storage mode corresponding to the target volume is determined by a preset judgment rule, the method further includes: Update the cache flag corresponding to the target volume according to the storage mode; the cache flag is used to represent the storage mode; A read / write request corresponding to the target volume is obtained, and a corresponding identifier is added to the read / write request of the target volume according to the cache flag, so as to process the read / write request accordingly according to the identifier.

2. The data management method according to claim 1, characterized in that: According to the characteristic information of the created target volume, the storage mode corresponding to the target volume is determined by a preset judgment rule, including: Identify the volume type of the target volume, and determine whether the target volume is a non-advanced feature volume according to the volume type; the non-advanced feature volume includes a self-thin volume, a compressed volume, a mirror volume, and a thin pool thin volume; If the target volume is a non-advanced feature volume, determining that the storage mode corresponding to the target volume is to enable two-layer system cache; If the target volume does not belong to a non-advanced feature volume, it is determined that the storage mode corresponding to the target volume is to disable two-layer system cache.

3. The data management method according to claim 1, characterized in that: According to the characteristic information of the created target volume, the storage mode corresponding to the target volume is determined by a preset judgment rule, including: Monitoring the current business scenario corresponding to the target volume; The storage mode corresponding to the target volume is determined according to the current business scenario and the correspondence between the preconfigured business scenario and the storage mode.

4. The data management method according to claim 1, characterized in that: According to the characteristic information of the created target volume, the storage mode corresponding to the target volume is determined by a preset judgment rule, including: Monitoring the current business scenario, and determining a preliminary storage method corresponding to the target volume according to the current business scenario; If the preliminary storage mode is to enable two-layer system cache, determining that the storage mode corresponding to the target volume is to enable two-layer system cache; If the initial storage mode is to disable two-layer system cache, the storage mode corresponding to the target volume is determined according to the volume type of the target volume.

5. The data management method according to claim 4, characterized in that: Determining a preliminary storage method corresponding to the target volume according to the current business scenario includes: If the current business scenario is snapshot startup, determining that the preliminary storage mode corresponding to the target volume is to enable two-layer system cache; If the current business scenario is snapshot stop, it is determined that the initial storage mode corresponding to the target volume is to disable two-layer system cache.

6. The data management method according to claim 4, characterized in that: Determining a preliminary storage method corresponding to the target volume according to the current business scenario includes: If the current business scenario is adding a mirrored volume, determining that the initial storage mode corresponding to the target volume is to enable two-layer system cache; If the current business scenario is image volume deletion, it is determined that the initial storage mode corresponding to the target volume is to disable two-layer system cache.

7. The data management method according to claim 1, characterized in that: Also includes: Get the storage mode configured by the user for the target volume.

8. The data management method according to claim 1, characterized in that: According to the read request corresponding to the target volume, directly read data from the disk, including: Obtaining a read request corresponding to the target volume, and determining, according to an identifier corresponding to the read request, whether the read request corresponds to disabling a two-layer system cache; If the read request corresponds to disabling two layers of system cache, data is directly read from the disk according to the read request.

9. The data management method according to claim 1, characterized in that: According to the write request corresponding to the target volume, the data to be stored is directly written to the disk, including: Obtaining a write request corresponding to the target volume, and determining, according to an identifier corresponding to the write request, whether the write request corresponds to disabling a two-layer system cache; If the write request corresponds to disabling two layers of system cache, the data to be stored included in the write request is directly written to the disk.

10. The data management method according to claim 1, characterized in that: Before directly writing the data to be stored to the disk according to the read / write request corresponding to the target volume, the method further includes: Obtaining an input / output request for the target volume; The input / output request is split according to size granularity, and the sub-input / output requests obtained by the split are used as the read / write request.

11. The data management method according to any one of claims 1 to 10, characterized in that: Before directly writing the data to be stored to the disk, it also includes: Performing a dirty data flushing operation on the target volume; After all dirty data is flushed, the data to be stored is directly written to the disk.

12. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the data management method according to any one of claims 1 to 11.

13. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein when the computer program is executed by a processor, the data management method according to any one of claims 1 to 11 is implemented.

14. A computer program product, characterized in that The invention comprises a computer program, which implements the data management method according to any one of claims 1 to 11 when being executed by a processor.

Citation Information

Patent Citations

  • Solid-state drive data processing method, solid-state drive controller, and solid-state drive

    WO2024130875A1