WO2013149524A1 - Method and system for writing data - Google Patents

Method and system for writing data Download PDF

Info

Publication number
WO2013149524A1
WO2013149524A1 PCT/CN2013/071975 CN2013071975W WO2013149524A1 WO 2013149524 A1 WO2013149524 A1 WO 2013149524A1 CN 2013071975 W CN2013071975 W CN 2013071975W WO 2013149524 A1 WO2013149524 A1 WO 2013149524A1
Authority
WO
WIPO (PCT)
Prior art keywords
written
thin
storage space
data
logical address
Prior art date
Application number
PCT/CN2013/071975
Other languages
French (fr)
Chinese (zh)
Inventor
冯欢
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2013149524A1 publication Critical patent/WO2013149524A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0665Virtualisation aspects at area level, e.g. provisioning of virtual or logical volumes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD

Definitions

  • the present invention relates to the field of data storage technologies, and more particularly to a method and system for writing data.
  • the thin provisioning system includes: a thin pool, a LUN (Logical Unit Number) and a mapping table; wherein, the thin pool is a physical storage space under the thin configuration system, and the allocation granularity is fixed;
  • the LU is a logical hard disk built on the thin pool;
  • the mapping table includes a plurality of mapping tags, which are used to record the physical address of the data stored in the thin pool and the corresponding relationship of the reduced LU logical addresses corresponding to the data.
  • the process of the data being written to the storage by the thin provisioning system is as follows:
  • the command to write data according to the request sent by the host is used to apply for storage space to the thin pool by the integer multiple of the fixed allocation granularity of the thin pool, and the storage space is allocated by the thin pool.
  • the data to be written is written into the storage space allocated by the thin pool.
  • the mapping table records the logical address corresponding to the data to be written on the thin LU, and is simplified. The corresponding physical address in the pool to indicate the storage space actually allocated by the data to be written.
  • the size of the storage space that can be recorded by one mapping tag of the mapping table is based on the allocation granularity of the thin pool. Therefore, when the allocation granularity of the thin pool is fixed, only one mapping tag can record one size for the fixed value. Allocating a granular storage space, if the requested storage space is N times the fixed allocation granularity (N is a positive integer greater than 1), then N mapping marks are generated.
  • the thin pool of the existing thin provisioning system allocates storage space with its own fixed allocation granularity, and the demand for the integrated big data service and the small data service is relatively moderate (usually mega-level), so there is waste. The system resource and system resource utilization rate are low. Even if the allocation granularity is too small, multiple mapping tags are used to record the large storage demand service, which causes waste of system memory resources. Summary of the invention
  • the embodiments of the present invention provide a method and a system for writing data, so as to solve the problem of wasting system resources and system resource utilization caused by the thin provisioning system allocates storage space by using a fixed allocation granularity of the existing thin provisioning system. Low problem.
  • the present invention provides the following technical solutions:
  • a method of writing data including:
  • the command for requesting to write data includes data to be written, length of the data to be written, and a logical address of the LUN to be written to the reduced logical unit number;
  • the invention also provides a system for writing data, comprising:
  • a receiving module configured to receive a command for requesting to write data, where the command for writing data includes a data to be written, a length of the data to be written, and a logical address of the LUN to be written into the reduced logical unit number;
  • a judging module configured to determine whether to completely allocate the logical address to be written to the thin LU Simple pool storage space
  • a determining module configured to determine, in a case where the determining result of the determining module is negative, a length of data that can be written by consecutive logical addresses of the logical pool that are not allocated the thin pool storage space; Applying, to the thin pool, a storage space greater than or equal to a length of data that can be written by the consecutive logical addresses, in an integer multiple of a minimum storage unit that can be provided by the memory; and storing an information receiving module for receiving the streamlining The pool responds to information about the storage space allocated by the application of the application module;
  • a writing module configured to write the to-be-written data into the allocated storage space of the thin pool, or receive the thin pool in the storage information receiving module, if the determination result of the determining module is yes After the allocated storage space information, the data to be written is written into the corresponding storage space.
  • the method for writing data provided by the embodiment of the present invention cancels the fixed allocation granularity of the thin pool in the prior art, and applies for storage space to the thin pool by an integer multiple of the minimum storage unit that the memory can provide. Because the storage space of the application is based on the minimum storage unit that the storage can provide, the storage space in the thin pool that is applied can be infinitely close to the storage space required by the data, and the system in the thin pool is avoided. Secondly, the storage space allocated by the thin pool is used as an overall allocation granularity of the thin pool, and is not differentiated by the fixed allocation granularity of the prior art thin pool, so that the logical address to be written into the thin LUN corresponds to the thin pool.
  • the physical address can be recorded in the mapping table in the form of a mapping tag, which saves memory resources.
  • the invention solves the problem that the existing thin provisioning system allocates storage space by using the fixed allocation granularity of the thin pool, and wastes system resources and system resource utilization, thereby realizing effective utilization of system resources.
  • FIG. 1 is a flowchart of a method for writing data according to an embodiment of the present invention
  • FIG. 3 is a structural block diagram of a system for writing data according to an embodiment of the present invention
  • FIG. 4 is a structural block diagram of a determining module according to an embodiment of the present invention.
  • FIG. 5 is a structural block diagram of a determining module according to an embodiment of the present invention.
  • FIG. 6 is a structural block diagram of an application module according to an embodiment of the present invention.
  • FIG. 7 is another structural block diagram of a system for writing data according to an embodiment of the present invention.
  • FIG. 8 is a hardware architecture diagram of a system for writing data according to an embodiment of the present invention.
  • FIG. 9 is another hardware architecture diagram of a system for writing data according to an embodiment of the present invention. detailed description
  • An embodiment of the present invention provides a method and system for writing data based on a thin provisioning system, dismounting a fixed allocation granularity set in a thin pool, and writing a logical address of an unallocated storage space in a data command according to a request issued by a host.
  • the length of the continuous data is applied to the thin pool by the integer multiple of the minimum storage unit that the memory can provide, so that the resources of the thin provisioning system are effectively utilized.
  • FIG. 1 is a flowchart of a method for writing data according to an embodiment of the present invention. Referring to FIG. 1, the method may include:
  • Step S100 Receive a command to request to write data, where the command to write data includes a data to be written, a length of the data to be written, and a logical address to be written into the reduced logical unit number LUN; requesting to write data
  • the command is issued by the host, and includes data to be written, a length of the data to be written, and a logical address to be written into the thin LUN, where the length of the data to be written is used to represent
  • the storage capacity information to be written to the data, the logical address to be written to the thin LUN is used to indicate the corresponding thin pool physical space that needs to be written to the data to be written.
  • the method of receiving the command for requesting the writing of the data may be the same as the prior art, and is completed by the production volume.
  • the receiving device may also be configured to directly receive the command for requesting the data to be written by the host.
  • the method of receiving data commands is not limited.
  • Step S200 determining whether the thin pool storage space is completely allocated to the logical address to be written into the reduced LU, and if so, executing step S300, if not, executing step S400;
  • the situation in which the logical address of the thin LUN to be written is allocated to the thin pool storage space includes three cases: first, the logical address portion of the thin LUN to be written has been allocated a thin pool storage space; second, the to-be-written The logical address of the thin LUN has been allocated to the thin pool storage space. The third logical address of the thin LUN to be written is not allocated the thin pool storage space. If the second case is the case where the determination result is yes, step S300 is performed, and if the first and third cases are the determination result, the process proceeds to step S400.
  • Step S300 the data to be written is written into the allocated storage space of the thin pool; when the logical address of the thin LUN to be written has been all allocated the thin pool storage space, referring to the prior art processing method, The data to be written is directly written into the allocated storage space.
  • Step S400 Determine a length of data that can be written by consecutive logical addresses of the logical address that are not allocated the thin pool storage space, and apply for the thin pool to be larger than an integer multiple of a minimum storage unit that can be provided by the memory. Or a storage space equal to the length of the data that the consecutive logical addresses can write;
  • the memory here can be a disk, a tape or a solid state drive.
  • step S200 The case where the result of the determination in step S200 is NO includes the following two: the logical address of the to-be-written thin LUN is completely unallocated with the thin pool storage space; and the logical address portion of the to-be-written thin LU is allocated the thin pool storage space portion allocation . In practical applications, only one of these two situations will occur.
  • the logical address in the corresponding case is not allocated the thin pool ⁇ ⁇ m ⁇ i car ⁇ ⁇ ⁇ ⁇ & iML , into n ⁇ t—
  • the length of the data that can be written by the consecutive logical addresses according to the formula: the size of the smallest memory unit that the memory can provide, x N, greater than or equal to the data that can be written by the consecutive logical addresses. Length; obtains an N value, and applies storage space to the thin pool by the size of the smallest storage unit that the N memories can provide.
  • the storage space of the length of the data that can be written to the continuous logical address is applied to the thin pool.
  • applying for the storage space to the thin pool may be performed by the thin LUN.
  • the minimum value of the allocation granularity may be predefined on the thin LU, where the minimum value of the allocation granularity is the minimum storage unit size that the memory can provide.
  • the smallest memory unit that a memory can provide is a sector with a size of 512 bytes.
  • Step S500 The receiving the thin pool responds to the information about the storage space allocated by the application, and writes the data to be written into the corresponding storage space.
  • the thin pool After receiving the storage space request, the thin pool allocates the storage space of the same size as the storage space of the application in response to the application, and sends information about the allocated storage space, where the information of the allocated storage space is allocated by the thin pool. Position information and size information of the storage space; after obtaining the information of the allocated storage space, the location and size of the storage space in which the data in the consecutive logical addresses should be written can be obtained from the information. Writing data to be written corresponding to the consecutive logical addresses is written into a corresponding storage space.
  • the method for writing data shown in FIG. 1 is, after receiving a command requesting to write data, determining whether the thin pool storage space is completely allocated to the logical address of the LU to be written, and if so, directly to be written The data is written into the allocated storage space. If not, it is determined that the logical address is not allocated to the Fi pool, and the address is 0.
  • An integer multiple of a minimum storage unit applying to the thin pool for a storage space that is greater than or equal to a length of data that can be written by the consecutive logical addresses, and after being obtained by the information of the storage space allocated by the thin pool, is to be written The data is written to the corresponding storage space.
  • the thin pool of the existing thin provisioning system allocates storage space with its own fixed allocation granularity, and the demand for the integrated big data service and the small data service is relatively moderate (usually mega-level), so there is waste.
  • the fixed allocation granularity is too large compared to the small data service; since the thin LUN can only apply for storage space with a positive integer multiple of the fixed allocation granularity of the thin pool, then for small data services, such as the bank's depositor database,
  • the minimum storage space (a storage space with a fixed allocation granularity) applied by the thin LUN is also much larger than the data to be written by the host. This causes the storage space allocated by the thin pool to be reasonably utilized, and there is a waste of thin pool storage resources.
  • mapping tags are used for recording; for big data services, such as video libraries, etc., the allocation space of the reduced LU application is multiple of the fixed allocation granularity, and The large storage requirement service is recorded by using multiple mapping tags, which causes waste of system memory resources.
  • the present invention eliminates the fixed allocation granularity of the thin pool in the prior art, and applies the storage space to the thin pool by the integer multiple of the minimum storage unit that the memory can provide, since the applied storage space is the minimum that the storage can provide.
  • the storage unit is based on the storage unit, so that the storage space in the thin pool can be infinitely close to the storage space required by the data, and the waste of system resources in the thin pool is avoided as much as possible.
  • the storage space allocated by the thin pool is used as the thin pool.
  • step S200 it is determined whether the thin pool storage space is completely allocated to the logical address of the LU to be written, which can be implemented by detecting the record of the logical address of the LU to be written in the mapping table.
  • the specific method can be as shown in FIG. 2, and the method includes the following steps:
  • Step S210 detecting a record of the logical address to be written into the thin LUN in the mapping table; Step S220, if the logical address of the to-be-written thin LU is completely recorded in the mapping table, determining that the given The logical address of the to-be-written thin LUN is completely allocated to the thin pool storage space; step S230, if the logical address portion of the to-be-written thin LU is not recorded in the mapping table, it is determined that the to-be-written is not given The logical address of the thin LUN is completely allocated to the thin pool storage space.
  • the specific method for determining the length of the data that can be written by the consecutive logical addresses of the thin pool storage space in the logical address in step S400 shown in FIG. 1 can be as follows:
  • the unallocated thin pool storage space is not allocated.
  • the length of the data that can be written by the consecutive logical addresses is the length of the data to be written in the command for writing the requested data;
  • the thin pool storage space is not completely allocated to the logical address to be written to the thin LUN, that is, the logical address portion of the thin LUN to be written is allocated the thin pool storage space portion allocation, and the entire data to be written needs to be performed.
  • the splitting may be performed by: splitting a logical address to be written into the reduced LU by using a logical contiguous address corresponding to the allocated storage space, and splitting the logical logic to be written into the thin LUN after the splitting
  • the address includes: a contiguous logical address to which the storage space has been allocated and a contiguous logical address to which the storage space is not allocated, wherein the contiguous logical address to which the storage space has been allocated has a record in the mapping table, and the storage space is not allocated
  • the continuous logical address does not have a record in the mapping table; the length of the data that can be written by the continuous logical address of the unallocated storage space after the split is calculated, and the specific calculation method can refer to the existing data length calculation method, where No more details; the split logical address of the unallocated pool storage space can be written to the data Degree is determined to be
  • the logical address of the thin LUN to be written after the split includes: a continuous logical address of the allocated storage space and The contiguous logical address of the storage space is not allocated. Therefore, the step S500 shown in FIG. 1 may be used to write the data corresponding to the consecutive logical addresses of the unallocated storage space, and may also include the storage space allocated by the pool. step:
  • the data to be written corresponding to the consecutive logical addresses of the allocated storage space is written into the allocated storage space.
  • Step S500 shown in FIG. 1 may further include the steps:
  • the logical address to be written into the thin LUN is recorded in the mapping table in the form of a mapping mark corresponding to the physical address corresponding to the thin pool;
  • it can be recorded in the form of a mapping mark.
  • the memory can apply to the thin pool for greater than or equal to the length of the data that can be written by the consecutive logical addresses.
  • the storage space may be preferably: a storage space that is greater than or equal to the length of data that can be written by the consecutive logical addresses is applied to the thin pool by a power of two of the memory sectors.
  • Such numerical settings are based on a common binary data recording method, so that data can be recorded more conveniently than existing storage, such as a hard disk.
  • the present invention applies the storage space to the thin pool by an integer multiple of the minimum storage unit that the memory can provide. Compared with the small data service, the present invention can allocate a minimum storage unit that can be provided by a memory to the small data service, thereby Maximize the utilization of storage space. Compared with the existing thin pool mega-level fixed allocation granularity, the present invention can greatly reduce the space wasted by the thin pool in small data services.
  • the present invention removes the fixed allocation granularity set in the thin pool, and the storage space allocated by the thin pool is no longer segmented by the existing fixed allocation granularity, but the storage space allocated by the thin pool is used as an overall allocation granularity of the thin pool. Allocating a complete storage space, thereby making a mapping in the mapping table of the present invention The number of mapped tags used avoids wasting system memory resources.
  • FIG. 3 is a structural block diagram of a system for writing data according to the present invention.
  • the system can include:
  • the receiving module 100 is configured to receive a command for requesting to write data, where the command for writing data includes a data to be written, a length of the data to be written, and a logical address of the LUN to be written into the reduced logical unit number;
  • the determining module 200 is configured to determine whether the thin pool storage space is completely allocated to the logical address of the thin LUN to be written;
  • a determining module 300 configured to determine, in a case where the determining result of the determining module is negative, a length of the logical address in which the continuous logical address of the thin pool storage space is not allocated;
  • the application module 400 is configured to apply, to the thin pool, a storage space that is greater than or equal to a length of data that can be written by the consecutive logical addresses, in an integer multiple of a minimum storage unit that can be provided by the storage;
  • the storage information receiving module 500 is configured to receive information about a storage space allocated by the thin pool in response to the application of the application module;
  • the writing module 600 is configured to write the to-be-written data into the allocated storage space of the thin pool if the determination result of the determining module is yes, or receive the streamlining in the storage information receiving module After the storage space information allocated by the pool, the data to be written is written into the corresponding storage space.
  • the structure of the determining module 200 can be as shown in FIG. 4, and includes:
  • the detecting unit 210 is configured to detect a record of the logical address of the to-be-written thin LUN in the mapping table;
  • a determining unit 220 configured to detect, in the detecting unit, the logical place to be written into the thin LUN
  • the structure of the determining module 300 can be as shown in FIG. 5, including:
  • the first determining unit 310 is configured to determine, when the thin pool storage space is not allocated to the logical address to be written into the thin LUN, the length of the data to be written is determined, where the thin pool storage space is not allocated. The length of data that can be written by consecutive logical addresses;
  • the splitting unit 320 is configured to allocate a thin pool storage space to the logical address of the to-be-written thin LUN, and use a logical address corresponding to the allocated storage space as a split point for the to-be-written LU The logical address is split;
  • the second determining unit 330 is configured to determine, according to the length of the split logical address that is not allocated the thin pool storage space, data that can be written into the continuous logical address of the unallocated thin pool storage space. The length of data that can be written.
  • the write module 600 can also be used to write the consecutive logical addresses of the allocated storage space after the split unit 320 is split, and the corresponding data is written into the allocated storage space.
  • the structure of the application module 400 can be as shown in FIG. 6, and includes:
  • a predefined unit 410 configured to pre-define a minimum value of the reduced LU allocation granularity, where a minimum value of the allocated granularity is a size of a minimum storage unit that the memory can provide;
  • the application unit 420 is configured to apply, to the thin pool, a data that is greater than or equal to the consecutive logical addresses, in a unit of a positive integer multiple of a minimum value of the reduced LUN allocation granularity defined by the predefined unit.
  • the storage space of the length, the difference between the size of the storage space of the thin pool of the application and the length of the data to be written is less than a preset threshold.
  • FIG. 7 is another structural block diagram of a system for writing data according to an embodiment of the present invention.
  • the system of Figure 7 further includes:
  • mapping table module 700 configured to: write the logical address of the reduced LU to be in a thin pool
  • the software module composition of the system for writing data based on the thin configuration of the present invention is shown above. It should be noted that the system for writing data of the present invention may also exist in hardware form, and several write data of the present invention will be listed below. An embodiment of the hardware form of the system.
  • FIG. 8 is a hardware architecture diagram of a system for writing data according to an embodiment of the present invention, with reference to FIG. 7 and FIG.
  • the interface module 100 can exist in the form of interface 01, and the received command to write data is stored in the first database 02;
  • the first database 02 stores the command to request to write data
  • the first processor 03 is a processor that has the built-in function of the determining module 200 and the determining module 300.
  • the first processor 03 extracts a command for receiving the request to write data stored in the first fetch database 02, and determines whether to write the to-be-written.
  • the logical address of the thin LUN is completely allocated to the thin pool storage space. When the judgment result is no, the length of the data that can be written by the continuous logical address of the thin pool storage space is determined in the logical address, which involves When splitting the data, the first processor 03 may store the split data to be written into the first database 02;
  • the compact LUN 04 has a built-in function of the application module 400, which applies an integer multiple of the minimum storage unit that the memory can provide, to the thin pool, which is greater than or equal to the length of the data that can be written by the consecutive logical addresses. storage;
  • Thin pool 05 responds to the LUN 04 application, allocates the corresponding storage space, and sends information about the location and size of the allocated storage space;
  • the function of the storage information receiving module 500 can be built in the form of software in the input device 06, or in the LU-24;
  • the input device 06 has built-in software for writing the function of the module 600.
  • the corresponding data to be written stored in the first database 02 can be directly extracted and written into the thin pool.
  • the allocation of other hardware devices can be obtained by transferring ⁇ i ⁇ , , ⁇ - ⁇ - 0?. ⁇ 4 eyes into the data, will fc into Thin storage space allocated by the pool;
  • the second database 07 has built-in software for mapping the function of the table module 700, and the second database 07 includes a mapping table composed of a plurality of mapping tags, which can allocate the storage space allocated by the thin pool to the corresponding physical address on the thin pool, and The corresponding logical address on the logical unit LUN is recorded in a mapping table in the form of a mapping mark;
  • interface 01 and the first database 02 can be integrated, as in the form of a production volume of the prior art.
  • FIG 9 is another hardware architecture diagram of the system for writing data according to the present invention, with reference to Figures 7 and 9.
  • the production volume 012 receives a command sent by the host to write data
  • the first processor 03 is a processor with built-in judgment module 200 and determination module 300 function software, and extracts a command for requesting write data from the generated volume 012, and performs corresponding processing;
  • the LU 04 has built-in software for applying the function of the module 400, software for storing the function of the information receiving module 500, and software for writing the function of the module 600;
  • Thin pool 05 responds to the LUN 04 application, allocates the corresponding storage space, and sends information about the allocation storage storage;
  • the second database 07 has a built-in function of the mapping table module 700, and the second database 07 includes a mapping table composed of a plurality of mapping tags.
  • FIG. 8 and FIG. 9 are only preferred manners of the hardware architecture of the present invention, and should not be a limitation on the hardware architecture system of the present invention.
  • Those skilled in the art can fully modify and integrate the software and hardware of the present invention by the technical revelation given by the specific embodiments of the present invention, and the corresponding software principles and hardware components shown.
  • Corresponding software and hardware it should be noted that the modifications and integrations do not depart from the technical idea of the present invention and are also within the scope of the present invention.
  • 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 form of storage known in the art. In the medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiments of the present invention provide a method and system for writing data. The method comprises: receiving a command for requesting to write data; determining whether to allocate a compacted pool storage space to all logical addresses to be written into a compacted LUN; if yes, writing the to-be-written data into a storage space allocated by the compacted pool; and if not, determining the length of the data that can be written into continuous logical addresses, to which the compacted pool storage space is not allocated, among the logical addresses and applying, according to an integral multiple of the size of a minimum storage unit that can be provided by a memory, to the compacted pool for the storage space greater than or equal to the length of the data that can be written into the continuous logical addresses; and receiving information of a storage space allocated by the compacted pool in response to the application and writing the to-be-written data into the corresponding storage space. By using the present invention, effective utilization of system resources is achieved.

