CN110531930B - Method and device for clearing cache of storage volume - Google Patents

Method and device for clearing cache of storage volume Download PDF

Info

Publication number
CN110531930B
CN110531930B CN201910778110.3A CN201910778110A CN110531930B CN 110531930 B CN110531930 B CN 110531930B CN 201910778110 A CN201910778110 A CN 201910778110A CN 110531930 B CN110531930 B CN 110531930B
Authority
CN
China
Prior art keywords
hash table
cdcb
data cache
storage volume
clearing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910778110.3A
Other languages
Chinese (zh)
Other versions
CN110531930A (en
Inventor
侯红生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201910778110.3A priority Critical patent/CN110531930B/en
Publication of CN110531930A publication Critical patent/CN110531930A/en
Application granted granted Critical
Publication of CN110531930B publication Critical patent/CN110531930B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method for clearing a storage volume cache, which is characterized by comprising the following steps: acquiring an identifier of a hash table corresponding to a storage volume to be cleared; when the identifier of the hash table is the identifier configured for the correspondingly created hash table when the storage volume is created, the hash table is only used for mounting the data cache table cdcb of the storage volume; determining the hash table corresponding to the storage volume according to the identifier of the hash table; and clearing the data cache table cdcb mounted on the hash table. When a storage volume is created, a hash table is correspondingly created, so that each storage volume has a hash table to mount the data cache table cdcb of the storage volume. Therefore, when the storage volume is cleared, a large amount of circulating operation and logic judgment are not needed, and the clearing efficiency of the storage volume cache is effectively improved. The application also provides a device for clearing the storage volume cache corresponding to the method.

Description

Method and device for clearing cache of storage volume
Technical Field
The present invention relates to the field of data removal technologies, and in particular, to a method and an apparatus for removing a storage volume cache.
Background
In the Linux system, a partition of a disk or a hard disk is generally established as a storage volume to facilitate data management, formatting and the like.
In the prior art, when deleting a cache in a storage volume, a system first performs indifferent search on an entire hash table according to an input ID or name of the storage volume to search a data cache table cdcb, which corresponds to the ID or name of the storage volume and is not marked as cleared, from the hash table, and then performs a clearing operation on the cache data in the searched data cache table cdcb, and marks the data cache table cdcb as cleared on the hash table.
However, each time the system finds a data cache table cdcb meeting the requirement, the system stops searching and performs a clearing operation on the found data cache table cdcb, and then performs indifferent searching on the hash table again until the whole hash table is searched. Therefore, such a clearing method requires a large number of loop operations and logic judgments, so that the efficiency of clearing the storage volume cache is relatively low.
Disclosure of Invention
Based on the defects of the prior art, the invention provides a method and a device for clearing a storage volume cache, so as to solve the problem that the clearing efficiency of the storage volume cache is low due to the fact that a large amount of circular operation and logic judgment are required in the existing clearing mode.
In order to achieve the purpose, the invention provides the following technical scheme:
one aspect of the present invention provides a method for clearing a storage volume cache, including:
acquiring an identifier of a hash table corresponding to a storage volume to be cleared; when the identifier of the hash table is the identifier configured for the correspondingly created hash table when the storage volume is created, the hash table is only used for mounting the data cache table cdcb of the storage volume;
determining the hash table corresponding to the storage volume according to the identifier of the hash table;
and clearing the data cache table cdcb mounted on the hash table.
Optionally, in the foregoing method, the performing a purging operation on the data cache table cdcb mounted on the hash table includes:
searching a data cache table cdcb which is not marked to be cleared from the hash table, and mounting the data cache table cdcb onto a temporary hash table; the temporary hash table is a temporarily created hash table;
and after the whole hash table is searched, clearing all the data cache tables cdcb mounted on the temporary hash table.
Optionally, in the foregoing method, finding the data cache table cdcb that is not marked as cleared from the hash table, and mounting the data cache table cdcb onto a temporary hash table includes:
looking up a data cache table cdcb which is not marked to be cleared from the hash table;
when the data cache table cdcb which is not marked as cleared is found, a temporary hash table is created, and the data cache table cdcb is mounted on the temporary hash table;
and searching other data cache tables cdcb which are not marked as cleared from the hash table, and mounting the searched data cache tables cdcb into the temporary hash table until the whole hash table is searched.
Optionally, in the foregoing method, the performing a purge operation on all the data cache tables cdcb mounted on the temporary hash table includes:
determining all the data cache tables cdcb mounted on the temporary hash table from the storage volume;
and performing clearing operation on the determined cache data in the data cache table cdcb, and marking the data cache table cdcb as cleared.
Optionally, in the foregoing method, after performing the purging operation on the cache data of all the data cache tables cdcb mounted on the temporary hash table, the method further includes:
and unloading all the data cache tables cdcb mounted on the temporary hash table from the temporary hash table, and deleting the temporary hash table.
Another aspect of the present invention provides a device for clearing a storage volume cache, including:
the device comprises an acquisition unit, a storage unit and a control unit, wherein the acquisition unit is used for acquiring the identifier of a hash table corresponding to a storage volume to be cleared; when the identifier of the hash table is the identifier configured for the correspondingly created hash table when the storage volume is created, the hash table is only used for mounting the data cache table cdcb of the storage volume;
the first determining unit is used for determining the hash table corresponding to the storage volume according to the identifier of the hash table;
and the first clearing unit is used for clearing the data cache table cdcb mounted on the hash table.
Optionally, in the above apparatus, the first cleaning unit includes:
the lookup unit is used for looking up the data cache table cdcb which is not marked as cleared from the hash table and mounting the data cache table cdcb onto the temporary hash table; the temporary hash table is a temporarily created hash table;
and the second clearing unit is used for clearing all the data cache tables cdcb mounted on the temporary hash table after the searching unit finishes searching the whole hash table.
Optionally, in the foregoing apparatus, the searching unit includes:
the searching subunit is configured to search the data cache table cdcb that is not marked as cleared from the hash table, and mount the data cache table cdcb into the temporary hash table until a complete hash table is searched every time one data cache table cdcb is found;
a creating unit, configured to create a temporary hash table when the lookup subunit finds one data cache table cdcb that is not marked as cleared from the hash table.
Optionally, in the above apparatus, the second cleaning unit includes:
a second determining unit, configured to determine, from the storage volume, all the data cache tables cdcb mounted on the temporary hash table;
and the third clearing unit is used for clearing the determined cache data in the data cache table cdcb and marking the data cache table cdcb as cleared.
Optionally, in the above apparatus, further comprising:
and the unloading unit is used for unloading all the data cache tables cdcb mounted on the temporary hash table from the temporary hash table and deleting the temporary hash table.
According to the method and the device for clearing the storage volume cache, when the storage volume is created, the hash table is correspondingly created, and the identifier is configured for the created hash table. Therefore, there is one hash table for each storage volume, and each hash table is only used for mounting the data cache table cdcb of the corresponding storage volume, and no longer all storage volumes share one hash table. When the cache of the storage volume is cleared, the hash table corresponding to the storage volume to be cleared is determined by acquiring the identifier of the hash table corresponding to the storage volume to be cleared. Since the data cache tables cdcb mounted on the hash table all belong to the storage volume to be cleared, the data cache tables cdcb mounted on the hash table can be cleared of cache data directly, and the cache of the storage volume can be completely cleared. And a large amount of circulating operation and logic judgment are not needed, so that the clearing efficiency of the storage volume cache is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flowchart illustrating a method for clearing a storage volume cache according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another method for clearing a storage volume cache according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating another method for clearing a storage volume cache according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of another method for clearing a storage volume cache according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an apparatus for clearing a storage volume cache according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of a first clearing unit according to another embodiment of the present invention;
fig. 7 is a schematic structural diagram of a lookup unit according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of a second clearing unit according to another embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
An embodiment of the present invention provides a method for clearing a storage volume cache, as shown in fig. 1, including:
s101, acquiring the identifier of the hash table corresponding to the storage volume to be cleared.
When the identifier of the hash table is used for creating the storage volume, the identifier is configured for the correspondingly created hash table, and the hash table is only used for mounting the data cache table cdcb of the storage volume.
That is to say, in the embodiment of the present invention, when a storage volume is created, a hash table is correspondingly created, which is used for subsequently mounting the created data cache table cdcb of the storage volume. And the hash table of the worn part is configured with a unique identifier. Specifically, the identifier may be a configured identifier of the hash table, and may be an ID or a name of the corresponding storage volume, so that the identifier of the hash table corresponding to the storage volume to be cleared is more easily determined. Of course, other forms of identifiers may be used, and the identifier of the hash table corresponding to the storage volume to be cleared may be determined by maintaining a correspondence table between the storage volume and the identifier of the hash table.
It should be noted that the storage volume may be a partition of a disk or may be a hard disk. The data cache table cdcb is a form of storage in which data is cached in a storage volume. The data cache table cdcb can be simply understood as a fixed-format table, and data is stored in the table, so that the data storage format is unified. The hash table is used for mounting the data cache table cdcb in the storage volume. Among them, in the linux operating system, mounting is a very important function, which refers to mounting a device (usually a storage device) to an existing directory. Therefore, in the embodiment of the present invention, the hash table can be simply understood as a directory, and the data cache table cdcb is a device mounted on the directory.
Specifically, when the cache in the storage volume needs to be cleared, the identifier of the hash table corresponding to the storage volume to be cleared, which is input by the user, is obtained.
And S102, determining the hash table corresponding to the storage volume according to the identifier of the hash table.
Specifically, after acquiring an identifier of a hash table corresponding to a storage volume to be cleared, which is input by a user, the hash table corresponding to the identifier is determined from the plurality of hash tables according to the identifier.
S103, clearing the data cache table cdcb mounted on the hash table.
It should be noted that, according to the identifier of the hash table corresponding to the storage volume to be cleared, which is input by the user, the determined hash table is only used for mounting the data cache table cdcb of the storage volume. Therefore, after the hash table corresponding to the storage volume to be cleared is determined, it is not necessary to judge whether the data cache table cdcb belongs to the storage volume to be cleared, and only the data cache table cdcb mounted on the hash table needs to be cleared, that is, the cache data in the data cache table cdcb is deleted, so that the cache clearing of the storage volume to be cleared is completed.
Specifically, the purging operation is performed on the data cache tables cdcb mounted on the hash table, which may be performed on all the data cache tables cdcb mounted on the hash table. Of course, in order to reduce unnecessary purging operations, only the data cache table cdcb cached with data may be purged, and the remaining data cache tables cdcb that have been purged and have not cached with data may not be purged.
Optionally, in another embodiment of the present invention, as shown in fig. 2, a specific implementation manner of step S103 includes:
s201, finding the data cache table cdcb which is not marked as cleared from the hash table, and mounting the data cache table cdcb onto the temporary hash table.
Wherein, the temporary hash table is a temporarily created hash table.
It should be noted that the data cache table cdcb is marked as cleared after being cleared. Specifically, the data cache table cdcb may be tagged with a "cleared" word, or may be marked by other means. Then, after the data is cached again in the data cache table cdcb, the tag is removed.
That is, the embodiment of the present invention only performs the clearing operation on the data cache table cdcb in which the data is cached. Therefore, it is first necessary to determine the data cache table cdcb in the hash table that is not marked as cleared. Specifically, a large number of loop operations and logic decisions are required to avoid the need for the same prior art. In the embodiment of the present invention, a data cache table cdcb meeting the requirement is found in the hash table, the search is not stopped, the data cache table cdcb is removed, and the searched data cache table cdcb is mounted in the temporarily created hash table. And continuously searching the data cache table cdcb which meets the requirement from the hash table until the whole hash table is searched.
Optionally, in another embodiment of the present invention, as shown in fig. 3, one implementation of step S201 includes:
s301, the data cache table cdcb which is not marked to be cleared is searched from the hash table.
Specifically, the data cache tables cdcb which are not marked to be cleared are sequentially searched from the data cache tables cdcb of the hash table.
It should be noted that, when a data cache table cdcb that is not marked as cleared is found from the hash table, step S302 is executed.
S302, creating a temporary hash table, and mounting the data cache table cdcb to the temporary hash table.
It should be noted that, when a data cache table cdcb which is not marked as cleared is found, the temporary hash table is created, so that when the entire storage volume is cleared and data is not cached again, that is, when there is no data cache table cdcb which is not marked as cleared in the hash table, the temporary hash table does not need to be created, thereby reducing unnecessary work. Of course, this is only an optional method, and it may also be that a temporary hash table is directly created at the beginning of the search, which also belongs to the protection scope of the present invention.
S303, other data cache tables cdcb which are not marked to be cleared are searched from the hash table, and the searched data cache tables cdcb are mounted in the temporary hash table until the whole hash table is searched.
It should be further noted that, after the whole hash table is searched, step S202 is executed to implement a purging operation on the searched data cache table cdcb at one time.
S202, clearing all the data cache tables cdcb mounted on the temporary hash table.
According to the embodiment of the invention, by introducing the temporary hash table, the effect that after the whole hash table is searched, all searched data cache tables cdcb are cleared at one time is realized. Thereby avoiding unnecessary loop operations.
Optionally, in another embodiment of the present invention, as shown in fig. 4, a specific implementation manner of step S202 includes:
s401, determining all the data cache tables cdcb mounted on the temporary hash table from the storage volume.
The data cache table cdcb is only mounted in the temporary hash table, so that the data cache table cdcb needs to be determined first to perform a clearing operation on the data cache table cdcb.
Specifically, the step S402 may be executed when one data cache table cdcb is determined, and the determined data cache table cdcb is cleared until all the data cache tables cdcb on the temporary hash table are cleared. Of course, step S402 may be executed after all the data cache tables cdcb are determined.
S402, clearing the determined cache data in the data cache table cdcb, and marking the data cache table cdcb as cleared.
Optionally, in another embodiment of the present invention, referring to fig. 2 as well, after performing step S202, the method may further include:
s203, unloading all the data cache tables cdcb mounted on the temporary hash table from the temporary hash table, and deleting the temporary hash table.
Note that, in order to avoid occupying resources, the temporary hash table is selected to be deleted. Of course, the value is only an optional way, and the temporary hash table may be optionally reserved for use in the next clearing.
According to the method for clearing the storage volume cache, provided by the embodiment of the invention, when the storage volume is created, a hash table is correspondingly created, and an identifier is configured for the created hash table. Therefore, there is one hash table for each storage volume, and each hash table is only used for mounting the data cache table cdcb of the corresponding storage volume, and no longer all storage volumes share one hash table. When the cache of the storage volume is cleared, the hash table corresponding to the storage volume to be cleared is determined by acquiring the identifier of the hash table corresponding to the storage volume to be cleared. Since the data cache tables cdcb mounted on the hash table all belong to the storage volume to be cleared, the data cache tables cdcb mounted on the hash table can be cleared of cache data directly, and the cache of the storage volume can be completely cleared. And a large amount of circulating operation and logic judgment are not needed, so that the clearing efficiency of the storage volume cache is effectively improved.
Another embodiment of the present invention provides an apparatus for clearing a storage volume cache, as shown in fig. 5, including:
an obtaining unit 501 is configured to obtain an identifier of a hash table corresponding to a storage volume to be cleared.
And when the identifier of the hash table is the identifier configured for the correspondingly created hash table when the storage volume is created, the hash table is only used for mounting the data cache table cdcb of the storage volume.
It should be noted that, the specific working process of the obtaining unit 501 may refer to step S101 in the foregoing method embodiment accordingly, and details are not described here again.
A first determining unit 502, configured to determine, according to the identifier of the hash table, the hash table corresponding to the storage volume.
It should be noted that, the specific working process of the first determining unit 502 may refer to step S102 in the foregoing method embodiment accordingly, and is not described herein again.
A first clearing unit 503, configured to perform a clearing operation on the data cache table cdcb mounted on the hash table.
It should be noted that, the specific working process of the first clearing unit 503 may refer to step S103 in the foregoing method embodiment accordingly, and is not described herein again.
Optionally, in another embodiment of the present invention, as shown in fig. 6, the first clearing unit includes:
the lookup unit 601 is configured to lookup the data cache table cdcb that is not marked as cleared from the hash table, and mount the data cache table cdcb onto the temporary hash table.
Wherein the temporary hash table is a temporarily created hash table.
It should be noted that, the specific working process of the searching unit 601 may refer to step S201 in the foregoing method embodiment accordingly, and details are not described here again.
A second clearing unit 602, configured to perform a clearing operation on all the data cache tables cdcb mounted on the temporary hash table after the lookup unit 601 finishes looking up the entire hash table.
It should be noted that, the specific working process of the second clearing unit 602 may refer to step S202 in the foregoing method embodiment accordingly, and details are not described here again.
Optionally, in another embodiment of the present invention, as shown in fig. 7, the searching unit includes:
a searching subunit 701, configured to search the data cache table cdcb that is not marked as cleared from the hash table, and mount the data cache table cdcb into the temporary hash table every time one data cache table cdcb is found, until the whole hash table is found.
It should be noted that, the specific working process of the searching subunit 701 may refer to steps S301 and S303 in the foregoing method embodiment, which is not described herein again.
A creating unit 702, configured to create a temporary hash table when the lookup sub-unit 701 finds one data cache table cdcb that is not marked as cleared from the hash table.
It should be noted that, the specific working process of the creating unit 702 may refer to step S302 in the foregoing method embodiment accordingly, and is not described herein again.
Optionally, in another embodiment of the present invention, as shown in fig. 8, the second clearing unit includes:
a second determining unit 801, configured to determine all the data cache tables cdcb mounted on the temporary hash table from the storage volume.
It should be noted that, the specific working process of the second determining unit 801 may refer to step S401 in the foregoing method embodiment accordingly, and details are not described here again.
A third clearing unit 802, configured to perform a clearing operation on the determined cache data in the data cache table cdcb, and mark the data cache table cdcb as cleared.
It should be noted that, the specific working process of the third removing unit 802 may refer to step S402 in the foregoing method embodiment accordingly, and details are not described here again.
Optionally, in another embodiment of the present invention, referring to fig. 6 as well, the first cleaning unit may further include:
an unloading unit 602, configured to unload all the data cache tables cdcb mounted on the temporary hash table from the temporary hash table, and delete the temporary hash table.
It should be noted that, the specific working process of the unloading unit 602 may refer to step S203 in the foregoing method embodiment accordingly, which is not described herein again.
The device for clearing the storage volume cache correspondingly creates a hash table when the storage volume is created, and configures the identifier for the created hash table. Therefore, there is one hash table for each storage volume, and each hash table is only used for mounting the data cache table cdcb of the corresponding storage volume, and no longer all storage volumes share one hash table. When the cache of the storage volume is cleared, the identification of the hash table corresponding to the storage volume to be cleared is obtained through the obtaining unit, and the hash table corresponding to the storage volume to be cleared is determined by the first determining unit. Since the data cache tables cdcb mounted on the hash table all belong to the storage volume to be cleared, the first clearing unit directly clears the cache data of the data cache tables cdcb mounted on the hash table, and the cache of the storage volume can be completely cleared. And a large amount of circulating operation and logic judgment are not needed, so that the clearing efficiency of the storage volume cache is effectively improved.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the components and steps of the various examples have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method for clearing a storage volume cache, comprising:
acquiring an identifier of a hash table corresponding to a storage volume to be cleared; when the identifier of the hash table is the identifier configured for the correspondingly created hash table when the storage volume is created, the hash table is only used for mounting the data cache table cdcb of the storage volume;
determining the hash table corresponding to the storage volume according to the identifier of the hash table;
clearing the data cache table cdcb mounted on the hash table; the clearing operation on the data cache table cdcb mounted on the hash table includes searching the data cache table cdcb which is not marked as cleared from the hash table, mounting the data cache table cdcb on a temporary hash table, and clearing all the data cache tables cdcb mounted on the temporary hash table after the search on the whole hash table is completed; the temporary hash table is a temporarily created hash table.
2. The method of claim 1, wherein looking up the data cache table cdcb that is not marked as cleared from the hash table and mounting the data cache table cdcb on a temporary hash table comprises:
looking up a data cache table cdcb which is not marked to be cleared from the hash table;
when the data cache table cdcb which is not marked to be cleared is found, a temporary hash table is created, and the data cache table cdcb is mounted on the temporary hash table;
and searching other data cache tables cdcb which are not marked as cleared from the hash table, and mounting the searched data cache tables cdcb into the temporary hash table until the whole hash table is searched.
3. The method according to claim 1, wherein the clearing operation of all the data cache tables cdcb mounted on the temporary hash table includes:
determining all the data cache tables cdcb mounted on the temporary hash table from the storage volume;
and clearing the determined cache data in the data cache table cdcb, and marking the data cache table cdcb as cleared.
4. The method according to claim 1, wherein after the clearing operation on the data cache table cdcb mounted on the hash table, the method further comprises:
and unloading all the data cache tables cdcb mounted on the temporary hash table from the temporary hash table, and deleting the temporary hash table.
5. An apparatus for clearing a storage volume cache, comprising:
the device comprises an acquisition unit, a storage unit and a control unit, wherein the acquisition unit is used for acquiring the identifier of a hash table corresponding to a storage volume to be cleared; when the identifier of the hash table is the identifier configured for the correspondingly created hash table when the storage volume is created, the hash table is only used for mounting the data cache table cdcb of the storage volume;
the first determining unit is used for determining the hash table corresponding to the storage volume according to the identifier of the hash table;
a first clearing unit, configured to perform a clearing operation on the data cache table cdcb mounted on the hash table; the first clearing unit comprises a searching unit and a second clearing unit;
the lookup unit is used for looking up the data cache table cdcb which is not marked as cleared from the hash table and mounting the data cache table cdcb onto the temporary hash table; the temporary hash table is a temporarily created hash table;
and the second clearing unit is used for clearing all the data cache tables cdcb mounted on the temporary hash table after the searching unit finishes searching the whole hash table.
6. The apparatus of claim 5, wherein the lookup unit comprises:
the searching subunit is configured to search the data cache table cdcb that is not marked as cleared from the hash table, and mount the data cache table cdcb into the temporary hash table until a complete hash table is searched every time one data cache table cdcb is found;
a creating unit, configured to create a temporary hash table when the lookup subunit finds one data cache table cdcb that is not marked as cleared from the hash table.
7. The apparatus of claim 5, wherein the second purge unit comprises:
a second determining unit, configured to determine, from the storage volume, all the data cache tables cdcb mounted on the temporary hash table;
and the third clearing unit is used for clearing the determined cache data in the data cache table cdcb and marking the data cache table cdcb as cleared.
8. The apparatus of claim 5, further comprising:
and the unloading unit is used for unloading all the data cache tables cdcb mounted on the temporary hash table from the temporary hash table and deleting the temporary hash table.
CN201910778110.3A 2019-08-22 2019-08-22 Method and device for clearing cache of storage volume Active CN110531930B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910778110.3A CN110531930B (en) 2019-08-22 2019-08-22 Method and device for clearing cache of storage volume

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910778110.3A CN110531930B (en) 2019-08-22 2019-08-22 Method and device for clearing cache of storage volume

Publications (2)

Publication Number Publication Date
CN110531930A CN110531930A (en) 2019-12-03
CN110531930B true CN110531930B (en) 2023-01-10

Family

ID=68664000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910778110.3A Active CN110531930B (en) 2019-08-22 2019-08-22 Method and device for clearing cache of storage volume

Country Status (1)

Country Link
CN (1) CN110531930B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102130939A (en) * 2010-12-10 2011-07-20 创新科存储技术有限公司 Remote duplication method and device
CN106202112A (en) * 2015-05-06 2016-12-07 阿里巴巴集团控股有限公司 CACHE DIRECTORY method for refreshing and device
CN107273397A (en) * 2016-03-31 2017-10-20 三星电子株式会社 The many Hash tables of virtual bucket for the online deduplication application of effective memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102130939A (en) * 2010-12-10 2011-07-20 创新科存储技术有限公司 Remote duplication method and device
CN106202112A (en) * 2015-05-06 2016-12-07 阿里巴巴集团控股有限公司 CACHE DIRECTORY method for refreshing and device
CN107273397A (en) * 2016-03-31 2017-10-20 三星电子株式会社 The many Hash tables of virtual bucket for the online deduplication application of effective memory

Also Published As

Publication number Publication date
CN110531930A (en) 2019-12-03

Similar Documents

Publication Publication Date Title
US9292217B2 (en) Logical volume space sharing
CN106202367B (en) A kind of processing method and processing device of object information
TWI443509B (en) Method for storing data into a memory
CN108932271B (en) File management method and device
CN103500191A (en) Flow table configuration, query and table item deleting method and device
CN103559139B (en) A kind of date storage method and device
CN106302632A (en) The method for down loading of a kind of foundation image and management node
CN109002330A (en) A kind of method, device and equipment identifying UEFI OS startup item
CN103838843A (en) File processing method and electronic equipment
CN103546380A (en) Message forwarding method and device based on strategy routing
CN106598926B (en) Operation revocation method and device
CN105867962A (en) System upgrading method and device
CN111045708A (en) Software upgrading method, electronic device and computer readable storage medium
CN103701653B (en) The processing method of a kind of interface hot plug configuration data and network configuration server
CN106506352A (en) A kind of method and device for E-Packeting
CN105468346A (en) Timing event management method, storage method, execution method and corresponding apparatus
CN106709066A (en) Data synchronization method and device
CN104239091A (en) File cleaning method and device and terminal
CN110531930B (en) Method and device for clearing cache of storage volume
WO2018177193A1 (en) Software upgrade method and device
CN105939402A (en) MAC table entry obtaining method and device
CN101706761A (en) Method and device for processing data of serial port parameters of wireless terminal
WO2016029670A1 (en) Set-top box data management method and set-top box
CN107155167A (en) Mobile terminal and its Bluetooth pairing name class processing method and storage device
CN107422991B (en) Storage strategy management system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant