Data management system, method, and apparatus, device, and controller

By introducing a controller into the data management system, dynamically switching between parallel architecture and hierarchical architecture, and managing data based on data popularity information, the problem that the existing system cannot meet different application needs is solved, and efficient memory access and storage optimization are achieved.

WO2024199082A1PCT designated stage expired Publication Date: 2024-10-03HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/083063
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-31
Filing Date
2024-03-21
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

It is difficult for existing data management systems to dynamically switch between parallel architecture and hierarchical architecture, resulting in the inability to meet the memory access needs, memory access speed and capacity requirements of different applications, and high operational complexity.

Method used

By introducing a controller into the data management system, using the combined architecture of the first storage medium and the second storage medium, the parallel architecture and the hierarchical architecture are dynamically switched, and data management is performed based on the heat information of the data to achieve fast access and cold storage of hot data. Effective caching of data to optimize storage capacity utilization.

Benefits of technology

It realizes the coexistence of parallel architecture and hierarchical architecture in the data management system, meets the memory access requirements of applications with strong or weak locality, reduces operation complexity, and improves memory access performance and storage efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083063_03102024_PF_FP_ABST
    Figure CN2024083063_03102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of storage and discloses a data management system, method, and apparatus, a device, and a controller. The data management system comprises a controller, a first storage medium, and a second storage medium. The memory access speed of the first storage medium is less than that of the second storage medium; the second storage medium comprises a first part and a second part; the first part is a cache of the first storage medium; and the first storage medium and the second part are not caches. The controller is used for acquiring target data to be managed and is also used for managing the target data by means of a target storage medium, wherein the target storage medium is a storage medium, among the first storage medium, the first part, and the second part, corresponding to the target data. According to the data management system provided by the present application, a parallel architecture and a hierarchical architecture can coexist, and the parallel architecture and the hierarchical architecture can be dynamically switched, so that the memory access requirements of various different types of applications can be met, and the system has relatively high applicability.
Need to check novelty before this filing date? Find Prior Art

Description

Data management system, method, device, equipment and controller

[0001] This application claims priority to Chinese patent application number 202310379505.2, filed on March 31, 2023, entitled “Data management system, method, device, equipment and controller,” the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present application relates to the field of storage technology, and in particular to a data management system, method, apparatus, device and controller. Background Art

[0003] The present application provides a data management system, method, apparatus, device and controller for managing data. The technical solution provided by the present application includes the following aspects.

[0004] In a first aspect, a data management system is provided, which includes a controller, a first storage medium and a second storage medium. The memory access speed of the first storage medium is lower than the memory access speed of the second storage medium, or in other words, the first storage medium is a slow memory and the second storage medium is a fast memory. The second storage medium includes a first part and a second part, the first part is a cache of the first storage medium, and the first storage medium and the second part are non-cached. Therefore, the first storage medium and the second part respectively store different data as main memory, and the first part caches part of the data stored in the first storage medium. The controller is used to obtain target data to be managed, and is also used to manage target data through a target storage medium, and the target storage medium is the storage medium corresponding to the target data in the first storage medium, the first part and the second part.

[0005] The data management system is an architecture in which a parallel architecture and a hierarchical architecture coexist. The first storage medium and the second part form a parallel architecture, while the first storage medium and the first part form an architecture that can dynamically switch between a parallel architecture and a hierarchical architecture. When the first part has not yet cached any data stored in the first storage medium, the first storage medium and the first part form a parallel architecture. As the data management system is continuously used, the first part gradually begins to cache part of the data stored in the first storage medium, and the architecture between the first storage medium and the first part switches from a parallel architecture to a hierarchical architecture. As the data management system continues to be used, the first part no longer needs to continue caching some of the cached data, and the architecture between the first storage medium and the first part switches from a hierarchical structure to a parallel architecture. Moreover, the process of dynamically switching between a parallel architecture and a hierarchical architecture can be completed under normal use of the data management system.

[0006] For applications with strong locality, a switch from a parallel architecture to a hierarchical architecture can be made, caching more hot data in the first part. Since the first part has a faster memory access speed, it can meet the high memory access speed requirements of applications with strong locality. For applications with weaker locality, a switch from a hierarchical architecture to a parallel architecture can be made, caching less hot data in the first part. Since the first part occupies less capacity in the second storage medium, the second part can occupy a larger capacity in the second storage medium, thereby increasing the main memory capacity and meeting the large main memory capacity requirements of applications with weaker locality.

[0007] In one possible implementation, a controller is configured to obtain first heat information corresponding to target data, the first heat information being used to indicate whether the target data is heat data; and manage the target data via a target storage medium based on the first heat information; wherein the target storage medium is the first portion, or the target medium is the first storage medium and the first portion. In this implementation, managing the target data based on the first heat information of the target data facilitates accurate management, thereby meeting the memory access requirements of various applications.

[0008] In one possible implementation, the controller is used to receive a target instruction, obtain a first address according to the target instruction, and determine the data corresponding to the first address as the target data. The target instruction can be a memory access instruction for accessing memory data, or it can be an instruction dedicated to managing data. When the first address is within the address range of the first storage medium, a reference value is determined based on the number of memory accesses of the target data, a reference duration, and a first threshold value. The reference duration is the difference between the time when the target instruction is received and the time when the target data was last accessed, and the reference duration is less than the first threshold value. When the reference value is greater than the second threshold value, it is determined that the first heat information indicates that the target data is hot data, or when the reference value is less than or equal to a third threshold value, it is determined that the first heat information indicates that the target data is cold data, and the third threshold value is less than or equal to the second threshold value. Since the number of memory accesses, the reference duration, and the first threshold value are comprehensively considered when determining the reference value, the determined reference value is relatively accurate, and the first heat information determined based on the reference value is also relatively accurate.

[0009] In one possible implementation, the controller is configured to identify historically accessed data as target data, where the target data corresponds to a first address within the address range of the first storage medium. If the target data has not been accessed for a period of time exceeding a fourth threshold, the controller determines that the first heat information indicates that the target data is cold data. In this implementation, there is no need to trigger management of the target data through a target instruction; historically accessed data can be designated as the target data to be managed.

[0010] In one possible implementation, the controller is configured to query an address mapping table based on a first address corresponding to the target data to obtain a query result; and if the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address within the address range of the first portion, delete the target data cached at the second address. The controller is further configured to delete the target mapping relationship between the first address and the second address from the address mapping table.

[0011] Since the target data is cold data, it means that there is no need to cache the target data through the first part. Since the query result indicates that the first address corresponds to the second address, it means that the first part has cached the target data. Therefore, it means that there is no longer any need to cache the colder target data through the first part, and the controller needs to delete the target data cached at the second address so as to leave more capacity in the first part for caching other hot data. In addition, the controller also needs to delete the table entry corresponding to the target data from the address mapping table so as to indicate that the first part no longer caches the target data.

[0012] In one possible implementation, the controller is used to write the target data cached at the second address to the first address, and then delete the target data cached at the second address when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is dirty data.

[0013] Since the target data is dirty data, it means that the target data has been modified after the first part cached the target data. In other words, the target data stored at the first address of the first storage medium is inconsistent with the target data cached at the second address of the first part. Therefore, it is necessary to first write the target data cached at the second address to the first address, and then delete the target data cached at the second address to ensure data consistency between the first storage medium and the first part. The present application can maintain data consistency between the first storage medium and the first part through the controller, with low overhead.

[0014] In one possible implementation, the controller is used to delete the target data cached at the second address when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is not dirty data.

[0015] Since the target data is not dirty, it indicates that the target data has not been modified since it was cached in the first portion. Therefore, the target data stored at the first address of the first storage medium and the target data cached at the second address of the first portion are identical. Therefore, the target data cached at the second address can be directly deleted without writing the target data to the first address of the first storage medium.

[0016] In one possible implementation, the controller is configured to query an address mapping table based on a first address corresponding to the target data to obtain a query result; and if the first heat information indicates that the target data is hot data and the query result indicates that the first address does not correspond to a second address within the address range of the first portion, cache the target data at the second address. The controller is further configured to add a target mapping relationship between the first address and the second address to the address mapping table.

[0017] Since the target data is hot data, it indicates that the target data needs to be cached through the first part. Since the query result indicates that the first address does not correspond to the second address, it indicates that the first part has not cached the target data. Therefore, it indicates that the hotter target data needs to be cached through the first part, and the controller will read the target data from the first storage medium and cache the target data at the second address, so that the first part caches the target data, which is conducive to the subsequent rapid access to the target data through the first part. In addition, the controller also needs to add a table entry corresponding to the target data in the address mapping table to indicate that the first part has cached the target data.

[0018] In one possible implementation, the controller is used to add the target mapping relationship to the queue with the lowest priority among multiple queues, and the target mapping relationship corresponds to second heat information, which is used to indicate the heat level of the target data; according to the update of the second heat information, the position of the target mapping relationship in the multiple queues is updated until the target mapping relationship is added to the queue with the highest priority among the multiple queues, and then the target mapping relationship is added to the address mapping table.

[0019] Since this method does not add the target mapping relationship directly to the address mapping table, but instead adds the target mapping relationship to the address mapping table after being buffered in the buffer, it can not only avoid the address mapping table being filled with only sudden hot data and unable to cache the mapping relationship corresponding to normal hot data, but also avoid the table entries in the address mapping table being frequently replaced, thereby increasing the cache hit rate and saving time, energy consumption and other expenses.

[0020] In one possible implementation, the controller is used to obtain a reference mapping relationship from a queue with the lowest priority among multiple queues, replace the reference mapping relationship in the address mapping table with a target mapping relationship, and transfer the reference mapping relationship from a queue with a non-lowest priority among multiple queues to a queue with the lowest priority among multiple queues.

[0021] Since this method does not directly replace the reference mapping relationship, but instead buffers the reference mapping relationship in the buffer and then replaces it with the target mapping relationship, it can avoid frequent replacement of entries in the address mapping table, increase the cache hit rate, and save time, energy consumption and other expenses.

[0022] In one possible implementation, the controller is configured to query an address mapping table based on a first address corresponding to the target data to obtain a query result; and if the first heat information indicates that the target data is hot data and the query result indicates that the first address corresponds to a second address within the address range of the first portion, the controller continues to cache the target data at the second address. The controller is further configured to update second heat information corresponding to the target mapping relationship between the first address and the second address, the second heat information being configured to indicate the heat level of the target mapping relationship.

