Mapping table management method, system, equipment and medium

By combining the use of fixed cache areas and dynamically extended cache areas in storage devices, the low performance problem caused by insufficient cache space of map tables is solved, and the random read and write performance and hit rate are improved.

CN119166541AActive Publication Date: 2024-12-20ARTMEM TECHNOLOGY CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411181299.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-20
Estimated Expiration
2044-08-27

AI Technical Summary

Technical Problem

The cache space of mapping tables in existing storage devices is fixed and small, resulting in low random read and write performance, decreased hit rate, and frequent table cutting, which increases time-consuming.

Method used

Using a combination of fixed cache area and dynamic extended cache area, add the header of the bidirectional linked list to cache the mapping table by searching the free cache unit of the fixed cache area and applying the cache unit from the dynamic extended cache area or the tail of the bidirectional linked list when it does not exist. , increase cache space and improve hit rate.

Benefits of technology

By increasing the cache space of the map table, the random read and write performance is improved, the number of read and write switching times of the map table is reduced, and time-consuming is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166541A_ABST
    Figure CN119166541A_ABST
Patent Text Reader

Abstract

The invention discloses a mapping table management method, system and equipment and a medium. The method comprises the following steps: searching a first storage unit of a fixed cache region to obtain a first search result; under the condition that the first search result represents that the first storage unit exists, adding the first storage unit into the head of the double linked list; under the condition that the first search result represents that the first storage unit does not exist, applying for a second storage unit from the dynamic extension cache region or applying for a third storage unit from the tail of the double linked list according to the dynamic extension determination information; and adding the second storage unit or the third storage unit into the head of the double linked list. The mapping table is cached by searching for the idle cache unit of the fixed cache region, applying for the cache unit of the dynamic extension cache region or applying for the cache unit at the tail of the double linked list, so that the hit rate of the mapping table is increased, the read-write performance is improved, and the method can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a mapping table management method, system, device and medium. Background Art

[0002] In a storage device, a fixed-size memory space is generally allocated for use as a mapping table cache, and the space is often very small.

[0003] The read and write performance of storage devices is an important indicator, especially the random read and write performance. Among them, random read performance is directly related to the hit rate of the mapping table. Too small a mapping table cache space reduces the hit rate and requires frequent table switching, resulting in low random read performance. In addition, in order to improve random write performance, current storage devices often accumulate a certain amount of new mapping items to memory, and then update the mapping table in a centralized manner. A small mapping table cache space will result in more mapping table read and write switching, which increases time consumption and ultimately leads to low random write performance. Summary of the invention

[0004] In view of this, an object of the embodiments of the present invention is to provide a mapping table management method, system, device and medium, which can improve the random read and write performance of a storage device.

[0005] In a first aspect, an embodiment of the present invention provides a mapping table management method, which is applied to a storage device, wherein the storage device includes a fixed cache area and a dynamically extended cache area, and the fixed cache area and the dynamically extended cache area are uniformly numbered. The mapping table management method includes: Searching a first storage unit of the fixed cache area to obtain a first search result, wherein the first storage unit represents an available and unused cache unit; If the first search result indicates that the first storage unit exists, adding the first storage unit to a head of a bidirectional linked list, so that the first storage unit caches a mapping table; In the case where the first search result indicates that the first storage unit does not exist, applying for a second storage unit from the dynamic extension cache area or applying for a third storage unit from the tail of the bidirectional linked list according to dynamic extension determination information, wherein the dynamic extension determination information indicates information for determining whether to apply for a cache unit from the dynamic extension cache area; The second storage unit or the third storage unit is added to the head of the bidirectional linked list, so that the second storage unit or the third storage unit caches the mapping table.

[0006] In some optional embodiments, searching the first storage unit of the fixed cache area to obtain a first search result includes: Acquire a bitmap table, wherein the bitmap table is used to record storage information of the fixed buffer area and the dynamically extended buffer area; The first storage unit is searched according to the bitmap table to obtain the first search result.

