Bitmap division method and device, storage medium and electronic equipment

By identifying and deleting invalid data bits in the bitmap and dynamically adjusting the shard size, the problem of low bitmap data backup efficiency in the existing technology is solved, and the efficiency and processing speed of data backup are significantly improved.

CN119226043APending Publication Date: 2024-12-31JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411353903.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the prior art, backup bitmaps according to the order of bitmaps data or splitting bitmaps into fixed-sized bitmaps leads to low backup efficiency of bitmaps data, especially when the data distribution is uneven or sparse.

Method used

By determining the invalid data bits in the target bitmap and deleting it, dynamically adjusting the bitmap shard size, ensuring that each shard contains as many valid data bits as possible, and eliminating invalid data bits to improve backup efficiency.

Benefits of technology

It improves the backup efficiency of bitmap data, especially when the data distribution is uneven or sparse, reduces the resource consumption of read and parsing time and subsequent data copy operations, and improves the efficiency of overall data backup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226043A_ABST
    Figure CN119226043A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a bitmap division method and device, a storage medium and electronic device.The bitmap division method comprises the steps that under the condition that it is determined that a first invalid data bit exists in a target position of a target bitmap, whether a second invalid data bit continuous with the target position exists in the target bitmap or not is determined, the target position is used for indicating a first starting data bit and / or an ending data bit in the target bitmap; when it is determined that the second invalid data bit exists in the target bitmap, deleting the first invalid data bit and the second invalid data bit to update the target bitmap; the first number of valid data bits allowed to be contained in a first bitmap fragment to be divided is set, the updated target bitmap is divided into target bitmap fragments according to the first number, and the target bitmap fragments comprise the first bitmap fragment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communications, and in particular, to a method and device for dividing a bitmap, a storage medium, and an electronic device. Background Art

[0002] In the era of cloud computing, more and more users are using cloud office services, and data backup is particularly important. The traditional backup method is to use snapshot technology and then copy the corresponding data blocks to the backup storage. That is, by comparing the data between two snapshots and then writing it to the backup storage pool, incremental data can be backed up. However, snapshot technology requires full copy of the data to be compared, which is relatively inefficient.

[0003] The Changed Block Tracking (CBT) mode of virtual machine backup is a backup mode that can identify and track blocks that have been modified in the virtual machine since the last backup, and these changes will be stored in the log file. After the CBT mode is enabled, the backup software will use this function to perform incremental backups. Enabling the CBT mode can ensure the integrity and consistency of the virtual machine backup, while avoiding the tediousness and time consumption of full backup. The CBT mode is very useful for large virtual machines and situations where frequent backups are required. This technology implements fine-grained data copying, reduces invalid data comparison and copying operations, and can efficiently perform data backup operations. Traditional bitmap sharding technology may be sharded according to the fixed length of the bitmap. In scenarios where data is evenly distributed, the backup efficiency is still acceptable. If the data is discrete or sparsely distributed, this sharding method will be inefficient. As the degree of discretization increases, the efficiency of this sharding method gradually decreases.

[0004] Therefore, the problem of low backup efficiency of the data in the bitmap caused by backing up the bitmap according to the order of the bitmap data or backing up the data in the bitmap by dividing the bitmap into bitmap slices of fixed size in the related art has not been effectively solved. Summary of the invention

[0005] The embodiments of the present application provide a bitmap partitioning method and device, a storage medium, and an electronic device, so as to at least solve the problem of low backup efficiency of data in the bitmap caused by backing up the bitmap according to the order of the bitmap data, or backing up the data in the bitmap by dividing the bitmap into bitmap slices of fixed size in the related art.

[0006] According to an embodiment of the present application, a method for dividing a bitmap is provided, specifically comprising: in a case where it is determined that a first invalid data bit exists in a target position of a target bitmap, determining whether a second invalid data bit continuous with the target position exists in the target bitmap, wherein the target position is used to indicate a first starting data bit and / or an ending data bit in the target bitmap; in a case where it is determined that the second invalid data bit exists in the target bitmap, deleting the first invalid data bit and the second invalid data bit to update the target bitmap; setting a first number of valid data bits allowed to be included in a first bitmap slice to be divided, and dividing the updated target bitmap into target bitmap slices according to the first number, wherein the target bitmap slices include: the first bitmap slices.

[0007] In an exemplary embodiment, before determining whether there is a second invalid data bit in the target bitmap that is continuous with the target position, the method further includes: determining whether the first data in the first data bit in the target bitmap and / or the second data in the end data bit are the target value; when it is determined that both the first data and the second data are the target values, or only the first data is the target value, or only the second data is the target value, determining that the first invalid data bit exists at the target position of the target bitmap; when it is determined that neither the first data nor the second data is the target value, determining that the first invalid data bit does not exist at the target position of the target bitmap.

[0008] In an exemplary embodiment, after determining that the first invalid data bit exists at the target position of the target bitmap, the method further includes: determining whether the second invalid data bit exists in the target bitmap; and in the case of determining that the second invalid data bit does not exist in the target bitmap, deleting the first invalid data bit to update the target bitmap.

[0009] In an exemplary embodiment, dividing an updated target bitmap into target bitmap slices according to the first number includes: determining a second number of valid data bits contained in the updated target bitmap; determining a first size relationship between the first number and the second number; dividing the updated target bitmap into the first bitmap slices when the first size relationship indicates that the first number is greater than or equal to the second number; determining a first number of valid data bits in sequence according to the position of each data bit in the updated target bitmap when the first size relationship indicates that the first number is less than the second number, and determining a first position of a target valid data bit in the first number of valid data bits in the updated target bitmap, wherein the target valid data bit is the last valid data bit in the first number of valid data bits; dividing the updated target bitmap into a first bitmap and a second bitmap according to the first position, and updating the first bitmap; dividing the updated first bitmap into the first bitmap slices; and setting a fourth number of valid data bits allowed to be contained in the second bitmap slices to be divided, and dividing the second bitmap into the second bitmap slices according to the fourth number, wherein the target bitmap slices include: the second bitmap slices.