[0023] Since the target data is hot data, it means that the target data needs to be cached through the first part. Since the query result indicates that the first address corresponds to the second address, it means that the first part has already cached the target data. Therefore, there is no need to adjust the cache status of the target data, so that the target data can continue to be cached at the second address, and there is no need to replace each table entry in the address mapping table. It is only necessary to update the second heat information corresponding to the target mapping relationship. The purpose of updating the second heat information is to make the target mapping relationship less likely to be replaced by other mapping relationships.

[0024] In a second aspect, a data management method is provided. The data management method is applied to a controller included in a data management system. The data management system also includes a first storage medium and a second storage medium. The first storage medium has a lower memory access speed than the second storage medium. The second storage medium includes a first portion and a second portion. The first portion is a cache for the first storage medium, while the first storage medium and the second portion are non-cached. The data management method includes: obtaining target data to be managed; and managing the target data via a target storage medium, where the target storage medium is the storage medium corresponding to the target data in the first storage medium, the first portion, and the second portion.

[0025] In one possible implementation, managing target data through a target storage medium includes: obtaining first heat information corresponding to the target data, the first heat information being used to indicate whether the target data is hot data; managing the target data through a target storage medium based on the first heat information; wherein the target storage medium is the first part, or the target medium is the first storage medium and the first part.

[0026] In one possible implementation, obtaining first heat information corresponding to target data includes: receiving a target instruction, obtaining a first address according to the target instruction, and determining the data corresponding to the first address as the target data; when the first address is within the address range of the first storage medium, determining a reference value based on the number of memory accesses of the target data, a reference duration, and a first threshold, the reference duration being the difference between the time when the target instruction is received and the time when the target data was last accessed, and the reference duration being less than the first threshold; when the reference value is greater than the second threshold, determining that the first heat information indicates that the target data is hot data, or, when the reference value is less than or equal to a third threshold, determining that the first heat information indicates that the target data is cold data, and the third threshold is less than or equal to the second threshold.

[0027] In one possible implementation, obtaining first heat information corresponding to target data includes: determining data that has been accessed historically as target data, the target data corresponding to a first address, and the first address being within the address range of a first storage medium; when the length of time during which the target data has not been accessed reaches a fourth threshold, determining that the first heat information indicates that the target data is cold data.

[0028] In one possible implementation, target data is managed through a target storage medium based on first heat information, including: querying an address mapping table based on a first address corresponding to the target data to obtain a query result; when the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address within the address range of the first part, deleting the target data cached at the second address; the data management method also includes: deleting the target mapping relationship between the first address and the second address from the address mapping table.

[0029] In one possible implementation, when the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address within the address range of the first part, deleting the target data cached at the second address includes: when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is dirty data, writing the target data cached at the second address to the first address, and then deleting the target data cached at the second address.

[0030] In one possible implementation, when the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address within the address range of the first part, deleting the target data cached at the second address includes: when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to the second address within the address range of the first part, and the query result also indicates that the target data is not dirty data, deleting the target data cached at the second address.

[0031] In one possible implementation, target data is managed through a target storage medium based on first heat information, including: querying an address mapping table based on a first address corresponding to the target data to obtain a query result; caching the target data at a second address when the first heat information indicates that the target data is hot data and the query result indicates that the first address does not correspond to a second address within the address range of the first part; the data management method also includes: adding a target mapping relationship between the first address and the second address in the address mapping table.

[0032] In one possible implementation, a target mapping relationship between a first address and a second address is added to an address mapping table, including: adding the target mapping relationship to a queue with the lowest priority among multiple queues, the target mapping relationship corresponding to second heat information, and the second heat information being used to indicate the heat level of the target data; updating the position of the target mapping relationship in the multiple queues according to the update of the second heat information, until the target mapping relationship is added to the queue with the highest priority among the multiple queues, and then adding the target mapping relationship to the address mapping table.

[0033] In one possible implementation, a target mapping relationship between a first address and a second address is added to an address mapping table, including: obtaining a reference mapping relationship from a queue with the lowest priority among multiple queues, replacing the reference mapping relationship in the address mapping table with the target mapping relationship, and transferring the reference mapping relationship from a queue with a non-lowest priority among multiple queues to a queue with the lowest priority among multiple queues.

[0034] In one possible implementation, target data is managed through a target storage medium based on first heat information, including: querying an address mapping table based on a first address corresponding to the target data to obtain a query result; continuing to cache the target data at the second address when the first heat information indicates that the target data is hot data and the query result indicates that the first address corresponds to a second address within the address range of the first part; the data management method also includes: updating second heat information corresponding to a target mapping relationship between the first address and the second address, the second heat information being used to indicate the hotness of the target mapping relationship.

[0035] In a third aspect, a data management device is provided. The data management device is applied to a controller included in a data management system. The data management system also includes a first storage medium and a second storage medium. The first storage medium has a lower memory access speed than the second storage medium. The second storage medium includes a first portion and a second portion. The first portion is a cache for the first storage medium, while the first storage medium and the second portion are non-cached. The data management device includes: an acquisition module for acquiring target data to be managed; and a management module for managing the target data via a target storage medium. The target storage medium is the storage medium corresponding to the target data in the first storage medium, the first portion, and the second portion.

[0036] In one possible implementation, a management module is used to obtain first heat information corresponding to the target data, where the first heat information is used to indicate whether the target data is hot data; and manage the target data through a target storage medium based on the first heat information; wherein the target storage medium is the first part, or the target medium is the first storage medium and the first part.

[0037] In one possible implementation, a management module is used to receive a target instruction, obtain a first address according to the target instruction, and determine the data corresponding to the first address as the target data; when the first address is within the address range of the first storage medium, determine a reference value based on the number of memory accesses of the target data, a reference duration, and a first threshold, the reference duration being the difference between the time when the target instruction is received and the time when the target data was last accessed, and the reference duration being less than the first threshold; when the reference value is greater than the second threshold, determine that the first heat information indicates that the target data is hot data, or, when the reference value is less than or equal to a third threshold, determine that the first heat information indicates that the target data is cold data, and the third threshold is less than or equal to the second threshold.

[0038] In one possible implementation, a management module is used to determine data that has been accessed historically as target data, where the target data corresponds to a first address, and the first address is within the address range of a first storage medium; when the length of time during which the target data has not been accessed reaches a fourth threshold, it is determined that the first heat information indicates that the target data is cold data.

[0039] In one possible implementation, the management module is configured to query the address mapping table according to the first address corresponding to the target data to obtain a query result; and if the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address within the address range of the first part, delete the target data cached at the second address;

[0040] The management module is further configured to delete the target mapping relationship between the first address and the second address from the address mapping table.

[0041] In one possible implementation, the management module is used to write the target data cached at the second address to the first address, and then delete the target data cached at the second address when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is dirty data.

[0042] In one possible implementation, the management module is used to delete the target data cached at the second address when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is not dirty data.

[0043] In one possible implementation, the management module is configured to query the address mapping table according to the first address corresponding to the target data to obtain a query result; and if the first heat information indicates that the target data is hot data and the query result indicates that the first address does not correspond to a second address within the address range of the first portion, cache the target data at the second address;

[0044] The management module is further configured to add a target mapping relationship between the first address and the second address to the address mapping table.

[0045] In one possible implementation, the management module is used to add the target mapping relationship to the queue with the lowest priority among multiple queues, and the target mapping relationship corresponds to second heat information, which is used to indicate the heat level of the target data; according to the update of the second heat information, the position of the target mapping relationship in the multiple queues is updated until the target mapping relationship is added to the queue with the highest priority among the multiple queues, and then the target mapping relationship is added to the address mapping table.

[0046] In one possible implementation, the management module is used to obtain a reference mapping relationship from the queue with the lowest priority among multiple queues, replace the reference mapping relationship in the address mapping table with the target mapping relationship, and transfer the reference mapping relationship from the queue with a non-lowest priority among multiple queues to the queue with the lowest priority among multiple queues.

[0047] In one possible implementation, the management module is configured to query the address mapping table according to the first address corresponding to the target data to obtain a query result; and if the first heat information indicates that the target data is hot data and the query result indicates that the first address corresponds to a second address within the address range of the first portion, continue to cache the target data at the second address;

[0048] The management module is further used to update second heat information corresponding to the target mapping relationship between the first address and the second address, where the second heat information is used to indicate the heat level of the target mapping relationship.

[0049] In a fourth aspect, a data management device is provided, which includes a processor and a data management system. The processor is connected to a controller included in the data management system. The data management system is a data management system provided by the first aspect or any possible implementation of the first aspect.

[0050] In a fifth aspect, a controller is provided, which is used to execute the data management method provided by the second aspect or any possible implementation of the second aspect.

[0051] It should be understood that the beneficial effects achieved by the technical solutions provided by the second to fifth aspects of this application and their corresponding possible implementation methods can be referred to the beneficial effects achieved by the technical solutions provided by the above-mentioned first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] FIG1 is a schematic diagram of a parallel architecture provided in an embodiment of the present application;

[0053] FIG2 is a schematic diagram of a hierarchical architecture provided in an embodiment of the present application;

[0054] FIG3 is a schematic diagram of a data management system provided in an embodiment of the present application;

[0055] FIG4 is a schematic diagram of another data management system provided in an embodiment of the present application;

[0056] FIG5 is a flow chart of a data management method provided in an embodiment of the present application;

[0057] FIG6 is a schematic diagram of a process for determining whether data is hot or cold, provided by an embodiment of the present application;

[0058] FIG7 is a structural diagram of an entry in a memory access information table provided in an embodiment of the present application;

[0059] FIG8 is a schematic diagram of a process for data management provided in an embodiment of the present application;

[0060] FIG9 is a structural diagram of an address mapping table provided in an embodiment of the present application;

[0061] FIG10 is a schematic diagram of a priority queue provided in an embodiment of the present application;

[0062] FIG11 is a structural diagram of a data management module provided in an embodiment of the present application;

[0063] FIG12 is a structural diagram of a data management device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0064] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0065] With the rapid development of multi-core computer technology (i.e., multiple processing cores within a processor) and various applications, processors are increasingly accessing storage media based on requests from applications. Storage media are used to store data, and accessing storage media includes both accessing and storing. Accessing can also be understood as reading, which is used to obtain data stored on a storage medium. Storing can also be understood as writing, which is used to cause a storage medium to store data.

[0066] Precisely because the frequency of accessing storage media is increasing, storage media are required to have better performance. Among them, the performance of storage media includes but is not limited to: storage density, static power consumption, access speed, service life, etc. Storage density refers to the ratio between the storage space occupied by the data that the storage medium can store (i.e., the capacity of the storage medium) and the storage space occupied by the storage medium itself. Static power consumption refers to the power consumption consumed by the storage medium when it is not being accessed, such as leakage power consumption and refresh power consumption, etc. Access speed refers to the speed at which the storage medium is accessed. The higher the speed, the shorter the time required for access. Service life refers to the time from when the storage medium is put into use to when the storage medium is damaged.