Description

写入数据的方法及系统  Method and system for writing data
本申请要求于 2012年 4月 1 日提交中国专利局、 申请号为  This application is submitted to the Chinese Patent Office on April 1, 2012, and the application number is
201210095935.3、 发明名称为 "写入数据的方法及系统" 的中国专利申请的优 先权, 其全部内容通过引用结合在本申请中。 201210095935.3, the priority of the Chinese patent application entitled "Method and System for Writing Data", the entire contents of which are hereby incorporated by reference.
技术领域 Technical field
本发明涉及数据存储技术领域, 更具体地说, 涉及一种写入数据的方法 及系统。  The present invention relates to the field of data storage technologies, and more particularly to a method and system for writing data.
背景技术 Background technique
随着科技的发展与因特网的广泛应用, 企业、 政府等机关产生的数据量越 来越大, 为这些数据合理规划存储空间成为当前存储解决方案的当务之急。 目 前在众多的存储解决方案中, 精简配置 (thin provisioning ) 由于其按需分配的 存储空间管理方式得到了广泛的应用。  With the development of technology and the widespread use of the Internet, the amount of data generated by enterprises, governments, and other institutions is increasing. It is imperative to plan storage space for these data as a current storage solution. Often in many storage solutions, thin provisioning is widely used due to its on-demand allocation of storage space management.
现有技术提供的精简配置系统包括: 精简池, 精简 LUN ( Logical Unit Number, 逻辑单元号)和映射表; 其中, 精简池为精简配置系统底层的物理存 储空间, 其分配粒度是固定的; 精简 LU 为建立在精简池之上的逻辑硬盘; 映射表包括多个映射标记, 该映射标记用于记录精简池存储的数据的物理地 址, 与该数据对应的精简 LU 逻辑地址的对应关系。 精简配置系统将数据写 入存储的过程如下: 精简 LU 根据主机下发的请求写入数据的命令, 以精简 池固定分配粒度的整数倍大小向精简池申请存储空间, 精简池分配存储空间, 以使待写入数据写入精简池分配的存储空间中,在待写入数据写入精简池分配 的存储空间后, 映射表记录该待写入数据在精简 LU 上对应的逻辑地址, 与 在精简池中对应的物理地址, 以表示该待写入数据实际分配的存储空间。 由于 现有技术中, 映射表的一个映射标记所能记录的存储空间大小是以精简池的分 配粒度为标准, 因此当精简池的分配粒度固定时, 一个映射标记只能记录一个 大小为该固定分配粒度的存储空间, 如果申请的存储空间是该固定分配粒度的 N倍(N为大于 1的正整数) , 那么就会产生 N个映射标记。 现有精简配置系统的精简池是以自身固定的分配粒度分配存储空间, 且为 综合大数据业务和小数据业务的需求, 固定分配粒度的取值较为适中 (通常为 兆级), 因此存在浪费系统资源, 系统资源利用率低的现象, 即使分配粒度过 小, 也会使用多个映射标记对该大存储需求业务进行记录, 这就造成系统内存 资源的浪费。 发明内容 The thin provisioning system provided by the prior art includes: a thin pool, a LUN (Logical Unit Number) and a mapping table; wherein, the thin pool is a physical storage space under the thin configuration system, and the allocation granularity is fixed; The LU is a logical hard disk built on the thin pool; the mapping table includes a plurality of mapping tags, which are used to record the physical address of the data stored in the thin pool and the corresponding relationship of the reduced LU logical addresses corresponding to the data. The process of the data being written to the storage by the thin provisioning system is as follows: The command to write data according to the request sent by the host is used to apply for storage space to the thin pool by the integer multiple of the fixed allocation granularity of the thin pool, and the storage space is allocated by the thin pool. The data to be written is written into the storage space allocated by the thin pool. After the data to be written is written into the storage space allocated by the thin pool, the mapping table records the logical address corresponding to the data to be written on the thin LU, and is simplified. The corresponding physical address in the pool to indicate the storage space actually allocated by the data to be written. In the prior art, the size of the storage space that can be recorded by one mapping tag of the mapping table is based on the allocation granularity of the thin pool. Therefore, when the allocation granularity of the thin pool is fixed, only one mapping tag can record one size for the fixed value. Allocating a granular storage space, if the requested storage space is N times the fixed allocation granularity (N is a positive integer greater than 1), then N mapping marks are generated. The thin pool of the existing thin provisioning system allocates storage space with its own fixed allocation granularity, and the demand for the integrated big data service and the small data service is relatively moderate (usually mega-level), so there is waste. The system resource and system resource utilization rate are low. Even if the allocation granularity is too small, multiple mapping tags are used to record the large storage demand service, which causes waste of system memory resources. Summary of the invention
有鉴于此, 本发明实施例提供一种写入数据的方法及系统, 以解决现有精 简配置系统由于精简池以自身固定的分配粒度分配存储空间, 而造成的浪费系 统资源、 系统资源利用率低的问题。  In view of the above, the embodiments of the present invention provide a method and a system for writing data, so as to solve the problem of wasting system resources and system resource utilization caused by the thin provisioning system allocates storage space by using a fixed allocation granularity of the existing thin provisioning system. Low problem.
为实现上述目的, 本发明提供如下技术方案:  To achieve the above object, the present invention provides the following technical solutions:
一种写入数据的方法, 包括:  A method of writing data, including:
接收请求写入数据的命令, 所述请求写入数据的命令包括待写入数据、 所 述待写入数据的长度以及待写入精简逻辑单元号 LUN的逻辑地址;  Receiving a command for requesting to write data, the command for requesting to write data includes data to be written, length of the data to be written, and a logical address of the LUN to be written to the reduced logical unit number;
判断是否给所述待写入精简 LU 的逻辑地址完全分配精简池存储空间; 若是, 则将所述待写入数据写入精简池已分配的存储空间中;  Determining whether the thin pool storage space is completely allocated to the logical address to be written into the thin LU; if yes, writing the data to be written into the allocated storage space of the thin pool;
若否,确定所述逻辑地址中未被分配精简池存储空间的连续的逻辑地址所 能写入数据的长度, 以存储器所能提供的最小存储单元的整数倍大小, 向所述 精简池申请大于或等于所述连续的逻辑地址所能写入数据的长度的存储空间; 接收精简池响应上述申请所分配的存储空间的信息,将待写入数据写入相 应的存储空间中。  If not, determining a length of data that can be written by consecutive logical addresses of the logical address that are not allocated the thin pool storage space, and applying to the thin pool by an integer multiple of a minimum storage unit that the memory can provide Or a storage space equal to the length of the data that can be written by the consecutive logical addresses; receiving the information of the storage space allocated by the thin pool in response to the application, and writing the data to be written into the corresponding storage space.
本发明还提供一种写入数据的系统, 包括:  The invention also provides a system for writing data, comprising:
接收模块, 用于接收请求写入数据的命令, 所述请求写入数据的命令包括 待写入数据、 所述待写入数据的长度以及待写入精简逻辑单元号 LUN的逻辑 地址;  a receiving module, configured to receive a command for requesting to write data, where the command for writing data includes a data to be written, a length of the data to be written, and a logical address of the LUN to be written into the reduced logical unit number;
判断模块, 用于判断是否给所述待写入精简 LU 的逻辑地址完全分配精 简池存储空间; a judging module, configured to determine whether to completely allocate the logical address to be written to the thin LU Simple pool storage space;
确定模块, 用于在所述判断模块的判断结果为否的情况下, 确定所述逻辑 地址中, 未被分配精简池存储空间的连续的逻辑地址所能写入数据的长度; 申请模块, 用于以存储器所能提供的最小存储单元的整数倍大小, 向所述 精简池申请大于或等于所述连续的逻辑地址所能写入数据的长度的存储空间; 存储信息接收模块, 用于接收精简池响应所述申请模块的申请所分配的存 储空间的信息;  a determining module, configured to determine, in a case where the determining result of the determining module is negative, a length of data that can be written by consecutive logical addresses of the logical pool that are not allocated the thin pool storage space; Applying, to the thin pool, a storage space greater than or equal to a length of data that can be written by the consecutive logical addresses, in an integer multiple of a minimum storage unit that can be provided by the memory; and storing an information receiving module for receiving the streamlining The pool responds to information about the storage space allocated by the application of the application module;
写入模块, 用于在所述判断模块的判断结果为是的情况下, 将所述待写入 数据写入精简池已分配的存储空间中,或在所述存储信息接收模块接收到精简 池所分配的存储空间信息后, 将待写入数据写入相应的存储空间中。  a writing module, configured to write the to-be-written data into the allocated storage space of the thin pool, or receive the thin pool in the storage information receiving module, if the determination result of the determining module is yes After the allocated storage space information, the data to be written is written into the corresponding storage space.
基于上述技术方案, 本发明实施例所提供的写入数据的方法取消了现有技术 中的精简池固定分配粒度, 以存储器所能提供的最小存储单元的整数倍大小, 向精简池申请存储空间, 由于申请的存储空间是以存储器所能提供的最小存储 单元为基础, 因此可以使得申请到的精简池中的存储空间无限接近于数据所需 的存储空间大小, 尽量避免浪费精简池中的系统资源; 其次, 精简池分配出的 存储空间作为精简池的一个整体分配粒度, 不再以现有技术的精简池固定分配 粒度进行区分, 使得待写入精简 LUN的逻辑地址, 与其在精简池上对应的物 理地址, 可以一个映射标记的形式记录在映射表中, 节省了内存资源。 本发明 解决了现有精简配置系统由于精简池以自身固定的分配粒度分配存储空间, 而 造成的浪费系统资源、系统资源利用率低的问题,实现了系统资源的有效利用。 附图说明  Based on the foregoing technical solution, the method for writing data provided by the embodiment of the present invention cancels the fixed allocation granularity of the thin pool in the prior art, and applies for storage space to the thin pool by an integer multiple of the minimum storage unit that the memory can provide. Because the storage space of the application is based on the minimum storage unit that the storage can provide, the storage space in the thin pool that is applied can be infinitely close to the storage space required by the data, and the system in the thin pool is avoided. Secondly, the storage space allocated by the thin pool is used as an overall allocation granularity of the thin pool, and is not differentiated by the fixed allocation granularity of the prior art thin pool, so that the logical address to be written into the thin LUN corresponds to the thin pool. The physical address can be recorded in the mapping table in the form of a mapping tag, which saves memory resources. The invention solves the problem that the existing thin provisioning system allocates storage space by using the fixed allocation granularity of the thin pool, and wastes system resources and system resource utilization, thereby realizing effective utilization of system resources. DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施 例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付 出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。 图 1为本发明实施例提供的一种写入数据的方法的流程图; 图 3为本发明实施例提供的一种写入数据的系统的结构框图; In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work. 1 is a flowchart of a method for writing data according to an embodiment of the present invention; FIG. 3 is a structural block diagram of a system for writing data according to an embodiment of the present invention;
图 4为本发明实施例提供的判断模块的结构框图;  4 is a structural block diagram of a determining module according to an embodiment of the present invention;
图 5为本发明实施例提供的确定模块的结构框图;  FIG. 5 is a structural block diagram of a determining module according to an embodiment of the present invention;
图 6为本发明实施例提供的申请模块的结构框图;  FIG. 6 is a structural block diagram of an application module according to an embodiment of the present invention;
图 7为本发明实施例提供的写入数据的系统的另一结构框图;  FIG. 7 is another structural block diagram of a system for writing data according to an embodiment of the present invention;
图 8为本发明实施例提供的写入数据的系统的硬件架构图;  FIG. 8 is a hardware architecture diagram of a system for writing data according to an embodiment of the present invention; FIG.
图 9为本发明实施例提供的写入数据的系统的另一硬件架构图。 具体实施方式  FIG. 9 is another hardware architecture diagram of a system for writing data according to an embodiment of the present invention. detailed description
本发明实施例提供一种基于精简配置系统的写入数据的方法及系统, 卸除 设置于精简池中的固定分配粒度,根据主机下发的请求写入数据命令中未分配 存储空间的逻辑地址连续的数据的长度, 以存储器所能提供的最小存储单元的 整数倍大小, 向精简池申请存储空间, 使得精简配置系统的资源得到有效的利 用。  An embodiment of the present invention provides a method and system for writing data based on a thin provisioning system, dismounting a fixed allocation granularity set in a thin pool, and writing a logical address of an unallocated storage space in a data command according to a request issued by a host. The length of the continuous data is applied to the thin pool by the integer multiple of the minimum storage unit that the memory can provide, so that the resources of the thin provisioning system are effectively utilized.
下面结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。  BRIEF DESCRIPTION OF THE DRAWINGS The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without the creative work are all within the scope of the present invention.
图 1为本发明实施例提供的一种写入数据的方法的流程图, 参照图 1 , 该 方法可以包括:  FIG. 1 is a flowchart of a method for writing data according to an embodiment of the present invention. Referring to FIG. 1, the method may include:
步骤 S100、接收请求写入数据的命令,所述请求写入数据的命令包括待写 入数据、所述待写入数据的长度以及待写入精简逻辑单元号 LUN的逻辑地址; 请求写入数据的命令为主机所下发, 包含待写入数据、 所述待写入数据的 长度以及待写入精简 LUN的逻辑地址, 其中所述待写入数据的长度用于表示 待写入数据所需的存储容量信息, 待写入精简 LUN的逻辑地址用于指示待写 入数据需要写入的对应精简池物理空间。接收请求写入数据的命令的方法可以 与现有技术相同, 由生产卷完成; 也可预设接收装置, 直接接收主机下发的请 求写入数据的命令; 本发明实施例具体的请求写入数据的命令的接收方式并不 设限。 Step S100: Receive a command to request to write data, where the command to write data includes a data to be written, a length of the data to be written, and a logical address to be written into the reduced logical unit number LUN; requesting to write data The command is issued by the host, and includes data to be written, a length of the data to be written, and a logical address to be written into the thin LUN, where the length of the data to be written is used to represent The storage capacity information to be written to the data, the logical address to be written to the thin LUN is used to indicate the corresponding thin pool physical space that needs to be written to the data to be written. The method of receiving the command for requesting the writing of the data may be the same as the prior art, and is completed by the production volume. The receiving device may also be configured to directly receive the command for requesting the data to be written by the host. The method of receiving data commands is not limited.
步骤 S200、 判断是否给所述待写入精简 LU 的逻辑地址完全分配精简池 存储空间, 若是, 执行步骤 S300、 若否, 执行步骤 S400;  Step S200, determining whether the thin pool storage space is completely allocated to the logical address to be written into the reduced LU, and if so, executing step S300, if not, executing step S400;
所述待写入精简 LUN的逻辑地址分配精简池存储空间的状况包括三种情 况: 第一、 所述待写入精简 LUN的逻辑地址部分已分配精简池存储空间; 第 二、 所述待写入精简 LUN的逻辑地址已全部分配精简池存储空间; 第三、 所 述待写入精简 LUN的逻辑地址全部未分配精简池存储空间。 其中, 第二种情 况为判断结果为是的情况的,执行步骤 S300,第一和第三种情况为判断结果为 否的情况, 执行步骤 S400。  The situation in which the logical address of the thin LUN to be written is allocated to the thin pool storage space includes three cases: first, the logical address portion of the thin LUN to be written has been allocated a thin pool storage space; second, the to-be-written The logical address of the thin LUN has been allocated to the thin pool storage space. The third logical address of the thin LUN to be written is not allocated the thin pool storage space. If the second case is the case where the determination result is yes, step S300 is performed, and if the first and third cases are the determination result, the process proceeds to step S400.
步骤 S300、 将所述待写入数据写入精简池已分配的存储空间中; 当所述待写入精简 LUN的逻辑地址已全部分配精简池存储空间, 则参照 现有技术的处理方法, 将所述待写入数据直接写入已分配的存储空间中。  Step S300, the data to be written is written into the allocated storage space of the thin pool; when the logical address of the thin LUN to be written has been all allocated the thin pool storage space, referring to the prior art processing method, The data to be written is directly written into the allocated storage space.
步骤 S400、确定所述逻辑地址中未被分配精简池存储空间的连续的逻辑地 址所能写入数据的长度, 以存储器所能提供的最小存储单元的整数倍大小, 向 所述精简池申请大于或等于所述连续的逻辑地址所能写入数据的长度的存储 空间;  Step S400: Determine a length of data that can be written by consecutive logical addresses of the logical address that are not allocated the thin pool storage space, and apply for the thin pool to be larger than an integer multiple of a minimum storage unit that can be provided by the memory. Or a storage space equal to the length of the data that the consecutive logical addresses can write;
这里的存储器可以是磁盘、 磁带或者固态硬盘。  The memory here can be a disk, a tape or a solid state drive.
步骤 S200判断结果为否的情况包括下述两者:所述待写入精简 LUN的逻 辑地址完全未分配精简池存储空间; 所述待写入精简 LU 的逻辑地址部分分 配精简池存储空间部分分配。在实际应用中,这两种情况只会出现其中的一种, 确定了实际应用中对应的情况后,确定对应情况下的逻辑地址中未被分配精简 池^^ ^ m ^ i车 ^ ό^ι & iML , 入 n ό t— 在确定了所述连续的逻辑地址所能写入数据的长度后, 可根据公式: 存储 器所能提供的最小存储单元的大小 x N, 大于或等于所述连续的逻辑地址所能 写入数据的长度; 得出 N值, 以所述 N个存储器所能提供的最小存储单元的 大小, 向精简池申请存储空间。 The case where the result of the determination in step S200 is NO includes the following two: the logical address of the to-be-written thin LUN is completely unallocated with the thin pool storage space; and the logical address portion of the to-be-written thin LU is allocated the thin pool storage space portion allocation . In practical applications, only one of these two situations will occur. After determining the corresponding situation in the actual application, it is determined that the logical address in the corresponding case is not allocated the thin pool ^^ ^ m ^ i car ^ ό ^ ι & iML , into n ό t— After determining the length of the data that can be written by the consecutive logical addresses, according to the formula: the size of the smallest memory unit that the memory can provide, x N, greater than or equal to the data that can be written by the consecutive logical addresses. Length; obtains an N value, and applies storage space to the thin pool by the size of the smallest storage unit that the N memories can provide.
优选的, 在满足所述连续的逻辑地址所能写入数据的存储需求的情况下, 向精简池申请大小趋近于所述连续的逻辑地址所能写入数据的长度的存储空 间。  Preferably, in the case that the storage requirement of the data that can be written by the consecutive logical addresses is satisfied, the storage space of the length of the data that can be written to the continuous logical address is applied to the thin pool.
优选的, 向精简池申请存储空间可由精简 LUN执行, 具体的, 可在精简 LU 上预先定义分配粒度的最小值,所述分配粒度最小值为所述存储器所能提 供的最小存储单元的大小, 以所述精简 LUN分配粒度的最小值的整数倍为单 位, 向所述精简池申请大于或等于所述连续的逻辑地址所能写入数据的长度, 所述申请的精简池的存储空间的大小与所述待写入数据的长度之间的差值小 于预设阔值。  Preferably, applying for the storage space to the thin pool may be performed by the thin LUN. Specifically, the minimum value of the allocation granularity may be predefined on the thin LU, where the minimum value of the allocation granularity is the minimum storage unit size that the memory can provide. Applying, to the thin pool, a length greater than or equal to the length of data that can be written by the consecutive logical addresses, in an integer multiple of a minimum value of the minimum size of the thin LUN allocation, the size of the storage space of the thin pool of the application The difference between the length of the data to be written is less than a preset threshold.
目前, 存储器所能提供的最小存储单元为扇区, 大小为 512字节。  Currently, the smallest memory unit that a memory can provide is a sector with a size of 512 bytes.
步骤 S500、接收精简池响应上述申请所分配的存储空间的信息,将待写入 数据写入相应的存储空间中。  Step S500: The receiving the thin pool responds to the information about the storage space allocated by the application, and writes the data to be written into the corresponding storage space.
精简池接收到存储空间申请后, 响应所述申请, 分配与所述申请的存储空 间大小相同的存储空间, 发送所分配的存储空间的信息, 该分配的存储空间的 信息记录有精简池所分配的存储空间的位置信息与大小信息; 在获取了所述分 配的存储空间的信息后,便可从该信息中获得所述连续的逻辑地址中的数据应 该写入的存储空间的位置与大小,将所述连续的逻辑地址所对应的待写入数据 写入相应的存储空间中。  After receiving the storage space request, the thin pool allocates the storage space of the same size as the storage space of the application in response to the application, and sends information about the allocated storage space, where the information of the allocated storage space is allocated by the thin pool. Position information and size information of the storage space; after obtaining the information of the allocated storage space, the location and size of the storage space in which the data in the consecutive logical addresses should be written can be obtained from the information. Writing data to be written corresponding to the consecutive logical addresses is written into a corresponding storage space.
图 1示出的写入数据的方法, 在接收到请求写入数据的命令之后, 判断是 否给所述待写入精简 LU 的逻辑地址完全分配精简池存储空间, 若是, 则直 接将待写入数据写入已分配存储空间中, 若否, 确定所述逻辑地址中未被分配 f i池 储 ΐ¾1 ό ί车 0 址所 , 入翁 0 唐, 最小存储单元的整数倍大小, 向所述精简池申请大于或等于所述连续的逻辑地 址所能写入数据的长度的存储空间, 在得到精简池分配的存储空间的信息后, 将待写入数据写入相应存储空间中。 The method for writing data shown in FIG. 1 is, after receiving a command requesting to write data, determining whether the thin pool storage space is completely allocated to the logical address of the LU to be written, and if so, directly to be written The data is written into the allocated storage space. If not, it is determined that the logical address is not allocated to the Fi pool, and the address is 0. An integer multiple of a minimum storage unit, applying to the thin pool for a storage space that is greater than or equal to a length of data that can be written by the consecutive logical addresses, and after being obtained by the information of the storage space allocated by the thin pool, is to be written The data is written to the corresponding storage space.
现有精简配置系统的精简池是以自身固定的分配粒度分配存储空间, 且为 综合大数据业务和小数据业务的需求, 固定分配粒度的取值较为适中 (通常为 兆级) , 因此存在浪费系统资源, 系统资源利用率低的现象, 具体的:  The thin pool of the existing thin provisioning system allocates storage space with its own fixed allocation granularity, and the demand for the integrated big data service and the small data service is relatively moderate (usually mega-level), so there is waste. System resources, low system resource utilization, specific:
( 1 )固定分配粒度相对于小数据业务而言过大; 由于精简 LUN只能以精 简池预定固定分配粒度的正整数倍申请存储空间, 那么对于小数据业务, 如银 行的储户资料数据库等, 精简 LUN所申请的最小存储空间 (一个固定分配粒 度的存储空间)相对于主机下发的待写入数据也大很多, 这就造成精简池分配 的存储空间无法合理利用, 存在浪费精简池存储资源的情况;  (1) The fixed allocation granularity is too large compared to the small data service; since the thin LUN can only apply for storage space with a positive integer multiple of the fixed allocation granularity of the thin pool, then for small data services, such as the bank's depositor database, The minimum storage space (a storage space with a fixed allocation granularity) applied by the thin LUN is also much larger than the data to be written by the host. This causes the storage space allocated by the thin pool to be reasonably utilized, and there is a waste of thin pool storage resources. Case;
( 2 )对于大数据业务所分配的存储空间, 需使用多个映射标记进行记录; 对于大数据业务, 如视频库等, 精简 LU 申请的分配空间为所述固定分配粒 度的多倍, 则需要使用多个映射标记对该大存储需求业务进行记录, 这就造成 系统内存资源的浪费。  (2) For the storage space allocated by the big data service, multiple mapping tags are used for recording; for big data services, such as video libraries, etc., the allocation space of the reduced LU application is multiple of the fixed allocation granularity, and The large storage requirement service is recorded by using multiple mapping tags, which causes waste of system memory resources.
而本发明取消了现有技术中的精简池固定分配粒度, 以存储器所能提供的 最小存储单元的整数倍大小, 向精简池申请存储空间, 由于申请的存储空间是 以存储器所能提供的最小存储单元为基础, 因此可以使得申请到的精简池中的 存储空间无限接近于数据所需的存储空间大小,尽量避免精简池中系统资源的 浪费; 其次, 精简池分配出的存储空间作为精简池的一个整体分配粒度, 不再 以现有技术的精简池固定分配粒度进行区分, 使得待写入精简 LU 的逻辑地 址, 与其在精简池上对应的物理地址, 可以一个映射标记的形式记录在映射表 中, 节省了内存资源。 本发明解决了现有精简配置系统由于精简池以自身固定 的分配粒度分配存储空间,而造成的浪费系统资源、系统资源利用率低的问题, 实现了系统资源的有效利用。 图 1所示步骤 S200中判断是否给所述待写入精简 LU 的逻辑地址完全分 配精简池存储空间, 可以通过检测所述待写入精简 LU 的逻辑地址在映射表 中的记录情况来实现, 具体方法可如图 2所示, 该方法包括步骤: However, the present invention eliminates the fixed allocation granularity of the thin pool in the prior art, and applies the storage space to the thin pool by the integer multiple of the minimum storage unit that the memory can provide, since the applied storage space is the minimum that the storage can provide. The storage unit is based on the storage unit, so that the storage space in the thin pool can be infinitely close to the storage space required by the data, and the waste of system resources in the thin pool is avoided as much as possible. Secondly, the storage space allocated by the thin pool is used as the thin pool. An overall allocation granularity is no longer distinguished by the prior art thin pool fixed allocation granularity, so that the logical address to be written into the thin LU, and the physical address corresponding to the thin pool, can be recorded in the mapping table in the form of a mapping mark. Medium, saving memory resources. The invention solves the problem that the existing thin provisioning system allocates storage space by using the fixed allocation granularity of the thin pool, and wastes system resources and system resource utilization, thereby realizing effective utilization of system resources. In step S200, it is determined whether the thin pool storage space is completely allocated to the logical address of the LU to be written, which can be implemented by detecting the record of the logical address of the LU to be written in the mapping table. The specific method can be as shown in FIG. 2, and the method includes the following steps:
步骤 S210、检测所述待写入精简 LUN的逻辑地址在所述映射表中的记录; 步骤 S220、若所述待写入精简 LU 的逻辑地址完全记录在所述映射表中, 则判定已经给所述待写入精简 LUN的逻辑地址完全分配精简池存储空间; 步骤 S230、 若所述待写入精简 LU 的逻辑地址部分或没有记录在所述映 射表中, 则判定未给所述待写入精简 LUN的逻辑地址完全分配精简池存储空 间。  Step S210, detecting a record of the logical address to be written into the thin LUN in the mapping table; Step S220, if the logical address of the to-be-written thin LU is completely recorded in the mapping table, determining that the given The logical address of the to-be-written thin LUN is completely allocated to the thin pool storage space; step S230, if the logical address portion of the to-be-written thin LU is not recorded in the mapping table, it is determined that the to-be-written is not given The logical address of the thin LUN is completely allocated to the thin pool storage space.
图 1所示步骤 S400中确定所述逻辑地址中, 未被分配精简池存储空间的 连续的逻辑地址所能写入数据的长度的具体方法可依如下所述:  The specific method for determining the length of the data that can be written by the consecutive logical addresses of the thin pool storage space in the logical address in step S400 shown in FIG. 1 can be as follows:
对于未给所述待写入精简 LUN的逻辑地址分配精简池存储空间的情况, 即所述待写入精简 LUN的逻辑地址完全未分配精简池存储空间, 则所述未被 分配精简池存储空间的连续的逻辑地址所能写入数据的长度为所述请求写入 数据的命令中的待写入数据的长度;  For the case where the thin pool storage space is not allocated to the logical address to be written to the thin LUN, that is, the logical address of the to-be-written thin LUN is completely unallocated with the thin pool storage space, the unallocated thin pool storage space is not allocated. The length of the data that can be written by the consecutive logical addresses is the length of the data to be written in the command for writing the requested data;
对于未完全给所述待写入精简 LUN的逻辑地址分配精简池存储空间的情 况, 即所述待写入精简 LUN的逻辑地址部分分配精简池存储空间部分分配, 需对整个待写入数据进行拆分, 具体可以为: 以已分配存储空间对应的逻辑连 续地址为拆分点, 对所述待写入精简 LU 的逻辑地址进行拆分, 拆分后的所 述待写入精简 LUN的逻辑地址包括: 已被分配存储空间的连续的逻辑地址和 未被分配存储空间的连续的逻辑地址, 其中, 已被分配存储空间的连续的逻辑 地址在映射表中存在记录, 未被分配存储空间的连续的逻辑地址在映射表中不 存在记录; 计算拆分后的未被分配存储空间的连续的逻辑地址所能写入数据的 长度, 具体计算方法可参照现有的数据长度计算方法, 此处不再赘述; 将拆分 后的未被分配精简池存储空间的连续的逻辑地址所能写入数据的长度确定为 For the case where the thin pool storage space is not completely allocated to the logical address to be written to the thin LUN, that is, the logical address portion of the thin LUN to be written is allocated the thin pool storage space portion allocation, and the entire data to be written needs to be performed. The splitting may be performed by: splitting a logical address to be written into the reduced LU by using a logical contiguous address corresponding to the allocated storage space, and splitting the logical logic to be written into the thin LUN after the splitting The address includes: a contiguous logical address to which the storage space has been allocated and a contiguous logical address to which the storage space is not allocated, wherein the contiguous logical address to which the storage space has been allocated has a record in the mapping table, and the storage space is not allocated The continuous logical address does not have a record in the mapping table; the length of the data that can be written by the continuous logical address of the unallocated storage space after the split is calculated, and the specific calculation method can refer to the existing data length calculation method, where No more details; the split logical address of the unallocated pool storage space can be written to the data Degree is determined to be
^ ^ ^商 旮 H ^ I'曰" 1 ^ i车 ^ ^ ^ ^ ϋ斤 ^ ^入 H 对于未完全给所述待写入精简 LUN的逻辑地址分配精简池存储空间的情 况, 由于拆分后的所述待写入精简 LUN的逻辑地址包括: 已被分配存储空间 的连续的逻辑地址和未被分配存储空间的连续的逻辑地址, 因此图 1所示步骤 S500在将所述未被分配存储空间的连续的逻辑地址对应的数据写入,精简池分 配的存储空间的同时, 还可以包括步骤: ^ ^ ^商旮H ^ I'曰" 1 ^ i car ^ ^ ^ ^ ϋ金 ^ ^ into H For the case where the thin pool storage space is not completely allocated to the logical address to be written to the thin LUN, the logical address of the thin LUN to be written after the split includes: a continuous logical address of the allocated storage space and The contiguous logical address of the storage space is not allocated. Therefore, the step S500 shown in FIG. 1 may be used to write the data corresponding to the consecutive logical addresses of the unallocated storage space, and may also include the storage space allocated by the pool. step:
将已被分配存储空间的连续的逻辑地址所对应的待写入数据, 写入已分配 的存储空间中。  The data to be written corresponding to the consecutive logical addresses of the allocated storage space is written into the allocated storage space.
图 1所示步骤 S500之后还可以包括步骤:  Step S500 shown in FIG. 1 may further include the steps:
将所述待写入精简 LUN的逻辑地址, 与其在精简池上对应的物理地址, 以映射标记的形式记录在映射表中;  The logical address to be written into the thin LUN is recorded in the mapping table in the form of a mapping mark corresponding to the physical address corresponding to the thin pool;
优选的, 可以一个映射标记的形式记录。  Preferably, it can be recorded in the form of a mapping mark.
发明人在对本发明的实践过程中发现, 以存储器所能提供的最 d、存储单元 的整数倍大小, 向所述精简池申请大于或等于, 所述连续的逻辑地址所能写入 数据的长度的存储空间, 可以优选为: 以存储器扇区的 2的幂次方倍, 向精简 池申请大于或等于所述连续的逻辑地址所能写入数据的长度的存储空间。这样 的数值设置以通用的二进制数据记录方式为基础, 因此相对于现有的存储而 言, 如硬盘等, 可以较为便捷的记录数据。  During the practice of the present invention, the inventors have found that, in the case of the most d, the integer multiple of the storage unit, the memory can apply to the thin pool for greater than or equal to the length of the data that can be written by the consecutive logical addresses. The storage space may be preferably: a storage space that is greater than or equal to the length of data that can be written by the consecutive logical addresses is applied to the thin pool by a power of two of the memory sectors. Such numerical settings are based on a common binary data recording method, so that data can be recorded more conveniently than existing storage, such as a hard disk.
本发明以存储器所能提供的最小存储单元的整数倍大小, 向精简池申请存 储空间, 相对于小数据业务, 本发明可将一个存储器所能提供的最小存储单元 分配给该小数据业务, 从而最大限度的提高存储空间利用率, 相对于现有的精 简池兆级固定分配粒度而言, 本发明可极大的减少精简池在小数据业务方面所 浪费的空间。  The present invention applies the storage space to the thin pool by an integer multiple of the minimum storage unit that the memory can provide. Compared with the small data service, the present invention can allocate a minimum storage unit that can be provided by a memory to the small data service, thereby Maximize the utilization of storage space. Compared with the existing thin pool mega-level fixed allocation granularity, the present invention can greatly reduce the space wasted by the thin pool in small data services.
本发明卸除了设置于精简池的固定分配粒度,精简池分配的存储空间不再 以现有的固定分配粒度分段, 而是将精简池分配出的存储空间作为精简池的一 个整体分配粒度, 分配完整的存储空间, 从而使得本发明映射表中的一个映射
Figure imgf000010_0001
映射标记的使用数目, 避免了系统内存资源的浪费。
The present invention removes the fixed allocation granularity set in the thin pool, and the storage space allocated by the thin pool is no longer segmented by the existing fixed allocation granularity, but the storage space allocated by the thin pool is used as an overall allocation granularity of the thin pool. Allocating a complete storage space, thereby making a mapping in the mapping table of the present invention
Figure imgf000010_0001
The number of mapped tags used avoids wasting system memory resources.
针对上文示出的基于精简配置系统的写入数据的方法, 下文将示出对应的 写入数据的系统。  For the method of writing data based on the thin provisioning system shown above, a corresponding system for writing data will be shown below.
图 3为本发明一种写入数据的系统的结构框图。 参照图 3 , 该系统可以包 括:  3 is a structural block diagram of a system for writing data according to the present invention. Referring to Figure 3, the system can include:
接收模块 100, 用于接收请求写入数据的命令, 所述请求写入数据的命令 包括待写入数据、 所述待写入数据的长度以及待写入精简逻辑单元号 LUN的 逻辑地址;  The receiving module 100 is configured to receive a command for requesting to write data, where the command for writing data includes a data to be written, a length of the data to be written, and a logical address of the LUN to be written into the reduced logical unit number;
判断模块 200,用于判断是否给所述待写入精简 LUN的逻辑地址完全分配 精简池存储空间;  The determining module 200 is configured to determine whether the thin pool storage space is completely allocated to the logical address of the thin LUN to be written;
确定模块 300, 用于在所述判断模块的判断结果为否的情况下, 确定所述 逻辑地址中, 未被分配精简池存储空间的连续的逻辑地址所能写入数据的长 度;  a determining module 300, configured to determine, in a case where the determining result of the determining module is negative, a length of the logical address in which the continuous logical address of the thin pool storage space is not allocated;
申请模块 400, 用于以存储器所能提供的最小存储单元的整数倍大小, 向 所述精简池申请大于或等于所述连续的逻辑地址所能写入数据的长度的存储 空间;  The application module 400 is configured to apply, to the thin pool, a storage space that is greater than or equal to a length of data that can be written by the consecutive logical addresses, in an integer multiple of a minimum storage unit that can be provided by the storage;
存储信息接收模块 500, 用于接收精简池响应所述申请模块的申请所分配 的存储空间的信息;  The storage information receiving module 500 is configured to receive information about a storage space allocated by the thin pool in response to the application of the application module;
写入模块 600, 用于在所述判断模块的判断结果为是的情况下, 将所述待 写入数据写入精简池已分配的存储空间中, 或在所述存储信息接收模块接收到 精简池所分配的存储空间信息后, 将待写入数据写入相应的存储空间中。  The writing module 600 is configured to write the to-be-written data into the allocated storage space of the thin pool if the determination result of the determining module is yes, or receive the streamlining in the storage information receiving module After the storage space information allocated by the pool, the data to be written is written into the corresponding storage space.
其中, 判断模块 200的结构可如图 4所示, 包括:  The structure of the determining module 200 can be as shown in FIG. 4, and includes:
检测单元 210,用于检测所述待写入精简 LUN的逻辑地址在所述映射表中 的记录;  The detecting unit 210 is configured to detect a record of the logical address of the to-be-written thin LUN in the mapping table;
判定单元 220,用于在所述检测单元检测到所述待写入精简 LUN的逻辑地  a determining unit 220, configured to detect, in the detecting unit, the logical place to be written into the thin LUN
^ Η^- , 給所 iz ^g入 f i TJT ^& ^ 完全分配精简池存储空间, 或, 在所述检测单元检测到所述待写入精简 LU 的逻辑地址部分或没有记录在所述映射表中时,判定未给所述待写入精简 LU 的逻辑地址完全分配精简池存储空间。 ^ Η^- , give iz ^g into fi TJT ^& ^ Fully allocating the thin pool storage space, or determining that the logic to be written into the thin LU is not given when the detecting unit detects that the logical address portion of the thin LU to be written is not recorded in the mapping table The address is fully allocated to the thin pool storage space.
确定模块 300的结构可如图 5所示, 包括:  The structure of the determining module 300 can be as shown in FIG. 5, including:
第一确定单元 310,用于在未给所述待写入精简 LUN的逻辑地址分配精简 池存储空间时, 将所述待写入数据的长度确定为, 所述未被分配精简池存储空 间的连续的逻辑地址所能写入数据的长度;  The first determining unit 310 is configured to determine, when the thin pool storage space is not allocated to the logical address to be written into the thin LUN, the length of the data to be written is determined, where the thin pool storage space is not allocated. The length of data that can be written by consecutive logical addresses;
拆分单元 320,用于在未完全给所述待写入精简 LUN的逻辑地址分配精简 池存储空间, 以已分配存储空间对应的逻辑地址为拆分点, 对所述待写入精简 LU 的逻辑地址进行拆分;  The splitting unit 320 is configured to allocate a thin pool storage space to the logical address of the to-be-written thin LUN, and use a logical address corresponding to the allocated storage space as a split point for the to-be-written LU The logical address is split;
第二确定单元 330, 用于将拆分后的未被分配精简池存储空间的连续的逻 辑地址所能写入数据的长度确定为, 所述未被分配精简池存储空间的连续的逻 辑地址所能写入数据的长度。  The second determining unit 330 is configured to determine, according to the length of the split logical address that is not allocated the thin pool storage space, data that can be written into the continuous logical address of the unallocated thin pool storage space. The length of data that can be written.
写入模块 600还可以用于,将拆分单元 320拆分后的已分配存储空间的连 续的逻辑地址, 所对应的数据, 写入已分配存储空间中。  The write module 600 can also be used to write the consecutive logical addresses of the allocated storage space after the split unit 320 is split, and the corresponding data is written into the allocated storage space.
申请模块 400的结构可如图 6所示, 包括:  The structure of the application module 400 can be as shown in FIG. 6, and includes:
预定义单元 410,用于预先定义所述精简 LU 分配粒度的最小值,所述分 配粒度的最小值为所述存储器所能提供的最小存储单元的大小;  a predefined unit 410, configured to pre-define a minimum value of the reduced LU allocation granularity, where a minimum value of the allocated granularity is a size of a minimum storage unit that the memory can provide;
申请单元 420,用于以所述预定义单元定义的所述精简 LUN分配粒度的最 小值的正整数倍为单位, 向所述精简池申请大于或等于所述连续的逻辑地址所 能写入数据的长度的存储空间, 所述申请的精简池的存储空间的大小与所述待 写入数据的长度之间的差值小于预设阔值。  The application unit 420 is configured to apply, to the thin pool, a data that is greater than or equal to the consecutive logical addresses, in a unit of a positive integer multiple of a minimum value of the reduced LUN allocation granularity defined by the predefined unit. The storage space of the length, the difference between the size of the storage space of the thin pool of the application and the length of the data to be written is less than a preset threshold.
图 7为本发明实施例所提供的写入数据的系统的另一结构框图。 结合图 3 和图 7所示系统, 图 7所示系统还包括:  FIG. 7 is another structural block diagram of a system for writing data according to an embodiment of the present invention. In conjunction with the systems shown in Figures 3 and 7, the system of Figure 7 further includes:
映射表模块 700,用于将所述待写入精简 LU 的逻辑地址,与其在精简池 上文示出了本发明基于精简配置的写入数据的系统的软件模块组成, 需要 说明的是, 本发明的写入数据的系统也可以硬件形式存在, 下面将列举几个本 发明写入数据的系统的硬件形态的实施例。 a mapping table module 700, configured to: write the logical address of the reduced LU to be in a thin pool The software module composition of the system for writing data based on the thin configuration of the present invention is shown above. It should be noted that the system for writing data of the present invention may also exist in hardware form, and several write data of the present invention will be listed below. An embodiment of the hardware form of the system.
图 8为本发明实施例所提供的写入数据的系统的硬件架构图,共同参照图 7和图 8。  FIG. 8 is a hardware architecture diagram of a system for writing data according to an embodiment of the present invention, with reference to FIG. 7 and FIG.
接口模块 100可以接口 01的形式存在, 将接收的请求写入数据的命令存 入第一数据库 02中;  The interface module 100 can exist in the form of interface 01, and the received command to write data is stored in the first database 02;
第一数据库 02存储所述请求写入数据的命令;  The first database 02 stores the command to request to write data;
第一处理器 03为内置有判断模块 200和确定模块 300功能软件的处理器, 第一处理器 03提取第一取数据库 02中存储的接收请求写入数据的命令, 判断 是否给所述待写入精简 LUN的逻辑地址完全分配精简池存储空间, 在判断结 果为否时, 确定所述逻辑地址中, 未被分配精简池存储空间的连续的逻辑地址 所能写入数据的长度, 其中涉及到对数据的拆分时, 第一处理器 03可将拆分 后的待写入数据再存放入第一数据库 02中;  The first processor 03 is a processor that has the built-in function of the determining module 200 and the determining module 300. The first processor 03 extracts a command for receiving the request to write data stored in the first fetch database 02, and determines whether to write the to-be-written. The logical address of the thin LUN is completely allocated to the thin pool storage space. When the judgment result is no, the length of the data that can be written by the continuous logical address of the thin pool storage space is determined in the logical address, which involves When splitting the data, the first processor 03 may store the split data to be written into the first database 02;
精简 LUN 04内置有申请模块 400的功能, 其以存储器所能提供的最小存 储单元的整数倍大小, 向所述精简池申请大于或等于, 所述连续的逻辑地址所 能写入数据的长度的存储空间;  The compact LUN 04 has a built-in function of the application module 400, which applies an integer multiple of the minimum storage unit that the memory can provide, to the thin pool, which is greater than or equal to the length of the data that can be written by the consecutive logical addresses. storage;
精简池 05响应精简 LUN 04的申请,分配相应的存储空间,发送关于分配 存储空间位置与大小的信息;  Thin pool 05 responds to the LUN 04 application, allocates the corresponding storage space, and sends information about the location and size of the allocated storage space;
存储信息接收模块 500 的功能可以软件形式内置在输入装置 06, 或精简 LU 04中;  The function of the storage information receiving module 500 can be built in the form of software in the input device 06, or in the LU-24;
输入装置 06内置有写入模块 600功能的软件, 当其还内置有存储信息接 收模块 500功能的软件时, 可直接提取第一数据库 02中存储的相应待写入数 据, 将其写入精简池分配的存储空间中; 当存储信息接收模块 500的功能设置 在其他硬件设备中时, 如精简 LU 04, 可通过获取其他硬件设备转发的分配 ^ i^ , , ^^- ^ - 0?. 储 ό 4目 入翁据, 将 fc 入 精简池分配的存储空间中; The input device 06 has built-in software for writing the function of the module 600. When it also has software for storing the function of the information receiving module 500, the corresponding data to be written stored in the first database 02 can be directly extracted and written into the thin pool. In the allocated storage space; when the function of the storage information receiving module 500 is set in other hardware devices, such as streamlining LU 04, the allocation of other hardware devices can be obtained by transferring ^ i^ , , ^^- ^ - 0?. ό 4 eyes into the data, will fc into Thin storage space allocated by the pool;
第二数据库 07内置有映射表模块 700功能的软件, 第二数据库 07包括由 多个映射标记组成的映射表, 可将精简池分配的存储空间在所述精简池上对应 的物理地址, 与在精简逻辑单元 LUN上对应的逻辑地址, 以一个映射标记的 形式记录在其内的映射表中;  The second database 07 has built-in software for mapping the function of the table module 700, and the second database 07 includes a mapping table composed of a plurality of mapping tags, which can allocate the storage space allocated by the thin pool to the corresponding physical address on the thin pool, and The corresponding logical address on the logical unit LUN is recorded in a mapping table in the form of a mapping mark;
需要说明地是, 接口 01与第一数据库 02可以进行整合, 如以现有技术的 生产卷形式出现。  It should be noted that the interface 01 and the first database 02 can be integrated, as in the form of a production volume of the prior art.
图 9为本发明写入数据的系统的另一硬件架构图, 参照图 7和图 9。  Figure 9 is another hardware architecture diagram of the system for writing data according to the present invention, with reference to Figures 7 and 9.
生产卷 012接收主机下发的请求写入数据的命令;  The production volume 012 receives a command sent by the host to write data;
第一处理器 03为内置有判断模块 200和确定模块 300功能软件的处理器, 从生成卷 012中提取请求写入数据的命令, 进行相应的处理;  The first processor 03 is a processor with built-in judgment module 200 and determination module 300 function software, and extracts a command for requesting write data from the generated volume 012, and performs corresponding processing;
精简 LU 04同时内置有申请模块 400功能的软件,存储信息接收模块 500 功能的软件, 和写入模块 600功能的软件;  The LU 04 has built-in software for applying the function of the module 400, software for storing the function of the information receiving module 500, and software for writing the function of the module 600;
精简池 05响应精简 LUN 04的申请,分配相应的存储空间,并发送关于分 配存储存储的信息;  Thin pool 05 responds to the LUN 04 application, allocates the corresponding storage space, and sends information about the allocation storage storage;
第二数据库 07内置有映射表模块 700的功能, 第二数据库 07包括由多个 映射标记组成的映射表。  The second database 07 has a built-in function of the mapping table module 700, and the second database 07 includes a mapping table composed of a plurality of mapping tags.
需要说明地是, 图 8和图 9所示出的硬件架构图, 只是本发明硬件架构的 优选方式, 其不应成为对本发明硬件架构体系的限制。 本领域技术人员完全能 够通过本发明具体实施方式所给出的技术启示, 结合所示出的相应软件原理与 硬件组成, 对本发明的软件与硬件做出相应的变形与整合, 而得出相似或相应 的软件与硬件, 值得说明地是, 该变形与整合并不脱离本发明的技术思想, 也 应在本发明的保护范围。  It should be noted that the hardware architecture diagrams shown in FIG. 8 and FIG. 9 are only preferred manners of the hardware architecture of the present invention, and should not be a limitation on the hardware architecture system of the present invention. Those skilled in the art can fully modify and integrate the software and hardware of the present invention by the technical revelation given by the specific embodiments of the present invention, and the corresponding software principles and hardware components shown. Corresponding software and hardware, it should be noted that the modifications and integrations do not depart from the technical idea of the present invention and are also within the scope of the present invention.
本说明书中各个实施例釆用递进的方式描述,每个实施例重点说明的都是 与其他实施例的不同之处, 各个实施例之间相同相似部分互相参见即可。 对于
Figure imgf000014_0001
简单, 相关之处参见方法部分说明即可。
The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same similar parts between the various embodiments may be referred to each other. for
Figure imgf000014_0001
Simple, see the method section for details.
专业人员还可以进一步意识到, 结合本文中所公开的实施例描述的各示例 的单元及算法步骤, 能够以电子硬件、 计算机软件或者二者的结合来实现, 为 了清楚地说明硬件和软件的可互换性, 在上述说明中已经按照功能一般性地描 述了各示例的组成及步骤。 这些功能究竟以硬件还是软件方式来执行, 取决于 技术方案的特定应用和设计约束条件。 专业技术人员可以对每个特定的应用来 使用不同方法来实现所描述的功能, 但是这种实现不应认为超出本发明的范 围。  A person skilled in the art will further appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both, in order to clearly illustrate the hardware and software. Interchangeability, the composition and steps of the various examples have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处 理器执行的软件模块, 或者二者的结合来实施。 软件模块可以置于随机存储器 The steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented directly in hardware, a software module executed by a processor, or a combination of both. Software modules can be placed in random access memory
( RAM )、 内存、只读存储器( ROM )、 电可编程 ROM、电可擦除可编程 ROM、 寄存器、 硬盘、 可移动磁盘、 CD-ROM、 或技术领域内所公知的任意其它形式 的存储介质中。 (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage known in the art. In the medium.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本 发明。 对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见 的, 本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下, 在 其它实施例中实现。 因此, 本发明将不会被限制于本文所示的这些实施例, 而 是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。  The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments are obvious to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded to the broadest scope of the principles and novel features disclosed herein.

Claims

权利要求 Rights request
1、 一种写入数据的方法, 其特征在于, 包括: A method for writing data, comprising:
接收请求写入数据的命令, 所述请求写入数据的命令包括待写入数据、 所述待写入数据的长度以及待写入精简逻辑单元号 LUN的逻辑地址;  Receiving a command to request to write data, where the command to write data includes a to-be-written data, a length of the data to be written, and a logical address to be written into the reduced logical unit number LUN;
判断是否给所述待写入精简 LU 的逻辑地址完全分配精简池存储空 间;  Determining whether the thin pool storage space is completely allocated to the logical address to be written to the thin LU;
若是, 则将所述待写入数据写入精简池已分配的存储空间中; 若否, 确定所述逻辑地址中, 未被分配精简池存储空间的连续的逻辑 地址所能写入数据的长度, 以存储器所能提供的最小存储单元的整数倍大 小, 向所述精简池申请大于或等于所述连续的逻辑地址所能写入数据的长 度的存储空间;  If yes, the data to be written is written into the allocated storage space of the thin pool; if not, the length of the data that can be written by the consecutive logical addresses of the reduced pool storage space in the logical address is determined. Applying, to the thin pool, a storage space that is greater than or equal to a length of data that can be written by the consecutive logical addresses, in an integer multiple of a minimum storage unit that the memory can provide;
接收精简池响应上述申请所分配的存储空间的信息, 将待写入数据写 入相应的存储空间中。  The receiving thin pool responds to the information about the storage space allocated by the above application, and writes the data to be written into the corresponding storage space.
2、 根据权利要求 1所述的方法, 其特征在于, 还包括:  2. The method according to claim 1, further comprising:
将所述待写入精简 LUN的逻辑地址,与其在精简池上对应的物理地址, 以映射标记的形式记录在映射表中。  The logical address to be written into the thin LUN is recorded in the mapping table in the form of a mapping mark corresponding to the physical address corresponding to the thin pool.
3、 根据权利要求 2所述的方法, 其特征在于, 所述判断是否给所述待 写入精简 LUN的逻辑地址完全分配精简池存储空间包括:  The method according to claim 2, wherein the determining whether to completely allocate the thin pool storage space to the logical address to be written into the thin LUN comprises:
检测所述待写入精简 LU 的逻辑地址在所述映射表中的记录; 若所述待写入精简 LUN的逻辑地址完全记录在所述映射表中, 则判定 已经给所述待写入精简 LUN的逻辑地址完全分配精简池存储空间;  Detecting a record of the logical address to be written into the reduced LU in the mapping table; if the logical address of the to-be-written thin LUN is completely recorded in the mapping table, determining that the to-be-written is simplified The logical address of the LUN is completely allocated to the thin pool storage space;
若所述待写入精简 LU 的逻辑地址部分或没有记录在所述映射表中, 则判定未给所述待写入精简 LU 的逻辑地址完全分配精简池存储空间。  If the logical address portion of the to-be-written LU is not recorded in the mapping table, it is determined that the thin pool storage space is not completely allocated to the logical address of the LU to be written.
4、 根据权利要求 1、 2或 3所述的方法, 其特征在于, 所述确定所述 逻辑地址中, 未被分配精简池存储空间的连续的逻辑地址所能写入数据的 长度包括: The method according to claim 1, 2 or 3, wherein the determining, in the logical address, that a continuous logical address of the thin pool storage space is not allocated can write data The length includes:
若未给所述待写入精简 LUN的逻辑地址分配精简池存储空间, 则所述 未被分配精简池存储空间的连续的逻辑地址所能写入数据的长度为所述待 写入数据的长度;  If the thin pool storage space is not allocated to the logical address to be written into the thin LUN, the length of the data that can be written by the consecutive logical addresses of the unallocated thin pool storage space is the length of the data to be written. ;
若未完全给所述待写入精简 LU 的逻辑地址分配精简池存储空间, 则 以已被分配存储空间对应的逻辑地址为拆分点, 对所述待写入精简 LUN的 逻辑地址进行拆分, 则所述未被分配精简池存储空间的连续的逻辑地址所 能写入数据的长度为拆分后的未被分配精简池存储空间的连续的逻辑地址 所能写入数据的长度。  If the thin pool storage space is not completely allocated to the logical address to be written into the thin LU, the logical address corresponding to the allocated storage space is used as a split point, and the logical address to be written into the thin LUN is split. Then, the length of the data that can be written by the consecutive logical addresses of the unallocated pool storage space is the length of the data that can be written by the consecutive logical addresses of the split thin pool storage space.
5、 根据权利要求 1所述的方法, 其特征在于, 所述以存储器所能提供 的最小存储单元的整数倍大小向所述精简池申请大于或等于所述连续的逻 辑地址所能写入数据的长度的存储空间包括:  The method according to claim 1, wherein the applying to the thin pool by the integer multiple of a minimum storage unit that can be provided by the memory is greater than or equal to the continuous logical address. The length of storage space includes:
预先定义所述精简 LU 分配粒度的最小值, 所述分配粒度最小值为所 述存储器所能提供的最小存储单元的大小;  Defining a minimum value of the reduced LU allocation granularity, the minimum of the allocated granularity being a minimum storage unit size that the memory can provide;
以所述精简 LUN分配粒度的最小值的整数倍为单位, 向所述精简池申 请大于或等于所述连续的逻辑地址所能写入数据的长度的存储空间, 所述 申请的精简池的存储空间的大小与所述待写入数据的长度之间的差值小于 预设阔值。  Applying, to the thin pool, a storage space that is greater than or equal to a length of data that can be written by the consecutive logical addresses, in units of integer multiples of the minimum value of the thin LUN allocation granularity, the thin pool storage of the application The difference between the size of the space and the length of the data to be written is less than a preset threshold.
6、 一种写入数据的系统, 其特征在于, 包括:  6. A system for writing data, comprising:
接收模块, 用于接收请求写入数据的命令, 所述请求写入数据的命令 包括待写入数据、 所述待写入数据的长度以及待写入精简逻辑单元号 LU 的逻辑地址;  a receiving module, configured to receive a command for requesting to write data, where the command for writing data includes a data to be written, a length of the data to be written, and a logical address to be written into the reduced logical unit number LU;
判断模块, 用于判断是否给所述待写入精简 LU 的逻辑地址完全分配 精简池存储空间;  a judging module, configured to determine whether the thin pool storage space is completely allocated to the logical address to be written into the thin LU;
确定模块, 用于在所述判断模块的判断结果为否的情况下, 确定所述 逻辑地址中, 未被分配精简池存储空间的连续的逻辑地址所能写入数据的 长度; a determining module, configured to determine, in the case that the determining result of the determining module is negative, that the logical address that is not allocated the thin pool storage space can be written by the logical address Length
申请模块, 用于以存储器所能提供的最小存储单元的整数倍大小, 向 所述精简池申请大于或等于所述连续的逻辑地址所能写入数据的长度的存 储空间;  An application module, configured to apply, to the thin pool, a storage space that is greater than or equal to a length of data that can be written by the consecutive logical addresses, by an integer multiple of a minimum storage unit that can be provided by the storage;
存储信息接收模块, 用于接收精简池响应所述申请模块的申请所分配 的存储空间的信息;  a storage information receiving module, configured to receive information about a storage space allocated by the thin pool in response to the application of the application module;
写入模块, 用于在所述判断模块的判断结果为是的情况下, 将所述待 写入数据写入精简池已分配的存储空间中, 或在所述存储信息接收模块接 收到精简池所分配的存储空间信息后, 将待写入数据写入相应的存储空间 中。  a writing module, configured to write the to-be-written data into the allocated storage space of the thin pool, or receive the thin pool in the storage information receiving module, if the determination result of the determining module is yes After the allocated storage space information, the data to be written is written into the corresponding storage space.
7、 根据权利要求 6所述的系统, 其特征在于, 还包括:  7. The system according to claim 6, further comprising:
映射表模块, 用于将所述待写入精简 LUN的逻辑地址, 与其在精简池 上的对应的物理地址 , 以映射标记的形式记录在映射表中。  The mapping table module is configured to record the logical address to be written into the thin LUN and the corresponding physical address on the thin pool in a mapping form in the mapping table.
8、 根据权利要求 7所述的系统, 其特征在于, 所述判断模块包括: 检测单元, 用于检测所述待写入精简 LUN的逻辑地址在所述映射表中 的记录;  The system according to claim 7, wherein the determining module comprises: a detecting unit, configured to detect a record of the logical address of the to-be-written thin LUN in the mapping table;
判定单元, 用于在所述检测单元检测到所述待写入精简 LUN的逻辑地 址完全记录在所述映射表中时, 判定已经给所述待写入精简 LU 的逻辑地 址完全分配精简池存储空间, 或, 在所述检测单元检测到所述待写入精简 LU 的逻辑地址部分或没有记录在所述映射表中时, 判定未给所述待写入 精简 LU 的逻辑地址完全分配精简池存储空间。  a determining unit, configured to: when the detecting unit detects that the logical address of the to-be-written thin LUN is completely recorded in the mapping table, determine that the logical address of the to-be-written thin LU has been completely allocated to the thin pool storage Space, or, when the detecting unit detects that the logical address portion of the LU to be written is not recorded in the mapping table, determines that the thin pool of the logical address to be written into the thin LU is not completely allocated. storage.
9、 根据权利要求 6、 7或 8所述的系统, 其特征在于, 所述确定模块 包括:  9. The system of claim 6, 7 or 8, wherein the determining module comprises:
第一确定单元, 用于在未给所述待写入精简 LU 的逻辑地址分配精简 池存储空间时, 将所述待写入数据的长度确定为, 所述未被分配精简池存 储空间的连续的逻辑地址所能写入数据的长度; 拆分单元, 用于在未完全给所述待写入精简 LU 的逻辑地址分配精简 池存储空间时, 以已分配存储空间对应的逻辑地址为拆分点, 对所述待写 入精简 LUN的逻辑地址进行拆分; a first determining unit, configured to determine, when the thin pool storage space is not allocated to the logical address to be written into the thin LU, the length of the data to be written is, the continuous storage space of the unallocated thin pool The length of the data that can be written to the logical address; a splitting unit, configured to: when a thin pool storage space is not completely allocated to the logical address to be written into the thin LU, use a logical address corresponding to the allocated storage space as a split point, and the thin LUN to be written The logical address is split;
第二确定单元, 用于将拆分后的未被分配精简池存储空间的连续的逻 辑地址所能写入数据的长度确定为, 所述未被分配精简池存储空间的连续 的逻辑地址所能写入数据的长度。  a second determining unit, configured to determine, by using a consecutive logical address of the split logical storage address that is not allocated the thin pool storage space, a continuous logical address that is not allocated the thin pool storage space The length of the data written.
10、 根据权利要求 6所述的系统, 其特征在于, 所述申请模块包括: 预定义单元, 用于预先定义所述精简 LUN分配粒度的最小值, 所述分 配粒度的最小值为所述存储器所能提供的最小存储单元的大小;  The system according to claim 6, wherein the application module includes: a predefined unit, configured to pre-define a minimum value of the granularity of the thin LUN allocation, where a minimum value of the allocated granularity is the memory The size of the smallest memory unit that can be provided;
申请单元,用于以所述预定义单元定义的所述精简 LUN分配粒度的 最小值的正整数倍为单位, 向所述精简池申请大于或等于所述连续的逻 辑地址所能写入数据的长度的存储空间, 所述申请的精简池的存储空间 的大小与所述待写入数据的长度之间的差值小于预设阔值。  An application unit, configured to apply, to the thin pool, a data that is greater than or equal to the continuous logical address and can write data by using a positive integer multiple of a minimum value of the thin LUN allocation granularity defined by the predefined unit. The storage space of the length, the difference between the size of the storage space of the thin pool of the application and the length of the data to be written is less than a preset threshold.
PCT/CN2013/071975 2012-04-01 2013-02-28 Method and system for writing data WO2013149524A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210095935.3 2012-04-01
CN201210095935.3A CN102650931B (en) 2012-04-01 2012-04-01 Method and system for writing data

Publications (1)

Publication Number Publication Date
WO2013149524A1 true WO2013149524A1 (en) 2013-10-10

Family

ID=46692940

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/071975 WO2013149524A1 (en) 2012-04-01 2013-02-28 Method and system for writing data

Country Status (2)

Country Link
CN (1) CN102650931B (en)
WO (1) WO2013149524A1 (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102650931B (en) * 2012-04-01 2015-07-08 华为技术有限公司 Method and system for writing data
CN103793386B (en) 2012-10-29 2017-12-12 腾讯科技(深圳)有限公司 The method and system of data processing
CN104915146A (en) * 2014-03-14 2015-09-16 中兴通讯股份有限公司 Resource distribution method and device based on automatic thin provisioning
CN104407936B (en) * 2014-11-18 2017-08-18 华为数字技术(成都)有限公司 A kind of data snapshot method and device
CN105786724B (en) * 2014-12-24 2018-12-25 华为技术有限公司 Space management and device
WO2016127291A1 (en) * 2015-02-09 2016-08-18 华为技术有限公司 Memory management device and method
CN106326132B (en) * 2015-06-29 2020-03-27 华为技术有限公司 Storage system, storage management device, memory, hybrid storage device, and storage management method
CN105049178A (en) * 2015-07-23 2015-11-11 柳州易旺科技有限公司 Multi-user information screening method
WO2017107015A1 (en) * 2015-12-21 2017-06-29 华为技术有限公司 Storage space allocation method, and storage device
CN106897031A (en) * 2017-03-01 2017-06-27 深圳市博信诺达经贸咨询有限公司 It is applied to the storage method and system of big data
CN107122131B (en) * 2017-04-18 2020-08-14 杭州宏杉科技股份有限公司 Thin provisioning method and device
CN107220184B (en) * 2017-05-10 2019-07-09 杭州宏杉科技股份有限公司 A kind of management method and device of LUN storage unit
CN109671458A (en) * 2017-10-17 2019-04-23 联发科技股份有限公司 The method of management flash memory module and relevant flash controller
CN108023963B (en) * 2017-12-15 2019-03-12 北京明朝万达科技股份有限公司 A kind of data processing method and device
CN109669640B (en) * 2018-12-24 2023-05-23 浙江大华技术股份有限公司 Data storage method, device, electronic equipment and medium
CN114185486A (en) * 2021-11-17 2022-03-15 深圳市德明利技术股份有限公司 Data writing method of DRAM (dynamic random Access memory) and DRAM control system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060242378A1 (en) * 2005-04-21 2006-10-26 Yoshiki Kano System and method for managing disk space in a thin-provisioned storage subsystem
US7444489B2 (en) * 2005-05-13 2008-10-28 3Par, Inc. Applications for non-disruptively moving data between logical disk regions in a data storage system
CN101382877A (en) * 2008-10-15 2009-03-11 青岛海信移动通信技术股份有限公司 FAT file data reading/writing method, system and mobile communication terminal
CN101477447A (en) * 2009-01-21 2009-07-08 杭州华三通信技术有限公司 Disk snap method and apparatus
CN101625627A (en) * 2009-08-05 2010-01-13 成都市华为赛门铁克科技有限公司 Data read-in method, disc redundant array and controller thereof
CN101719052A (en) * 2009-12-22 2010-06-02 成都市华为赛门铁克科技有限公司 Method, device and system for writing data
CN102289510A (en) * 2011-08-31 2011-12-21 成都市华为赛门铁克科技有限公司 Method and device for writing data to production volume
CN102650931A (en) * 2012-04-01 2012-08-29 华为技术有限公司 Method and system for writing data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976223B (en) * 2010-10-09 2012-12-12 成都市华为赛门铁克科技有限公司 Thin provisioning method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060242378A1 (en) * 2005-04-21 2006-10-26 Yoshiki Kano System and method for managing disk space in a thin-provisioned storage subsystem
US7444489B2 (en) * 2005-05-13 2008-10-28 3Par, Inc. Applications for non-disruptively moving data between logical disk regions in a data storage system
CN101382877A (en) * 2008-10-15 2009-03-11 青岛海信移动通信技术股份有限公司 FAT file data reading/writing method, system and mobile communication terminal
CN101477447A (en) * 2009-01-21 2009-07-08 杭州华三通信技术有限公司 Disk snap method and apparatus
CN101625627A (en) * 2009-08-05 2010-01-13 成都市华为赛门铁克科技有限公司 Data read-in method, disc redundant array and controller thereof
CN101719052A (en) * 2009-12-22 2010-06-02 成都市华为赛门铁克科技有限公司 Method, device and system for writing data
CN102289510A (en) * 2011-08-31 2011-12-21 成都市华为赛门铁克科技有限公司 Method and device for writing data to production volume
CN102650931A (en) * 2012-04-01 2012-08-29 华为技术有限公司 Method and system for writing data

Also Published As

Publication number Publication date
CN102650931B (en) 2015-07-08
CN102650931A (en) 2012-08-29

Similar Documents

Publication Publication Date Title
WO2013149524A1 (en) Method and system for writing data
US11797180B2 (en) Apparatus and method to provide cache move with non-volatile mass memory system
JP6286478B2 (en) Storage device and storage space allocation method
TWI575377B (en) Storage system with load balancing mechanism and method of operation thereof
US10795599B2 (en) Data migration method, host and solid state disk
CN110633048B (en) Namespace operation method of flash memory storage device
TW201101030A (en) Memory system and mapping methods thereof
AU2012279345B2 (en) Techniques for moving data between memory types
TW202032359A (en) Memory module, method for managing operational state data in said memory module, and host device
CN107533435B (en) Storage space allocation method and storage equipment
WO2013097621A1 (en) Data-tiered storage processing method and device and storage device
WO2017148242A1 (en) Method for accessing shingled magnetic recording (smr) hard disk, and server
US20130036265A1 (en) Method to allow storage cache acceleration when the slow tier is on independent controller
CN103399823A (en) Method, equipment and system for storing service data
KR20150055413A (en) Data storage device
TW202101227A (en) Apparatus and method and computer program product for handling flash physical-resource sets
US20210026781A1 (en) Storage device configurable mapping granularity system
US10019160B2 (en) Controller and data storage device including the same
WO2015135281A1 (en) Resource allocation method and device based on thin provisioning
CN113377278A (en) Solid state disk, garbage recycling and controlling method, equipment, system and storage medium
US20180150257A1 (en) File System Streams Support And Usage
TWI604306B (en) Data management method for data storage device and memory controller
WO2015096002A1 (en) Storage space allocation method, device and controller

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: 13773095

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: 13773095

Country of ref document: EP

Kind code of ref document: A1