[0007] In some optional embodiments, applying for a second storage unit from the dynamic expansion buffer area or applying for a third storage unit from the tail of the bidirectional linked list according to the dynamic expansion determination information includes: In a case where the dynamic expansion determination information indicates that a cache unit is requested from the dynamic expansion cache area, opening the dynamic expansion cache area; Applying for the second storage unit from the dynamically extended buffer area; Marking the bitmap table corresponding to the second storage unit as an available and unused cache unit; searching the second storage unit according to the bitmap table so that the second storage unit caches the mapping table; When the dynamic expansion determination information indicates that no cache unit is requested from the dynamic expansion cache area, closing the dynamic expansion cache area; The third storage unit is requested from the tail of the bidirectional linked list.

[0008] In some optional embodiments, applying for the third storage unit from the tail of the bidirectional linked list includes: Apply for a longest cache unit from the tail of the bidirectional linked list, where the longest cache unit represents a cache unit with the longest usage time; Obtaining the unit number of the oldest cache unit; The longest cache unit is updated to the head of the bidirectional linked list according to the unit number, so that the longest cache unit becomes the most recently used cache unit, and the longest cache unit represents the third storage unit.

[0009] In some optional embodiments, after updating the oldest cache unit to the head of the bidirectional linked list according to the unit number, the method further includes: Obtaining a longest mapping table of the longest cache unit, wherein the longest mapping represents a mapping table stored in the longest cache unit; Identify the longest mapping table to obtain an identification result; When the identification result indicates that the oldest mapping table is a dirty table, the cache data of the oldest mapping table is written into the flash memory, and after the writing is completed, the oldest mapping table is deleted so that the oldest cache unit stores a new mapping table.

[0010] In some optional embodiments, the first number of the fixed cache area and the second number of the dynamically extended cache area are continuous, and when the second storage unit needs to be released, the method further includes: Searching upward from the end of the bidirectional linked list to find the second storage unit of the second number; removing the second storage unit from the bidirectional linked list; The bitmap table corresponding to the second storage unit is set to be unusable, so that the second storage unit returns to the dynamically extended cache area.

[0011] In some optional embodiments, the method for determining the dynamic extension determination information includes: Get the random score value of the preset default value; Comparing the logical addresses of two consecutive read operations to obtain a first comparison result; When the first comparison result indicates that the logical addresses of two consecutive read operations are not continuous, increasing the random score value by a first value; When the first comparison result indicates that the logical addresses of two consecutive read operations are continuous, subtracting a second value from the random score value; Compare the random score value with the first threshold and the second threshold respectively to obtain a second comparison result; If the second comparison result indicates that the random score value is greater than or equal to the first threshold, marking the read operation as a random read operation, and configuring the dynamic expansion determination information to require applying for a cache unit from the dynamic expansion cache area; When the second comparison result indicates that the random score value is less than or equal to a second threshold, the read operation is marked as a sequential read operation, and the dynamic expansion determination information is configured so that no cache unit is required from the dynamic expansion cache area.

[0012] In a second aspect, an embodiment of the present invention provides a mapping table management system, including: A first module is used to search a first storage unit in a fixed cache area to obtain a first search result, wherein the first storage unit represents an available and unused cache unit; A second module is configured to add the first storage unit to a head of a bidirectional linked list when the first search result indicates that the first storage unit exists, so that the first storage unit caches a mapping table; A third module is used for applying for a second storage unit from the dynamic extension cache area or applying for a third storage unit from the tail of the bidirectional linked list according to dynamic extension determination information when the first search result indicates that the first storage unit does not exist, wherein the dynamic extension determination information indicates information for determining whether to apply for a cache unit from the dynamic extension cache area; The fourth module is used to add the second storage unit or the third storage unit to the head of the bidirectional linked list, so that the second storage unit or the third storage unit caches the mapping table.

[0013] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the steps of the above method are implemented when the computer program is executed by the processor.

[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to perform the method as described above.

[0015] The implementation of the embodiment of the present invention includes the following beneficial effects: The embodiment of the present invention provides a mapping table management method, including: searching the first storage unit of the fixed cache area to obtain a first search result, the first storage unit represents an available and unused cache unit; when the first search result represents that the first storage unit exists, adding the first storage unit to the head of a two-way linked list, so that the first storage unit caches the mapping table; when the first search result represents that the first storage unit does not exist, applying for a second storage unit from the dynamic expansion cache area or applying for a third storage unit from the tail of the two-way linked list according to dynamic expansion determination information, the dynamic expansion determination information represents information for determining whether to apply for a cache unit from the dynamic expansion cache area; adding the second storage unit or the third storage unit to the head of the two-way linked list, so that the second storage unit or the third storage unit caches the mapping table. The mapping table is cached by searching for free cache units in the fixed cache area, and when there are no free cache units in the fixed cache area, the mapping table is cached by applying for cache units in the dynamic expansion cache area or applying for cache units at the tail of the two-way linked list, thereby increasing the cache space of the mapping table, improving the hit rate of the mapping table, and thus improving the read and write performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a flowchart of the steps of a mapping table management method provided by an embodiment of the present invention; Figure 2is a schematic diagram of numbering of a fixed buffer area and a dynamically extended buffer area provided in an embodiment of the present invention; Figure 3 is a structural block diagram of a mapping table management system provided by an embodiment of the present invention; Figure 4 It is a schematic block diagram of the structure of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0017] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0018] In the description of the present invention, it should be understood that descriptions involving orientation, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0019] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0020] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.

[0021] The embodiment of the present invention provides a mapping table management method, system, device and medium, wherein a mapping table management method includes: searching a first storage unit of the fixed cache area to obtain a first search result, wherein the first storage unit represents an available and unused cache unit; when the first search result represents that the first storage unit exists, adding the first storage unit to the head of a bidirectional linked list, so that the first storage unit caches the mapping table; when the first search result represents that the first storage unit does not exist, applying for a second storage unit from the dynamic expansion cache area or applying for a third storage unit from the tail of the bidirectional linked list according to dynamic expansion determination information, wherein the dynamic expansion determination information represents information for determining whether to apply for a cache unit from the dynamic expansion cache area; adding the second storage unit or the third storage unit to the head of the bidirectional linked list, so that the second storage unit or the third storage unit caches the mapping table. The mapping table is cached by searching for free cache units in the fixed cache area, and when there are no free cache units in the fixed cache area, the mapping table is cached by applying for cache units in the dynamic expansion cache area or applying for cache units at the tail of the bidirectional linked list, thereby increasing the cache space of the mapping table, improving the hit rate of the mapping table, and thus improving the read and write performance.

[0022] The allocation method of the embodiment of the present invention is further described below.

[0023] Reference Figure 1 , Figure 1 A flowchart of a mapping table management method provided in an embodiment of the present invention is applied to a storage device, wherein the storage device includes a fixed cache area and a dynamically extended cache area, and the fixed cache area and the dynamically extended cache area are uniformly numbered. The mapping table management method includes but is not limited to the following steps: S101, searching a first storage unit of the fixed cache area to obtain a first search result, where the first storage unit represents an available and unused cache unit; S102: if the first search result indicates that the first storage unit exists, add the first storage unit to the head of a bidirectional linked list, so that the first storage unit caches a mapping table; S103, when the first search result indicates that the first storage unit does not exist, applying for a second storage unit from the dynamic extension cache area or applying for a third storage unit from the tail of the bidirectional linked list according to dynamic extension determination information, wherein the dynamic extension determination information indicates information for determining whether to apply for a cache unit from the dynamic extension cache area; S104: Add the second storage unit or the third storage unit to the head of the bidirectional linked list, so that the second storage unit or the third storage unit caches a mapping table.