[0067] Traditional storage media have the advantages of high access speed (also known as fast memory) and long lifespan, but also have the disadvantages of low storage density and high static power consumption. New storage media have the disadvantages of slow access speed (also known as slow memory) and short lifespan, but have the advantages of high storage density, low static power consumption, and byte addressability. Based on this, fast memory and slow memory can be combined to form a certain architecture to fully utilize the advantages of each storage medium.

[0068] For example, an exemplary architecture is a parallel architecture shown in Figure 1, including a fast memory, a controller 1, a slow memory, and a controller 2. Among them, the fast memory and the slow memory are both non-cached (that is, both serve as main memory), and the two storage media are used to store different data. In this parallel architecture, hot data with a higher access frequency is migrated from the slow memory to the fast memory for storage, and the controller 1 implements fast access to the hot data by accessing the fast memory according to the instructions sent by the processor. Among them, after the hot data is migrated from the slow memory to the fast memory, the hot data is only stored by the fast memory and no longer stored by the slow memory. In addition, the cold data with a lower access frequency is stored in the slow memory, and the controller 2 implements access to the cold data by accessing the slow memory according to the instructions sent by the processor.

[0069] This parallel architecture is suitable for applications with weak locality, such as big data applications, including but not limited to message service frameworks (MSF), breadth-first search (BFS), and k-nearest neighbor (KNN). Weak locality means that data with the same value or stored in the same storage location does not need to be frequently accessed.

[0070] For another example, another exemplary architecture is a hierarchical architecture shown in FIG2 , which includes a fast memory, a slow memory, and a controller 3. Among them, the slow memory is non-cached (i.e., main memory), and the fast memory is a cache of the slow memory. The slow memory is used to store all data, and the fast memory is used to cache hot data among all data. The controller 3 accesses the data by accessing the fast memory according to the instructions sent by the processor. If the data that needs to be accessed is cached in the fast memory, the access can be completed directly. If the data that needs to be accessed is not cached in the fast memory, the fast memory obtains the data that needs to be accessed from the slow memory and caches it to facilitate the access.

[0071] This hierarchical architecture suffers from low flexibility and high hardware complexity. Furthermore, it is suitable for applications with strong locality, such as internet-related applications, including but not limited to Astar (a heuristic search algorithm) and data information communication technology (DICT). Strong locality refers to the need to frequently access data with the same value or stored in the same storage location.

[0072] In the related art, if you want to switch from a parallel architecture to a hierarchical architecture, or vice versa, you need to reconfigure the hardware (i.e., storage medium) usage mode and restart the system running on the device where the hardware is located, which makes the operation more complex. However, if you do not switch between the parallel architecture and the hierarchical architecture, and use only one of the parallel architecture and the hierarchical architecture, it is often only possible to meet the memory access requirements of one type of application, which is relatively limited and not very applicable. For example, if you use the parallel architecture alone, you can only meet the memory access requirements of applications with weak locality. Such memory access requirements have low requirements for memory access speed (no need for low memory access latency) and high requirements for main memory capacity. For another example, if you use the hierarchical architecture alone, you can only meet the memory access requirements of applications with strong locality. Such memory access requirements have high requirements for memory access speed (low memory access latency) and low requirements for main memory capacity.

[0073] Based on this, an embodiment of the present application provides a data management system. As shown in Figure 3, the data management system includes a controller, a first storage medium, and a second storage medium. The memory access speed of the first storage medium is lower than the memory access speed of the second storage medium. In other words, the first storage medium is a slow memory, and the second storage medium is a fast memory. The second storage medium includes a first part and a second part, the first part is a cache of the first storage medium, and the first storage medium and the second part are non-cached. Therefore, the first storage medium and the second part respectively store different data as main memory, and the first part caches part of the data stored in the first storage medium, and some of the data may be hot data with a higher memory access frequency. It should be understood that different data does not necessarily refer to data with different values, but may also refer to data corresponding to different applications, etc., which is not limited here.

[0074] Thus, the first storage medium and the second part form a parallel architecture, and the first storage medium and the first part form an architecture that can dynamically switch between a parallel architecture and a hierarchical architecture. This dynamically switchable architecture is described as follows.

[0075] In the initial state, that is, when the first part is not yet caching any data stored on the first storage medium, the first storage medium and the first part form a parallel architecture. As the data management system is used, the first part gradually begins to cache some of the data stored on the first storage medium. For example, if the first part caches hot data to facilitate fast access to the hot data, the first storage medium and the first part switch from a parallel architecture to a hierarchical architecture. As the data management system continues to be used, the first part no longer needs to cache some of the cached data. For example, if the hot data cached by the first part has become cold data, the first part no longer needs to cache the cold data and instead needs to delete the cold data to free up space for caching other hot data. The first storage medium and the first part then switch from a hierarchical architecture to a parallel architecture. Because the first storage medium and the first part can switch both from a parallel architecture to a hierarchical architecture and vice versa, they form an architecture that can dynamically switch between parallel and hierarchical architectures.

[0076] It can be seen that the data management system provided by the embodiment of the present application can make the parallel architecture and the hierarchical architecture coexist, which can meet the memory access requirements of applications with weak locality and the memory access requirements of applications with strong locality, and has strong applicability. For example, for applications with strong locality, it is possible to switch from a parallel architecture to a hierarchical architecture, so that more hot data is cached in the first part. Since the memory access speed of the first part is relatively high, it can meet the memory access requirements with higher requirements for memory access speed. For another example, for applications with weak locality, it is possible to switch from a hierarchical architecture to a parallel architecture, so that less hot data is cached in the first part. The capacity occupied by the first part in the second storage medium is relatively small, and the second part can occupy a larger capacity in the second storage medium, thereby increasing the capacity of the main memory and meeting the memory access requirements with higher requirements for the main memory capacity.

[0077] Moreover, the process of dynamic switching between the parallel architecture and the hierarchical architecture can be completed under normal use of the data management system, without the need to reconfigure the hardware (i.e., storage medium) usage mode or restart the system running on the device where the hardware is located as in the related technologies described above, thereby reducing the complexity of the operation.

[0078] For example, the sum of the capacity of the first part and the capacity of the second part is less than or equal to the capacity of the second storage medium. The capacity of the first part and the capacity of the second part can be adjusted according to actual needs and are not limited here.

[0079] The controller included in the data management system is a bus circuit controller for managing and scheduling the transmission speed between the processor and the storage medium. A controller can be a separate chip or integrated into other chips. Other chips include, but are not limited to, processors, north bridge chips, etc., which are not limited here.

[0080] For example, the first storage medium may be a non-volatile memory (NVM), such as a phase change memory (PCM), etc. In addition, the second storage medium may be a dynamic random access memory (DRAM), etc. The embodiments of the present application do not limit the first storage medium and the second storage medium.

[0081] In an exemplary embodiment, the modules included within the controller are described in conjunction with the data management system shown in FIG4 . The modules within the controller include, but are not limited to, an address translation module, a memory access module, a mapping module, a migration module, a control module, a delay module, and a storage module (not shown in FIG4 ). The storage module includes a memory access information table, an address mapping table, and a buffer. The buffer is, for example, a first-in-first-out (FIFO) queue, which is not limited here. The address translation module and the migration module may also be connected to the processor via a bus.

[0082] Among them, the capacity of the first part and the capacity of the second part described above can be adjusted according to actual needs, which can be achieved through a migration module. For example, the migration module can receive an instruction sent by the processor through the bus, and adjust the capacity of the first part and the capacity of the second part in the second storage medium according to the instruction. In addition, the control module can modify the relevant parameters of the first storage medium through the delay module according to actual needs. The relevant parameters include but are not limited to parameters such as time delay. The relevant parameters can be simulated by a hardware simulation platform such as a field programmable gate array (FPGA) on the first storage medium and the second storage medium. Of course, the various modules shown in Figure 4 also have other functions. For details of other functions, please refer to the description in the method embodiment below, which will not be repeated here.

[0083] The embodiment of the present application provides a data management method, which can be applied to the controller included in the data management system shown in Figure 3 or Figure 4. As shown in Figure 5, the method includes the following steps 501 and 502.

[0084] Step 501: Acquire target data that needs to be managed.

[0085] Since the controller needs to manage data, it should obtain the target data to be managed. The target data can have a certain unit, or the target data includes at least one unit data. Each unit data has a certain data length, and the data length can be set according to actual needs. For example, the data length of each unit can be 64 bytes (byte, B), and the length of the target data can be 64B, 128B, 192B, etc.

[0086] In an exemplary embodiment, the manner in which the controller obtains the target data that needs to be managed includes but is not limited to the following Case A1 and Case A2.

[0087] In case A1, the controller receives a target instruction, obtains a first address according to the target instruction, and determines data corresponding to the first address as target data.

[0088] As shown in Figure 4 , the processor sends a target instruction to the controller via a bus. The target instruction carries a logical address. The controller receives the target instruction through an address translation module, parses the target instruction to obtain the logical address, and then converts the logical address into a first address. This first address is a physical address, so that the data corresponding to the first address can be determined as the target data.

[0089] In some embodiments, the target instruction is a memory access instruction. Therefore, the target instruction is used to access memory data, and the controller uses the data to be accessed as the target data, which is equivalent to triggering data management when accessing memory data. In addition to carrying a logical address, the target instruction also carries a memory access identifier, which is used to indicate access (i.e., reading) or storage (i.e., writing). When the memory access identifier is used to indicate access, the data corresponding to the first address is the data stored at the first address and needs to be read from the first address. When the memory access identifier is used to indicate storage, the data corresponding to the first address is the data that needs to be written to the first address so that the first address is stored. In addition to sending the target instruction to the controller via the bus, the processor also sends the data corresponding to the first address to the controller via the bus. The bus used to send the target instruction and the bus used to send the data corresponding to the first address can be different or the same bus. In other embodiments, the target instruction carries a logical address but does not carry a memory access identifier. Therefore, the target instruction can be regarded as an instruction specifically used to trigger data management, which is equivalent to specifically triggering data management. Accordingly, the data corresponding to the first address can be the data stored at the first address.

[0090] In an exemplary embodiment, the case A1 further includes the following case B1 and case B2.

[0091] In case B1, the first address is located within the address range of the second portion in the second storage medium, that is, within the cache address range.

[0092] Case B2: the first address is within the address range of the first storage medium, that is, within the cache address range.