[0010] In an exemplary embodiment, dividing the second bitmap into the second bitmap slices according to the fourth quantity includes: determining whether there is a third invalid data bit in the second position of the second bitmap, wherein the second position is used to indicate the second starting data bit of the second bitmap; in the case of determining that the third invalid data bit exists in the second position, determining whether there is a fourth invalid data bit in the second bitmap that is continuous with the second position; in the case of determining that the fourth invalid data bit exists in the second bitmap, deleting the third invalid data bit and the fourth invalid data bit to update the second bitmap; determining a fifth quantity of valid data bits contained in the updated second bitmap; determining a second size relationship between the fourth quantity and the fifth quantity; and in the case of the second size relationship indicating that the fourth quantity is greater than or equal to the fifth quantity, dividing the updated second bitmap into the second bitmap slices.

[0011] In an exemplary embodiment, the updated target bitmap is divided into a first bitmap and a second bitmap according to the first position, and the first bitmap is updated, including: determining whether the third position of the updated target bitmap contains a fifth invalid data bit, wherein the third position is a subsequent position continuous with the first position; in the case where it is determined that the third position contains the fifth invalid data bit, determining whether there is a sixth invalid data bit continuous with the fifth invalid data bit in the target bitmap; in the case where it is determined that there is a sixth invalid data bit continuous with the sixth invalid data bit in the target bitmap, determining a sixth number of invalid data bits contained in the fifth invalid data bit and the sixth invalid data bit, and obtaining a preset redundancy; determining a third size relationship between the sixth number and the preset redundancy; and dividing the target bitmap into the first bitmap and the second bitmap according to the third size relationship.

[0012] In an exemplary embodiment, the target bitmap is divided into the first bitmap and the second bitmap according to the third size relationship, including: when the third size relationship indicates that the sixth quantity is less than the preset redundancy, the invalid data bits of the preset redundancy are determined in sequence according to the position of each invalid data bit included in the fifth invalid data bit and the sixth invalid data bit, and the seventh invalid data bit among the invalid data bits of the preset redundancy is determined, wherein the seventh invalid data bit is the last invalid data bit among the invalid data bits of the preset redundancy; the target bitmap is divided into the first bitmap and the second bitmap according to the seventh invalid data bit; when the third size relationship indicates that the sixth quantity is greater than or equal to the preset redundancy, the eighth invalid data bit is determined in the target bitmap, and the target bitmap is divided into the first bitmap and the second bitmap according to the eighth invalid data bit, wherein the eighth invalid data bit is the last invalid data bit among the fifth invalid data bit and the sixth invalid data bit.

[0013] According to another embodiment of the present application, a bitmap partitioning device is provided, including: a determination module, for determining whether there is a second invalid data bit continuous with the target position in the target bitmap when it is determined that there is a first invalid data bit in the target position of the target bitmap, wherein the target position is used to indicate the first starting data bit and / or ending data bit in the target bitmap; when it is determined that there is the second invalid data bit in the target bitmap, deleting the first invalid data bit and the second invalid data bit to update the target bitmap; setting a first number of valid data bits allowed to be included in the first bitmap slice to be divided, and dividing the updated target bitmap into target bitmap slices according to the first number, wherein the target bitmap slices include: the first bitmap slices.

[0014] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps in the above method embodiment when running.

[0015] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in the above method embodiment.

[0016] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiment are implemented.

[0017] By the bitmap partitioning method of the present application, when it is determined that the first starting data bit and / or the first ending data bit of the target bitmap have a first invalid data bit, it is determined whether there is a second invalid data bit in the target bitmap that is continuous with the target position, that is, the first starting data bit and / or the first ending data bit; when it is determined that there is a second invalid data bit in the target bitmap, the first invalid data bit and the second invalid data bit are deleted to update the target bitmap; the first number of valid data bits allowed to be included in the first bitmap slice to be divided is set, and the updated target bitmap is divided into the first bitmap slice according to the first number. That is to say, the optional embodiment of the present application determines whether there are invalid data bits in the target position and the position continuous with the target position in the target bitmap, and then when it is determined that the target position and the position continuous with the target position both contain invalid data bits, the invalid data bits are deleted to update the target bitmap. The updated target bitmap is divided into target bitmap slices. Through the above technical solution, the problem of low backup efficiency of data in the bitmap caused by backing up the data in the bitmap according to the backup bitmap of the bitmap data sequence or dividing the bitmap into fixed-size bitmap slices in the related art can be solved. This can improve the backup efficiency of the data in the bitmap. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a hardware structure block diagram of a computer terminal of a bitmap partitioning method according to an embodiment of the present application;

[0019] Figure 2 is a flowchart of a bitmap partitioning method according to an embodiment of the present application;

[0020] Figure 3 It is a schematic diagram of reading and writing data with a fixed shard size in the related art (I);

[0021] Figure 4is a schematic diagram of a bitmap slicing method according to an optional embodiment of the present application (I);

[0022] Figure 5 It is a schematic diagram of reading and writing data with a fixed shard size in the related art (II);

[0023] Figure 6 This is a schematic diagram of a bitmap slicing method according to an optional embodiment of the present application (II);

[0024] Figure 7 It is a schematic diagram of reading and writing data with a fixed shard size in the related art (III);

[0025] Figure 8 This is a schematic diagram of a bitmap slicing method according to an optional embodiment of the present application (III);

[0026] Fig. 9 It is a structural block diagram of a bitmap partitioning device according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0029] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal for a bitmap partitioning method according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0030] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the interactive state in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0031] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0032] Figure 2 is a flowchart of a bitmap partitioning method according to an embodiment of the present application, which can be applied to Figure 1 In a computer terminal, such as Figure 2 As shown, the process includes the following steps:

[0033] Step S202, when it is determined that there is a first invalid data bit in the target position of the target bitmap, determining whether there is a second invalid data bit in the target bitmap that is continuous with the target position, wherein the target position is used to indicate a first start data bit and / or end data bit in the target bitmap;

[0034] The invalid data bits may be represented by 0, and the data bits in the bitmap may be 0 or 1.

[0035] Step S204, when it is determined that the second invalid data bit exists in the target bitmap, deleting the first invalid data bit and the second invalid data bit to update the target bitmap;

[0036] The data bit that is continuous with the first start data bit may be the data bit after the first start data bit, for example:

[0037] The bit map is 0001110, the first starting data bit is 0, the first starting data bit is an invalid data bit, and the invalid data bits consecutive to the first starting data bit are 00 followed by 0.

[0038] The data bits continuous with the end data bit may be the data bits before the end data bit, for example, 111000, the end data bit is 0, the end data bit is an invalid data bit, and the second invalid data bit is 00 before the end data bit.

[0039] Step S206, setting a first number of valid data bits allowed to be contained in the first bitmap slice to be divided, and dividing the updated target bitmap into target bitmap slices according to the first number, wherein the target bitmap slices include: the first bitmap slices.

[0040] By the bitmap partitioning method of the present application, when it is determined that the first starting data bit and / or the first ending data bit of the target bitmap have a first invalid data bit, it is determined whether there is a second invalid data bit in the target bitmap that is continuous with the target position, that is, the first starting data bit and / or the first ending data bit; when it is determined that there is a second invalid data bit in the target bitmap, the first invalid data bit and the second invalid data bit are deleted to update the target bitmap; the first number of valid data bits allowed to be included in the first bitmap slice to be divided is set, and the updated target bitmap is divided into the first bitmap slice according to the first number. That is to say, the optional embodiment of the present application determines whether there are invalid data bits in the target position and the position continuous with the target position in the target bitmap, and then when it is determined that the target position and the position continuous with the target position both contain invalid data bits, the invalid data bits are deleted to update the target bitmap. The updated target bitmap is divided into target bitmap slices. Through the above technical solution, the problem of low backup efficiency of data in the bitmap caused by backing up the data in the bitmap according to the backup bitmap of the bitmap data sequence or dividing the bitmap into fixed-size bitmap slices in the related art can be solved. This can improve the backup efficiency of the data in the bitmap.

[0041] Optionally, before determining whether there is a second invalid data bit continuous with the target position in the target bitmap in the above step S202, the method also includes: determining whether the first data in the first data bit in the target bitmap and / or the second data in the end data bit are the target value; when it is determined that both the first data and the second data are the target values, or only the first data is the target value, or only the second data is the target value, determining that the first invalid data bit exists at the target position of the target bitmap; when it is determined that neither the first data nor the second data is the target value, determining that the first invalid data bit does not exist at the target position of the target bitmap.

[0042] It is understood that the target bitmap is a bitmap used to track data changes since the last backup, where each bit indicates whether a data block has changed. A "1" in the bitmap indicates that the data block has changed and needs to be backed up; a "0" indicates that the data block has not changed and can be ignored. Specifically:

[0043] (1) Determine whether the data in the first data bit and the end data bit in the target bitmap are the target values:

[0044] The target value usually refers to the value of the invalid data bit, i.e. "0". Through this step, it is possible to check whether the start and end positions of the bitmap contain invalid data, thereby avoiding wasting computing resources on unnecessary data reading or backup at these positions.

[0045] When it is determined that both the first data and the second data are the target value, or only the first data is the target value, or only the second data is the target value, it is determined that the first invalid data bit exists at the target position of the target bitmap: if the starting data bit of the bitmap is "0", or the ending data bit is "0", or both are "0", then there is no data change at these positions. Therefore, it can be determined that these positions contain the first invalid data bit. This helps to remove these redundant "0" bits when reading and processing the bitmap, thereby improving reading and backup efficiency.

[0046] (2) When it is determined that neither the first data nor the second data is the target value, it is determined that the first invalid data bit does not exist at the target position of the target bitmap:

[0047] If the starting data bit and the ending data bit of the bitmap are not "0", that is, they are all "1", it means that the data from the starting to the ending position may change. In this case, there is no first invalid data bit at these positions, and it is necessary to continue reading and analyzing the bitmap to determine which specific data blocks have changed.

[0048] Through the above steps, it is possible to more efficiently determine which data blocks in the bitmap really need to be paid attention to and backed up, thereby avoiding the processing of all-0 or invalid data, saving computing resources, and improving the overall efficiency of data backup. Especially when the bitmap data is unevenly distributed or there are a large number of invalid bits, this preprocessing can improve the data hit rate and processing speed during the backup process.

[0049] Wherein, after determining that the first invalid data bit exists in the target position of the target bitmap, the method further includes: determining whether the second invalid data bit exists in the target bitmap; and if it is determined that the second invalid data bit does not exist in the target bitmap, deleting the first invalid data bit to update the target bitmap.

[0050] It can be understood that each bit in the bitmap (usually a binary bit) corresponds to a block on the disk. If the block changes, the corresponding bit in the bitmap is marked as 1, otherwise it is marked as 0. When backing up data, by reading the 1 in the bitmap, you can know which data blocks need to be backed up. In order to further improve the efficiency of data backup, especially for bitmaps that are sparsely distributed or contain a large number of invalid data bits (for example: disk blocks that have not changed in virtual machine backup scenarios), the bitmap can be updated. Specifically:

[0051] (1) Determine the first invalid data bit:

[0052] When processing the target bitmap, first check whether there is a first invalid data bit (usually bit 0 in the bitmap) at the target position. This step is based on the dynamic sharding backup scheme, and the purpose is to identify and remove invalid data bits that do not need to be copied.

[0053] (2) Determine the second invalid data bit:

[0054] If the first invalid data bit is found at the target position, the target bitmap is checked for a second consecutive invalid data bit. The second invalid data bit can be understood as a series of consecutive 0 bits after the first invalid data bit. Through the above method, it can be determined whether there are sufficiently long consecutive invalid data bits to determine whether special processing is required.

[0055] (3) Delete the first invalid data bit and update the bitmap:

[0056] When it is confirmed that there is no continuous second invalid data bit in the target bitmap (i.e., there is no continuous 0 bits of sufficient length), the first invalid data bit can be deleted. In this case, these invalid 0 bits are skipped during bitmap processing.

[0057] By updating the target bitmap using the above technical solution, it can be ensured that in subsequent data backup operations, only valid data bits (i.e. bits with a value of 1) need to be backed up, thereby avoiding the processing of a large amount of invalid data and improving the efficiency of data reading and backup.

[0058] In summary, by eliminating invalid data bits, especially when the bitmap is sparsely distributed, the time for bitmap reading and parsing, as well as the resource consumption of subsequent data copy operations, can be reduced, thereby improving the overall data backup efficiency.

[0059] Optionally, the above-mentioned step S206 of dividing the updated target bitmap into target bitmap slices according to the first number includes: determining a second number of valid data bits contained in the updated target bitmap; determining a first size relationship between the first number and the second number; when the first size relationship indicates that the first number is greater than or equal to the second number, dividing the updated target bitmap into the first bitmap slices; when the first size relationship indicates that the first number is less than the second number, determining the first number of valid data bits in turn according to the position of each data bit in the updated target bitmap, and determining the first position of the target valid data bit in the first number of valid data bits in the updated target bitmap, wherein the target valid data bit is the last valid data bit in the first number of valid data bits; dividing the updated target bitmap into a first bitmap and a second bitmap according to the first position, and updating the first bitmap; dividing the updated first bitmap into the first bitmap slices; and, setting a fourth number of valid data bits allowed to be contained in the second bitmap slices to be divided, and dividing the second bitmap into the second bitmap slices according to the fourth number, wherein the target bitmap slices include: the second bitmap slices.

[0060] It can be understood that the specific implementation steps of the bitmap dynamic slicing algorithm in the updated target bitmap processing process include:

[0061] (1) Determine the second number of valid data bits contained in the updated target bitmap:

[0062] After the bitmap is updated, it is necessary to count the second number of valid data bits (usually data bits with a bit value of 1) therein.

[0063] (2) Determine a first magnitude relationship between the first quantity and the second quantity:

[0064] The first number is set according to factors such as system resources and backup efficiency. The first number is the expected number of valid data bits that should be included in a bitmap slice. By comparing the first number and the second number, it can be determined whether the updated target bitmap is suitable for slicing according to the preset first number.

[0065] (3) When the first size relationship indicates that the first number is greater than or equal to the second number, the updated target bitmap is divided into the first bitmap fragments:

[0066] If the first number is greater than or equal to the second number, it means that the number of valid data bits in the updated target bitmap is not enough to constitute a slice alone, or just meets the requirements of a slice. In this case, the entire updated target bitmap can be processed as a complete slice (the first bitmap slice) without further segmentation.

[0067] (4) When the first size relationship indicates that the first quantity is smaller than the second quantity, dynamic sharding is performed:

[0068] When the first number is less than the second number, it can be determined that the number of valid data bits in the updated target bitmap exceeds the preset slice size. At this time, the first number of valid data bits can be dynamically determined starting from the starting position of the bitmap according to the position of the data bits until the first valid data bit is found and the first number is satisfied.

[0069] After determining the valid data bits in the first bitmap slice, it is also necessary to identify the first position of the last valid data bit in this slice in the updated target bitmap, and then accurately divide the bitmap into two parts, namely the first bitmap and the remaining second bitmap.

[0070] (5) After the first bitmap is segmented, the first bitmap needs to be updated to reflect the status changes of the valid data bits that have been backed up. Usually, these bits are set to an invalid state (bit value 0).

[0071] After the first bitmap is updated, it can be divided according to the definition of the first bitmap slice, and the fourth number of valid data bits allowed to be included in the second bitmap slice is set, and the remaining second bitmap is further sliced ​​according to the fourth number.

[0072] Through such a dynamic sharding strategy, the number of valid data bits in each bitmap shard can be ensured to be as balanced as possible, while reducing the processing of invalid data bits, thereby improving the efficiency of data backup. Especially in scenarios where data distribution is uneven or sparse, this flexibility can significantly improve resource utilization and data processing speed.

[0073] Wherein, dividing the second bitmap into the second bitmap slices according to the fourth quantity includes: determining whether there is a third invalid data bit in the second position of the second bitmap, wherein the second position is used to indicate the second starting data bit of the second bitmap; in the case of determining that the third invalid data bit exists in the second position, determining whether there is a fourth invalid data bit continuous with the second position in the second bitmap; in the case of determining that the fourth invalid data bit exists in the second bitmap, deleting the third invalid data bit and the fourth invalid data bit to update the second bitmap; determining a fifth quantity of valid data bits contained in the updated second bitmap; determining a second size relationship between the fourth quantity and the fifth quantity; in the case where the second size relationship indicates that the fourth quantity is greater than or equal to the fifth quantity, dividing the updated second bitmap into the second bitmap slices.

[0074] It can be understood that the process of processing the second bitmap to optimize the sharding can ensure that each shard contains as many valid data bits as possible, while removing invalid data bits to improve data processing efficiency. Specifically:

[0075] (1) Determine whether there is a third invalid data bit at the second position of the second bitmap:

[0076] The second position of the bitmap is checked to determine whether the second position contains an invalid data bit (i.e., a bit with a value of 0). The second position can be checked from any non-starting position of the bitmap. When it is determined that the second position has a third invalid data bit, determine whether the second bitmap has a fourth invalid data bit that is continuous with the second position. If an invalid data bit is found in the second position, the algorithm will continue to check the subsequent bits that are continuous with this position to see if there are more invalid data bits (i.e., the fourth invalid data bit), with the purpose of determining the range of continuous invalid bits. When it is determined that the second bitmap has a fourth invalid data bit, the third invalid data bit and the fourth invalid data bit are deleted to update the second bitmap. If continuous invalid data bits are detected, the algorithm will remove these continuous invalid bits and update the bitmap. The purpose of this is to reduce the processing of invalid data and improve the efficiency of data backup.

[0077] (2) Determine a fifth number of valid data bits contained in the updated second bitmap:

[0078] After the bitmap is updated, the fifth number of valid data bits (ie, bits with a value of 1) therein is recalculated.

[0079] Determine a second size relationship between the fourth number and the fifth number: the fourth number may be a preset sharding size or an expected number of valid data bits that each shard should contain. The second size relationship is used to compare the fourth number with the fifth number (the number of valid bits in the updated bitmap) to see whether the sharding condition is met.

[0080] In the case where the second size relationship indicates that the fourth number is greater than or equal to the fifth number, the updated second bitmap is divided into the second bitmap slices: if the preset slice size (fourth number) is greater than or equal to the number of valid data bits in the updated bitmap (fifth number), then the current updated bitmap can be directly used as a bitmap slice without further segmentation or processing. At this time, according to this judgment result, the current bitmap is divided into a slice to prepare for data backup or processing.

[0081] Through the above embodiments, the data distribution in the bitmap can be intelligently identified and processed to ensure that each shard contains as many valid data bits as possible while avoiding unnecessary invalid data bits, thereby achieving effective resource utilization and efficiency improvement in operations such as data backup. This strategy of dynamically adjusting the shard size can significantly improve the speed and accuracy of data processing, especially when processing sparse or discrete data distribution.

[0082] Wherein, the updated target bitmap is divided into a first bitmap and a second bitmap according to the first position, and the first bitmap is updated, including: determining whether the third position of the updated target bitmap contains a fifth invalid data bit, wherein the third position is a subsequent position continuous with the first position; in the case where it is determined that the third position contains the fifth invalid data bit, determining whether there is a sixth invalid data bit continuous with the fifth invalid data bit in the target bitmap; in the case where it is determined that there is a sixth invalid data bit continuous with the sixth invalid data bit in the target bitmap, determining a sixth number of invalid data bits contained in the fifth invalid data bit and the sixth invalid data bit, and obtaining a preset redundancy; determining a third size relationship between the sixth number and the preset redundancy; and dividing the target bitmap into the first bitmap and the second bitmap according to the third size relationship.

[0083] Wherein, dividing the target bitmap into the first bitmap and the second bitmap according to the third size relationship includes: when the third size relationship indicates that the sixth quantity is less than the preset redundancy, determining the invalid data bits of the preset redundancy in sequence according to the position of each invalid data bit included in the fifth invalid data bit and the sixth invalid data bit, and determining the seventh invalid data bit among the invalid data bits of the preset redundancy, wherein the seventh invalid data bit is the last invalid data bit among the invalid data bits of the preset redundancy; dividing the target bitmap into the first bitmap and the second bitmap according to the seventh invalid data bit; when the third size relationship indicates that the sixth quantity is greater than or equal to the preset redundancy, determining the eighth invalid data bit in the target bitmap, and dividing the target bitmap into the first bitmap and the second bitmap according to the eighth invalid data bit, wherein the eighth invalid data bit is the last invalid data bit among the fifth invalid data bit and the sixth invalid data bit.

[0084] It can be understood that the bitmap slices are dynamically divided according to the position and number of invalid data bits (i.e., 0 bits in the bitmap), specifically including:

[0085] (1) Determine whether it is less than the preset redundancy.

[0086] In the process of reading the target bitmap, if it is determined that there are consecutive invalid data bits (for example, the sixth number of 0 bits), if the number of these consecutive 0 bits is less than the preset redundancy, the reading will continue until the accumulated consecutive 0 bits reach the preset redundancy. Once the accumulated consecutive 0 bits reach the preset redundancy, the seventh invalid data bit is the last 0 bit in this continuous sequence. This marks the end of a slice, because the algorithm will start reading the data of the next slice after the seventh invalid data bit.

[0087] (2) When the amount of redundancy is greater than or equal to the preset amount:

[0088] If during the reading process, it is found that the number of consecutive 0 bits is greater than or equal to the preset redundancy, the algorithm will immediately determine the last 0 bit as the segmentation point of the fragment, that is, the eighth invalid data bit.

[0089] The eighth invalid data bit is determined dynamically. It can be the last 0 bit when the accumulated amount reaches the preset redundancy amount, or the latest 0 bit when the accumulated amount exceeds the preset redundancy amount. Once the eighth invalid data bit is determined, the target bitmap is divided into the first bitmap and the second bitmap according to this position, that is, the currently read shard and the next shard to be read.

[0090] In summary, the embodiment of the present application can dynamically and intelligently adjust the size of the shard according to the validity (i.e., whether it is 1 bit) and invalidity (i.e., the continuous occurrence of 0 bits) of the data in the bitmap. This dynamic adjustment mechanism ensures that the amount of data contained in the bitmap shard is as balanced as possible, while effectively eliminating a large amount of continuous invalid data, avoiding unnecessary data processing and transmission, thereby significantly improving the efficiency of data backup. In addition, it can flexibly respond to the sparsity of data and the impact of continuous invalid data, and optimize the data reading and backup process.

[0091] In order to better understand the process of the above-mentioned bitmap division method, the implementation process of the above-mentioned bitmap division method is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.

[0092] An optional embodiment of the present application defines a method for backing up data based on bitmap dynamic sharding, which dynamically adjusts sharded data according to the total amount of bitmap data, and uses a bitmap sharding algorithm to quickly and efficiently generate bitmap sharding information.

[0093] The traditional sharding method and the fixed allocation bitmap method will lead to uneven data distribution in the shards, reducing the utilization rate of computing resource copies. That is, the traditional solution is too fixed, which will lead to large data differences in different bitmap shards, resulting in a waste of computing resources during the transmission process. In order to solve the above problems, the optional embodiment of the present application proposes a bitmap dynamic balanced backup data solution, which can quickly formulate the data sharding method and the number of shards to improve the utilization rate of thread copies. It not only solves the problem of data balance, but also solves the problem of data fragmentation caused by sparse distribution, thereby improving the utilization rate of computing resources.

[0094] First, we need to calculate the total number m of data bits that are 1 in the bitmap.

[0095] That is, the total number m of valid data bits in the bitmap (ie, the target bitmap of the present application) is calculated, and the amount of valid bitmap data in each bitmap slice is set to n (ie, the first number of the present application).

[0096] Secondly, the bitmap can be sliced, specifically:

[0097] (1) Slice the bitmap with uniform bitmap distribution.

[0098] For example: the bitmap is: 1001100110110011. Figure 3 This is a schematic diagram of reading and writing data with a fixed shard size in the related art (I), such as Figure 3 As shown:

[0099] In the related art, a bitmap is divided into a bitmap slice 10011001 and a bitmap slice 10110011, and then the steps of reading and writing data are performed. The disk files corresponding to the two bitmap slices are backed up from the original disk file of the virtual machine to the backup disk file.

[0100] If you follow Figure 3 The total number of valid bitmap data is 9. If the number of bitmap data contained in each slice is 5, the slice method calculated by the dynamic slice algorithm of the optional embodiment of the present application is Figure 4 The method in the embodiment is to divide the bitmap into bitmap slice 100110011 and bitmap slice 110011. Figure 4 is a schematic diagram of a bitmap slicing method according to an optional embodiment of the present application (I), such as Figure 4 As shown, the data of the fragment is discontinuous, and the invalid 0 data at the beginning (record offset) will be skipped to reduce the invalid bitmap added to the fragment.

[0101] (2) If there are consecutive 0s at the beginning or end of the bitmap, the bitmap is fragmented.

[0102] For example, the bitmap is 00010111000000. Figure 5 This is a schematic diagram of reading and writing data with a fixed shard size in the related art (II), such as Figure 5 As shown:

[0103] In the related art, the bitmap is divided into bitmap slice 0001011 and bitmap slice 1000000, and then the data reading and writing steps are performed. The disk files corresponding to the two bitmap slices are backed up from the original disk files of the virtual machine to the backup disk files.

[0104] If you follow Figure 5 The slicing method in requires that the bitmap be divided into two bitmap slices. Figure 6 is a schematic diagram of a bitmap slicing method according to an optional embodiment of the present application (II), such as Figure 6 As shown, the invalid and non-images in the head and tail of the bitmap are removed (if the redundancy is not reached, they must be removed), and then the valid bitmap data is obtained. That is, the bitmap is divided into 10111 bitmap slices. Reducing the bitmap slices in sequence can be completed on one bitmap slice.

[0105] (3) Bitmap fragmentation is performed on bitmaps with relatively uneven bitmap distribution.

[0106] For example, 010000000000111. Figure 7 This is a schematic diagram of reading and writing data with a fixed shard size in the related art (III), such as Figure 7 As shown:

[0107] In the related art, the bitmap is divided into bitmap slice 0100000 and bitmap slice 00000111, and then the steps of reading and writing data are performed. The disk files corresponding to the two bitmap slices are backed up from the original disk file of the virtual machine to the backup disk file.

[0108] and Figure 8 is a schematic diagram of a bitmap slicing method according to an optional embodiment of the present application (III), such as Figure 8 As shown, during transmission, the user can set the minimum redundancy (the number of consecutive 0s). Figure 1 If multiple invalid bitmaps 0 appear consecutively at the back, reaching the minimum redundancy, then this section of invalid bitmap 0 is automatically fragmented (here the redundancy is set to 3): when reading the bitmap data, first remove the data starting with 0, and the resulting bitmap is 10000000000111. When 1 is read and there are 3 consecutive 0s, it is automatically fragmented to obtain the first piece of data bit 1, and the remaining data bits are 0000000111. Then, according to step 2, the leading 0 is removed, and 111 is obtained as the second piece of data, that is, the bitmap is divided into bitmap fragment 1 and bitmap fragment 111. Compared with traditional fragmentation, the fragmentation method in the optional embodiment of the present application reduces the number of invalid bitmaps 0 in the fragment, improves the data reading efficiency, makes the data hit rate higher, reduces the verification time of invalid data, and improves the data copying efficiency.

[0109] The optional embodiment of the present application dynamically adjusts the size of the shards, and no longer fixes the number of valid data bitmaps. In the case of dense or evenly distributed data, sharding can be performed according to a fixed valid bitmap, but as the data is sparsely distributed or scattered, it is necessary to accurately determine the location of the data based on the redundancy. Although there are many shards, the data hit rate of each bitmap shard is high, reducing the traversal of invalid data.

[0110] In summary, the bitmap-based dynamic sharding backup scheme proposed in the optional embodiment of the present application, sharding transmission not only improves the efficiency of data backup, but also uses a dynamic algorithm to quickly generate data shards compared to traditional fixed sharding technology, and removes invalid bits 0 in the data, thereby improving the hit rate of data in the bitmap shards and improving the backup efficiency of the data. In a scenario where the bitmap is sparsely distributed, if the traditional backup method is used, there will be a lot of invalid sharding data with all 0s. When copying data, it is necessary to traverse and query the invalid bitmap, reducing the copying efficiency. This scheme will not generate shards with all 0s during the sharding process. If continuous invalid bitmaps 0 appear, the algorithm will be used to truncate the shards in advance to reduce the number of invalid bitmaps in the shards. Sharding in this way can reduce the number of data traversals and improve the data hit rate, thereby improving the efficiency of backup.

[0111] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0112] In the present embodiment, a bitmap partitioning device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0113] Fig. 9 is a structural block diagram of a bitmap partitioning device according to an embodiment of the present application, such as Fig. 9 As shown, the device comprises:

[0114] A determination module 92 is used to determine whether there is a second invalid data bit in the target bitmap that is continuous with the target position when it is determined that there is a first invalid data bit in the target position of the target bitmap, wherein the target position is used to indicate a first start data bit and / or end data bit in the target bitmap;

[0115] The deleting module 94 is further configured to delete the first invalid data bit and the second invalid data bit to update the target bitmap when it is determined that the second invalid data bit exists in the target bitmap;

[0116] The setting module 96 is further used to set a first number of valid data bits allowed to be included in the first bitmap slice to be divided, and divide the updated target bitmap into target bitmap slices according to the first number, wherein the target bitmap slices include: the first bitmap slices.

[0117] By means of the bitmap division device of the present application, when it is determined that the first starting data bit and / or the first ending data bit of the target bitmap have a first invalid data bit, it is determined whether there is a second invalid data bit in the target bitmap that is continuous with the target position, i.e., the first starting data bit and / or the first ending data bit; when it is determined that there is a second invalid data bit in the target bitmap, the first invalid data bit and the second invalid data bit are deleted to update the target bitmap; the first number of valid data bits allowed to be included in the first bitmap slice to be divided is set, and the updated target bitmap is divided into the first bitmap slice according to the first number. That is to say, the optional embodiment of the present application determines whether there are invalid data bits in the target position and the position continuous with the target position in the target bitmap, and then when it is determined that the target position and the position continuous with the target position both contain invalid data bits, the invalid data bits are deleted to update the target bitmap. The updated target bitmap is divided into target bitmap slices. By means of the above technical scheme, the problem of low backup efficiency of data in the bitmap caused by backing up the data in the bitmap according to the backup bitmap of the bitmap data sequence or dividing the bitmap into fixed-size bitmap slices in the related art can be solved. This can improve the backup efficiency of the data in the bitmap.