[0024] It should be noted that if Figure 2 As shown, the present application divides the memory of the storage device into two areas, a fixed cache area and a dynamically extended cache area. The dynamically extended cache area can store mapping tables, user data, device system data, etc. The size of each mapping table is fixed. The fixed cache area is divided into N cache units and the dynamically extended cache area is divided into M cache units based on the size of the mapping table. All cache units in the fixed cache area and the dynamically extended cache area are uniformly numbered. The fixed cache area is numbered from 0 to N-1, and the dynamic extended cache area is numbered from N to N+M-1. The fixed cache area and the dynamically extended cache area are distinguished by numbering, so as to facilitate management. The use of the cache area is managed through the mapping table manager. And through the bitmap table, each cache unit is corresponded one by one to whether it can be used, whether it has been used, whether it is a dirty table, etc., without specific limitation. The cache unit in the fixed cache area is always available (that is, it can be used to cache the mapping table), and the cache unit in the dynamically extended cache area is not available by default (that is, the mapping table cannot be cached by default). In addition, the switch signal (i.e., dynamic expansion confirmation information) is used to control whether the dynamic expansion function is used. If used, a cache unit (i.e., a second storage unit) is applied to the dynamic expansion cache area to cache the mapping table. If not used, a cache unit (i.e., a third storage unit) is applied to the end of the bidirectional linked list to cache the mapping table. The time sequence of all used cache units is managed by the bidirectional linked list and the LRU algorithm; if a piece of data has not been accessed in the recent period, then the possibility of it being accessed in the future is also very small. Therefore, when the cache is full, the LRU algorithm will give priority to eliminating the data that has not been accessed for the longest time. The dynamic expansion scheme of the mapping table cache space is implemented. In the random read and write scenario, the amount of user read and write data is small, and there is a lot of idle cache space for user data (i.e., the dynamic expansion cache area). This part of the idle cache mapping table is used to improve the mapping table hit rate, thereby improving the random read and write performance.

[0025] In some optional embodiments, searching the first storage unit of the fixed cache area to obtain the first search result includes: obtaining a bitmap table, wherein the bitmap table is used to record storage information of the fixed cache area and the dynamically extended cache area; and searching the first storage unit according to the bitmap table to obtain the first search result.

[0026] Specifically, the bitmap table records the usage of each cache unit in the fixed cache area and the usage of each cache unit in the dynamically extended cache area, so that the logical address, cache data, cache size, cache time and other information of the corresponding cache unit can be obtained through the bitmap table. The cache size includes the cache unit size and the size of the cache data, and the cache time indicates the cache time of the cache data in the cache unit. When it is necessary to search for usable and unused cache units in the fixed cache area, the usage information of the cache units in the fixed cache area is obtained through the bitmap table, so as to find the first usable and unused storage unit. The first storage unit is a cache unit in the fixed cache area whose usage status is usable and unused. The first storage unit is cached in the mapping table, so as to increase the storage space of the mapping table and increase the hit rate of the mapping table when reading and writing data.

[0027] In some optional embodiments, applying for a second storage unit from the dynamic expansion cache area or applying for a third storage unit from the end of the bidirectional linked list according to dynamic expansion determination information includes: opening the dynamic expansion cache area when the dynamic expansion determination information indicates that a cache unit is applied from the dynamic expansion cache area; applying for the second storage unit from the dynamic expansion cache area; marking the bitmap table corresponding to the second storage unit as a usable and unused cache unit; searching for the second storage unit according to the bitmap table so that the second storage unit caches the mapping table; closing the dynamic expansion cache area when the dynamic expansion determination information indicates that a cache unit is not applied from the dynamic expansion cache area; and applying for the third storage unit from the end of the bidirectional linked list.