[0093] For example, in case B2, each unit of data included in the data corresponding to the first address (i.e., the target data) corresponds to an entry in the memory access information table. Since the target data includes at least one unit of data, the first address corresponds to at least one entry in the memory access information table. The memory access information table can be maintained by a memory access module (as shown in FIG4 ) included in the controller. The address conversion module included in the controller obtains the first address according to the target instruction and sends the first address to the memory access module. See branch 1 of FIG6 . The memory access module then determines whether there is an entry corresponding to the first address in the memory access information table. If there is no entry corresponding to the first address in the memory access information table, it means that the data corresponding to the first address has not been accessed before, and the memory access module creates a new entry corresponding to the first address in the memory access information table. If there is an entry corresponding to the first address in the memory access information table, it means that the data corresponding to the first address has been accessed before, or in other words, the data corresponding to the first address is data that has been accessed historically, and the memory access module does not need to create a new entry, but can simply update the entry corresponding to the first address.

[0094] Exemplarily, each entry in the memory access information table includes, but is not limited to, information such as valid bits, address, first heat information, number of memory accesses, and lifetime. Each piece of information is described below.

[0095] Valid bit: used to indicate whether the entry is valid.

[0096] Address: If the address has corresponding data, the table entry where the address is located is the table entry corresponding to the data corresponding to the address. Taking the case where the target data only includes one unit of data, the first address corresponds to at most one table entry in the memory access information table. The memory access module can determine whether there is a table entry corresponding to the first address in the memory access information table by searching whether the first address exists in the memory access information table. If the first address does not exist in any table entry, the memory access module determines that there is no table entry corresponding to the first address in the memory access information table. If the first address exists in a certain table entry, the memory access module determines that the table entry containing the first address is the table entry corresponding to the first address.

[0097] First heat information: used to indicate whether the data corresponding to the address is hot data. Exemplarily, the first heat information is a heat identifier. When the heat identifier takes a first value, it is used to indicate that the data corresponding to the address in the table entry is hot data. When the heat identifier takes a second value, it is used to indicate that the data corresponding to the address in the table entry is cold data. The first value and the second value are different values. For example, the first value is 1 and the second value is 0. This application does not limit the first value and the second value.

[0098] Memory access count: includes only access counts (i.e., read counts), or only store counts (i.e., write counts), or includes both access counts and store counts. For example, when the memory access count includes both access counts and store counts, the structure of the entries in the memory access information table can be seen in Figure 7.

[0099] Lifetime: This is the difference between the current time and the last time the data corresponding to the address in the entry was accessed. In other words, the lifetime is the length of time the data corresponding to the address in the entry has not been accessed. Each time the data corresponding to the address in the entry is accessed, the lifetime is reset to zero and starts counting up. This lifetime can be updated in real time.

[0100] It should be understood that the newly created table item mentioned above refers to adding a table item to the memory access information table and recording various information in the table item. For example, first determine the current number of memory accesses, determine the first heat information based on the information other than the first heat information, and record all the information other than the first heat information and the first heat information in the table item. The table item corresponding to the updated first address mentioned above refers to updating the information recorded in the table item, for example, updating the first heat information and the number of memory accesses in the table item, etc. For example, first determine the current number of memory accesses, determine the updated first heat information based on the current number of memory accesses, if the original number of memory accesses is different from the current number of memory accesses, then replace the memory access number recorded in the table item with the original number of memory accesses to the current number of memory accesses, if the original first heat information is different from the updated first heat information, then replace the first heat information recorded in the table item with the original first heat information to the updated first heat information, thereby completing the update of the table item. In the case where the target instruction is a memory access instruction, the current memory access count is greater than the original memory access count, and the current memory access count can be obtained by adding the original memory access count. Alternatively, in the case where the target instruction is not a memory access instruction, the current memory access count is equal to the original memory access count. In addition, the process of determining the first heat information can be referred to the description of step 502 below and will not be described in detail here.

[0101] It should also be understood that the maintenance of the memory access information table is equivalent to the collection of memory access information. In the related art, a two-way hash linked table is often used to realize the collection of memory access information, so as to facilitate the subsequent implementation of the trace hash migration (THMigrator) of data based on the collected memory access information. However, compared to the memory access information table provided in the embodiment of the present application, the related art realizes the collection of memory access information by means of a two-way hash linked table, which is not only more difficult and has a higher cost, but also has low practicality and may only be applicable to a simulator environment, and cannot be applied to a real hardware environment like the embodiment of the present application.

[0102] In case A2, the controller determines the historically accessed data as target data, the target data corresponds to a first address, and the first address is within the address range of the first storage medium.

[0103] 4 , the controller can determine the data that has been accessed historically as the target data through the memory access module. For example, according to the description corresponding to situation B2 above, when the first address corresponding to the target data is within the address range of the first storage medium, if the target data is data that has been accessed historically, then a table entry corresponding to the target data will exist in the memory access information table. Based on this, the memory access module can use the data corresponding to the addresses in each table entry included in the memory access information table as the target data, and the address recorded in each table entry is the first address corresponding to the target data.

[0104] In an exemplary embodiment, referring to branch 2 of FIG6 , the memory access module queries the memory access information table to obtain the target data in each clock cycle, thereby achieving periodic determination of the target data. Since the target data is data that needs to be managed, this is equivalent to periodically triggering the management of the target data.

[0105] Step 502: managing target data through a target storage medium, where the target storage medium is the first storage medium, the first part, and the storage medium corresponding to the target data in the second part.

[0106] Since the target data is data that needs to be managed, after the target data is acquired, the target data should be managed through the target storage medium. For example, when the first address corresponding to the target data is located in a different address range, the target storage medium and the method of managing the target data through the target storage medium are also different accordingly, as described below.

[0107] In some embodiments, for the above case B1, ie, the case where the first address corresponding to the target data is within the address range of the second portion in the second storage medium, the target storage medium is the second portion in the second storage medium.

[0108] Correspondingly, referring to branch 1 of Figure 8, the controller manages the target data through the target storage medium, including: the controller manages the target data through the second part. In which, since the first address in situation B1 is obtained according to the target instruction, when the target instruction is a memory access instruction, the controller's management of the target data refers to: according to the instruction of the memory access identifier carried by the target instruction, the target data at the first address included in the second part is accessed. For example, the target data stored at the first address is read and sent to the controller. For another example, the target data is written to the first address. Alternatively, when the target instruction is not a memory access instruction, the controller's management of the target data may refer to: managing the target data in accordance with the default management method. In which, the default management method includes but is not limited to continuing to store the target data in the second part, correcting errors in the target data, etc. The default management method can be set according to actual needs and is not limited here.

[0109] Referring to Figure 4 , in this embodiment, the controller's target data management process can be implemented by the mapping module, migration module, and control module included in the controller. Specifically, the memory access module receives the first address sent by the address translation module, determines that the first address is within the address range of the second portion, and obtains a determination result. The memory access module sends the determination result to the mapping module, which in turn sends the determination result to the migration module. Based on the determination result, the migration module instructs the control module to manage the target data through the second portion. Accordingly, the control module manages the target data through the second portion as instructed, thereby completing the target data management process.

[0110] In other embodiments, for the above cases B2 and A2, that is, the first address corresponding to the target data is within the address range of the first storage medium, the target storage medium is the first part in the second storage medium, or the target storage medium is the first part and the first storage medium.

[0111] Accordingly, the controller manages the target data through the target storage medium, including: the controller obtains first heat information corresponding to the target data, the first heat information is used to indicate whether the target data is hot data, and the controller manages the target data through the target storage medium according to the first heat information.

[0112] Step 501 above introduces the first heat information and explains that the first heat information corresponding to the target data can be determined based on the information recorded in the table item corresponding to the target data. Referring to FIG4 , the controller can determine the first heat information through the memory access module, that is, obtain the first heat information. Exemplarily, the method for obtaining the first heat information includes, but is not limited to, the following cases C1 and C2.

[0113] Corresponding to situation C1 of situation B2, the controller obtains the first heat information corresponding to the target data, including: determining a reference value based on the number of memory accesses of the target data, a reference duration and a first threshold, the reference duration being the difference between the time when the target instruction is received and the time when the target data was last accessed, the reference duration being less than the first threshold, and when the reference value is greater than the second threshold, determining that the first heat information indicates that the target data is hot data, or, when the reference value is less than or equal to the third threshold, determining that the first heat information indicates that the target data is cold data, and the third threshold is less than or equal to the second threshold.

[0114] The controller first determines the current number of memory accesses and the lifetime. Since the lifetime of the entry corresponding to the target data in the memory access information table is the difference between the current moment (i.e., the moment the target instruction was received) and the moment the target data was last accessed, and the lifetime is updated in real time, the lifetime can be used as a reference duration. The controller also obtains a first threshold value, which can be understood as the maximum lifetime. This application does not limit the value of the first threshold value, and the value of the first threshold value can be set according to actual needs.

[0115] For example, taking the memory access count as including the number of reads and the number of writes, determining the reference value based on the number of memory accesses of the target data, the reference duration, and the first threshold includes: a controller determining a weighted sum of the number of reads and the number of writes, determining the difference between the first threshold and the reference duration, determining a ratio between the reference duration and the difference, and then multiplying the weighted sum and the ratio to determine the reference value. Therefore, the process of determining the reference value can be expressed as the following formula:

[0116] In this formula, H represents the reference value, w c Indicates the number of writes, r c represents the number of reads, α represents the weight corresponding to the number of writes, (1-α) represents the weight corresponding to the number of reads, T represents the first threshold, and t represents the reference time.

[0117] After determining the reference value, the controller determines the first heat information based on the value range of the reference value. Referring to branch 1 of Figure 6, when the value range of the reference value is greater than the second threshold, it means that the reference value is large enough and the target data is hot enough, and thus the first heat information is determined to indicate that the target data is hot data. When the value range of the reference data is less than or equal to the third threshold, it means that the reference value is small enough and the target data is cold enough, and thus the first heat information is determined to indicate that the target data is cold data. It should be understood that the values ​​of the second threshold and the third threshold can be determined according to actual needs. It should also be understood that after determining the first heat information, the first heat information needs to be recorded in a newly created table entry, or recorded in an updated table entry as the updated first heat information. For details, see the description in step 501 above, which will not be repeated here.

[0118] Corresponding to case C2 of case A2, the controller obtains first heat information corresponding to the target data, including: when the length of time during which the target data has not been accessed reaches a fourth threshold, determining that the first heat information indicates that the target data is cold data.

[0119] If the target data has not been accessed for a period of time that reaches a fourth threshold, it indicates that the target data has not been accessed for a long period of time and is sufficiently cold. Therefore, it can be determined that the first heat information indicates that the target data is cold data. The value of the fourth threshold can be determined based on actual needs and is not limited here.