[0118] In an exemplary embodiment, the determination module 92 is also used to determine whether the first data in the first data bit in the target bitmap and / or the second data in the end data bit are the target value; when it is determined that both the first data and the second data are the target value, or only the first data is the target value, or only the second data is the target value, determine that the first invalid data bit exists at the target position of the target bitmap; when it is determined that neither the first data nor the second data is the target value, determine that the first invalid data bit does not exist at the target position of the target bitmap.

[0119] In an exemplary embodiment, the determination module 92 is further used to determine whether the second invalid data bit exists in the target bitmap; if it is determined that the second invalid data bit does not exist in the target bitmap, delete the first invalid data bit to update the target bitmap.

[0120] In an exemplary embodiment, the setting module 96 is further used to determine a second number of valid data bits contained in the updated target bitmap; determine a first size relationship between the first number and the second number; when the first size relationship indicates that the first number is greater than or equal to the second number, divide the updated target bitmap into the first bitmap slices; when the first size relationship indicates that the first number is less than the second number, determine the first number of valid data bits in turn according to the position of each data bit in the updated target bitmap, and determine the first position of the target valid data bit in the first number of valid data bits in the updated target bitmap, wherein the target valid data bit is the last valid data bit in the first number of valid data bits; divide the updated target bitmap into a first bitmap and a second bitmap according to the first position, and update the first bitmap; divide the updated first bitmap into the first bitmap slices; and set a fourth number of valid data bits allowed to be contained in the second bitmap slices to be divided, and divide the second bitmap into the second bitmap slices according to the fourth number, wherein the target bitmap slices include: the second bitmap slices.

[0121] In an exemplary embodiment, the setting module 96 is also used to determine whether there is a third invalid data bit in the second position of the second bitmap, wherein the second position is used to indicate the second starting data bit of the second bitmap; when it is determined that the third invalid data bit exists in the second position, determine whether there is a fourth invalid data bit continuous with the second position in the second bitmap; when it is determined that the fourth invalid data bit exists in the second bitmap, delete the third invalid data bit and the fourth invalid data bit to update the second bitmap; determine a fifth number of valid data bits contained in the updated second bitmap; determine a second size relationship between the fourth number and the fifth number; and when the second size relationship indicates that the fourth number is greater than or equal to the fifth number, divide the updated second bitmap into second bitmap slices.

[0122] In an exemplary embodiment, the setting module 96 is also used to determine whether the third position of the updated target bitmap contains a fifth invalid data bit, wherein the third position is a subsequent position continuous with the first position; in the case where it is determined that the third position contains the fifth invalid data bit, determine whether there is a sixth invalid data bit continuous with the fifth invalid data bit in the target bitmap; in the case where it is determined that there is a sixth invalid data bit continuous with the sixth invalid data bit in the target bitmap, determine a sixth number of invalid data bits contained in the fifth invalid data bit and the sixth invalid data bit, and obtain a preset redundancy; determine a third size relationship between the sixth number and the preset redundancy; and divide the target bitmap into the first bitmap and the second bitmap according to the third size relationship.

[0123] In an exemplary embodiment, the setting module 96 is also used to determine the invalid data bits of the preset redundancy in sequence according to the position of each invalid data bit contained in the fifth invalid data bit and the sixth invalid data bit, and determine the seventh invalid data bit among the invalid data bits of the preset redundancy, wherein the seventh invalid data bit is the last invalid data bit among the invalid data bits of the preset redundancy; divide the target bitmap into the first bitmap and the second bitmap according to the seventh invalid data bit; and determine the eighth invalid data bit in the target bitmap and divide the target bitmap into the first bitmap and the second bitmap according to the eighth invalid data bit, wherein the eighth invalid data bit is the last invalid data bit among the fifth invalid data bit and the sixth invalid data bit, when the third size relationship indicates that the sixth number is greater than or equal to the preset redundancy.

[0124] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in the above method embodiment when running.

[0125] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0126] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0127] S1, when it is determined that a first invalid data bit exists in a target position of a target bitmap, determining whether a second invalid data bit that is continuous with the target position exists in the target bitmap, wherein the target position is used to indicate a first start data bit and / or end data bit in the target bitmap;

[0128] S2, when it is determined that the second invalid data bit exists in the target bitmap, deleting the first invalid data bit and the second invalid data bit to update the target bitmap;

[0129] S3, setting a first number of valid data bits allowed to be contained in the first bitmap slice to be divided, and dividing the updated target bitmap into target bitmap slices according to the first number, wherein the target bitmap slices include: the first bitmap slices.

[0130] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in the above method embodiment.

[0131] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0132] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0133] S1, when it is determined that a first invalid data bit exists in a target position of a target bitmap, determining whether a second invalid data bit that is continuous with the target position exists in the target bitmap, wherein the target position is used to indicate a first start data bit and / or end data bit in the target bitmap;

[0134] S2, when it is determined that the second invalid data bit exists in the target bitmap, deleting the first invalid data bit and the second invalid data bit to update the target bitmap;

[0135] S3, setting a first number of valid data bits allowed to be contained in the first bitmap slice to be divided, and dividing the updated target bitmap into target bitmap slices according to the first number, wherein the target bitmap slices include: the first bitmap slices.

[0136] An embodiment of the present application further provides a computer program product, including a computer program, which is implemented to perform the steps in the above method embodiment when executed by a processor.

[0137] Optionally, in this embodiment, the computer program product may be executed by a processor to perform the following steps:

[0138] S1, when it is determined that a first invalid data bit exists in a target position of a target bitmap, determining whether a second invalid data bit that is continuous with the target position exists in the target bitmap, wherein the target position is used to indicate a first start data bit and / or end data bit in the target bitmap;

