WO2022042011A1 - 一种位图数据中空闲块的查找方法及相关组件 - Google Patents

一种位图数据中空闲块的查找方法及相关组件 Download PDF

Info

Publication number
WO2022042011A1
WO2022042011A1 PCT/CN2021/103380 CN2021103380W WO2022042011A1 WO 2022042011 A1 WO2022042011 A1 WO 2022042011A1 CN 2021103380 W CN2021103380 W CN 2021103380W WO 2022042011 A1 WO2022042011 A1 WO 2022042011A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
level
block
bitmap
integer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2021/103380
Other languages
English (en)
French (fr)
Inventor
李燕红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Wave Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Priority to US18/011,510 priority Critical patent/US11748255B1/en
Publication of WO2022042011A1 publication Critical patent/WO2022042011A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2237Vectors, bitmaps or matrices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7204Capacity control, e.g. partitioning, end-of-life degradation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7205Cleaning, compaction, garbage collection, erase control
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the technical field of storage systems, and in particular, to a method, apparatus, and device for searching for free blocks in bitmap data, and a readable storage medium.
  • bitmap data (bitmap) management In order to adapt the storage system to the SSD for better performance, some solutions for adapting to the SSD have been produced, including bitmap data (bitmap) management. Way.
  • bitmap data Bitmap
  • Existing research institutions and storage manufacturers are all committed to studying how to adapt SSDs and proposing adaptation solutions.
  • bitmap data In the process of managing bitmap data, it is necessary to count the number of free blocks (bit (binary digit, bit) of 0) in the bitmap data block, so as to complete the allocation and recovery of storage space, data storage and Migration function.
  • bit-by-bit traversal Since there are 262,144 bits in a bitmap data block on average, it takes 262,144 cycles to determine the distribution of free blocks in a bitmap data block, and the processing efficiency is relatively low. The data size of the corresponding bitmap data is very large, and the value changes very fast. If such a bit traversal method is used for each bitmap data to determine the free blocks in it, it is not only the realization of finding free blocks The efficiency is extremely low, which will further affect the efficiency of space reclamation and the efficient management of the overall storage space.
  • the present application provides a method for finding free blocks in bitmap data, including:
  • bitmap data block into several integer data with a fixed length
  • the template array is based on all integers with the fixed length.
  • the value of the type data is used as an array subscript, and the corresponding data arrangement feature information is used as a data item; the data arrangement feature information includes the number of free blocks and distribution information;
  • the overall free block distribution of the bitmap data block is counted according to the data arrangement characteristic information corresponding to each of the integer data.
  • the data arrangement feature information includes: a data level and the number of free blocks; the data level indicates a data block release priority level generated according to the distribution of the free blocks, as the distribution information;
  • the method further includes: performing an analysis on the bitmap according to the overall free block distribution.
  • the data block is released.
  • bitmap data block is divided into several integer data with a fixed length, including:
  • the bitmap data block is divided into data every 16 bits to obtain several 16-bit integer data.
  • the data level and the corresponding judgment rule include:
  • Level 1 more than 15 bits are 0;
  • 0 is a free block
  • 1 is a non-free block
  • the priority level of data block release from the first level to the tenth level is gradually reduced.
  • performing release processing on the bitmap data block according to the overall free block distribution including:
  • the second level and the third level take more than 8 consecutive bits of 0 to perform bit release;
  • bit release For the integer data belonging to the sixth level, the seventh level, the eighth level, the ninth level, and the tenth level, a bit of 0 is searched for, and bit release is performed.
  • the method further includes:
  • using the value of the integer data as a subscript perform an array value operation on the template array to obtain the data arrangement feature information corresponding to the integer data, including: using the value of the sample data as the subscript. target, perform an array value operation on the template array, and obtain the data arrangement feature information corresponding to the sample data;
  • counting the overall free block distribution of the bitmap data blocks according to the data arrangement feature information corresponding to each of the integer data includes: counting the data according to the data arrangement feature information corresponding to each of the sample data.
  • the overall free block distribution of bitmap data blocks includes: counting the data according to the data arrangement feature information corresponding to each of the sample data.
  • count all the data arrangement feature information under the target integer including:
  • weighted calculation is performed on the number of sample data corresponding to each of the data levels, and the obtained weighted value is used as the overall free block distribution of the bitmap data block;
  • the method further includes:
  • Release processing is performed on each of the bitmap data blocks in descending order of the proportional values.
  • the present application also provides a device for finding free blocks in bitmap data, including:
  • bitmap determination unit for determining the bitmap data block of the free block to be searched
  • a data division unit used for dividing the bitmap data block into several integer data with a fixed length
  • the template matching unit is configured to use the value of the integer data as a subscript to perform an array value operation on the template array to obtain data arrangement feature information corresponding to the integer data;
  • the value of the fixed-length integer data is used as an array subscript, and the corresponding data arrangement feature information is used as a data item;
  • the data arrangement feature information includes the number of free blocks and distribution information;
  • a statistical unit configured to count the overall free block distribution of the bitmap data block according to the data arrangement characteristic information corresponding to each of the integer data.
  • the application also provides a computer equipment, including:
  • the processor is configured to implement the steps of the method for finding free blocks in the bitmap data when executing the computer program.
  • the present application also provides a readable storage medium, where a program is stored on the readable storage medium, and when the program is executed by a processor, the steps of the method for finding a free block in the bitmap data are implemented.
  • the value of the integer data after the bitmap data is divided into blocks is used as a subscript, and an array value operation is performed on a template array.
  • the information on the distribution of the free blocks can be directly obtained, which avoids the huge power consumption caused by the comparison and statistics of the bits in the bitmap data one by one, and greatly improves the processing efficiency.
  • the present application also provides an apparatus and device for searching for free blocks in bitmap data, and a readable storage medium, which have the above beneficial effects, and will not be repeated here.
  • FIG. 1 is a flowchart of a method for searching for a free block in bitmap data provided by an embodiment of the present application
  • FIG. 2 is a structural block diagram of a device for finding free blocks in bitmap data according to an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a computer device according to an embodiment of the present application.
  • the core of this application is to provide a method for finding free blocks in bitmap data, which can significantly improve the efficiency of finding free blocks in bitmap data, thereby providing reliable support for further space reclamation and data management; this application Another core is to provide a free block search device and device in bitmap data and a readable storage medium.
  • the present application provides a method for finding free blocks in bitmap data. Please refer to FIG. 1 , which is a flowchart of a method for finding free blocks in bitmap data provided by this embodiment.
  • the method mainly includes:
  • Step s110 determine the bitmap data block of the free block to be searched
  • a bitmap management method in a storage system adapted to SSD includes two bitmaps: data volume bitmap and metadata volume bitmap.
  • the data volume bitmap is used to mark the status of blocks in the data LSA volume
  • the metadata bitmap is used to mark the metadata in the LSA volume.
  • the two Bitmap values represent different meanings, and the management methods are both similar and different.
  • the bitmap data in this step can be a data volume bitmap block or a metadata volume bitmap block. It is applicable to two kinds of Bitmaps, and the type of the specific bitmap data block is not limited in this step.
  • a free block refers to a data block whose bit is 0.
  • a bitmap data block contains about 262144 binary bits, such as 0100011101010...01010, and the data length is about 262144.
  • the data block contains randomly distributed 0s and 1s.
  • a free block search is performed.
  • Step s120 dividing the bitmap data block into several integer data with a fixed length
  • the bitmap data block is divided into data segments at fixed lengths to obtain several integer data with fixed lengths.
  • the division interval of the data segment that is, the size of the fixed length is not limited, which can be 8 bits, 16 bits, etc., and can be divided according to the actual data comparison requirements, because the subsequent steps need to be based on the length of the integer data.
  • the bitmap data block can be The image data block is divided into data every 16 bits to obtain several 16-bit integer data.
  • the bitmap data block of 262144 bits per 16-bit division can be regarded as 16384 uint16 values.
  • Step s130 using the value of the integer data as a subscript, perform an array value operation on the template array to obtain data arrangement feature information corresponding to the integer data;
  • the template array takes the values of all integer data with a fixed length as the array subscript, and the corresponding data arrangement feature information as the data item.
  • the binary integer data of length 3 All forms include: 000, 001, 010, 011, 100, 101, 110 and 111, a total of 8 data forms, and the value of the corresponding integer data (the value after conversion to decimal) is 0, 1, 2 respectively , 3, 4, 5, 6, 7.
  • the data arrangement feature information includes the number of free blocks and distribution information. For example, there are two 0s in total, and the discontinuities are located on both sides.
  • the data arrangement feature information obtained after conversion is an 8-bit integer, such as 0101 0010, According to the preset data arrangement feature information generation method, the data arrangement feature information corresponding to all binary integer data can be obtained: 000 corresponds to data arrangement feature information of 0001 0000, and 001 corresponds to data arrangement feature information of 0010 The data arrangement feature information corresponding to 0001 and 010 is 0011 0010 and so on.
  • the value of all integer data with a fixed length is used as the array subscript to arrange the data layout feature information. For example, if the value of 000 is 0, the data layout feature information corresponding to 000 is arranged in the template array. The 0th item of 010; the value of 010 is 2, then the data arrangement feature information corresponding to 010 is ranked the second item in the template array; if the current integer data of the free block information to be determined is 000 and the value is 0, then take For the array item whose subscript is 0, the template array will output the 0th item (the data arrangement characteristic information corresponding to 000) and take it out, and then the data arrangement characteristic information of the integer data of the current idle block information to be determined can be obtained.
  • the free block distribution information in the current integer data can be obtained by the array value operation, and there is no need to traverse each bit in the current integer data one by one (16-bit integer data needs to be compared 16 times), which greatly improves the processing efficiency. .
  • Step s140 statistics the overall free block distribution of the bitmap data blocks according to the data arrangement characteristic information corresponding to each integer data block.
  • Adjacent blocks can be determined according to the cutting positions of each small block, so as to determine the free block distribution of the overall bitmap data block.
  • Adjacent blocks can be determined according to the cutting positions of each small block, so as to determine the free block distribution of the overall bitmap data block.
  • only this kind of The implementation is introduced by force.
  • the value of the integer data after the bitmap data is divided into blocks is used as a subscript, and the template array is searched for.
  • the array value operation can directly obtain the information on the distribution of the free blocks, which avoids the huge power consumption caused by the comparison and statistics of the bits in the bitmap data one by one, and greatly improves the processing efficiency.
  • the specific data form and the information contained in the data arrangement feature information are not limited.
  • the data arrangement feature information may specifically include: data level and idle block. The number of blocks; wherein, the data level indicates the release priority level of the data block generated according to the distribution of the free blocks, as the distribution information; then correspondingly, according to the data arrangement characteristic information corresponding to each integer data, the bitmap data block is counted. After the overall free block distribution is obtained, further execution may be performed: release the bitmap data blocks according to the overall free block distribution.
  • the data arrangement feature information can be: the first 4 bits record the data level, and the last 4 bits record the 16-bit integer data. 8-bit integer data of the number of 0s in the data. For example, a 16-bit integer data is ⁇ 1111100000000000 ⁇ , the data level is 2, and the number of 0s in uint16 is 11, then the data arrangement feature information can be 0010 1011; for example, a 16-bit integer data is ⁇ 1111111111000000 ⁇ , The data level is 4, and the number of 0s in uint16 is 6, then the data layout feature information can be 0100 0110.
  • the data template is composed of a uint8 array with a length of 65536.
  • the subscript of the array is the value of uint16 under all data arrangements.
  • Using template matching to process 100 integer data only needs 100 group value operations to obtain the data distribution level in the sample and the total number of 0s in the sample. Greatly improve the processing efficiency.
  • the data level indicates the release priority level of the data block generated according to the distribution of the free blocks.
  • the division rule of the data level is not limited.
  • a 10-level data level determination rule is as follows:
  • Level 1 more than 15 bits are 0;
  • 0 is a free block
  • 1 is a non-free block
  • the priority level of data block release from level 1 to level 10 is gradually reduced.
  • the specific process of releasing the bitmap data blocks is not limited according to the overall distribution of free blocks.
  • the following steps may be specifically included:
  • the feature information matching of the template array can be performed on each integer data after the bitmap data block is segmented.
  • 262144 bits are regarded as 16384 uint16 values. It may take a long time to match uint16 values one by one.
  • several (such as 100) uint16s can be taken out as samples by random sampling, and estimated by analyzing the distribution of 0 in the samples The distribution of 0 in the bitmap data block can reduce the workload of template matching and improve the search efficiency.
  • the integer data can be randomly sampled, and a specified number of data can be taken out as sample data;
  • As a subscript perform an array value operation on the template array to obtain the data arrangement feature information corresponding to the integer data, including: using the value of the sample data as a subscript, perform an array value operation on the template array, and obtain the corresponding value of the sample data.
  • Data arrangement feature information correspondingly, according to the data arrangement feature information corresponding to each integer data, statistics the overall free block distribution of the bitmap data blocks, including: statistics bitmap data according to the data arrangement feature information corresponding to each sample data The overall free block distribution of the block.
  • the processing manner after obtaining the overall free block distribution of the bitmap data blocks is not limited, and the data block release process may be further performed based on the overall free block distribution.
  • the data block release priority corresponding to the data level can be used as the weight, and the number of sample data corresponding to each data level can be weighted to calculate the weighted value obtained.
  • the overall free block distribution of the bitmap data block then correspondingly, after the statistics of the overall free block distribution of the bitmap data block according to the data arrangement feature information corresponding to each integer data, it also includes:
  • a template array composed of a uint8 array with a length of 65536.
  • the subscript of the array is the value of uint16 as a sample.
  • the bitmap data block of 262144 bits is regarded as 16384 uint16 values, and 10 uint16s are taken out as samples by random sampling, and template array matching is performed on the samples to obtain the data layout feature information templet corresponding to each sample. .
  • Sample 1 ⁇ 1111100000000000 ⁇ , data level: 2, number of 0s in uint16: 11.
  • Sample 2 ⁇ 1111111111000000 ⁇ , data level: 4, number of 0s in uint16: 6.
  • Sample 7 ⁇ 10101010101011 ⁇ , data level: 7, number of 0s in uint16: 7
  • Sample 8 ⁇ 1010101011111111 ⁇ , data level: 9, number of 0s in uint16: 4
  • Sample 9 ⁇ 10101010101011 ⁇ , data level: 8, number of 0s in uint16: 7
  • Sample 10 ⁇ 1111111111111111 ⁇ .
  • Data level 10
  • the number of 0s in uint16 0
  • a weight is set for each level, for example:
  • each block has 10 samples of the same level and 0, corresponding to the above samples 1 to 10 respectively.
  • the weighted value is sorted in proportion to 0 in the block:
  • Block[1]>Block[0]>Block[2]>Block[4]>Block[3]>Block[6]>Block[5] Block[7]>Block[8];
  • the level searches for the free bit.
  • the minimum unit of modification is bit, that is, the allocation and recovery of block corresponds to the modification of bitmap, in which the allocation of block corresponds to 0 of bit to 1, and the recovery of block corresponds to 1 of bit to 0 .
  • FIG. 2 is a structural block diagram of an apparatus for finding free blocks in bitmap data provided by this embodiment.
  • the apparatus for finding free blocks in bitmap data provided in this embodiment can be compared with the above-mentioned method for finding free blocks in bitmap data.
  • bitmap determination unit 210 is used to determine the bitmap data block of the free block to be searched
  • the data dividing unit 220 is used for dividing the bitmap data block into several integer data with fixed length;
  • the template matching unit 230 is configured to use the value of the integer data as a subscript, perform an array value operation on the template array, and obtain data arrangement feature information corresponding to the integer data; wherein, the template array is based on all integer data with a fixed length.
  • the value of is used as an array subscript, and the corresponding data layout feature information is used as a data item; the data layout feature information includes the number of free blocks and distribution information;
  • the statistical unit 240 is configured to count the overall free block distribution of the bitmap data blocks according to the data arrangement characteristic information corresponding to each integer data.
  • This embodiment provides a computer device, which mainly includes: a memory and a processor.
  • the memory is used to store the program
  • the steps of implementing the method for searching for free blocks in bitmap data as described in the foregoing embodiments may refer to the description of the method for searching for free blocks in the above-mentioned bitmap data.
  • FIG. 3 is a schematic structural diagram of a computer device provided in this embodiment.
  • the computer device may vary greatly due to different configurations or performance, and may include one or more processors (central processing units, CPU) 322 (for example, one or more processors) and memory 332, one or more storage media 330 (eg, one or more mass computer devices) storing application programs 342 or data 344.
  • the memory 332 and the storage medium 330 may be short-term storage or persistent storage.
  • the program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instructions to operate on the data processing device.
  • the central processing unit 322 may be configured to communicate with the storage medium 330 to execute a series of instruction operations in the storage medium 330 on the computer device 301 .
  • Computer device 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input and output interfaces 358, and/or, one or more operating systems 341, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
  • the steps in the method for searching for free blocks in bitmap data described above in FIG. 1 may be implemented by the structure of the computer device introduced in this embodiment.
  • This embodiment discloses a readable storage medium on which a program is stored.
  • the steps of the method for searching for a free block in bitmap data as described in the foregoing embodiment may be implemented.
  • the readable storage medium may specifically be a USB flash drive, a removable hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, etc. Readable storage medium.
  • a software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.
  • RAM random access memory
  • ROM read only memory
  • electrically programmable ROM electrically erasable programmable ROM
  • registers hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.

Landscapes

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

Abstract

一种位图数据中空闲块的查找方法,对于一个位图数据的空闲块查找,以位图数据分块后的整型数据的值作为下标,对模板数组进行数组取值运算便可直接获得空闲块分布情况信息,避免了对位图数据中个bit进行逐一比对统计所带来的极大的功耗占用,极大提高了处理效率。还提供了一种位图数据中空闲块的查找装置、设备及一种可读存储介质,具有上述有益效果。

Description

一种位图数据中空闲块的查找方法及相关组件
本申请要求于2020年8月28日提交中国专利局、申请号为202010889329.3、发明名称为“一种位图数据中空闲块的查找方法及相关组件”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及存储系统技术领域,特别涉及一种位图数据中空闲块的查找方法、装置、设备及一种可读存储介质。
背景技术
随着SSD(Solid State Disk,固态硬盘)盘的广泛使用,存储系统为了跟SSD适配以发挥更好的性能,目前已经产生一些适配SSD的方案,方案中有位图数据(bitmap)管理方式。现有的研究机构、存储厂商均致力于研究如何适配SSD,提出适配方案。在对位图数据的管理过程中,需要统计位图数据块中空闲块(为0的bit(binary digit,比特))的数量,以便根据该信息完成存储空间的分配和回收、数据的存放和迁移功能。
目前统计位图数据块中0的数量是采取逐个bit位遍历的方式。由于一个位图数据块中平均会有262144个bit位,则确定一个位图数据块中的空闲块分布情况需进行262144次循环,处理效率比较低,而且随着目前适配SSD的空间粒度大大缩小、状态变化更快,对应的位图数据的数据量十分庞大,而且值变化的特别快,若针对每个位图数据采用这样的bit位遍历方式确定其中的空闲块不仅查找空闲块的实现效率极低,还会进一步导致影响空间回收的效率,影响整体存储空间的高效管理。
因此,如何提升位图数据中空闲块的查找实现效率,是本领域技术人员急需解决的问题。
发明内容
本申请的目的是提供一种位图数据中空闲块的查找方法,该方法可以显著提升位图数据中空闲块的查找实现效率,从而为进一步的空间回收以 及数据管理提供可靠的支持;本申请的另一目的是提供一种位图数据中空闲块的查找装置、设备及一种可读存储介质。
为解决上述技术问题,本申请提供一种位图数据中空闲块的查找方法,包括:
确定待查找空闲块的位图数据块;
将所述位图数据块划分为具有固定长度的若干整型数据;
以所述整型数据的值作为下标,对模板数组进行数组取值运算,得到所述整型数据对应的数据排布特征信息;其中,所述模板数组以所有具有所述固定长度的整型数据的值作为数组下标,以对应的数据排布特征信息作为数据项;所述数据排布特征信息中包括空闲块的数量以及分布信息;
根据各所述整型数据对应的数据排布特征信息统计所述位图数据块的整体空闲块分布情况。
可选地,所述数据排布特征信息包括:数据等级以及空闲块的数量;所述数据等级指示根据空闲块的分布情况生成的数据块释放优先等级,作为所述分布信息;
则相应地,在根据各所述整型数据对应的数据排布特征信息统计所述位图数据块的整体空闲块分布情况之后,还包括:根据所述整体空闲块分布情况对所述位图数据块进行释放处理。
可选地,将所述位图数据块划分为若干具有固定长度的整型数据,包括:
将所述位图数据块每隔16位进行数据划分,得到若干16位整型数据。
可选地,所述数据等级以及对应的判定规则包括:
第1级,15个以上bit为0;
第2级,存在连续8个及以上的bit为0,且连续的0在两侧;
第3级,存在连续8个及以上的bit为0,且连续的0在中间;
第4级,存在连续4~7个bit为0,且连续的0在两侧;
第5级,存在连续4~7个bit为0,且连续的0在中间;
第6级,存在少于连续4个bit为0,且0的总数量不少于10;
第7级,存在少于连续4个bit为0,且0的总数量不少于6;
第8级,无连续的0,且0的总数量不少于6;
第9级,无连续的0,且0的总数量少于6;
第10级,16个bit全是1;
其中,0为空闲块,1为非空闲块,且从所述第1级至所述第10级数据块释放优先等级逐级降低。
可选地,根据所述整体空闲块分布情况对所述位图数据块进行释放处理,包括:
对属于所述第1级、所述第2级以及所述第3级的整型数据,取超过连续8个为0的bit进行bit释放;
对属于所述第4级以及所述第5级的整型数据,取超过连续4个为0的bit进行bit释放;
对属于所述第6级、所述第7级、所述第8级、所述第9级以及所述第10级的整型数据,搜索为0的bit进行bit释放。
可选地,在将所述位图数据块划分为具有固定长度的若干整型数据之后,还包括:
对所述整型数据进行随机抽样,取出指定个数的数据作为样本数据;
则相应地,以所述整型数据的值作为下标,对模板数组进行数组取值运算,得到所述整型数据对应的数据排布特征信息,包括:以所述样本数据的值作为下标,对模板数组进行数组取值运算,得到所述样本数据对应的数据排布特征信息;
则相应地,根据各所述整型数据对应的数据排布特征信息统计所述位图数据块的整体空闲块分布情况,包括:根据各所述样本数据对应的数据排布特征信息统计所述位图数据块的整体空闲块分布情况。
可选地,统计所有所述目标整型下的数据排布特征信息,包括:
将所述数据等级对应的数据块释放优先程度作为权重,对各所述数据等级对应的样本数据的数量进行加权计算,将得到的加权值作为所述位图数据块的整体空闲块分布情况;
则相应地,在根据各所述整型数据对应的数据排布特征信息统计所述位图数据块的整体空闲块分布情况之后,还包括:
计算各所述位图数据块对应的所述加权值与所述位图数据块中空闲块的总数的比例值;
按照所述比例值由大到小的顺序对各所述位图数据块进行释放处理。
本申请还提供了一种位图数据中空闲块的查找装置,包括:
位图确定单元,用于确定待查找空闲块的位图数据块;
数据划分单元,用于将所述位图数据块划分为具有固定长度的若干整型数据;
模板匹配单元,用于以所述整型数据的值作为下标,对模板数组进行数组取值运算,得到所述整型数据对应的数据排布特征信息;其中,所述模板数组以所有具有所述固定长度的整型数据的值作为数组下标,以对应的数据排布特征信息作为数据项;所述数据排布特征信息中包括空闲块的数量以及分布信息;
统计单元,用于根据各所述整型数据对应的数据排布特征信息统计所述位图数据块的整体空闲块分布情况。
本申请还提供了一种计算机设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行所述计算机程序时实现所述的位图数据中空闲块的查找方法的步骤。
本申请还提供了一种可读存储介质,所述可读存储介质上存储有程序,所述程序被处理器执行时实现所述位图数据中空闲块的查找方法的步骤。
本申请所提供的位图数据中空闲块的查找方法,对于一个位图数据的空闲块查找,以位图数据分块后的整型数据的值作为下标,对模板数组进行数组取值运算便可直接获得空闲块分布情况信息,避免了对位图数据中个bit进行逐一比对统计所带来的极大的功耗占用,极大提高了处理效率。
本申请还提供了一种位图数据中空闲块的查找装置、设备及一种可读存储介质,具有上述有益效果,在此不再赘述。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请实施例提供的一种位图数据中空闲块的查找方法的流程图;
图2为本申请实施例提供的一种位图数据中空闲块的查找装置的结构框图;
图3为本申请实施例提供的一种计算机设备的结构示意图。
具体实施方式
本申请的核心是提供一种位图数据中空闲块的查找方法,该方法可以显著提升位图数据中空闲块的查找实现效率,从而为进一步的空间回收以及数据管理提供可靠的支持;本申请的另一核心是提供一种位图数据中空闲块的查找装置、设备及一种可读存储介质。
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请提供了一种位图数据中空闲块的查找方法,请参考图1,图1为本实施例提供的位图数据中空闲块的查找方法的流程图,该方法主要包括:
步骤s110、确定待查找空闲块的位图数据块;
适配SSD的存储系统中一种Bitmap管理方式包含数据卷bitmap、元数据卷bitmap两种bitmap,数据卷bitmap用来标记数据LSA卷中block的状态,元数据bitmap用来标记元数据LSA卷中每个grain的状态,两种Bitmap的值分别代表了不同的含义,管理方式既有相似也有不同,本步骤中的位图数据快可以为数据卷bitmap块,也可以为元数据卷bitmap块,适用于两种Bitmap,本步骤中对于具体的位数数据块的类型不作限定。
空闲块指bit为0的数据块,一个位图数据块中包含262144个左右二进制的bit位,比如0100011101010……01010,数据长度为262144左右,该数据块中包含无规则分布的0以及1,为了方便后续对位图数据的管理过程,比如存储空间的分配和回收、数据的存放和迁移功能,需要统计位图数据块中空闲块的数量,将当前待查找空闲块的位图数据块,作为目标位图数据块,进行空闲块的查找。
步骤s120、将位图数据块划分为具有固定长度的若干整型数据;
将述位图数据块每隔固定长度进行数据段的划分,得到若干具有固定长度的整型数据。本实施例中对于数据段的划分间隔,即固定长度的大小不做限定,可以为8位、16位等,可以根据实际数据比对需求进行划分,由于后续步骤中需要根据整型数据的长度确定所有可能的整型数据的形式对应的数据排布特征信息进行模板数组的生成,为控制模板数组的大小的同时尽量控制位图数据块中空间块的查找次数,可选地,可以将位图数据块每隔16位进行数据划分,得到若干16位整型数据,每16位划分下262144个bit位的位图数据块可以看做16384个uint16值,所有可能的整型数据的形式包括6656种形式,假定每种形式下的数据排布特征信息包括8bit,则模板数组需占用65536Byte=64KB大小,空间占用较小,且数据比对数量较少。本实施例中仅以整型数据为uint16值为例进行介绍,其他数据长度下的空闲块查找过程均可参照本实施例的介绍,在此不再赘述。
步骤s130、以整型数据的值作为下标,对模板数组进行数组取值运算,得到整型数据对应的数据排布特征信息;
其中,模板数组以所有具有固定长度的整型数据的值作为数组下标,以对应的数据排布特征信息作为数据项,以固定长度为3为例,则长度为3的二进制整型数据的所有形式包括:000,001,010,011,100,101、110以及111一共8种数据形式,而对应的整型数据的值(换算为10进制后的值)分别为0,1,2,3,4,5,6,7。数据排布特征信息中包括空闲块的数量以及分布信息,比如一共有两个0,非连续分别位于两侧,进行转换后得到的数据排布特征信息为一个8位整型,比如0101 0010,根据预设的数据排布特征信息生成方式可以得到所有二进制整型数据对应的数据排布特征信 息分别为:000对应的数据排布特征信息为0001 0000,001对应的数据排布特征信息为0010 0001,010对应的数据排布特征信息为0011 0010等。
模板数组中以所有具有固定长度的整型数据的值作为数组下标进行各数据排布特征信息的排布,比如000的值为0,则000对应的数据排布特征信息排在模板数组中的第0项;010的值为2,则010对应的数据排布特征信息排在模板数组中的第2项;若当前待确定空闲块信息的整型数据为000,值为0,则取下标为0的数组项,模板数组便输出第0项(000对应的数据排布特征信息)取出,即可得到当前待确定空闲块信息的整型数据的数据排布特征信息,仅需一次数组取值运算便可得到当前整型数据中的空闲块分布信息,无需对当前整型数据中各bit进行逐一遍历(16位的整型数据需要比对16次),极大提高了处理效率。
步骤s140、根据各整型数据对应的数据排布特征信息统计位图数据块的整体空闲块分布情况。
为了相对简化长度较长的位图数据块的直接模板匹配过程造成的模板过大的问题,本实施例中对位图数据块分为若干小块后,分别对各小块进行模板匹配处理,但是最终需要确定整个位图数据块中的空闲块分布,因此,需要统计各小块的模板匹配结果,进一步生成整体位图数据块的空闲块分布。
而其中具体的统计实现算法以及步骤本实施例中不做限定,可以根据各小块的切割位置确定相邻块,从而确定整体位图数据块的空闲块分布,本实施例中仅以该种实现方式为力进行介绍,其他实现方式均可参照本实施例的介绍,在此不再赘述。
基于上述介绍,本实施例提供的位图数据中空闲块的查找方法,对于一个位图数据的空闲块查找,以位图数据分块后的整型数据的值作为下标,对模板数组进行数组取值运算便可直接获得空闲块分布情况信息,避免了对位图数据中个bit进行逐一比对统计所带来的极大的功耗占用,极大提高了处理效率。
上述实施例中对于数据排布特征信息的具体数据形式以及包含的信息 不做限定,为了便于后续对于空闲块的回收处理,可选地,数据排布特征信息中具体可以包括:数据等级以及空闲块的数量;其中,数据等级指示根据空闲块的分布情况生成的数据块释放优先等级,作为分布信息;则相应地,在根据各整型数据对应的数据排布特征信息统计位图数据块的整体空闲块分布情况之后,可以进一步执行:根据整体空闲块分布情况对位图数据块进行释放处理。
以将位图数据块每隔16位进行数据划分,得到若干16位整型数据为例,则相应地,数据排布特征信息可以为:前4位记录数据等级,后4位记录16位整型数据中0的个数的8位整型数据。比如某16位整型数据为{1111100000000000},数据等级为2,uint16中0的个数为11,则数据排布特征信息可以为0010 1011;又比如某16位整型数据为{1111111111000000},数据等级为4,uint16中0的个数为6,则数据排布特征信息可以0100 0110,本实施例中主要以该种数据长度以及信息类型下的特征信息的可行形式为例进行介绍,其他数据长度以及信息类型下的特征信息的设置均可参照本实施例的介绍,在此不再赘述。则此时,数据模板由一个长度为65536的uint8数组来构成,数组下标为所有数据排布下uint16的值,结构为:const uint8templet[65536]={x,x,x,……,x};其中,x为uint8数组。模板数组需占用65536Byte=64KB大小,空间占用较小,使用模板匹配的方式处理100个整型数据只需要100次数组取值运算便可获得样本中数据分布等级与样本中0的总数量,极大提高了处理效率。
数据等级指示根据空闲块的分布情况生成的数据块释放优先等级,本实施例中对于数据等级的划分规则不做限定,可选地,一种10级的数据等级判定规则如下所示:
第1级,15个以上bit为0;
第2级,存在连续8个及以上的bit为0,且连续的0在两侧(说明有更高的概率与相邻的uint16组成连续的0);
第3级,存在连续8个及以上的bit为0,且连续的0在中间;
第4级,存在连续4~7个bit为0,且连续的0在两侧;
第5级,存在连续4~7个bit为0,且连续的0在中间;
第6级,存在少于连续4个bit为0,且0的总数量不少于10;
第7级,存在少于连续4个bit为0,且0的总数量不少于6;
第8级,无连续的0,且0的总数量不少于6;
第9级,无连续的0,且0的总数量少于6;
第10级,16个bit全是1;
其中,0为空闲块,1为非空闲块,且从第1级至第10级数据块释放优先等级逐级降低。
上述等级的划分充分考虑了各种空闲块的分布情况对于空间回收处理的影响,根据uint16中的数据排布特点划定,且等级数量核实,避免了过少或过多的等级数量对于后续回收处理过程造成的过于简化或复杂性过高的问题。
在上述等级规则下,根据整体空闲块分布情况对位图数据块进行释放处理的具体过程不做限定,可选地,可以具体包括以下步骤:
对属于第1级、第2级以及第3级的整型数据,取超过连续8个为0的bit进行bit释放;
对属于第4级以及第5级的整型数据,取超过连续4个为0的bit进行bit释放;
对属于第6级、第7级、第8级、第9级以及第10级的整型数据,搜索为0的bit进行bit释放。
本实施例中仅以上述等级划分形式为例进行介绍,其他的等级划分以及规则下的空闲块查找方式均可参照本实施例的介绍,在此不再赘述。
上述实施例中可以对位图数据块切分后的每个整型数据进行模板数组的特征信息匹配,以16位划分为例,将262144个bit位看做是16384个uint16值,对16384个uint16值进行逐一匹配可能耗时较长,为了进一步提升空闲块查找效率,可选地,可以通过随机抽样的方式从中取出若干(如100)个uint16作为样本,通过分析样本中0的分布情况估算位图数据块中0的分布情况,可以减少模板匹配的工作量,提升查找效率。
具体地,在将位图数据块划分为具有固定长度的若干整型数据之后, 可以对整型数据进行随机抽样,取出指定个数的数据作为样本数据;则相应地,以整型数据的值作为下标,对模板数组进行数组取值运算,得到整型数据对应的数据排布特征信息,包括:以样本数据的值作为下标,对模板数组进行数组取值运算,得到样本数据对应的数据排布特征信息;相应地,根据各整型数据对应的数据排布特征信息统计位图数据块的整体空闲块分布情况,包括:根据各样本数据对应的数据排布特征信息统计位图数据块的整体空闲块分布情况。
上述实施例中对得到位图数据块的整体空闲块分布情况后的处理方式不做限定,可以进一步基于整体空闲块分布情况进行数据块的释放处理。
具体地,统计所有目标整型下的数据排布特征信息时,可以将数据等级对应的数据块释放优先程度作为权重,对各数据等级对应的样本数据的数量进行加权计算,将得到的加权值作为位图数据块的整体空闲块分布情况;则相应地,在根据各整型数据对应的数据排布特征信息统计位图数据块的整体空闲块分布情况之后,还包括:
(1)计算各位图数据块对应的加权值与位图数据块中空闲块的总数的比例值;
(2)按照比例值由大到小的顺序对各位图数据块进行释放处理。
为加深理解,以下介绍一种具体的实现场景。
设置一个长度为65536由uint8数组构成的模板数组,数组下标为作为样本的uint16的值,结构为:const uint8 templet[65536]={x,x,x,……,x};对应uint8的值,前4位记录数据等级,后4位记录uint16中0的个数。
将262144个bit位的位图数据块看做是16384个uint16值,通过随机抽样的方式从中取出10个uint16作为样本,对该样本进行模板数组匹配,得到各样本对应的数据排布特征信息templet。
样本1:{1111100000000000},数据等级:2,uint16中0的个数:11.
templet[0]=0010 1011.
样本2:{1111111111000000},数据等级:4,uint16中0的个数:6.
templet[1]=0100 0110
样本3:{1110000000000111},数据等级:3,uint16中0的个数:10
templet[2]=0011 1010
样本4:{1111100000011111},数据等级:5,uint16中0的个数:6
templet[3]=0101 1010
样本5:{0000000000000001},数据等级:1,uint16中0的个数:15
templet[4]=0001 1111
样本6:{1010101001001000},数据等级:6,uint16中0的个数:10
templet[5]=0110 1010
样本7:{1010101010101011},数据等级:7,uint16中0的个数:7
templet[6]=0111 0111
样本8:{1010101011111111},数据等级:9,uint16中0的个数:4
templet[7]=1001 0100
样本9:{1010101010101011},数据等级:8,uint16中0的个数:7
templet[8]=1000 0111
样本10:{1111111111111111}。数据等级:10,uint16中0的个数:0
templet[9]=1010 0000
针对每一级都设置一个权重,比如:
第1级:10
第2级:9
第3级:8
第4级:7
第5级:6
第6级:5
第7级:4
第8级:3
第9级:2
第10级:1
假设10个block,每个Block都有10个相同级别和0的样本,分别对应上面的样本1~10.
通过加权计算,每个block的加权值:
Block[0]=9*10=90;加权值与0的比例:90/11=8.18
Block[1]=7*10=70;加权值与0的比例:70/6=11.67
Block[2]=8*10=80;加权值与0的比例:80/10=8
Block[3]=6*10=60;加权值与0的比例:60/6=6
Block[4]=10*10=100;加权值与0的比例:100/15=6.67
Block[5]=5*10=50;加权值与0的比例:50/10=5
Block[6]=4*10=40;加权值与0的比例:40/7=5.71
Block[7]=2*10=20;加权值与0的比例:20/4=5
Block[8]=3*10=30;加权值与0的比例:30/7=4.29
Block[9]=1*10=10;加权值与0的比例:10/0=∞(舍弃)
加权值与block中0的比例排序:
Block[1]>Block[0]>Block[2]>Block[4]>Block[3]>Block[6]>Block[5]=Block[7]>Block[8];
所以挑选Block时,就按照上述的顺序来逐一选择。
在挑选释放的Bit时,当为第一级和第二级和第三级时,只取超过连续8个为free的bit,四、五级时只取连续四个为free的bit,剩余的级别则搜索取出free的bit。
在对数据卷bitmap进行修改时,修改的最小单位为bit,即block的分配和回收对应到bitmap为bit的修改,其中block的分配对应bit的0改1,block的回收对应bit的1改0。
请参考图2,图2为本实施例提供的位图数据中空闲块的查找装置的结构框图;主要包括:位图确定单元210、数据划分单元220、模板匹配单元230以及统计单元240。本实施例提供的位图数据中空闲块的查找装置可与上述位图数据中空闲块的查找方法相互对照。
其中,位图确定单元210用于确定待查找空闲块的位图数据块;
数据划分单元220用于将位图数据块划分为具有固定长度的若干整型数据;
模板匹配单元230用于以整型数据的值作为下标,对模板数组进行数组取值运算,得到整型数据对应的数据排布特征信息;其中,模板数组以所有具有固定长度的整型数据的值作为数组下标,以对应的数据排布特征信息作为数据项;数据排布特征信息中包括空闲块的数量以及分布信息;
统计单元240用于根据各整型数据对应的数据排布特征信息统计位图数据块的整体空闲块分布情况。
本实施例提供一种计算机设备,主要包括:存储器以及处理器。
其中,存储器用于存储程序;
处理器用于执行程序时实现如上述实施例介绍的位图数据中空闲块的查找方法的步骤,具体可参照上述位图数据中空闲块的查找方法的介绍。
请参考图3,为本实施例提供的计算机设备的结构示意图,该计算机设备可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)322(例如,一个或一个以上处理器)和存储器332,一个或一个以上存储应用程序342或数据344的存储介质330(例如一个或一个以上海量计算机设备)。其中,存储器332和存储介质330可以是短暂存储或持久存储。存储在存储介质330的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对数据处理设备中的一系列指令操作。更进一步地,中央处理器322可以设置为与存储介质330通信,在计算机设备301上执行存储介质330中的一系列指令操作。
计算机设备301还可以包括一个或一个以上电源326,一个或一个以上有线或无线网络接口350,一个或一个以上输入输出接口358,和/或,一个或一个以上操作系统341,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。
上面图1所描述的位图数据中空闲块的查找方法中的步骤可以由本实施例介绍的计算机设备的结构实现。
本实施例公开一种可读存储介质,其上存储有程序,程序被处理器执行时实现如上述实施例介绍的位图数据中空闲块的查找方法的步骤,具体 可参照上述实施例中对位图数据中空闲块的查找方法的介绍。
该可读存储介质具体可以为U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可存储程序代码的可读存储介质。
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
以上对本申请所提供的位图数据中空闲块的查找方法、装置、设备及可读存储介质进行了详细介绍。本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。

Claims (10)

  1. 一种位图数据中空闲块的查找方法,其特征在于,包括:
    确定待查找空闲块的位图数据块;
    将所述位图数据块划分为具有固定长度的若干整型数据;
    以所述整型数据的值作为下标,对模板数组进行数组取值运算,得到所述整型数据对应的数据排布特征信息;其中,所述模板数组以所有具有所述固定长度的整型数据的值作为数组下标,以对应的数据排布特征信息作为数据项;所述数据排布特征信息中包括空闲块的数量以及分布信息;
    根据各所述整型数据对应的数据排布特征信息统计所述位图数据块的整体空闲块分布情况。
  2. 如权利要求1所述的位图数据中空闲块的查找方法,其特征在于,所述数据排布特征信息包括:数据等级以及空闲块的数量;所述数据等级指示根据空闲块的分布情况生成的数据块释放优先等级,作为所述分布信息;
    则相应地,在根据各所述整型数据对应的数据排布特征信息统计所述位图数据块的整体空闲块分布情况之后,还包括:根据所述整体空闲块分布情况对所述位图数据块进行释放处理。
  3. 如权利要求2所述的位图数据中空闲块的查找方法,其特征在于,将所述位图数据块划分为若干具有固定长度的整型数据,包括:
    将所述位图数据块每隔16位进行数据划分,得到若干16位整型数据。
  4. 如权利要求3所述的位图数据中空闲块的查找方法,其特征在于,所述数据等级以及对应的判定规则包括:
    第1级,15个以上bit为0;
    第2级,存在连续8个及以上的bit为0,且连续的0在两侧;
    第3级,存在连续8个及以上的bit为0,且连续的0在中间;
    第4级,存在连续4~7个bit为0,且连续的0在两侧;
    第5级,存在连续4~7个bit为0,且连续的0在中间;
    第6级,存在少于连续4个bit为0,且0的总数量不少于10;
    第7级,存在少于连续4个bit为0,且0的总数量不少于6;
    第8级,无连续的0,且0的总数量不少于6;
    第9级,无连续的0,且0的总数量少于6;
    第10级,16个bit全是1;
    其中,0为空闲块,1为非空闲块,且从所述第1级至所述第10级数据块释放优先等级逐级降低。
  5. 如权利要求4所述的位图数据中空闲块的查找方法,其特征在于,根据所述整体空闲块分布情况对所述位图数据块进行释放处理,包括:
    对属于所述第1级、所述第2级以及所述第3级的整型数据,取超过连续8个为0的bit进行bit释放;
    对属于所述第4级以及所述第5级的整型数据,取超过连续4个为0的bit进行bit释放;
    对属于所述第6级、所述第7级、所述第8级、所述第9级以及所述第10级的整型数据,搜索为0的bit进行bit释放。
  6. 如权利要求2所述的位图数据中空闲块的查找方法,其特征在于,在将所述位图数据块划分为具有固定长度的若干整型数据之后,还包括:
    对所述整型数据进行随机抽样,取出指定个数的数据作为样本数据;
    则相应地,以所述整型数据的值作为下标,对模板数组进行数组取值运算,得到所述整型数据对应的数据排布特征信息,包括:以所述样本数据的值作为下标,对模板数组进行数组取值运算,得到所述样本数据对应的数据排布特征信息;
    则相应地,根据各所述整型数据对应的数据排布特征信息统计所述位图数据块的整体空闲块分布情况,包括:根据各所述样本数据对应的数据排布特征信息统计所述位图数据块的整体空闲块分布情况。
  7. 如权利要求2所述的位图数据中空闲块的查找方法,其特征在于,统计所有所述目标整型下的数据排布特征信息,包括:
    将所述数据等级对应的数据块释放优先程度作为权重,对各所述数据等级对应的样本数据的数量进行加权计算,将得到的加权值作为所述位图数据块的整体空闲块分布情况;
    则相应地,在根据各所述整型数据对应的数据排布特征信息统计所述 位图数据块的整体空闲块分布情况之后,还包括:
    计算各所述位图数据块对应的所述加权值与所述位图数据块中空闲块的总数的比例值;
    按照所述比例值由大到小的顺序对各所述位图数据块进行释放处理。
  8. 一种位图数据中空闲块的查找装置,其特征在于,包括:
    位图确定单元,用于确定待查找空闲块的位图数据块;
    数据划分单元,用于将所述位图数据块划分为具有固定长度的若干整型数据;
    模板匹配单元,用于以所述整型数据的值作为下标,对模板数组进行数组取值运算,得到所述整型数据对应的数据排布特征信息;其中,所述模板数组以所有具有所述固定长度的整型数据的值作为数组下标,以对应的数据排布特征信息作为数据项;所述数据排布特征信息中包括空闲块的数量以及分布信息;
    统计单元,用于根据各所述整型数据对应的数据排布特征信息统计所述位图数据块的整体空闲块分布情况。
  9. 一种计算机设备,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序时实现如权利要求1至7任一项所述的位图数据中空闲块的查找方法的步骤。
  10. 一种可读存储介质,其特征在于,所述可读存储介质上存储有程序,所述程序被处理器执行时实现如权利要求1至7任一项所述位图数据中空闲块的查找方法的步骤。