[0120] For example, referring to branch 2 of Figure 6, the controller can determine whether the length of time the target data has not been accessed has reached a fourth threshold each time a clock cycle is reached. If the length of time the target data has not been accessed has reached the fourth threshold, it is determined that the first heat information indicates that the target data is cold data. If the length of time the target data has not been accessed has not reached the fourth threshold, it is considered that the target data is not cold data in the current clock cycle, and the judgment process is repeated after the next clock cycle is reached. Of course, the determined first heat information also needs to be recorded in a newly created table entry, or recorded in an updated table entry as the updated first heat information, which will not be repeated here.

[0121] Exemplarily, the manner in which the controller determines that the length of time during which the target data has not been accessed reaches the fourth threshold includes, but is not limited to, the following cases D1 and D2.

[0122] In case D1, a timer corresponding to the target data is obtained. The timer is configured to start counting down from a fourth threshold after the target data was last accessed. Therefore, if the timer corresponding to the target data has reached zero, it indicates that the duration of time the target data has not been accessed has reached the fourth threshold. If the timer corresponding to the target data has not reached zero, it indicates that the duration of time the target data has not been accessed has not yet reached the fourth threshold.

[0123] In case D2, the controller obtains the lifetime from the entry corresponding to the target data. The lifetime is the duration that the target data has not been accessed. The controller can then compare the lifetime with a fourth threshold to determine whether the duration that the target data has not been accessed has reached the fourth threshold.

[0124] It should be understood that the above-described cases C1 and C2 for obtaining the first heat information are examples, and the embodiments of the present application may also obtain the first heat information according to other possible methods, which are not limited here. Regardless of how the first heat information is obtained, the target data can be managed through the target storage medium based on the obtained first heat information. Before explaining the management process, the address mapping table required for the management process is first explained for easier understanding.

[0125] The address mapping table is used to indicate a mapping relationship between a first address within the address range of the first storage medium and a second address within the address range of the first portion. If such a mapping relationship exists in the address mapping table, it indicates that the target data corresponding to the first address has been cached at the second address. If such a mapping relationship does not exist in the address mapping table, it indicates that the first portion has not cached the target data corresponding to the first address. Referring to Figure 4, the controller can query and maintain the address mapping table through the mapping module, as described below.

[0126] For example, as shown in FIG9 , FIG9 shows an address mapping table that uses a fully associative mode. Each entry in the address mapping table occupies 64 bits, and each entry includes, but is not limited to, information such as the first block number, the second block number, a valid bit, a hotness level bit, a dirty bit, and a count bit. Each piece of information is described below.

[0127] First block number: used to indicate the block number in the first storage medium.

[0128] Second block number: used to indicate the block number within the first part.

[0129] Among them, for the address mapping table shown in Figure 9, the first address can be represented by the first block number and the offset information within the block. Accordingly, referring to Figure 9 again, the controller queries the address mapping table according to the first address, including: the controller queries each table entry in the address mapping table according to the first block number included in the first address. Afterwards, if a table entry is hit, the second block number corresponding to the first block number in the table entry is obtained. The second address corresponding to the first address can be determined based on the second block number and the offset information within the block included in the first address, and the second address is within the address range of the first part. In addition, the blocks in the first part included in the second storage medium (such as block 0 and block 1 shown in Figure 9) can also be called pages.

[0130] Valid bit: used to indicate whether the entry is valid.

[0131] Dirty bit: Indicates whether the target data corresponding to the entry is dirty. Dirty data means it has been modified since the first cached data, while non-dirty data means it has not been modified since the first cached data.

[0132] Count bit: used to indicate the locality of the target data corresponding to the entry, such as temporal locality, which refers to the frequency of access to the target data in a short period of time. The embodiment of the present application does not limit the calculation method of the count bit.

[0133] Heat level bit: used to indicate the priority of the target data corresponding to the table entry.

[0134] Among them, the counting bit and the heat level bit are used together to determine the replacement strategy for each table entry in the address mapping table. In other words, the counting bit and the heat level bit are used together to determine which table entries have data that is hot enough and needs to be cached through the first part (adding the table entries corresponding to these data to the address mapping table), and which table entries have data that is not hot enough and does not require the baseline to be cached through the first part (deleting the table entries corresponding to these data from the address mapping table), thereby forming a replacement strategy for each table entry. Exemplarily, the embodiment of the present application combines the counting bit and the heat level bit to determine the replacement strategy based on the least recently used (LRU) algorithm. Thereby forming a kind of LRU-like algorithm, as described below.

[0135] It should be understood that the address mapping table of the fully associative mode is only an example. In the embodiment of the present application, address mapping tables of other modes may be selected according to actual needs, such as the address mapping table of the group associative mode, the address mapping table of the direct mapping mode, etc., which are not limited here.

[0136] Based on the address mapping table described above, the process in which the controller manages the target data through the target storage medium according to the first heat information includes but is not limited to the following cases E1 to E4.

[0137] Case E1, see branch 2 in Figure 8, the controller manages the target data through the target storage medium according to the first heat information, including: the controller queries the address mapping table according to the first address corresponding to the target data to obtain the query result, when the first heat information indicates that the target data is cold data and the query result indicates that the first address does not correspond to the second address, the target data is managed through the target storage medium, and the target storage medium is the first storage medium.

[0138] Since the target data is cold data, there is no need to cache the target data in the first portion. Since the query result indicates that the first address does not correspond to the second address, the first portion does not cache the target data. Therefore, there is no need to adjust the first portion to cache the target data, nor is there any need to replace the entries in the address mapping table.

[0139] This situation E1 can be implemented by the memory access module, mapping module, migration module and control module shown in Figure 4. The memory access module receives the first address sent by the address conversion module, determines that the first address is within the address range of the first storage medium, obtains a determination result, and sends the first address and the determination result to the mapping module. Based on the determination result, the mapping module queries the address mapping table according to the first address to obtain a query result. When the query result indicates that the first address does not correspond to the second address, the mapping module further obtains the first heat information determined by the memory access module. When the first heat information indicates that the target data is cold data, an indication is sent to the migration module. The migration module further instructs the control module, and the control module manages the target data through the first storage medium according to the indication, thereby completing the target data management process.

[0140] Exemplarily, when the controller determines the first heat information according to the target instruction (i.e., case C1 above) and the target instruction is a memory access instruction, the controller manages the target data through the target storage medium, which may include: the controller accesses the target data at the first address in the first storage medium according to the instruction of the memory access identifier carried by the target instruction. For example, the target data stored at the first address is read and sent to the controller, or the target data is written to the first address. Thus, it is equivalent to bypassing the first part and directly accessing the cold data in the first storage medium. In the case where the controller determines the first heat information according to the target instruction but the target instruction is not a memory access instruction, or the controller does not determine the first heat information according to the target instruction (i.e., case C2 above), the controller's management of the target data may refer to: managing the target data at the first address in the first storage medium according to the default management method. Among them, the default management method includes but is not limited to continuing to maintain the storage of the target data, correcting errors in the target data, etc. The default management method can be set according to actual needs and is not limited here.

[0141] Case E2, see branch 3 in Figure 8, the controller manages the target data through the target storage medium according to the first heat information, including: the controller queries the address mapping table according to the first address corresponding to the target data, obtains the query result, and caches the target data at the second address when the first heat information indicates that the target data is hot data and the query result indicates that the first address does not correspond to the second address. The target storage medium includes a first storage medium and a first part. The method also includes: adding a target mapping relationship between the first address and the second address to the address mapping table, that is, adding a table entry corresponding to the target data to the address mapping table.

[0142] Since the target data is hot data, it indicates that the target data needs to be cached through the first part. Since the query result indicates that the first address does not correspond to the second address, it indicates that the first part has not cached the target data. Therefore, it indicates that the hotter target data needs to be cached through the first part, and the controller will read the target data from the first storage medium and cache the target data at the second address, so that the first part caches the target data, which is conducive to the subsequent rapid access to the target data through the first part. In addition, the controller also needs to add a table entry corresponding to the target data in the address mapping table to indicate that the first part has cached the target data.

[0143] This situation E2 can be implemented by the memory access module, mapping module, migration module and control module shown in Figure 4. The memory access module receives the first address sent by the address conversion module, determines that the first address is located in the address range of the first storage medium, obtains a determination result, and sends the first address and the determination result to the mapping module. Based on the determination result, the mapping module queries the address mapping table according to the first address to obtain a query result. When the query result indicates that the first address does not correspond to the second address, the mapping module further obtains the first heat information determined by the memory access module. When the first heat information indicates that the target data is hot data, the mapping module, on the one hand, adds a table entry corresponding to the target data to the address mapping table, and on the other hand, sends an instruction to the migration module. The migration module further instructs the control module, and the control module obtains the target data from the first address of the first storage medium according to the instruction and caches the target data at the second address of the first part.

[0144] In addition, the controller may use a general LRU algorithm in the process of adding the target mapping relationship between the first address and the second address in the address mapping table. In the LRU algorithm, if the target data is hot data (i.e., the first heat information corresponding to the target data in the memory access information table is greater than the second threshold), the target mapping relationship corresponding to the target data is added to the address mapping table, for example, the original mapping relationship in the address mapping table is directly replaced with the target mapping relationship.

[0145] However, if this hot data is sudden hot data that occurs occasionally within a certain period of time, then using this direct replacement method will cause the address mapping table to be filled with the mapping relationships corresponding to the sudden hot data. For normal hot data with a higher average access frequency but a lower access frequency than the sudden hot data within this period of time, the address mapping table cannot record the mapping relationships corresponding to these normal hot data, which may reduce the cache hit rate. Furthermore, if there is a lot of sudden hot data within this period of time, the table entries in the address mapping table will also be frequently replaced, which will not only cause a lot of time and energy consumption, but may also reduce the cache hit rate. It can be seen that the LRU algorithm has certain limitations, which may lead to a low cache hit rate, and thus lead to a decrease in memory access performance.

[0146] Therefore, the embodiment of the present application improves the LRU algorithm, combines the count bit, the heat level bit and the buffer included in the address mapping table and the controller to form a quasi-LRU algorithm. Among them, the buffer includes multiple queues, different queues have different priorities, and each queue is used to store a certain mapping relationship. The priorities of different positions in the same queue can be different or the same. For example, referring to Figure 10, Figure 10 shows an exemplary buffer, which includes a high priority queue, a medium priority queue and a low priority queue, and the priorities of different positions in the same queue are different.

[0147] Based on this, in an exemplary embodiment, the controller adds a target mapping relationship between the first address and the second address in the address mapping table, including but not limited to the following case F1 and case F2.

[0148] Case F1, adding a target mapping relationship between the first address and the second address to the address mapping table, including: the controller adds the target mapping relationship to the queue with the lowest priority among multiple queues, and updates the position of the target mapping relationship in the multiple queues according to the update of the second heat information, until the target mapping relationship is added to the queue with the highest priority among the multiple queues, and then adds the target mapping relationship to the address mapping table.

[0149] The target mapping relationship corresponds to the second heat information, which is used to indicate the heat level of the target data. The second heat information is the count bit and heat level bit in the address mapping table shown in Figure 9. According to the above description, the count bit is used to indicate the temporal locality of the target data corresponding to the table entry, and the heat level bit is used to indicate the priority of the target data corresponding to the table entry, which can be the priority of the queue where the target data is located.

[0150] In case F1, although it is determined that the target data is hot data, the target mapping relationship corresponding to the target data is not directly added to the address mapping table, so the target mapping relationship is first added to a queue with the lowest priority among multiple queues. If the target data continues to be frequently accessed in the future, and the time locality indicated by the count bit increases, the target mapping relationship can be transferred to a higher priority position in the same queue. If the target mapping relationship is already in the highest priority position in a queue, the target mapping relationship can be transferred to a position in a queue with a higher priority, and the priority indicated by the heat level bit also increases. Similarly, if the target mapping relationship can be subsequently transferred to the queue with the highest priority among multiple queues, it means that the target data corresponding to the target mapping relationship has sufficient heat, and thus such a target mapping relationship with sufficiently high heat can be added to the address mapping table.

[0151] Since this method does not add the target mapping relationship directly to the address mapping table, but adds the target mapping relationship to the address mapping table after buffering in the buffer zone, it is equivalent to an upgrade mechanism (as shown in Figure 10). Therefore, it can not only avoid the address mapping table being filled with only sudden hot data and unable to cache the mapping relationship corresponding to normal hot data, but also avoid the table entries in the address mapping table being frequently replaced, thereby increasing the cache hit rate and saving time, energy consumption and other expenses.

[0152] Case F2, adding a target mapping relationship between the first address and the second address in the address mapping table, includes: the controller obtains a reference mapping relationship from a queue with the lowest priority among the multiple queues, and replaces the reference mapping relationship in the address mapping table with the target mapping relationship.

[0153] Among them, the reference mapping relationship is transferred from a queue with a non-lowest priority among multiple queues to a queue with the lowest priority among multiple queues. That is to say, the priority of the reference mapping relationship is gradually reduced. For example, the reference data corresponding to the reference mapping relationship was once hot data, so the reference mapping relationship was added to the address mapping table, and when it was added to the address mapping table, the reference mapping relationship was in a queue with a non-lowest priority among multiple queues (for example, a queue with the highest priority). However, since the reference data is not frequently accessed subsequently, the temporal locality indicated by the count bit continues to decrease, then the target mapping relationship can be transferred to a lower priority position in the same queue. Afterwards, if the target mapping relationship is already in the lowest priority position in a queue, then the target mapping relationship can be transferred to a position in a queue with a lower priority, and the priority indicated by the heat level bit is also reduced. By analogy, the reference mapping relationship will be transferred to the queue with the lowest priority and replaced by the target mapping relationship in the address mapping table.

[0154] For example, when the priorities of various positions in the lowest-priority queue are the same, the reference mapping relationship may be the mapping relationship at any position in the lowest-priority queue. When the priorities of various positions in the lowest-priority queue are different, the reference mapping relationship may be the mapping relationship at the lowest-priority position in the lowest-priority queue.

[0155] Since this method does not directly replace the reference mapping relationship, but instead replaces the reference mapping relationship with the target mapping relationship after being buffered in the buffer, it is equivalent to a degradation mechanism (as shown in Figure 10). Therefore, it can avoid the frequent replacement of table entries in the address mapping table, increase the cache hit rate, and save time, energy consumption and other expenses.

[0156] As described above, the mapping module shown in FIG4 can be used to add an entry corresponding to the target data to the address mapping table. For example, in cases F1 and F2 above, the mapping module can send an instruction to the migration module, which in turn sends an instruction to the control module, causing the control module to control the buffer, thereby adding the target mapping relationship to the address mapping table through the buffer, thereby replacing the entry in the address mapping table.

[0157] Exemplarily, when the controller determines the first heat information based on the target instruction (i.e., case C1 above) and the target instruction is a memory access instruction, the controller's management of the target data may also include: accessing the target data according to the instructions of the memory access identifier carried by the target instruction, for example, accessing the target data stored at the first address or the second address.

[0158] In case E3, referring to branch 4 in FIG. 8 , the controller manages the target data via the target storage medium based on the first heat information, including: the controller queries an address mapping table based on the first address corresponding to the target data to obtain a query result; if the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address, deleting the target data cached at the second address. The method also includes: the controller deleting the target mapping relationship between the first address and the second address from the address mapping table, that is, deleting the entry corresponding to the target data in the address mapping table.

[0159] Since the target data is cold data, it means that there is no need to cache the target data through the first part. Since the query result indicates that the first address corresponds to the second address, it means that the first part has cached the target data. Therefore, it means that there is no longer any need to cache the colder target data through the first part, and the controller needs to delete the target data cached at the second address so as to leave more capacity in the first part for caching other hot data. In addition, the controller also needs to delete the table entry corresponding to the target data from the address mapping table so as to indicate that the first part no longer caches the target data.

[0160] This situation E3 can be implemented by the memory access module, mapping module, migration module and control module shown in Figure 4. The memory access module receives the first address sent by the address conversion module, determines that the first address is located in the address range of the first storage medium, obtains a determination result, and sends the first address and the determination result to the mapping module. Based on the determination result, the mapping module queries the address mapping table according to the first address to obtain a query result. When the query result indicates that the first address corresponds to the second address, the mapping module further obtains the first heat information determined by the memory access module. When the first heat information indicates that the target data is cold data, the mapping module deletes the table entry corresponding to the target data from the address mapping table on the one hand, and sends an instruction to the migration module on the other hand. The migration module further instructs the control module, and the control module deletes the target data cached at the second address of the first part according to the instruction.

[0161] In an exemplary embodiment, the controller can directly delete the target data in the first part of the cache without having to determine whether the target data in the first part of the cache is dirty data. For example, when the second storage medium is a read-only storage medium, the target data in the first part of the cache will not be modified and will not become dirty data, so there is no need to determine whether the target data is dirty data. Alternatively, if the target data in the first part of the cache is likely to be modified, the controller can first determine whether the target data is dirty data, such as by querying the table entry corresponding to the target data in the address mapping table through the mapping module, and determining whether the target data is dirty data based on the dirty bit in the table entry. Afterwards, the target data is deleted based on the determination result. See Case G1 and Case G2 for details.

[0162] In case G1, when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to the second address, and the query result also indicates that the target data is dirty data, the target data cached at the second address is written to the first address, and then the target data cached at the second address is deleted.

[0163] Since the target data is dirty, this indicates that the target data has been modified since the first portion cached the target data. In other words, the target data stored at the first address of the first storage medium is inconsistent with the target data cached at the second address of the first portion. Therefore, it is necessary to first write the target data cached at the second address to the first address and then delete the target data cached at the second address to ensure data consistency between the first storage medium and the first portion. Both the writing and deleting processes can be performed by the control module shown in FIG4 .

[0164] In case G2, when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to the second address, and the query result also indicates that the target data is not dirty data, the target data cached at the second address is deleted.

[0165] Since the target data is not dirty, it indicates that the target data has not been modified since it was cached in the first portion. Therefore, the target data stored at the first address of the first storage medium and the target data cached at the second address of the first portion are identical. Therefore, the target data cached at the second address can be directly deleted without writing the target data to the first address of the first storage medium.

[0166] Exemplarily, when the controller determines the first heat information based on the target instruction (i.e., case C1 above) and the target instruction is a memory access instruction, the controller's management of the target data may also include: accessing the target data according to the indication of the memory access identifier carried by the target instruction, for example, accessing the target data stored at the second address of the first part before deleting the target data from the first part, and for example, accessing the target data stored at the first address of the first storage medium after deleting the target data from the first part.

[0167] In case E4, referring to branch 5 in FIG8 , the controller manages the target data through the target storage medium based on the first heat information, including: querying the address mapping table based on the first address corresponding to the target data to obtain a query result; and if the first heat information indicates that the target data is hot data and the query result indicates that the first address corresponds to a second address, continuing to cache the target data at the second address. The method also includes: updating second heat information corresponding to the target mapping relationship between the first address and the second address, the second heat information being used to indicate the hotness of the target mapping relationship.

[0168] Since the target data is hot data, it means that the target data needs to be cached through the first part. Since the query result indicates that the first address corresponds to the second address, it means that the first part has already cached the target data. Therefore, there is no need to adjust the cache status of the target data, so that the target data can continue to be cached at the second address, and there is no need to replace the various entries in the address mapping table. It is only necessary to update the second heat information corresponding to the target mapping relationship. That is, the count bit and the heat level bit are updated in the address mapping table to indicate that the heat level of the target mapping relationship has increased.

[0169] This situation E4 can be implemented by the memory access module and mapping module shown in Figure 4. The memory access module receives the first address sent by the address conversion module, determines that the first address is located in the address range of the first storage medium, obtains a determination result, and sends the first address and the determination result to the mapping module. Based on the determination result, the mapping module queries the address mapping table according to the first address to obtain a query result. When the query result indicates that the first address corresponds to the second address, the mapping module further obtains the first heat information determined by the memory access module. When the first heat information indicates that the target data is hot data, the mapping module updates the second heat information corresponding to the target mapping relationship in the address mapping table. In addition, corresponding to the update of the second heat information, the position of the target mapping relationship in each priority queue included in the buffer can also be adjusted according to the updated second heat information, so that the target mapping relationship is less likely to be replaced from the address mapping table by other mapping relationships.

[0170] Exemplarily, when the controller determines the first heat information based on the target instruction (i.e., case C1 above) and the target instruction is a memory access instruction, the controller's management of the target data may also include: accessing the target data according to the instructions of the memory access identifier carried by the target instruction, for example, accessing the target data stored at the second address.

[0171] According to the above situations E1 to E4, it can be seen that the embodiment of the present application can dynamically switch the architecture between the first storage medium and the first part only through the controller, and maintain the consistency of the target data between the first storage medium and the first part. In the process of switching from a parallel architecture to a hierarchical architecture, it is only necessary to gradually establish new entries in the address mapping table. In the process of switching from a hierarchical architecture to a parallel architecture, it is only necessary to delete entries in the address mapping table, and increase the overhead of writing the target data back to the first storage medium when the target data is dirty data. In addition, during the normal use of the data management system, such as when only data access is required, the overhead of querying the address mapping table to determine whether the cache hits may be generated. In addition, no other overhead for maintaining consistency will be generated. Compared to the large amount of overhead generated by maintaining consistency through the operating system in the related art (including but not limited to: the overhead of on-chip cache flushing, the overhead of translation lookaside buffer (TLB) shootdown, etc.), the overhead required by the embodiment of the present application is lower.