[0028] Specifically, the dynamic expansion determination information is information used to determine whether to apply for a cache unit from the dynamic expansion cache area. When more cache space is needed to cache the mapping table, the dynamic expansion determination information is used to determine whether to open the dynamic expansion cache area. When it is necessary to apply for a cache unit from the dynamic expansion cache area, the dynamic expansion cache area is opened, so that the cache unit with a usage status of unused in the dynamic expansion cache area is searched through the bitmap table, and the usage status of the cache unit is marked as usable and unused in the bitmap table, that is, the second storage unit; according to the address of the second storage unit recorded in the bitmap table, the second storage unit is searched, and the mapping table is cached in the second storage unit after the second storage unit is found. When it is determined that the dynamic expansion cache area is not to be opened through the dynamic expansion determination information, the dynamic expansion cache area is closed, and a third storage unit is applied from the tail of the bidirectional linked list; the bidirectional linked list corresponds to a cache unit for caching mapping, and the head of the bidirectional linked list corresponds to the most recently used cache unit. Correspondingly, the tail of the bidirectional linked list is the cache unit that has been used the longest. When a new mapping table needs to be cached, the cache unit that has been used the longest at the tail of the bidirectional linked list is added to the head of the bidirectional linked list, so as to cache the new mapping table.

[0029] In some optional embodiments, applying for the third storage unit from the tail of the bidirectional linked list includes: applying for a longest cache unit from the tail of the bidirectional linked list, the longest cache unit representing a cache unit with the longest usage time; obtaining the unit number of the longest cache unit; updating the longest cache unit to the head of the bidirectional linked list according to the unit number, so that the longest cache unit becomes the most recently used cache unit, and the longest cache unit represents the third storage unit.

[0030] Specifically, the cache unit corresponding to the tail of the two-way linked list is the longest cache unit. When it is necessary to find the cache unit cache mapping table in the fixed cache area, and there is no available and unused cache unit in the fixed cache area, apply for a longest cache unit at the tail of the two-way linked list, and update the longest cache unit to the head of the two-way linked list, that is, the head of the two-way linked list corresponds to the longest cache unit, and the longest cache unit is updated to the most recently used cache unit. Specifically, the unit number of the longest cache unit is updated to the head of the two-way linked list, so that the longest cache unit is updated to the most recently used cache unit, and the longest cache unit is the third storage unit.

[0031] In some optional embodiments, after updating the oldest cache unit to the head of the bidirectional linked list according to the unit number, it also includes: obtaining the oldest mapping table of the oldest cache unit, the oldest mapping representing the mapping table stored in the oldest cache unit; identifying the oldest mapping table to obtain an identification result; when the identification result represents that the oldest mapping table is a dirty table, writing the cache data of the oldest mapping table into a flash memory, and deleting the oldest mapping table after writing is completed, so that the oldest cache unit stores a new mapping table.

[0032] Specifically, after the oldest cache unit is updated to the head of the bidirectional linked list, the oldest mapping table cached in the oldest cache unit is obtained, and the information of the oldest mapping table is identified; when it is identified that the oldest mapping table belongs to a dirty table, the cache data of the oldest mapping table is written into the flash memory. The records in the dirty table have been updated, inserted or deleted, but these changes have not been synchronized to the database or file system. Before storing the new mapping table, the data in the dirty mapping table needs to be written into the flash memory to ensure the persistence and integrity of the data. After the dirty mapping table is written into the flash memory, the cache needs to be refreshed to clear the dirty table flag and make room for the new mapping table. After the dirty mapping table is successfully written and refreshed, a new mapping table can be created and loaded into the memory.

[0033] In some optional embodiments, the first number of the fixed cache area and the second number of the dynamically extended cache area are continuous, and in the case where the second storage unit needs to be released, the method further includes: searching upward from the tail of the bidirectional linked list to find the second storage unit with the second number; The second storage unit is removed from the bidirectional linked list; and the bitmap table corresponding to the second storage unit is set to be unusable, so that the second storage unit returns to the dynamically extended cache area.

[0034] Specifically, when it is necessary to release the cache unit of the extended cache area, search upward from the end of the bidirectional linked list to find the cache unit numbered N to N+M-1, which is the second storage unit. Release the memory corresponding to the second storage unit, remove the second storage unit from the bidirectional linked list, and set the bitmap table corresponding to the second storage unit to be unusable.

[0035] In some optional embodiments, the method for determining the dynamic expansion determination information includes: obtaining a random score value of a preset default value; comparing the logical addresses of two consecutive read operations to obtain a first comparison result; when the first comparison result indicates that the logical addresses of two consecutive read operations are discontinuous, adding a first value to the random score value; when the first comparison result indicates that the logical addresses of two consecutive read operations are continuous, subtracting a second value from the random score value; comparing the random score value with a first threshold and a second threshold respectively to obtain a second comparison result; when the second comparison result indicates that the random score value is greater than or equal to the first threshold, marking the read operation as a random read operation, and configuring the dynamic expansion determination information to require a cache unit to be applied for from the dynamic expansion cache area; when the second comparison result indicates that the random score value is less than or equal to the second threshold, marking the read operation as a sequential read operation, and configuring the dynamic expansion determination information to not require a cache unit to be applied for from the dynamic expansion cache area.

[0036] Specifically, the storage device is provided with a random read identification module, and when a random read scenario is detected, the dynamic expansion function is enabled, and when a sequential read scenario is detected, the dynamic expansion function is disabled. When the storage device enters a mapping table update scenario, the dynamic expansion function is also automatically enabled.

[0037] The preset default value of the specific random score value RAND_VAL is K. The specific value is set according to the needs and is not limited here. Determine whether the logical addresses of the two consecutive reads are continuous. If not, the value of RAND_VAL is increased by N (that is, the first value). If continuous, the value of RAND_VAL is subtracted by M (that is, the second value). If the value of RAND_VAL increases to the first threshold, such as 2*K, it is considered to be a random read scenario. If the value of RAND_VAL decreases to the second threshold, such as 0, it is considered to be a sequential read scenario. After confirming that it is a sequential read or random read scenario, RAND_VAL is restored to the preset default value, and then the random score value RAND_VAL is recalculated, that is, a cyclic calculation. After a cycle is completed, the random score value RAND_VAL is restored to the preset default value.

[0038] The implementation of the embodiment of the present invention includes the following beneficial effects: The embodiment of the present invention provides a mapping table management method, including: searching the first storage unit of the fixed cache area to obtain a first search result, the first storage unit represents an available and unused cache unit; when the first search result represents that the first storage unit exists, adding the first storage unit to the head of a two-way linked list, so that the first storage unit caches the mapping table; when the first search result represents that the first storage unit does not exist, applying for a second storage unit from the dynamic expansion cache area or applying for a third storage unit from the tail of the two-way linked list according to dynamic expansion determination information, the dynamic expansion determination information represents information for determining whether to apply for a cache unit from the dynamic expansion cache area; adding the second storage unit or the third storage unit to the head of the two-way linked list, so that the second storage unit or the third storage unit caches the mapping table. The mapping table is cached by searching for free cache units in the fixed cache area, and when there are no free cache units in the fixed cache area, the mapping table is cached by applying for cache units in the dynamic expansion cache area or applying for cache units at the tail of the two-way linked list, thereby increasing the cache space of the mapping table, improving the hit rate of the mapping table, and thus improving the read and write performance.

[0039] like Figure 3 As shown, in a second aspect, an embodiment of the present invention provides a mapping table management system, including: A first module is used to search a first storage unit in a fixed cache area to obtain a first search result, wherein the first storage unit represents an available and unused cache unit; A second module is configured to add the first storage unit to a head of a bidirectional linked list when the first search result indicates that the first storage unit exists, so that the first storage unit caches a mapping table; A third module is used for applying for a second storage unit from the dynamic extension cache area or applying for a third storage unit from the tail of the bidirectional linked list according to dynamic extension determination information when the first search result indicates that the first storage unit does not exist, wherein the dynamic extension determination information indicates information for determining whether to apply for a cache unit from the dynamic extension cache area; The fourth module is used to add the second storage unit or the third storage unit to the head of the bidirectional linked list, so that the second storage unit or the third storage unit caches the mapping table.