[0139] S2, when it is determined that the second invalid data bit exists in the target bitmap, deleting the first invalid data bit and the second invalid data bit to update the target bitmap;

[0140] S3, setting a first number of valid data bits allowed to be contained in the first bitmap slice to be divided, and dividing the updated target bitmap into target bitmap slices according to the first number, wherein the target bitmap slices include: the first bitmap slices.

[0141] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0142] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0143] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for dividing a bitmap, characterized in that: include: In the case of determining that a first invalid data bit exists at a target position of the target bitmap, determining whether a second invalid data bit that is continuous with the target position exists in the target bitmap, wherein the target position is used to indicate a first start data bit and / or end data bit in the target bitmap; In the case of determining that the second invalid data bit exists in the target bitmap, deleting the first invalid data bit and the second invalid data bit to update the target bitmap; A first number of valid data bits allowed to be contained in the first bitmap slice to be divided is set, and the updated target bitmap is divided into target bitmap slices according to the first number, wherein the target bitmap slices include: the first bitmap slices.

2. The method according to claim 1, characterized in that Before determining whether there is a second invalid data bit in the target bitmap that is continuous with the target position, the method further includes: Determine whether the first data in the first data bit in the target bitmap and / or the second data in the end data bit is a target value; When it is determined that both the first data and the second data are the target value, or only the first data is the target value, or only the second data is the target value, determining that the first invalid data bit exists at the target position of the target bitmap; When it is determined that neither the first data nor the second data is the target value, it is determined that the first invalid data bit does not exist at the target position of the target bitmap.

3. The method according to claim 2, characterized in that After determining that the first invalid data bit exists at the target position of the target bitmap, the method further includes: determining whether the second invalid data bit exists in the target bitmap; When it is determined that the second invalid data bit does not exist in the target bitmap, the first invalid data bit is deleted to update the target bitmap.

4. The method according to claim 1, characterized in that: Dividing the updated target bitmap into target bitmap slices according to the first quantity includes: determining a second number of valid data bits contained in the updated target bitmap; Determine a first magnitude relationship between the first quantity and the second quantity; In a case where the first size relationship indicates that the first number is greater than or equal to the second number, dividing the updated target bitmap into the first bitmap slices; In a case where the first size relationship indicates that the first number is smaller than the second number, determining the first number of valid data bits in sequence according to the position of each data bit in the updated target bitmap, and determining a first position of a target valid data bit in the first number of valid data bits in the updated target bitmap, wherein the target valid data bit is the last valid data bit in the first number of valid data bits; Dividing the updated target bitmap into a first bitmap and a second bitmap according to the first position, and updating the first bitmap; dividing the updated first bitmap into the first bitmap slices; and, A fourth number of valid data bits allowed to be contained in the second bitmap slice to be divided is set, and the second bitmap is divided into the second bitmap slices according to the fourth number, wherein the target bitmap slices include: the second bitmap slices.

5. The method according to claim 4, characterized in that Dividing the second bitmap into the second bitmap slices according to the fourth number includes: determining whether there is a third invalid data bit at a second position of the second bitmap, wherein the second position is used to indicate a second starting data bit of the second bitmap; In the case where it is determined that the third invalid data bit exists in the second position, determining whether there is a fourth invalid data bit in the second bitmap that is continuous with the second position; In the case of determining that the fourth invalid data bit exists in the second bitmap, deleting the third invalid data bit and the fourth invalid data bit to update the second bitmap; determining a fifth number of valid data bits contained in the updated second bitmap; Determining a second magnitude relationship between the fourth quantity and the fifth quantity; In a case where the second size relationship indicates that the fourth number is greater than or equal to the fifth number, the updated second bitmap is divided into the second bitmap fragments.

6. The method according to claim 4, characterized in that Dividing the updated target bitmap into a first bitmap and a second bitmap according to the first position, and updating the first bitmap, comprising: Determining whether a third position of the updated target bitmap contains a fifth invalid data bit, wherein the third position is a subsequent position continuous with the first position; In the case where it is determined that the third position includes the fifth invalid data bit, determining whether there is a sixth invalid data bit in the target bitmap that is continuous with the fifth invalid data bit; In the case of determining that the target bitmap contains the sixth invalid data bit, determining a sixth number of invalid data bits included in the fifth invalid data bit and the sixth invalid data bit, and obtaining a preset redundancy; Determining a third magnitude relationship between the sixth quantity and the preset redundancy; The target bitmap is divided into the first bitmap and the second bitmap according to the third size relationship.

7. The method according to claim 6, characterized in that Dividing the target bitmap into the first bitmap and the second bitmap according to the third size relationship includes: In a case where the third size relationship indicates that the sixth number is less than the preset redundancy, sequentially determining the invalid data bits of the preset redundancy according to the position of each invalid data bit included in the fifth invalid data bit and the sixth invalid data bit, and determining a seventh invalid data bit among the invalid data bits of the preset redundancy, wherein the seventh invalid data bit is the last invalid data bit among the invalid data bits of the preset redundancy; dividing the target bitmap into the first bitmap and the second bitmap according to the seventh invalid data bit; In a case where the third size relationship indicates that the sixth quantity is greater than or equal to the preset redundancy, an eighth invalid data bit is determined in the target bitmap, and the target bitmap is divided into the first bitmap and the second bitmap according to the eighth invalid data bit, wherein the eighth invalid data bit is the last invalid data bit between the fifth invalid data bit and the sixth invalid data bit.

8. A bitmap partitioning device, characterized in that: include: A determination module, configured to determine whether there is a second invalid data bit in the target bitmap that is continuous with the target position when it is determined that there is a first invalid data bit in the target position of the target bitmap, wherein the target position is used to indicate a first start data bit and / or end data bit in the target bitmap; The deleting module is further configured to delete the first invalid data bit and the second invalid data bit when it is determined that the second invalid data bit exists in the target bitmap, so as to update the target bitmap; The setting module is further used to set a first number of valid data bits allowed to be included in the first bitmap slice to be divided, and divide the updated target bitmap into target bitmap slices according to the first number, wherein the target bitmap slices include: the first bitmap slices.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.