[0172] To sum up, the data management system provided by the embodiment of the present application can enable the coexistence of parallel architecture and hierarchical architecture, which can not only meet the memory access requirements of applications with weak locality, but also meet the memory access requirements of applications with strong locality, and has strong applicability.

[0173] For applications with weak locality, if a hierarchical architecture is used alone, data stored in the slow memory needs to be cached in the fast memory, resulting in unnecessary data movement, longer memory access latency, and higher power consumption. Moreover, when the hierarchical architecture is used alone, only the first storage medium serves as the main memory, and the main memory capacity is relatively small. Therefore, the embodiments of the present application can adopt a parallel architecture for applications with weak locality. The first storage medium and the second part can each serve as the main memory, which is equivalent to increasing the main memory capacity. Moreover, by storing data in the first storage medium or the first part, unnecessary data movement can be avoided, thereby reducing memory access latency and power consumption.

[0174] For applications with strong locality, if a parallel architecture is used alone, memory access operations for the slow memory may be generated, and the data in the fast memory may need to be written back to the slow memory (because after the data is migrated from the slow memory to the fast memory, the slow memory no longer stores the data, so it needs to be written back). Therefore, not only the memory access latency is increased, but also the power consumption is increased. Therefore, the embodiment of the present application can adopt a hierarchical architecture for applications with strong locality, and transfer the hot data from the first storage medium with a slower memory access speed to the first part with a faster memory access speed, and the data cached in the first part may not be written back to the first storage medium. Thus, not only the memory access latency can be reduced, but also the overhead required for write-back is saved, power consumption is reduced, and wear on the first storage medium is reduced, which is conducive to extending the service life of the first storage medium.

[0175] The above describes the data management method provided by the embodiment of the present application. Corresponding to the above method, the embodiment of the present application also provides a data management device. The data management device is applied to the controller included in the data management system, and the data management system also includes a first storage medium and a second storage medium. The memory access speed of the first storage medium is lower than the memory access speed of the second storage medium. The second storage medium includes a first part and a second part. The first part is a cache of the first storage medium, and the first storage medium and the second part are non-cached. The data management device is used to execute the data management method shown in Figure 5 above through the various modules shown in Figure 11. As shown in Figure 11, the data management device provided by the embodiment of the present application includes the following modules.

[0176] An acquisition module 1101 is used to acquire target data that needs to be managed;

[0177] The management module 1102 is configured to manage target data through a target storage medium, where the target storage medium is the first storage medium, the first part, and the storage medium corresponding to the target data in the second part.

[0178] In an exemplary embodiment, the management module 1102 is used to obtain first heat information corresponding to the target data, where the first heat information is used to indicate whether the target data is hot data; based on the first heat information, the target data is managed through the target storage medium; wherein the target storage medium is the first part, or the target medium is the first storage medium and the first part.

[0179] In an exemplary embodiment, the management module 1102 is used to receive a target instruction, obtain a first address according to the target instruction, and determine the data corresponding to the first address as the target data; when the first address is within the address range of the first storage medium, determine a reference value based on the number of memory accesses of the target data, a reference duration and a first threshold, the reference duration being the difference between the time when the target instruction is received and the time when the target data was last accessed, and the reference duration is less than the first threshold; when the reference value is greater than the second threshold, determine that the first heat information indicates that the target data is hot data, or, when the reference value is less than or equal to the third threshold, determine that the first heat information indicates that the target data is cold data, and the third threshold is less than or equal to the second threshold.

[0180] Exemplarily, the management module 1102 is used to determine data that has been accessed historically as target data, the target data corresponds to a first address, and the first address is located within the address range of the first storage medium; when the length of time that the target data has not been accessed reaches a fourth threshold, it is determined that the first heat information indicates that the target data is cold data.

[0181] In an exemplary embodiment, the management module 1102 is configured to query the address mapping table according to the first address corresponding to the target data to obtain a query result; and if the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address within the address range of the first portion, delete the target data cached at the second address;

[0182] The management module 1102 is further configured to delete the target mapping relationship between the first address and the second address from the address mapping table.

[0183] In an exemplary embodiment, the management module 1102 is used to write the target data cached at the second address to the first address, and then delete the target data cached at the second address when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is dirty data.

[0184] Exemplarily, the management module 1102 is used to delete the target data cached at the second address when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is not dirty data.

[0185] In an exemplary embodiment, the management module 1102 is configured to query the address mapping table according to the first address corresponding to the target data to obtain a query result; if the first heat information indicates that the target data is hot data and the query result indicates that the first address does not correspond to a second address within the address range of the first portion, cache the target data at the second address;

[0186] The management module 1102 is further configured to add a target mapping relationship between the first address and the second address to the address mapping table.

[0187] In an exemplary embodiment, the management module 1102 is used to add the target mapping relationship to the queue with the lowest priority among multiple queues, and the target mapping relationship corresponds to the second heat information, and the second heat information is used to indicate the heat level of the target data; according to the update of the second heat information, the position of the target mapping relationship in the multiple queues is updated until the target mapping relationship is added to the queue with the highest priority among the multiple queues, and then the target mapping relationship is added to the address mapping table.

[0188] In an exemplary embodiment, the management module 1102 is used to obtain a reference mapping relationship from the queue with the lowest priority among multiple queues, replace the reference mapping relationship in the address mapping table with the target mapping relationship, and transfer the reference mapping relationship from the queue with a non-lowest priority among multiple queues to the queue with the lowest priority among multiple queues.

[0189] Exemplarily, the management module 1102 is configured to query the address mapping table according to the first address corresponding to the target data to obtain a query result; and if the first heat information indicates that the target data is hot data and the query result indicates that the first address corresponds to a second address within the address range of the first portion, continue to cache the target data at the second address;

[0190] The management module 1102 is further configured to update second heat information corresponding to the target mapping relationship between the first address and the second address, where the second heat information is used to indicate the heat level of the target mapping relationship.

[0191] It should be understood that the beneficial effects of the device provided in FIG11 above when implementing its functions are the same as the beneficial effects of the data management method shown in FIG5 . In addition, when implementing its functions, the device provided in FIG11 is only illustrated by the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept. The implementation process is detailed in the method embodiment and will not be repeated here.

[0192] In an exemplary embodiment, the present application also provides a data management device. As shown in FIG12 , the data management device includes a processor and a data management system. The processor is connected to a controller included in the data management system, for example, the processor is connected to the controller via a bus. The data management system can be any of the data management systems described above, such as the data management system shown in FIG3 or FIG4 .

[0193] Exemplarily, the processor is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a GPU, a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor or one or more integrated circuits or application-specific integrated circuits (ASICs) for implementing the solution of the present application, a programmable logic device (PLD), other general-purpose processors or other programmable logic devices, discrete gates, transistor logic devices, discrete hardware components or any combination thereof. PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor, etc. It is worth noting that the processor can be a processor that supports the advanced reduced instruction set machine (ARM) architecture. It can implement or execute the various logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.

[0194] For example, the embodiment of the present application further provides a controller for executing the data management method corresponding to Figure 5. The controller can be a chip or other forms other than a chip, which is not limited here.

[0195] In this application, the terms "first," "second," and the like are used to distinguish between identical or similar items having substantially the same function or effect. It should be understood that "first," "second," and "nth" do not have a logical or temporal dependency, nor do they limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first," "second," and the like to describe various elements, these elements should not be limited by these terms. These terms are simply used to distinguish one element from another.

[0196] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0197] In this application, the term "at least one" means one or more, and the term "plurality" means two or more. For example, a plurality of queues means two or more queues. The terms "system" and "network" are often used interchangeably herein.

[0198] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0199] It should also be understood that the terms “if” and “if” may be interpreted to mean “when” or “upon” or “in response to determining” or “in response to detecting.” Similarly, the phrases “if it is determined that ” or “if [stated condition or event] is detected” may be interpreted to mean “upon determining ” or “in response to determining ” or “upon detecting [stated condition or event]” or “in response to detecting [stated condition or event],” depending on the context.

[0200] The above description is merely an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A data management system, characterized in that: The data management system includes a controller, a first storage medium and a second storage medium, wherein the memory access speed of the first storage medium is lower than the memory access speed of the second storage medium, the second storage medium includes a first part and a second part, the first part is a cache of the first storage medium, and the first storage medium and the second part are non-cached; The controller is used to obtain target data that needs to be managed; The controller is further configured to manage the target data through a target storage medium, where the target storage medium is a storage medium corresponding to the target data in the first storage medium, the first part, and the second part.

2. The data management system according to claim 1, characterized in that: The controller is used to obtain first heat information corresponding to the target data, where the first heat information is used to indicate whether the target data is hot data; managing the target data through the target storage medium according to the first heat information; The target storage medium is the first part, or the target medium is the first storage medium and the first part.

3. The data management system according to claim 2, characterized in that: The controller is configured to receive a target instruction, obtain a first address according to the target instruction, and determine data corresponding to the first address as the target data; In the case where the first address is within the address range of the first storage medium, determining a reference value according to the number of memory accesses of the target data, a reference duration, and a first threshold, the reference duration being the difference between the time when the target instruction is received and the time when the target data was last accessed, and the reference duration being less than the first threshold; When the reference value is greater than a second threshold, it is determined that the first heat information indicates that the target data is hot data; or, when the reference value is less than or equal to a third threshold, it is determined that the first heat information indicates that the target data is cold data, and the third threshold is less than or equal to the second threshold.

4. The data management system according to claim 2, characterized in that: The controller is used to determine the historically accessed data as the target data, the target data corresponds to a first address, and the first address is within the address range of the first storage medium; When the time length during which the target data is not accessed reaches a fourth threshold, it is determined that the first heat information indicates that the target data is cold data.

5. The data management system according to any one of claims 2 to 4, characterized in that: The controller is used to query the address mapping table according to the first address corresponding to the target data to obtain a query result; When the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address within the address range of the first part, deleting the target data cached at the second address; The controller is further configured to delete a target mapping relationship between the first address and the second address from the address mapping table.

6. The data management system according to claim 5, characterized in that: The controller is used to write the target data cached at the second address to the first address and then delete the target data cached at the second address when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is dirty data.

7. The data management system according to claim 5, characterized in that: The controller is used to delete the target data cached at the second address when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is not dirty data.