PCT/CN2021/103380 2020-08-28 2021-06-30 一种位图数据中空闲块的查找方法及相关组件 Ceased WO2022042011A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/011,510 US11748255B1 (en) 2020-08-28 2021-06-30 Method for searching free blocks in bitmap data, and related components

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010889329.3 2020-08-28
CN202010889329.3A CN111984652B (zh) 2020-08-28 2020-08-28 一种位图数据中空闲块的查找方法及相关组件

Publications (1)

Publication Number Publication Date
WO2022042011A1 true WO2022042011A1 (zh) 2022-03-03

Family

ID=73441297

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/103380 Ceased WO2022042011A1 (zh) 2020-08-28 2021-06-30 一种位图数据中空闲块的查找方法及相关组件

Country Status (3)

Country Link
US (1) US11748255B1 (zh)
CN (1) CN111984652B (zh)
WO (1) WO2022042011A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111984652B (zh) * 2020-08-28 2022-08-12 苏州浪潮智能科技有限公司 一种位图数据中空闲块的查找方法及相关组件

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104731872A (zh) * 2015-03-05 2015-06-24 长沙新弘软件有限公司 基于位图的存储空间管理系统及其方法
CN107665146A (zh) * 2016-07-29 2018-02-06 华为技术有限公司 内存管理装置和方法
WO2018063020A1 (en) * 2016-09-28 2018-04-05 Huawei Technologies Co., Ltd Memory management method and device
CN110688065A (zh) * 2019-09-05 2020-01-14 苏州浪潮智能科技有限公司 一种存储空间管理方法、系统、电子设备及存储介质
CN110780820A (zh) * 2019-10-25 2020-02-11 苏州浪潮智能科技有限公司 一种连续存储空间确定方法、装置及电子设备和存储介质
CN111984652A (zh) * 2020-08-28 2020-11-24 苏州浪潮智能科技有限公司 一种位图数据中空闲块的查找方法及相关组件

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8539179B1 (en) * 2009-03-31 2013-09-17 Symantec Corporation Methods and systems for creating full backups
US8200926B1 (en) * 2009-05-28 2012-06-12 Symantec Corporation Methods and systems for creating full backups
US10528459B2 (en) * 2015-05-15 2020-01-07 Vmware, Inc. Scalable space management using bitmap summary tree
US10303671B1 (en) * 2016-09-30 2019-05-28 Juniper Networks, Inc. Apparatus, system, and method for accelerating bitmap lookups in network devices
CN109992527B (zh) * 2019-04-15 2021-08-10 苏州浪潮智能科技有限公司 一种全闪存储系统的位图管理方法
US11640339B2 (en) * 2020-11-23 2023-05-02 International Business Machines Corporation Creating a backup data set

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104731872A (zh) * 2015-03-05 2015-06-24 长沙新弘软件有限公司 基于位图的存储空间管理系统及其方法
CN107665146A (zh) * 2016-07-29 2018-02-06 华为技术有限公司 内存管理装置和方法
WO2018063020A1 (en) * 2016-09-28 2018-04-05 Huawei Technologies Co., Ltd Memory management method and device
CN110688065A (zh) * 2019-09-05 2020-01-14 苏州浪潮智能科技有限公司 一种存储空间管理方法、系统、电子设备及存储介质
CN110780820A (zh) * 2019-10-25 2020-02-11 苏州浪潮智能科技有限公司 一种连续存储空间确定方法、装置及电子设备和存储介质
CN111984652A (zh) * 2020-08-28 2020-11-24 苏州浪潮智能科技有限公司 一种位图数据中空闲块的查找方法及相关组件

