Deduplication service automatic switch method, device, equipment and readable storage medium
By comparing the number of data fingerprints and preset values in the fingerprint table, the status of the deletion service is automatically adjusted, and further adjusted according to the repetition rate of the data write operation, the problem that the status of the deletion service in the prior art cannot adapt to changes in the storage scenario is solved, and storage efficiency and performance are improved.
Patent Information
- Application Number
- CN202311506794.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-10
- Publication Date
- 2025-05-20
- Estimated Expiration
- 2043-11-10
AI Technical Summary
In the prior art, the status of the deletion service cannot adapt to changes in the storage scenario, resulting in the service status being unable to be updated in time, affecting storage efficiency and performance.
By comparing the number of data fingerprints in the fingerprint table with the preset value when the deletion service is in a pending state, automatically turning on or off the deletion service, and adjusting the status according to the repetition rate of the data writing operation.
It realizes automatic update of the deletion service status, adapts to changes in storage scenarios, improves storage efficiency and performance, and avoids delays and errors caused by manual judgment.
Smart Images

Figure CN117573026B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data storage, and in particular to a method, device, equipment and readable storage medium for automatically switching on and off a deduplication service. Background Art
[0002] Based on the deduplication service, duplicate data can be deleted before the data is written to the disk, thereby reducing data redundancy and saving storage space; at the same time, the number of writes to the disk and the data volume can be reduced, and the service life of the disk can be extended. Since the deduplication service needs to judge the repetition of the data corresponding to the data write operation, while achieving the above beneficial effects, the deduplication service also increases the latency of the data write operation.
[0003] Currently, the opening or closing of the deduplication service is judged based on manual experience, and this method has a large lag, which easily leads to the state of the deduplication service being unable to adapt to changes in the storage scenario. For example, after the deduplication service is turned on based on manual experience, as the storage operation progresses, the number of duplicate data becomes less and less, but manual operation cannot perceive this change, which will result in the deduplication service still being in the on state, thus not only failing to save storage space, but also increasing the write latency. Summary of the Invention
[0004] This application provides a method, device, equipment and computer-readable storage medium for automatically switching on and off a deduplication service, which can solve the technical problem that the state of the deduplication service in the prior art cannot adapt to changes in the storage scenario.
[0005] In a first aspect, an embodiment of this application provides a method for automatically switching on and off a deduplication service, and the method for automatically switching on and off a deduplication service includes:
[0006] When the deduplication service is in a pending state, compare the number of data fingerprints in the fingerprint table with a preset value;
[0007] If the number of data fingerprints in the fingerprint table is not greater than the preset value, turn off the deduplication service;
[0008] When the deduplication service is turned off, obtain the data fingerprint of the data corresponding to the data write operation every preset number of times;
[0009] If the obtained data fingerprint exists in the fingerprint table, increment the value of P by 1;
[0010] When the number of obtained data fingerprints reaches Q, calculate the ratio of P to Q to obtain a first repetition rate;
[0011] If the first repetition rate is greater than a first threshold, turn on the deduplication service.
[0012] In combination with the first aspect, in one embodiment, after the step of calculating the ratio of P to Q to obtain the first repetition rate when the number of acquired data fingerprints reaches Q, the following steps are further included:
[0013] Return to the step of obtaining the data fingerprint of the data corresponding to each data write operation every preset number of times until S first repetition rates are obtained;
[0014] If all S first repetition rates are greater than the first threshold, the deduplication service is enabled.
[0015] In combination with the first aspect, in one embodiment, after the step of comparing the number of data fingerprints in the fingerprint table with a preset value when the deduplication service is in a pending state, the following steps are further included:
[0016] If the number of data fingerprints in the fingerprint table is greater than the preset value, the deduplication service is enabled;
[0017] When the deduplication service is enabled, for each data write operation, if the data fingerprint of its corresponding data exists in the fingerprint table, the value of N is incremented by 1;
[0018] When the number of data write operations reaches M, calculate the ratio of N to M to obtain the second repetition rate;
[0019] If the second repetition rate is less than the second threshold, the deduplication service is disabled.
[0020] In combination with the first aspect, in one embodiment, after the step of enabling the deduplication service if the first repetition rate is greater than the first threshold, the following steps are further included:
[0021] Execute the step that when the deduplication service is enabled, for each data write operation, if the data fingerprint of its corresponding data exists in the fingerprint table, the value of N is incremented by 1;
[0022] After the step of disabling the deduplication service if the second repetition rate is less than the second threshold, the following steps are further included:
[0023] Execute the step of obtaining the data fingerprint of the data corresponding to each data write operation every preset number of times when the deduplication service is disabled.
[0024] In combination with the first aspect, in one embodiment, the deduplication service automatic switch method further includes:
[0025] When the update opportunity is met, write the data fingerprint of the data corresponding to each data write operation into the cold fingerprint table;
[0026] Determine the duplicate fingerprint information in the cold fingerprint table;
[0027] Update the fingerprint table based on the duplicate fingerprint information.
[0028] In a second aspect, an embodiment of the present application provides a deduplication service automatic switch device, and the deduplication service automatic switch device includes:
[0029] An initialization module, configured to compare the number of data fingerprints in the fingerprint table with a preset value when the deduplication service is in a pending state;
[0030] If the number of data fingerprints in the fingerprint table is not greater than the preset value, the deduplication service is closed;
[0031] A service status control module, configured to obtain the data fingerprint of the data corresponding to the data write operation once every preset number of times when the deduplication service is closed;
[0032] If the obtained data fingerprint exists in the fingerprint table, the value of P is incremented by 1;
[0033] When the number of obtained data fingerprints reaches Q, calculate the ratio of P to Q to obtain a first duplication rate;
[0034] If the first duplication rate is greater than a first threshold, the deduplication service is enabled.
[0035] In combination with the second aspect, in an embodiment, the initialization module is further configured to:
[0036] If the number of data fingerprints in the fingerprint table is greater than the preset value, the deduplication service is enabled;
[0037] The service status control module is further configured to:
[0038] When the deduplication service is enabled, for each data write operation, if the data fingerprint of the corresponding data exists in the fingerprint table, the value of N is incremented by 1;
[0039] When the number of data write operations reaches M, calculate the ratio of N to M to obtain a second duplication rate;
[0040] If the second duplication rate is less than a second threshold, the deduplication service is closed.
[0041] In combination with the second aspect, in an embodiment, the deduplication service automatic switch device further includes an update module, configured to:
[0042] When the update timing is met, write the data fingerprint of the data corresponding to each data write operation into the cold fingerprint table;
[0043] Determine the duplicate fingerprint information in the cold fingerprint table;
[0044] Update the fingerprint table based on the duplicate fingerprint information.
[0045] In a third aspect, an embodiment of the present application provides a deduplication service automatic switch device, which includes a processor, a memory, and a deduplication service automatic switch program stored on the memory and executable by the processor. When the deduplication service automatic switch program is executed by the processor, the steps of the deduplication service automatic switch method described above are implemented.
[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a deduplication service automatic switch program is stored. When the deduplication service automatic switch program is executed by a processor, the steps of the deduplication service automatic switch method described above are implemented.
[0047] The beneficial effects brought by the technical solutions provided in the embodiments of the present application include:
[0048] In the embodiment of the present application, when the deduplication service is in a pending state, the number of data fingerprints in the fingerprint table is compared with a preset value; if the number of data fingerprints in the fingerprint table is not greater than the preset value, the deduplication service is turned off; when the deduplication service is turned off, the data fingerprint of the data corresponding to the data write operation is obtained once every preset number of times; if the obtained data fingerprint exists in the fingerprint table, the value of P is incremented by 1; when the number of obtained data fingerprints reaches Q, the ratio of P to Q is calculated to obtain a first duplication rate; if the first duplication rate is greater than a first threshold, the deduplication service is turned on. Through the embodiment of the present application, first, the state of the deduplication service is determined according to the number of data fingerprints in the fingerprint table. When the deduplication service is turned off, the data duplication rate during the storage process is calculated, so as to control the state of the deduplication service based on the data duplication rate, and the state of the deduplication service is automatically updated. Description of the Drawings
[0049] Figure 1 It is a schematic flowchart of the first embodiment of the deduplication service automatic switch method of the present application;
[0050] Figure 2 It is a schematic flowchart of the second embodiment of the deduplication service automatic switch method of the present application;
[0051] Figure 3 It is a schematic flowchart of the second embodiment of the deduplication service automatic switch method of the present application;
[0052] Figure 4 It is a schematic diagram of the functional modules of an embodiment of the deduplication service automatic switch device of the present application;
[0053] Figure 5 It is a schematic diagram of the hardware structure of the deduplication service automatic switch device involved in the solution of the embodiment of the present application. Detailed Embodiments
[0054] To enable those skilled in the art to better understand the solution of this application, the technical solution in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of this application.
[0055] To make the purpose, technical solution and advantages of this application clearer, the embodiments of this application will be further described in detail below in conjunction with the accompanying drawings.
[0056] In a first aspect, an embodiment of this application provides a method for automatically switching the deduplication service.
[0057] In one embodiment, refer to Figure 1 , Figure 1 which is a schematic flowchart of the first embodiment of the method for automatically switching the deduplication service of this application. As Figure 1 shown, the method for automatically switching the deduplication service includes:
[0058] Step S10, when the deduplication service is in a pending state, compare the number of data fingerprints in the fingerprint table with a preset value;
[0059] Step S20, if the number of data fingerprints in the fingerprint table is not greater than the preset value, turn off the deduplication service;
[0060] In this embodiment, before the state of the deduplication service is first determined, the deduplication service is in a pending state. At this time, by comparing the number of data fingerprints in the fingerprint table with the preset value, if the number of data fingerprints in the fingerprint table is not greater than the preset value, it means that the number of data fingerprints in the fingerprint table is relatively small. Then, the situation where the data fingerprints of the data corresponding to the data write operation exist in the fingerprint table may be relatively small. In this way, even if the deduplication service is turned on, most of the data corresponding to the data write operation will still be written, which will not achieve a positive effect and will increase the write latency. Therefore, before the state of the deduplication service is first determined, if the number of data fingerprints in the fingerprint table is not greater than the preset value, turn off the deduplication service.
[0061] Among them, the preset value is set according to actual needs and is not limited here.
[0062] Step S30, when the deduplication service is turned off, obtain the data fingerprints of the data corresponding to the data write operation once every preset number of times;
[0063] In this embodiment, the preset number of times is set according to actual needs, such as 50, 100, etc., and there is no limitation here. Taking the preset number of times as 100 as an example, that is, after obtaining the data fingerprint of the data corresponding to the a-th data writing operation, after an interval of 100 data writing operations, obtain the data fingerprint of the data corresponding to the (a + 101 * 1)-th writing operation, and then after an interval of 100 data writing operations, obtain the data fingerprint of the data corresponding to the (a + 101 * 2)-th writing operation, and so on.
[0064] Step S40, if the obtained data fingerprint exists in the fingerprint table, then the value of P is incremented by 1;
[0065] In this embodiment, each time the data fingerprint of the data corresponding to a data writing operation is obtained, it is matched with the data fingerprints recorded in the fingerprint table. If there is a data fingerprint in the fingerprint table that is the same as it, it is determined that the currently obtained data fingerprint exists in the fingerprint table, and the value of P is incremented by 1. It should be noted that the same processing is performed for each obtained data fingerprint.
[0066] Step S50, when the number of obtained data fingerprints reaches Q, calculate the ratio of P to Q to obtain the first repetition rate;
[0067] In this embodiment, Q is set according to actual needs, such as set to 100, 200, 500, etc. Taking Q equal to 100 as an example, that is, a total of 100 data fingerprints of the data corresponding to the data writing operations are obtained, that is, the number of obtained data fingerprints is Q. Since step S40 is executed for each obtained data fingerprint, the value of P is also clear, and thus the ratio of P to Q is calculated to obtain the first repetition rate. For example, if P is 30, then the first repetition rate is 30%.
[0068] Step S60, if the first repetition rate is greater than the first threshold, then enable the deduplication service.
[0069] In this embodiment, if the first repetition rate is greater than the first threshold, it means that the repetition rate of the data in the current storage scenario is relatively high, and then the deduplication service is enabled. Among them, the first threshold is set according to actual needs and there is no limitation here.
[0070] In the embodiment of the present application, when the deduplication service is in a pending state, the number of data fingerprints in the fingerprint table is compared with a preset value; if the number of data fingerprints in the fingerprint table is not greater than the preset value, the deduplication service is closed; when the deduplication service is closed, the data fingerprint of the data corresponding to the data write operation is obtained once every preset number of times; if the obtained data fingerprint exists in the fingerprint table, the value of P is incremented by 1; when the number of obtained data fingerprints reaches Q, the ratio of P to Q is calculated to obtain the first duplication rate; if the first duplication rate is greater than the first threshold, the deduplication service is enabled. Through the embodiment of the present application, first, the state of the deduplication service is determined according to the number of data fingerprints in the fingerprint table. When the deduplication service is closed, the data duplication rate during the storage process is calculated, so as to control the state of the deduplication service based on the data duplication rate, realizing automatic update of the state of the deduplication service.
[0071] Further, in one embodiment, referring to Figure 2 , Figure 2 is a schematic flowchart of the second embodiment of the automatic switch method for the deduplication service of the present application. As Figure 2 shown, after step S10, it further includes:
[0072] Step S70, if the number of data fingerprints in the fingerprint table is greater than the preset value, the deduplication service is enabled;
[0073] In this embodiment, before the state of the deduplication service is determined for the first time, the deduplication service is in a pending state. At this time, by comparing the number of data fingerprints in the fingerprint table with the preset value, if the number of data fingerprints in the fingerprint table is greater than the preset value, it means that the number of data fingerprints in the fingerprint table is relatively large, and the situation where the data fingerprint of the data corresponding to the data write operation exists in the fingerprint table may be relatively large. In this way, the deduplication service should be enabled. Therefore, before the state of the deduplication service is determined for the first time, if the number of data fingerprints in the fingerprint table is greater than the preset value, the deduplication service is enabled.
[0074] Step S80, when the deduplication service is enabled, for each data write operation, if the data fingerprint of the corresponding data exists in the fingerprint table, the value of N is incremented by 1;
[0075] In this embodiment, when the deduplication service is enabled, for each data write operation, the data fingerprint of the corresponding data is matched with the data fingerprints recorded in the fingerprint table. If there is a data fingerprint in the recorded data fingerprints in the fingerprint table that is the same as it, it is determined that the data fingerprint corresponding to the current data write operation exists in the fingerprint table, and the value of N is incremented by 1.
[0076] Step S90, when the number of data write operations reaches M, the ratio of N to M is calculated to obtain the second duplication rate;
[0077] In this embodiment, M is set according to actual needs, such as being set to 100, 200, 500, etc. Taking M equal to 100 as an example, since step S80 is executed for each data writing operation, the value of N is also determined, and thus the ratio of N to M is calculated to obtain the second repetition rate. For example, if N is 50, the second repetition rate is 50%.
[0078] Step S100, if the second repetition rate is less than the second threshold, then turn off the deduplication service.
[0079] In this embodiment, if the second repetition rate is less than the second threshold, it indicates that the repetition rate of data in the current storage scenario is relatively low, and then the deduplication service is turned off. Here, the second threshold is set according to actual needs and is not limited herein.
[0080] Further, in one embodiment, referring to Figure 3 , Figure 3 is a schematic flowchart of the third embodiment of the method for automatically turning on and off the deduplication service of the present application. As Figure 3 shown, after the step of if the first repetition rate is greater than the first threshold, then turn on the deduplication service, it further includes:
[0081] Execute the step that when the deduplication service is turned on, for each data writing operation, if the data fingerprint of the corresponding data exists in the fingerprint table, then the value of N is incremented by 1;
[0082] After the step of if the second repetition rate is less than the second threshold, then turn off the deduplication service, it further includes:
[0083] Execute the step that when the deduplication service is turned off, the data fingerprint of the data corresponding to the data writing operation is obtained once every preset number of times.
[0084] Further, in one embodiment, after step S50, it further includes:
[0085] Return to the step of obtaining the data fingerprint of the data corresponding to the data writing operation once every preset number of times until S first repetition rates are obtained; if all S first repetition rates are greater than the first threshold, then turn on the deduplication service.
[0086] In this embodiment, S is a preset value, such as 3, 5, 10, etc., and is specifically set according to actual needs. After obtaining a first repetition rate, it is determined whether S first repetition rates have been obtained currently. If not, the process of determining the first repetition rate is performed again until S first repetition rates are obtained.
[0087] If all S first repetition rates are greater than the first threshold, then turn on the deduplication service.
[0088] Among them, if all S first repetition rates are greater than the first threshold, it can better indicate that the current data repetition rate is high, so that the decision to enable the deduplication service is more in line with the actual situation.
[0089] Further, in one embodiment, the method for automatically turning on and off the deduplication service further includes:
[0090] When the update opportunity is met, write the data fingerprint corresponding to each data write operation into the cold fingerprint table; determine the duplicate fingerprint information in the cold fingerprint table; update the fingerprint table based on the duplicate fingerprint information.
[0091] In this embodiment, when it is in a preset time period, it is determined that the update opportunity is met; it can also be that when the execution entity of this embodiment is in a low-load state / idle state, it is determined that the update opportunity is met. Among them, it can be determined whether it is in a low-load state / idle state according to the occupancy rate of the key devices of the execution entity. For example, if the CPU / memory occupancy rate is lower than the preset occupancy rate, it is determined that it is in a low-load state / idle state.
[0092] When the update opportunity is met, write the data fingerprint corresponding to each data write operation into the cold fingerprint table. Among them, for each data write operation, the corresponding metadata will be stored, and the metadata contains the corresponding data fingerprint. Therefore, the data fingerprint corresponding to each data write operation can be obtained based on the stored metadata and then written into the cold fingerprint table.
[0093] Determine the duplicate fingerprint information in the cold fingerprint table. For example, the duplicate fingerprint information includes: fingerprint information 1 to 10. Updating the fingerprint table based on the duplicate fingerprint information can be:
[0094] Empty the fingerprint table, and then write fingerprint information 1 to 10 into the fingerprint table;
[0095] Determine the fingerprint information that exists in the duplicate fingerprint information but does not exist in the fingerprint table. For example, fingerprint information 8 to 10 does not exist in the fingerprint table, then append fingerprint information 8 to 10 to the fingerprint table.
[0096] In a second aspect, the embodiments of the present application further provide a device for automatically turning on and off the deduplication service.
[0097] In one embodiment, referring to Figure 4 , Figure 4 is a schematic diagram of the functional modules of an embodiment of the device for automatically turning on and off the deduplication service of the present application. As Figure 4 shown, the device for automatically turning on and off the deduplication service includes:
[0098] An initialization module 10, configured to compare the number of data fingerprints in the fingerprint table with a preset value when the deduplication service is in a pending state;
[0099] If the number of data fingerprints in the fingerprint table is not greater than a preset value, the deduplication service is closed;
[0100] The service status control module 20 is used to obtain the data fingerprint of the data corresponding to the data writing operation once every preset number of times when the deduplication service is closed;
[0101] If the obtained data fingerprint exists in the fingerprint table, the value of P is incremented by 1;
[0102] When the number of obtained data fingerprints reaches Q, calculate the ratio of P to Q to obtain the first duplication rate;
[0103] If the first duplication rate is greater than the first threshold, the deduplication service is enabled.
[0104] Further, in one embodiment, the initialization module 10 is further used for:
[0105] If the number of data fingerprints in the fingerprint table is greater than the preset value, the deduplication service is enabled;
[0106] The service status control module 20 is further used for:
[0107] When the deduplication service is enabled, for each data writing operation, if the data fingerprint of the corresponding data exists in the fingerprint table, the value of N is incremented by 1;
[0108] When the number of data writing operations reaches M, calculate the ratio of N to M to obtain the second duplication rate;
[0109] If the second duplication rate is less than the second threshold, the deduplication service is closed.
[0110] Further, in one embodiment, the deduplication service automatic switch device further includes an update module for:
[0111] When the update opportunity is met, write the data fingerprint of the data corresponding to each data writing operation into the cold fingerprint table;
[0112] Determine the duplicate fingerprint information in the cold fingerprint table;
[0113] Update the fingerprint table based on the duplicate fingerprint information.
[0114] Among them, the function implementation of each module in the above deduplication service automatic switch device corresponds to each step in the above deduplication service automatic switch method embodiment, and its function and implementation process will not be elaborated here one by one.
[0115] In a third aspect, an embodiment of the present application provides a deduplication service automatic switch device, and the deduplication service automatic switch device can be a device with data processing functions such as a personal computer (PC), a laptop computer, a server, etc.
[0116] Refer to Figure 5 , Figure 5 which is a schematic diagram of the hardware structure of the deduplication service automatic switch device involved in the solution of the embodiment of the present application. In the embodiment of the present application, the deduplication service automatic switch device may include a processor, a memory, a communication interface, and a communication bus.
[0117] Among them, the communication bus can be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0118] The communication interface includes interfaces such as input / output (I / O) interfaces, physical interfaces, and logical interfaces for implementing the interconnection of components inside the deduplication service automatic switch device, as well as interfaces for implementing the interconnection between the deduplication service automatic switch device and other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0119] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical memory, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0120] The processor can be a general-purpose processor, and the general-purpose processor can call the deduplication service automatic switch program stored in the memory and execute the deduplication service automatic switch method provided by the embodiment of the present application. For example, the general-purpose processor can be a central processing unit (CPU). Among them, the method executed when the deduplication service automatic switch program is called can refer to the various embodiments of the deduplication service automatic switch method of the present application, which will not be elaborated here.
[0121] Those skilled in the art can understand that Figure 5 the hardware structure shown in
[0122] does not constitute a limitation to the present application, and may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements.
[0123] A deduplication service automatic switch program is stored on the computer-readable storage medium of the present application. When the deduplication service automatic switch program is executed by a processor, the steps of the deduplication service automatic switch method as described above are implemented.
[0124] Among them, the method implemented when the deduplication service automatic switch program is executed can refer to the various embodiments of the deduplication service automatic switch method of the present application, which will not be elaborated here.
[0125] It should be noted that the serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments.
[0126] The terms "including" and "having" and any variations thereof in the specification, claims and above-mentioned drawings of the present application are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices. The descriptions with terms such as "first", "second" and "third" are used to distinguish different objects, etc., and do not represent the order of precedence, nor do they limit that "first", "second" and "third" are of different types.
[0127] In the description of the embodiments of the present application, words such as "exemplary", "for example" or "for illustration" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplary", "for example" or "for illustration" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary", "for example" or "for illustration" is intended to present the relevant concepts in a specific manner.
[0128] In the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may represent A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality of" means two or more than two.
[0129] In some processes described in the embodiments of the present application, a plurality of operations or steps appear in a specific order. However, it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or may be executed in parallel. The serial numbers of the operations are only used to distinguish different operations, and the serial numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0130] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above and includes several instructions for causing a terminal device to execute the methods described in various embodiments of the present application.
[0131] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.
Claims
1. A method for automatically switching on and off a deduplication service, characterized in that: The deduplication service automatic switching method comprises: When the deduplication service is in a pending state, the number of data fingerprints in the fingerprint table is compared with the preset value; If the number of data fingerprints in the fingerprint table is not greater than the preset value, the deduplication service is closed; When the deduplication service is turned off, the data fingerprint of the data corresponding to the data write operation is obtained after every preset number of data write operations; If the acquired data fingerprint exists in the fingerprint table, the value of P is increased by 1; When the number of acquired data fingerprints reaches Q, the ratio of P to Q is calculated to obtain the first repetition rate; If the first duplication rate is greater than the first threshold, the deduplication service is started.
2. The deduplication service automatic switching method according to claim 1, characterized in that: After the step of calculating the ratio of P to Q to obtain the first repetition rate when the number of acquired data fingerprints reaches Q, the method further includes: Returning to the step of acquiring the data fingerprint of the data corresponding to the data writing operation once every preset number of times, until S first repetition rates are obtained; If the S first repetition rates are all greater than the first threshold, the deduplication service is enabled.
3. The deduplication service automatic switching method according to claim 1, characterized in that: After the step of comparing the number of data fingerprints in the fingerprint table with a preset value when the deduplication service is in a pending state, the method further includes: If the number of data fingerprints in the fingerprint table is greater than the preset value, the deduplication service is enabled; When the deduplication service is enabled, for each data write operation, if the data fingerprint of the corresponding data exists in the fingerprint table, the value of N is increased by 1; When the number of data writing operations reaches M, the ratio of N to M is calculated to obtain a second repetition rate; If the second duplication rate is less than the second threshold, the deduplication service is closed.
4. The deduplication service automatic switching method according to claim 3, characterized in that: After the step of starting the deduplication service if the first repetition rate is greater than the first threshold, the method further includes: Execute the step of increasing the value of N by 1 for each data write operation when the deduplication service is enabled if the data fingerprint of the corresponding data exists in the fingerprint table; After the step of shutting down the deduplication service if the second repetition rate is less than the second threshold, the method further includes: The step of obtaining a data fingerprint of data corresponding to a data write operation once every preset number of times when the deduplication service is closed is performed.
5. The method for automatically switching on and off a deduplication service according to any one of claims 1 to 4, characterized in that: The deduplication service automatic switching method further includes: When the update opportunity is met, the data fingerprint of the data corresponding to each data write operation is written into the cold fingerprint table; Determine duplicate fingerprint information in the cold fingerprint table; The fingerprint table is updated based on the repeated fingerprint information.
6. A deduplication service automatic switch device, characterized in that: The deduplication service automatic switch device comprises: An initialization module, used to compare the number of data fingerprints in the fingerprint table with a preset value when the deduplication service is in a pending state; If the number of data fingerprints in the fingerprint table is not greater than the preset value, the deduplication service is closed; A service status control module, used for obtaining a data fingerprint of data corresponding to a data write operation after each preset number of data write operations when the deduplication service is closed; If the acquired data fingerprint exists in the fingerprint table, the value of P is increased by 1; When the number of acquired data fingerprints reaches Q, the ratio of P to Q is calculated to obtain the first repetition rate; If the first duplication rate is greater than the first threshold, the deduplication service is started.
7. The deduplication service automatic switch device according to claim 6, characterized in that: Initialization module, also used for: If the number of data fingerprints in the fingerprint table is greater than the preset value, the deduplication service is enabled; The service status control module is also used to: When the deduplication service is enabled, for each data write operation, if the data fingerprint of the corresponding data exists in the fingerprint table, the value of N is increased by 1; When the number of data writing operations reaches M, the ratio of N to M is calculated to obtain a second repetition rate; If the second duplication rate is less than the second threshold, the deduplication service is closed.
8. The deduplication service automatic switch device according to claim 6 or 7, characterized in that: The deduplication service automatic switch device also includes an update module, which is used to: When the update opportunity is met, the data fingerprint of the data corresponding to each data write operation is written into the cold fingerprint table; Determine duplicate fingerprint information in the cold fingerprint table; The fingerprint table is updated based on the repeated fingerprint information.
9. A deduplication service automatic switch device, characterized in that: The deduplication service automatic switching device includes a processor, a memory, and a deduplication service automatic switching program stored in the memory and executable by the processor, wherein when the deduplication service automatic switching program is executed by the processor, the steps of the deduplication service automatic switching method as described in any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a deduplication service automatic switching program, wherein when the deduplication service automatic switching program is executed by a processor, the steps of the deduplication service automatic switching method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Data storage method and device
CN112684975A
Data writing method and system of storage system
CN112783446A