8. The data management system according to claim 2 or 3, characterized in that: The controller is used to query the address mapping table according to the first address corresponding to the target data to obtain a query result; When the first heat information indicates that the target data is hot data and the query result indicates that the first address does not correspond to a second address within the address range of the first portion, caching the target data at the second address; The controller is further configured to add a target mapping relationship between the first address and the second address in the address mapping table.

9. The data management system according to claim 8, characterized in that: The controller is used to add the target mapping relationship to a queue with the lowest priority among the multiple queues, the target mapping relationship corresponding to second heat information, and the second heat information is used to indicate the heat level of the target data; According to the update status of the second heat information, the position of the target mapping relationship in the multiple queues is updated until the target mapping relationship is added to the queue with the highest priority among the multiple queues, and then the target mapping relationship is added to the address mapping table.

10. The data management system according to claim 8, characterized in that: The controller is used to obtain a reference mapping relationship from a queue with the lowest priority among multiple queues, replace the reference mapping relationship in the address mapping table with the target mapping relationship, and transfer the reference mapping relationship from a queue with a non-lowest priority among the multiple queues to a queue with the lowest priority among the multiple queues.

11. The data management system according to claim 2 or 3, characterized in that: The controller is used to query the address mapping table according to the first address corresponding to the target data to obtain a query result; When the first heat information indicates that the target data is hot data and the query result indicates that the first address corresponds to a second address within the address range of the first part, continue to cache the target data at the second address; The controller is further used to update second heat information corresponding to the target mapping relationship between the first address and the second address, where the second heat information is used to indicate the heat level of the target mapping relationship.

12. A data management method, characterized in that: The data management method is applied to a controller included in a data management system, the data management system also includes a first storage medium and a second storage medium, the memory access speed of the first storage medium is lower than the memory access speed of the second storage medium, the second storage medium includes a first part and a second part, the first part is a cache of the first storage medium, and the first storage medium and the second part are non-cached, the data management method includes: Obtain the target data that needs to be managed; The target data is managed by a target storage medium, and the target storage medium is a storage medium corresponding to the target data in the first storage medium, the first part, and the second part.

13. The data management method according to claim 12, characterized in that: The managing the target data through the target storage medium includes: Acquire first heat information corresponding to the target data, where the first heat information is used to indicate whether the target data is hot data; managing the target data through the target storage medium according to the first heat information; The target storage medium is the first part, or the target medium is the first storage medium and the first part.

14. The data management method according to claim 13, characterized in that: The obtaining the first heat information corresponding to the target data includes: receiving a target instruction, acquiring a first address according to the target instruction, and determining data corresponding to the first address as the target data; In the case where the first address is within the address range of the first storage medium, determining a reference value according to the number of memory accesses of the target data, a reference duration, and a first threshold, the reference duration being the difference between the time when the target instruction is received and the time when the target data was last accessed, and the reference duration being less than the first threshold; When the reference value is greater than a second threshold, it is determined that the first heat information indicates that the target data is hot data; or, when the reference value is less than or equal to a third threshold, it is determined that the first heat information indicates that the target data is cold data, and the third threshold is less than or equal to the second threshold.

15. The data management method according to claim 13, characterized in that: The obtaining the first heat information corresponding to the target data includes: Determine the historically accessed data as the target data, the target data corresponds to a first address, and the first address is within the address range of the first storage medium; When the time length during which the target data is not accessed reaches a fourth threshold, it is determined that the first heat information indicates that the target data is cold data.

16. The data management method according to any one of claims 13 to 15, characterized in that: The step of managing the target data through the target storage medium according to the first heat information includes: Querying an address mapping table according to the first address corresponding to the target data to obtain a query result; When the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address within the address range of the first part, deleting the target data cached at the second address; The data management method further comprises: The target mapping relationship between the first address and the second address is deleted from the address mapping table.

17. The data management method according to claim 16, characterized in that: When the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address within the address range of the first part, deleting the target data cached at the second address includes: When the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is dirty data, after the target data cached at the second address is written to the first address, the target data cached at the second address is deleted.

18. The data management method according to claim 16, characterized in that: When the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address within the address range of the first part, deleting the target data cached at the second address includes: When the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is not dirty data, the target data cached at the second address is deleted.

19. The data management method according to claim 13 or 14, characterized in that: The step of managing the target data through the target storage medium according to the first heat information includes: Querying an address mapping table according to the first address corresponding to the target data to obtain a query result; When the first heat information indicates that the target data is hot data and the query result indicates that the first address does not correspond to a second address within the address range of the first portion, caching the target data at the second address; The data management method further comprises: A target mapping relationship between the first address and the second address is added to the address mapping table.

20. The data management method according to claim 19, characterized in that: The adding a target mapping relationship between the first address and the second address in the address mapping table includes: Adding the target mapping relationship to a queue with the lowest priority among multiple queues, the target mapping relationship corresponding to second heat information, the second heat information being used to indicate the heat level of the target data; According to the update status of the second heat information, the position of the target mapping relationship in the multiple queues is updated until the target mapping relationship is added to the queue with the highest priority among the multiple queues, and then the target mapping relationship is added to the address mapping table.

21. The data management method according to claim 19, characterized in that: The adding a target mapping relationship between the first address and the second address in the address mapping table includes: A reference mapping relationship is obtained from the queue with the lowest priority among multiple queues, the reference mapping relationship in the address mapping table is replaced with the target mapping relationship, and the reference mapping relationship is transferred from the queue with a non-lowest priority among the multiple queues to the queue with the lowest priority among the multiple queues.

22. The data management method according to claim 13 or 14, characterized in that: The step of managing the target data through the target storage medium according to the first heat information includes: Querying an address mapping table according to the first address corresponding to the target data to obtain a query result; When the first heat information indicates that the target data is hot data and the query result indicates that the first address corresponds to a second address within the address range of the first part, continue to cache the target data at the second address; The data management method further includes: updating second heat information corresponding to a target mapping relationship between the first address and the second address, wherein the second heat information is used to indicate a heat level of the target mapping relationship.

23. A data management device, characterized in that: The data management device is applied to a controller included in a data management system, the data management system also includes a first storage medium and a second storage medium, the memory access speed of the first storage medium is lower than the memory access speed of the second storage medium, the second storage medium includes a first part and a second part, the first part is a cache of the first storage medium, the first storage medium and the second part are non-cached, and the data management device includes: The acquisition module is used to obtain the target data that needs to be managed; A management module is used to manage the target data through a target storage medium, where the target storage medium is the storage medium corresponding to the target data in the first storage medium, the first part, and the second part.

24. The data management device according to claim 23, characterized in that: The management module is used to obtain first heat information corresponding to the target data, where the first heat information is used to indicate whether the target data is hot data; and manage the target data through the target storage medium according to the first heat information; wherein the target storage medium is the first part, or the target medium is the first storage medium and the first part.

25. The data management device according to claim 24, characterized in that: The management module is configured to receive a target instruction, obtain a first address according to the target instruction, and determine data corresponding to the first address as the target data; when the first address is within the address range of the first storage medium, determine a reference value according to the number of memory accesses of the target data, a reference duration, and a first threshold, wherein the reference duration is a difference between a time when the target instruction is received and a time when the target data was last accessed, and the reference duration is less than the first threshold; When the reference value is greater than a second threshold, it is determined that the first heat information indicates that the target data is hot data; or, when the reference value is less than or equal to a third threshold, it is determined that the first heat information indicates that the target data is cold data, and the third threshold is less than or equal to the second threshold.

26. The data management device according to claim 24, characterized in that: The management module is used to determine the data that has been accessed historically as the target data, the target data corresponds to a first address, and the first address is located within the address range of the first storage medium; when the length of time that the target data has not been accessed reaches a fourth threshold, it is determined that the first heat information indicates that the target data is cold data.

27. The data management device according to any one of claims 24 to 26, characterized in that: The management module is configured to query the address mapping table according to the first address corresponding to the target data to obtain a query result; if the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to a second address within the address range of the first part, delete the target data cached at the second address; The management module is further used to delete the target mapping relationship between the first address and the second address from the address mapping table.

28. The data management device according to claim 27, characterized in that: The management module is used to write the target data cached at the second address to the first address and then delete the target data cached at the second address when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is dirty data.

29. The data management device according to claim 27, characterized in that: The management module is used to delete the target data cached at the second address when the first heat information indicates that the target data is cold data, the query result indicates that the first address corresponds to a second address within the address range of the first part, and the query result also indicates that the target data is not dirty data.

30. The data management device according to claim 24 or 25, characterized in that: The management module is configured to query the address mapping table according to the first address corresponding to the target data to obtain a query result; if the first heat information indicates that the target data is hot data and the query result indicates that the first address does not correspond to a second address within the address range of the first part, cache the target data at the second address; The management module is further used to add a target mapping relationship between the first address and the second address in the address mapping table.

31. The data management device according to claim 30, characterized in that: The management module is used to add the target mapping relationship to a queue with the lowest priority among the multiple queues, the target mapping relationship corresponds to second heat information, and the second heat information is used to indicate the heat level of the target data; According to the update status of the second heat information, the position of the target mapping relationship in the multiple queues is updated until the target mapping relationship is added to the queue with the highest priority among the multiple queues, and then the target mapping relationship is added to the address mapping table.

32. The data management device according to claim 30, characterized in that: The management module is used to obtain a reference mapping relationship from the queue with the lowest priority among multiple queues, replace the reference mapping relationship in the address mapping table with the target mapping relationship, and transfer the reference mapping relationship from the queue with a non-lowest priority among the multiple queues to the queue with the lowest priority among the multiple queues.

33. The data management device according to claim 24 or 25, characterized in that: The management module is configured to query the address mapping table according to the first address corresponding to the target data to obtain a query result; if the first heat information indicates that the target data is hot data and the query result indicates that the first address corresponds to a second address within the address range of the first part, continue to cache the target data at the second address; The management module is further used to update second heat information corresponding to the target mapping relationship between the first address and the second address, where the second heat information is used to indicate the heat level of the target mapping relationship.

34. A data management device, characterized in that: The data management device comprises a processor and a data management system, wherein the processor is connected to a controller included in the data management system, and the data management system is the data management system according to any one of claims 1-11.

35. A controller, characterized in that: The controller is used to execute the data management method described in any one of claims 12-22.

Citation Information

Patent Citations

  • Data management system, method, device, equipment and controller

    CN118732933A

  • Storage device and data file access method

    CN103838681A

  • Flash memory, storage medium conversion method and computing device

    CN113821158A

  • Memory management method and device, equipment and storage medium

    CN114253873A