Also Published As

Publication number Publication date
CN111984652B (zh) 2022-08-12
CN111984652A (zh) 2020-11-24
US20230273875A1 (en) 2023-08-31
US11748255B1 (en) 2023-09-05

Similar Documents

Publication Publication Date Title
CN114281989A (zh) 基于文本相似度的数据去重方法、装置及存储介质和服务器
WO2012159320A1 (zh) 一种大规模图像数据的聚类方法及装置
EP4664297A1 (en) Data processing method and data storage system
CN112631731A (zh) 数据查询方法、装置、电子设备及存储介质
WO2022007596A1 (zh) 图像检索系统、方法和装置
CN115952005A (zh) 一种元数据负载均衡方法、装置、设备及可读存储介质
CN113723618B (zh) 一种shap的优化方法、设备及介质
WO2023231184A1 (zh) 一种特征筛选方法、装置、存储介质及电子设备
WO2022042011A1 (zh) 一种位图数据中空闲块的查找方法及相关组件
CN113704565A (zh) 基于全局区间误差的学习型时空索引方法、装置及介质
CN109375989B (zh) 一种并行后缀排序方法及系统
CN112328630B (zh) 数据查询方法、装置、设备及存储介质
CN116302307A (zh) 一种多虚拟机迁移方法、装置、设备及介质
CN115269539A (zh) 数据存储方法及装置、电子设备、存储介质
CN115221874A (zh) 倒排索引的构建方法、名单筛查方法、装置、电子设备
CN116860183B (zh) 一种数据存储方法、电子设备及存储介质
US11789639B1 (en) Method and apparatus for screening TB-scale incremental data
CN116610731B (zh) 一种大数据分布式存储方法、装置、电子设备及存储介质
CN114077690A (zh) 向量数据处理方法、装置、设备及存储介质
WO2024113405A1 (zh) 一种数据处理方法、装置、设备及存储介质
KR102372252B1 (ko) 실루엣 평가 함수를 적용한 빠른 시뮬레이티드어닐링 데이터 클러스터링 방법 및 그 장치
CN114123190A (zh) 确定电表所属目标台区的方法、装置、电子设备及存储介质
CN114896240A (zh) 一种数据检索方法、装置、存储介质及电子装置
CN118200201B (zh) 通信时延指标可靠性检测方法、装置、设备及存储介质
Fu et al. Jump Filter: A Dynamic Sketch for Big Data Governance.

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21859853

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21859853

Country of ref document: EP

Kind code of ref document: A1