[0040] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0041] like Figure 4 As shown, in the third aspect, an embodiment of the present invention further provides a computer device, which can be a terminal. The computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, which, when executed, enable the processor to execute any one of the methods for visualizing management of industrial equipment. The processor is used to provide computing and control capabilities to support the operation of the entire computer device. The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium, which, when executed by the processor, enables the processor to execute any one of the methods for visualizing management of industrial equipment. The network interface is used for network communications, such as sending assigned tasks, etc. Those skilled in the art will appreciate that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present disclosure, and does not constitute a limitation on the computer device to which the solution of the present disclosure is applied. The specific computer device may include Figure 4More or less components shown in, or some components are combined, or there are different component arrangements. It should be understood that the processor can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In one embodiment, the processor is used to run a computer program stored in a memory to implement the following steps: searching the first storage unit of the fixed cache area to obtain a first search result, the first storage unit representing an available and unused cache unit; when the first search result represents that the first storage unit exists, adding the first storage unit to the head of a bidirectional linked list so that the first storage unit caches a mapping table; when the first search result represents that the first storage unit does not exist, applying for a second storage unit from the dynamically extended cache area or applying for a third storage unit from the tail of the bidirectional linked list according to dynamic expansion determination information, the dynamic expansion determination information representing information for determining whether to apply for a cache unit from the dynamically extended cache area; adding the second storage unit or the third storage unit to the head of the bidirectional linked list so that the second storage unit or the third storage unit caches a mapping table.

[0042] It can be seen that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0043] In addition, the embodiment of the present application also discloses a computer program product or a computer program, and the computer program product or the computer program is stored in a computer-readable storage medium. The processor of the computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device performs the above method. Similarly, the contents in the above method embodiment are all applicable to the storage medium embodiment, and the functions specifically implemented by the storage medium embodiment are the same as those in the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above method embodiment.

[0044] It is understood that all or some steps and systems in the disclosed method above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital information processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media generally contain computer readable instructions, data structures, program modules, or other data in modulated data information such as carrier waves or other transport mechanisms, and may include any information delivery media.

[0045] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the technical field without departing from the purpose of the present invention.

Claims

1. A mapping table management method, characterized in that: Applied to a storage device, the storage device includes a fixed cache area and a dynamically extended cache area, the fixed cache area and the dynamically extended cache area are uniformly numbered, and the mapping table management method includes: Searching a first storage unit of the fixed cache area to obtain a first search result, wherein the first storage unit represents an available and unused cache unit; If the first search result indicates that the first storage unit exists, adding the first storage unit to a head of a bidirectional linked list, so that the first storage unit caches a mapping table; In the case where the first search result indicates that the first storage unit does not exist, applying for a second storage unit from the dynamic extension cache area or applying for a third storage unit from the tail of the bidirectional linked list according to dynamic extension determination information, wherein the dynamic extension determination information indicates information for determining whether to apply for a cache unit from the dynamic extension cache area; The second storage unit or the third storage unit is added to the head of the bidirectional linked list, so that the second storage unit or the third storage unit caches the mapping table.

2. The method according to claim 1, characterized in that The step of searching the first storage unit of the fixed buffer area to obtain a first search result includes: Acquire a bitmap table, wherein the bitmap table is used to record storage information of the fixed buffer area and the dynamically extended buffer area; The first storage unit is searched according to the bitmap table to obtain the first search result.

3. The method according to claim 2, characterized in that The step of applying for a second storage unit from the dynamic expansion buffer area or applying for a third storage unit from the tail of the bidirectional linked list according to the dynamic expansion determination information comprises: In a case where the dynamic expansion determination information indicates that a cache unit is requested from the dynamic expansion cache area, opening the dynamic expansion cache area; Applying for the second storage unit from the dynamically extended buffer area; Marking the bitmap table corresponding to the second storage unit as an available and unused cache unit; searching the second storage unit according to the bitmap table so that the second storage unit caches the mapping table; When the dynamic expansion determination information indicates that no cache unit is requested from the dynamic expansion cache area, closing the dynamic expansion cache area; The third storage unit is requested from the tail of the bidirectional linked list.

