Data management system, method, device, equipment and controller
By utilizing the dynamic switching architecture of the controller and two storage media in the data management system, and managing the target data based on data popularity information, the problem of difficulty in meeting the memory access needs of different applications in the existing technology is solved, and efficient memory access speed is achieved. and mass storage.
Patent Information
- Application Number
- CN202310379505.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-01
AI Technical Summary
Existing storage technology is difficult to dynamically switch between parallel architecture and hierarchical architecture, resulting in the inability to meet the memory access requirements of different applications. Especially for applications with strong or weak locality, memory access speed and capacity requirements cannot be met at the same time.
Provide a data management system that uses a controller and two storage media, one as a cache and the other as a non-cache. By dynamically switching between parallel architecture and hierarchical architecture, it manages target data according to the hotness information of the data to achieve fast memory access and large-scale storage. capacity storage.
It realizes the dynamic switching between parallel architecture and hierarchical architecture in the data management system, meets the high memory access speed of applications with strong locality and the large main memory capacity requirements of applications with weak locality, and reduces the operational complexity.
Smart Images

Figure CN118732933A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a data management system, method, device, equipment and controller. Background Art
[0002] Storage media is used to store data. How to manage data has become a problem worthy of attention. Summary of the invention
[0003] The present application provides a data management system, method, device, equipment and controller to manage 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 storage and the second storage medium is a fast storage. 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. Among them, 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. Among them, the first storage medium and the second part constitute a parallel architecture, and the first storage medium and the first part constitute 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 constitute a parallel architecture. With the continuous use of the data management system, the first part gradually begins to cache part of the data stored in the first storage medium, and the first storage medium and the first part switch from a parallel architecture to a hierarchical architecture. With the continued use of the data management system, the first part no longer needs to continue caching some cached data, and the first storage medium and the first part switch from a hierarchical structure to a parallel architecture. In addition, the process of dynamically switching between the parallel architecture and the hierarchical architecture can be completed when the data management system is used normally.
[0006] For applications with strong locality, the parallel architecture can be switched to the hierarchical architecture so that more hot data is cached in the first part. Since the first part has a higher memory access speed, it can meet the high memory access speed required by applications with strong locality. For applications with weaker locality, the hierarchical architecture can be switched to the parallel architecture so that less hot data is cached in the first part. The first part occupies a smaller capacity in the second storage medium, 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 large main memory capacity required by applications with weaker locality.
[0007] In a possible implementation, the controller is used to obtain first heat information corresponding to the target data, the first heat information is used to indicate whether the target data is hot data; according to the first heat information, the target data is managed through a 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. In this implementation, the target data is managed according to the first heat information of the target data, which is conducive to ensuring the accuracy of management, thereby meeting the memory access requirements of various applications.
[0008] In a 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 according to the number of memory accesses of the target data, a reference duration, and a first threshold value, 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 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 according to the reference value is also relatively accurate.
[0009] In a possible implementation, the controller is used to determine the data that has been accessed historically 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; 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. In this implementation, there is no need to trigger the management of the target data through a target instruction, and the data that has been accessed historically can be used as the target data that needs to be managed.
[0010] In a possible implementation, 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; 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, the target data cached at the second address is deleted. The controller is also used 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 caches the target data. Therefore, it means that there is no 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 the data consistency between the first storage medium and the first part. The present application can maintain the 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 data, it means that the target data has not been modified after the first part caches the target data, and 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 part are originally consistent data. Therefore, the target data cached at the second address can be directly deleted without writing the target data to the first address in the first storage medium.
[0016] In a possible implementation, 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 part, the target data is cached at the second address. The controller is also used to add a target mapping relationship between the first address and the second address in 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 does not cache 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 fast 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, 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.
[0019] 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 can not only avoid the address mapping table being filled with burst hot data only 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 replaces the reference mapping relationship with the target mapping relationship after being buffered in the buffer, 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 a possible implementation, 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, the target data continues to be cached at the second address. The controller is also used to update the second heat information corresponding to the target mapping relationship between the first address and the second address, and the second heat information is used 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 second heat information is updated 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, which is applied to a controller included in a data management system, wherein the data management system also includes a first storage medium and a second storage medium, wherein the access speed of the first storage medium is lower than the access speed of the second storage medium, and the second storage medium includes a first part and a second part, wherein 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: obtaining target data to be managed; managing the target data through a target storage medium, wherein 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.
[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 data corresponding to the first address as target data; when the first address is within the address range of a 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 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 an address range of a first storage medium; when a time period 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 according to first heat information, including: querying an address mapping table according to 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, the target data cached at the second address is deleted, including: 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 writing the target data cached at the second address to the first address, the target data cached at the second address is deleted.
[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 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, deleting the target data cached at the second address.
[0031] In one possible implementation, target data is managed through a target storage medium according to first heat information, including: querying an address mapping table according to 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 is used to indicate the heat level of the target data; according to the update of the second heat information, updating the position of the target mapping relationship in the multiple queues, 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 according to first heat information, including: querying an address mapping table according to 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 heat level of the target mapping relationship.
[0035] In a third aspect, a data management device is provided, which is applied to a controller included in a 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, and 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 includes: an acquisition module for acquiring target data to be managed; a management module for managing target data through 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.
[0036] In one possible implementation, a management module is used to obtain first heat information corresponding to 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 a 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.
[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 data corresponding to the first address as target data; when the first address is within the address range of a 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, 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 a 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, 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 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.
[0039] In a 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; 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 used 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 a possible implementation, the management module 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 part, cache the target data at the second address;
[0044] 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.
[0045] In one possible implementation, a management module is used to add a target mapping relationship to a queue with the lowest priority among multiple queues, and 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 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 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.
[0047] In a 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; 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;
[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, the data management device including a processor and a data management system, the processor is connected to a controller included in the data management system, and 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, wherein the controller is used to execute the data management method provided by the second aspect or any possible implementation manner 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 the present 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] Figure 1 A schematic diagram of a parallel architecture provided in an embodiment of the present application;
[0053] Figure 2 A schematic diagram of a hierarchical architecture provided in an embodiment of the present application;
[0054] Figure 3 A schematic diagram of a data management system provided in an embodiment of the present application;
[0055] Figure 4 A schematic diagram of another data management system provided in an embodiment of the present application;
[0056] Figure 5 A flowchart of a data management method provided in an embodiment of the present application;
[0057] Figure 6 A schematic diagram of a process for determining whether data is hot or cold provided in an embodiment of the present application;
[0058] Figure 7 A structural diagram of a table entry in a memory access information table provided in an embodiment of the present application;
[0059] Figure 8 A schematic diagram of a data management process provided in an embodiment of the present application;
[0060] Fig. 9 A structural diagram of an address mapping table provided in an embodiment of the present application;
[0061] Fig.10 A schematic diagram of a priority queue provided in an embodiment of the present application;
[0062] Fig.11 A structural diagram of a data management module provided in an embodiment of the present application;
[0063] Fig.12 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 computer multi-core (i.e., multiple processing cores, located in the processor) technology and various applications, the processor is accessing the storage medium more and more frequently according to the request sent by the application. Among them, the storage medium is used to store data, and the access to the storage medium includes access and storage. Access can also be understood as reading, which is used to obtain the data stored in the storage medium. Storage can also be understood as writing, which is used to make the storage medium store data.
[0066] It is precisely because the frequency of accessing the storage medium is getting higher and higher that the storage medium is required to have better performance. Among them, the performance of the storage medium includes but is not limited to: storage density, static power consumption, memory 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 (that is, 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. Memory access speed refers to: the speed of accessing the storage medium. The faster the speed, the shorter the time required for memory access. Service life refers to: the time from the storage medium is put into use to the storage medium being damaged.
[0067] Traditional storage media have the advantages of high memory access speed (also called fast memory) and long service life, but also have the disadvantages of low storage density and high static power consumption. New storage media have the disadvantages of low memory access speed (also called slow memory) and short service life, 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 into a certain architecture to fully utilize the advantages of the two storage media.
[0068] For example, an exemplary architecture is Figure 1The parallel architecture shown includes 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 are used 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-related applications, including but not limited to message service framework (MSF), breadth first search (BFS) and K-nearest neighbor (KNN) applications, etc., which are not limited here. Weak locality means that there is no need to frequently access data with the same value or stored in the same storage location.
[0070] For example, another exemplary architecture is Figure 2 The hierarchical architecture shown includes a fast memory, a slow memory and a controller 3. Among them, the slow memory is a non-cache (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 in 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 has problems such as low flexibility and high hardware complexity. In addition, this hierarchical architecture 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) and other applications, which are not limited here. Among them, strong locality means that data with the same value or stored in the same storage location needs to be frequently accessed.
[0072] In the related art, if you want to switch from a parallel architecture to a hierarchical architecture, or if you want to switch from a hierarchical architecture to a parallel architecture, you need to reconfigure the hardware (i.e., storage medium) usage mode, and you also need to restart the system running on the device where the hardware is located, which has a high operation complexity. 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 can often only meet the memory access requirements of one type of application, which is relatively limited and not sufficiently applicable. For example, if you use a parallel architecture alone, you can only meet the memory access requirements of applications with weak locality. This type of memory access requirement has a low requirement for memory access speed (no need for low memory access latency) and a high requirement for main memory capacity. For another example, if you use a hierarchical architecture alone, you can only meet the memory access requirements of applications with strong locality. This type of memory access requirement has a high requirement for memory access speed (requires low memory access latency) and a low requirement for main memory capacity.
[0073] Based on this, the present application embodiment provides a data management system. Figure 3 As shown, 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 storage, and the second storage medium is a fast storage. 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 part of the data may be hot data with a higher 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] Therefore, 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 has not cached any data stored in the first storage medium, the first storage medium and the first part form a parallel architecture. With the continuous use of the data management system, the first part gradually begins to cache part of the data stored in the first storage medium. For example, the first part caches hot data to facilitate fast access to hot data, and the first storage medium and the first part switch from a parallel architecture to a hierarchical architecture. With the continued use of the data management system, the first part no longer needs to continue caching some cached data. For example, the hot data cached by the first part has been converted into cold data, and the first part no longer needs to continue caching these cold data, but needs to delete these cold data to leave more capacity for caching other hot data. The first storage medium and the first part switch from a hierarchical structure to a parallel architecture. Since the first storage medium and the first part can switch from a parallel architecture to a hierarchical architecture, and can switch from a hierarchical architecture to a parallel architecture, an architecture that can dynamically switch between a parallel architecture and a hierarchical architecture is formed.
[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 being able to increase the capacity of the main memory and meet the memory access requirements with higher requirements for the main memory capacity.
[0077] Moreover, the process of dynamically 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 operations.
[0078] Exemplarily, 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 planning 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] Exemplarily, 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 embodiment of the present application does not limit the first storage medium and the second storage medium.
[0081] In an exemplary embodiment, in combination with Figure 4 The data management system shown in the figure illustrates the modules included in the controller. The modules in the controller include but are not limited to: address conversion module, memory access module, mapping module, migration module, control module, delay module and storage module ( Figure 4 The storage module includes a memory access information table, an address mapping table and a buffer. The buffer is, for example, a first input first output (FIFO) queue, which is not limited here. The address conversion module and the migration module can 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 instructions 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 instructions. 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 delay. The relevant parameters can be simulated by hardware simulation platforms such as field programmable gate arrays (FPGA) to obtain the first storage medium and the second storage medium. Of course, Figure 4 Each module shown also has other functions, which are described in detail in the method embodiment below and will not be described in detail here.
[0083] The present invention provides a data management method, which can be applied to Figure 3 or Figure 4 The data management system shown includes a controller. Figure 5 As shown, the method includes the following steps 501 and 502.
[0084] Step 501, obtaining target data to be managed.
[0085] Since the controller needs to manage data, the controller should obtain the target data that needs to be managed. The target data can have a certain unit, or the target data includes at least one unit data. Each unit data is 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 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] Among them, see Figure 4 , the processor sends a target instruction to the controller through the bus, and the target instruction carries a logical address. The controller receives the target instruction through the address conversion module, parses the target instruction to obtain the logical address, and then converts the logical address into a first address, which belongs to 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 the 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 through the bus, the processor also sends the data corresponding to the first address to the controller through 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 and does not carry a memory access identifier. Therefore, the target instruction can be regarded as an instruction dedicated to triggering data management, which is equivalent to specifically triggering data management. Correspondingly, 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] Case B1: the first address is located within the address range of the second part in the second storage medium, that is, within the cache address range.
[0092] Case B2: the first address is located 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 a table 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 table entry in the memory access information table. The memory access information table can be provided by a memory access module (e.g., Figure 4 The controller includes an address conversion module, which obtains the first address according to the target instruction and sends the first address to the memory access module. Figure 6 In branch 1, the memory access module determines whether there is a table entry corresponding to the first address in the memory access information table. If there is no table 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, so the memory access module creates a new table entry corresponding to the first address in the memory access information table. If there is a table 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 historically accessed data, so the memory access module does not need to create a new table entry, but only needs to update the table 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, addresses, first heat information, memory access times, and survival time, and each piece of information is described below.
[0095] Valid bit: used to indicate whether the table entry is valid.
[0096] Address: If the address has corresponding data, then 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 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 is 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 is 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 the access count (i.e., the number of reads), or includes only the storage count (i.e., the number of writes), or includes both the access count and the storage count. For example, when the memory access count includes both the access count and the storage count, the structure of the entries in the memory access information table can be found in Figure 7 .
[0099] Lifetime: the difference between the current time and the time when the data corresponding to the address in the table entry was last accessed. In other words, the lifetime is the length of time that the data corresponding to the address in the table entry has not been accessed. Each time the data corresponding to the address in the table entry is accessed, the lifetime is reset to zero and starts counting up. The 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, the current number of memory accesses is first determined, and the first heat information is determined based on various information except the first heat information, and all information except the first heat information and the first heat information are recorded 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. For example, the current number of memory accesses is first determined, and the updated first heat information is determined based on the current number of memory accesses. If the original number of memory accesses is different from the current number of memory accesses, the number of memory accesses recorded in the table item is replaced by 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, the first heat information recorded in the table item is replaced by the original first heat information to the updated first heat information, thereby completing the update of the table item. Among them, when the target instruction is a memory access instruction, the current memory access number is greater than the original memory access number, and the current memory access number can be obtained by increasing the original memory access number. Alternatively, when the target instruction is not a memory access instruction, the current memory access number is equal to the original memory access number. In addition, the process of determining the first heat information can refer to the description in step 502 below, which will not be repeated 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 list is often used to realize the collection of memory access information, so as to facilitate the subsequent implementation of the trace hash migration (Trace Hash Migrator, THMigrator) of data according to the collected memory access information. However, compared with 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 list, which is not only more difficult and more expensive, but also less practical, 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] Among them, see Figure 4 , the controller can determine the data that has been accessed historically as the target data through the memory access module. Exemplarily, according to the description corresponding to the above situation B2, 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 there will be a table entry corresponding to the target data in the memory access information table. Based on this, the memory access module can use the data corresponding to the address 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, see Figure 6 In branch 2, the memory access module queries the memory access information table to obtain the target data in each clock cycle, thereby realizing the periodic determination of the target data. Since the target data is the data to be managed, it 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. Exemplarily, 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 implementations, for the above situation B1, ie, the situation where the first address corresponding to the target data is located within the address range of the second part in the second storage medium, the target storage medium is the second part in the second storage medium.
[0108] Accordingly, see Figure 8 Branch 1, the controller manages the target data through the target storage medium, including: the controller manages the target data through the second part. Among them, since the first address in situation B1 is obtained according to the target instruction, when the target instruction is a memory access instruction, the management of the target data by the controller refers to: according to the indication 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 management of the target data by the controller may refer to: managing the target data according to the default management method. Among them, the default management method includes but is not limited to continuing to keep the second part storing 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.
[0109] See also Figure 4 In this implementation, the controller can implement the target data management process through the mapping module, migration module and control module included in the controller. 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 second part, and obtains a determination result. The memory access module sends the determination result to the mapping module, and the mapping module sends the determination result to the migration module. The migration module instructs the control module to manage the target data through the second part according to the determination result. Accordingly, the control module manages the target data through the second part according to the instruction, thereby completing the target data management process.
[0110] In other embodiments, for the above situation B2 and situation 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] Correspondingly, 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] The above step 501 introduces the first heat information and explains that the first heat information corresponding to the target data can be determined according to the information recorded in the table item corresponding to the target data. Figure 4 , the controller can determine the first heat information through the memory access module, that is, to obtain the first heat information. Exemplarily, the way to obtain the first heat information includes but is not limited to the following situation C1 and situation 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 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.
[0114] Among them, the controller first determines the current number of memory accesses and the survival time. Since the survival time of the entry record corresponding to the target data in the memory access information table is the difference between the current moment (i.e., the moment when the target instruction is received) and the moment when the target data was last accessed, and the survival time is updated in real time, the survival time can be used as a reference duration. The controller also obtains a first threshold value, which can be understood as the maximum survival time. The implementation of 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] Exemplarily, taking the memory access times including the read times and the write times as an example, determining the reference value according to the memory access times of the target data, the reference duration and the first threshold value includes: the controller determines the weighted sum of the read times and the write times, determines the difference between the first threshold value and the reference duration, determines the ratio between the reference duration and the difference, and then determines the product of the weighted sum and the ratio as the reference value. Therefore, the process of determining the reference value can be expressed as the following formula:
[0116]
[0117] 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 duration.
[0118] After determining the reference value, the controller determines the first heat information according to the value range of the reference value. Figure 6Branch 1, 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, so it is determined that the first heat information indicates 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, so it is determined that the first heat information indicates 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 item, or, as the updated first heat information, recorded in the updated table item. For details, see the description in step 501 above, which will not be repeated here.
[0119] Corresponding to situation C2 of situation 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.
[0120] The target data has not been accessed for a long time, and the target data is cold enough. 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 according to actual needs and is not limited here.
[0121] For example, see Figure 6 Branch 2, the controller can determine whether the length of time that the target data has not been accessed has reached a fourth threshold each time a clock cycle is reached. If the length of time that 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 that 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.
[0122] 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 situation D1 and situation D2.
[0123] In case D1, a timer corresponding to the target data is obtained, and the timer is used to start the countdown from the fourth threshold after the target data was last accessed. Therefore, if the timer corresponding to the target data has been reset to zero, it means that the time duration for which the target data has not been accessed has reached the fourth threshold. If the timer corresponding to the target data has not been reset to zero, it means that the time duration for which the target data has not been accessed has not yet reached the fourth threshold.
[0124] In case D2, the controller obtains the survival time from the table entry corresponding to the target data, which is the duration of time the target data has not been accessed. Thus, the controller can compare the survival time with the fourth threshold to determine whether the duration of time the target data has not been accessed reaches the fourth threshold.
[0125] It should be understood that the above-described situations 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 use in the management process is first explained for ease of understanding.
[0126] The address mapping table is used to indicate the mapping relationship between the first address in the address range of the first storage medium and the second address in the address range of the first part. If such a mapping relationship exists in the address mapping table, it means 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 means that the first part has not cached the target data corresponding to the first address. Figure 4 The controller can query and maintain the address mapping table through the mapping module, as described below.
[0127] For example, Fig. 9 As shown, Fig. 9 An address mapping table is shown, and the address mapping table adopts a fully associative mode. Each table entry in the address mapping table occupies 64 bits, and each table entry includes but is not limited to: the first block number (block number), the second block number, the valid bit, the hot degree bit, the dirty bit and the count bit and other information, and each information is described below.
[0128] First block number: used to indicate the block number in the first storage medium.
[0129] Second block number: used to indicate the block number within the first part.
[0130] Among them, for Fig. 9 In the address mapping table shown in FIG. 1 , the first address may be represented by the first block number and the offset information within the block. Fig. 9, 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 according to the second block number and the block offset information included in the first address, and the second address is within the address range of the first part. In addition, the block (e.g. Fig. 9 Block 0 and block 1 shown may also be referred to as pages.
[0131] Valid bit: used to indicate whether the entry is valid.
[0132] Dirty bit: used to indicate whether the target data corresponding to the table entry is dirty data. The target data being dirty data means that the target data has been modified after the first part of the target data is cached, and the target data being not dirty data means that the target data has not been modified after the first part of the target data is cached.
[0133] Count bit: used to indicate the locality of the target data corresponding to the entry, such as temporal locality, where temporal locality 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.
[0134] Heat level bit: used to indicate the priority of the target data corresponding to the table entry.
[0135] Among them, the count 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 count bit and the heat level bit are used together to determine which table entries correspond to 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 correspond to data that is not hot enough and does not require a 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 count bit and the heat level bit to determine the replacement strategy based on the least recently used (LRU) algorithm. Thereby forming a quasi-LRU algorithm, as described below.
[0136] It should be understood that the address mapping table of the full associative mode is only an example. The embodiment of the present application can also select address mapping tables of other modes 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 is not limited here.
[0137] 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.
[0138] Case E1, see Figure 8 In branch 2, 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 a query result, and 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.
[0139] 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 does not correspond to the second address, it means that the first part does not cache the target data. Therefore, there is no need to adjust so that the first part caches the target data, and there is no need to replace each table entry in the address mapping table.
[0140] In this case, E1 can be Figure 4 The memory access module, mapping module, migration module and control module shown are implemented. 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 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 management process of the target data.
[0141] Exemplarily, when the controller determines the first heat information according to the target instruction (i.e., the 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 indication 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., the case C2 above), the management of the target data by the controller 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 store 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.
[0142] Case E2, see Figure 8 In branch 3, 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 a 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 in the address mapping table, that is, adding a table entry corresponding to the target data in the address mapping table.
[0143] 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 does not cache 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 fast 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.
[0144] In this case, E2 can be Figure 4The memory access module, mapping module, migration module and control module shown are implemented. 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 in the address mapping table, and on the other hand, sends an indication 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 indication, and caches the target data at the second address of the first part.
[0145] In addition, the controller may use a general LRU algorithm in the process of adding a 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 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, such as directly replacing the original mapping relationship in the address mapping table with the target mapping relationship.
[0146] 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 replaced frequently, which will not only cause a lot of time and energy consumption, but also may 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 then lead to a decrease in memory access performance.
[0147] 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 forms a quasi-LRU algorithm. 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, see Fig.10 , Fig.10 An exemplary buffer is shown, which includes a high priority queue, a medium priority queue and a low priority queue, and different positions in the same queue have different priorities.
[0148] 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.
[0149] 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.
[0150] 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. The second heat information is Fig. 9 The count bit and heat level bit in the address mapping table shown. According to the above description, the count bit is used to indicate the time 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.
[0151] In case F1, although the target data is determined to be 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 temporal 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, so this target mapping relationship with sufficiently high heat can be added to the address mapping table.
[0152] Since this method does not directly add the target mapping relationship to the address mapping table, but adds the target mapping relationship to the address mapping table after being buffered by the buffer, it is equivalent to an upgrade mechanism (such as Fig.10 As shown), it can not only avoid the address mapping table being filled with burst hot data only 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.
[0153] 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.
[0154] 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. In other words, 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 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, 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.
[0155] Exemplarily, 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.
[0156] Since this method does not directly replace the reference mapping relationship, but the reference mapping relationship is buffered by the buffer and then replaced by the target mapping relationship, it is equivalent to a degradation mechanism (such as Fig.10 As shown), it is possible to avoid frequent replacement of entries in the address mapping table, increase the cache hit rate, and save time, energy consumption and other expenses.
[0157] According to the above description, it can be seen that Figure 4 The mapping module shown adds the table entry corresponding to the target data from the address mapping table. For example, for the above situations F1 and F2, the mapping module can send instructions to the migration module, and the migration module sends instructions to the control module, so that the control module controls the buffer, thereby adding the target mapping relationship to the address mapping table through the buffer, thereby replacing the table entry in the address mapping table.
[0158] Exemplarily, when the controller determines the first thermal information based on the target instruction (i.e., situation 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 first address or the second address.
[0159] Case E3, see Figure 8 In branch 4, 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, and when the first heat information indicates that the target data is cold data and the query result indicates that the first address corresponds to the second address, deletes the target data cached at the second address. The method also includes: the controller deletes the target mapping relationship between the first address and the second address from the address mapping table, that is, deletes the table entry corresponding to the target data in the address mapping table.
[0160] 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 caches the target data. Therefore, it means that there is no 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.
[0161] In this case, E3 can be Figure 4 The memory access module, mapping module, migration module and control module shown are implemented. 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.
[0162] In an exemplary embodiment, the controller can directly delete the target data cached in the first part without having to determine whether the target data cached in the first part is dirty data. For example, when the second storage medium is a read-only storage medium, the target data cached in the first part 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 cached in the first part is likely to be modified, the controller can first determine whether the target data is dirty data, such as 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. After that, the target data is deleted based on the determination result, as shown in Case G1 and Case G2 for details.
[0163] 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.
[0164] 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 the data consistency between the first storage medium and the first part. The writing and deleting processes can be performed by Figure 4 The control module shown is complete.
[0165] 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.
[0166] Since the target data is not dirty data, it means that the target data has not been modified after the first part caches the target data, and 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 part are originally consistent data. Therefore, the target data cached at the second address can be directly deleted without writing the target data to the first address in the first storage medium.
[0167] Exemplarily, when the controller determines the first thermal information based on the target instruction (i.e., situation 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 another example, accessing the target data stored at the first address of the first storage medium after deleting the target data from the first part.
[0168] Case E4, see Figure 8 In branch 5, the controller manages the target data through the target storage medium according to the first heat information, including: querying the address mapping table according to the first address corresponding to the target data to obtain the query result, and 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 the second address. The method also includes: updating the second heat information corresponding to the target mapping relationship between the first address and the second address, and the second heat information is used to indicate the heat level of the target mapping relationship.
[0169] 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. 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.
[0170] In this case E4 can be Figure 4 The memory access module and mapping module shown are implemented. 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.
[0171] Exemplarily, when the controller determines the first heat information based on the target instruction (i.e., situation 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.
[0172] According to the above situation E1 to situation 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 the parallel architecture to the hierarchical architecture, it is only necessary to gradually establish new entries in the address mapping table, and in the process of switching from the hierarchical architecture to the parallel architecture, it is only necessary to delete the 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, in the process of normal use of the data management system, such as only the process of data access, 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 with 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 flushing the on-chip cache, the overhead of shootdown of the translation lookaside buffer (TLB), etc.), the overhead required by the embodiment of the present application is lower.
[0173] 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 weaker locality, but also meet the memory access requirements of applications with stronger locality, and has strong applicability.
[0174] For applications with weak locality, if the hierarchical architecture is used alone, the data stored in the slow memory needs to be cached in the fast memory, resulting in unnecessary data movement, large memory access latency, and high power consumption. Moreover, when the hierarchical architecture is used alone, only the first storage medium is used as the main memory, and the main memory capacity is small. Therefore, the embodiment of the present application can adopt a parallel architecture for applications with weak locality, and the first storage medium and the second part can be used as the main memory respectively, which is equivalent to increasing the main memory capacity. Moreover, by storing data through the first storage medium or the first part, unnecessary data movement can be avoided, thereby reducing memory access latency and reducing power consumption.
[0175] For applications with strong locality, if a parallel architecture is used alone, memory access operations for slow memory may be generated, and the data in fast memory may need to be written back to slow memory (because after the data is migrated from slow memory to 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. As a result, not only the memory access latency can be reduced, but also the overhead required for write-back is saved, the power consumption is reduced, and the wear on the first storage medium is reduced, which is conducive to extending the service life of the first storage medium.
[0176] 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 a controller included in the 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 device is used to Fig.11 The modules shown above perform the Figure 5 The data management method shown in Fig.11 As shown, the data management device provided in the embodiment of the present application includes the following modules.
[0177] An acquisition module 1101 is used to acquire target data that needs to be managed;
[0178] The management module 1102 is used to manage the target data through the target storage medium, where the target storage medium is the first storage medium, the storage medium corresponding to the target data in the first part and the second part.
[0179] In an exemplary embodiment, the management module 1102 is used to obtain first thermal information corresponding to the target data, where the first thermal information is used to indicate whether the target data is hot data; based on the first thermal information, the target data is managed through a 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.
[0180] 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 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 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 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.
[0181] 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.
[0182] In an exemplary embodiment, the management module 1102 is used 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;
[0183] 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.
[0184] 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.
[0185] 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.
[0186] 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 part, cache the target data at the second address;
[0187] 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.
[0188] 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 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.
[0189] In an exemplary embodiment, the management module 1102 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.
[0190] 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; 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;
[0191] The management module 1102 is further used to update the 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.
[0192] It should be understood that the above Fig.11 The device provided has the following beneficial effects when achieving its function: Figure 5 The data management method shown has the same beneficial effects. In addition, Fig.11 When the device provided realizes its functions, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is 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, and their implementation process is detailed in the method embodiment, which will not be repeated here.
[0193] In an exemplary embodiment, the present application also provides a data management device. Fig.12As shown, the data management device includes a processor and a data management system, and 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 Figure 3 or Figure 4 The data management system shown.
[0194] 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 (ASIC) 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. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting an advanced RISC machines (ARM) architecture. It may implement or execute various logic blocks, modules and circuits described in conjunction with the disclosure of the present 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.
[0195] Exemplarily, the present application also provides a controller for executing Figure 5 Corresponding data management method. The controller can be a chip or other forms other than a chip, which is not limited here.
[0196] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limit on the quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another element.
[0197] 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.
[0198] The term "at least one" in this application means one or more, and the term "multiple" in this application means two or more, for example, multiple queues means two or more queues. The terms "system" and "network" are often used interchangeably herein.
[0199] It should be understood that the terms used in the description of the various examples herein are only for describing specific examples and are 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.
[0200] 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 [a stated condition or event] is detected" may be interpreted to mean "upon determining that ..." or "in response to determining that ..." or "upon detecting [a stated condition or event]" or "in response to detecting [a stated condition or event]," depending on the context.
[0201] The above description is only an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope 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
Cited By
Data management system, method, and apparatus, device, and controller
EP4682698A1
Data management system, method, and apparatus, device, and controller
WO2024199082A1