4. The method according to claim 3, characterized in that The step of applying for the third storage unit from the tail of the bidirectional linked list comprises: Apply for a longest cache unit from the tail of the bidirectional linked list, where the longest cache unit represents a cache unit with the longest usage time; Obtaining the unit number of the oldest cache unit; The longest cache unit is updated to the head of the bidirectional linked list according to the unit number, so that the longest cache unit becomes the most recently used cache unit, and the longest cache unit represents the third storage unit.

5. The method according to claim 4, characterized in that After the oldest cache unit is updated to the head of the bidirectional linked list according to the unit number, the method further includes: Obtaining a longest mapping table of the longest cache unit, wherein the longest mapping represents a mapping table stored in the longest cache unit; Identify the longest mapping table to obtain an identification result; When the identification result indicates that the oldest mapping table is a dirty table, the cache data of the oldest mapping table is written into the flash memory, and after the writing is completed, the oldest mapping table is deleted so that the oldest cache unit stores a new mapping table.

6. The method according to claim 2, characterized in that The first number of the fixed buffer area and the second number of the dynamically extended buffer area are continuous, and in the case where the second storage unit needs to be released, the method further includes: Searching upward from the end of the bidirectional linked list to find the second storage unit of the second number; removing the second storage unit from the bidirectional linked list; The bitmap table corresponding to the second storage unit is set to be unusable, so that the second storage unit returns to the dynamically extended cache area.

7. The method according to claim 1, characterized in that The method for determining the dynamically extended determination information includes: Get the random score value of the preset default value; Comparing the logical addresses of two consecutive read operations to obtain a first comparison result; When the first comparison result indicates that the logical addresses of two consecutive read operations are not continuous, increasing the random score value by a first value; When the first comparison result indicates that the logical addresses of two consecutive read operations are continuous, subtracting a second value from the random score value; Compare the random score value with the first threshold and the second threshold respectively to obtain a second comparison result; If the second comparison result indicates that the random score value is greater than or equal to the first threshold, marking the read operation as a random read operation, and configuring the dynamic expansion determination information to require applying for a cache unit from the dynamic expansion cache area; When the second comparison result indicates that the random score value is less than or equal to a second threshold, the read operation is marked as a sequential read operation, and the dynamic expansion determination information is configured so that no cache unit is required from the dynamic expansion cache area.

8. A mapping table management system, characterized in that: include: A first module is used to search a first storage unit in a fixed cache area to obtain a first search result, wherein the first storage unit represents an available and unused cache unit; A second module is configured to add the first storage unit to a head of a bidirectional linked list when the first search result indicates that the first storage unit exists, so that the first storage unit caches a mapping table; A third module is used for applying for a second storage unit from the dynamic extension cache area or applying for a third storage unit from the tail of the bidirectional linked list according to dynamic extension determination information when the first search result indicates that the first storage unit does not exist, wherein the dynamic extension determination information indicates information for determining whether to apply for a cache unit from the dynamic extension cache area; The fourth module is used to add the second storage unit or the third storage unit to the head of the bidirectional linked list, so that the second storage unit or the third storage unit caches the mapping table.

9. A computer device, wherein: The computer device comprises a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to perform the method according to any one of claims 1 to 7 when executed by the processor.

Citation Information

Patent Citations

  • Memory application method and system for caching application data of transmission control protocol (TCP) connection

    CN102497431A

  • Management method of mapping table caches in solid-state disk system

    CN104166634A

  • Flash cold and hot data separation storage method in combination with address mapping tables

    CN107368436A

  • Method and system for improving SSD read-write performance

    CN110209356A

  • SSD data storage node management method and device, computer device and storage medium

    CN110674053A