WO2019057000A1 - Log writing method, apparatus and system - Google Patents

Log writing method, apparatus and system Download PDF

Info

Publication number
WO2019057000A1
WO2019057000A1 PCT/CN2018/105904 CN2018105904W WO2019057000A1 WO 2019057000 A1 WO2019057000 A1 WO 2019057000A1 CN 2018105904 W CN2018105904 W CN 2018105904W WO 2019057000 A1 WO2019057000 A1 WO 2019057000A1
Authority
WO
WIPO (PCT)
Prior art keywords
log
size
written
data
disk
Prior art date
Application number
PCT/CN2018/105904
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 WO2019057000A1 publication Critical patent/WO2019057000A1/en

Links

Images

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/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • 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
    • 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/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • 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/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device

Definitions

  • the present application relates to the field of storage technologies, and in particular, to a log writing method, apparatus, and system.
  • WAL Write Ahead Log
  • the data is written to the log file on the log disk, and then the data is persisted to the database, so that when the storage system is down, the WAL can be passed.
  • the log is restored to the state before the downtime to avoid data loss.
  • aspects of the present application provide a log writing method, apparatus, and system for improving the efficiency of writing a log.
  • the embodiment of the present application provides a log writing method, including:
  • log entry to be written includes log meta information and log data to be written, where the size of the log data to be written is M times the size of the reference data block, and M is a positive integer;
  • the size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block;
  • N ⁇ M, and N is a positive integer
  • the embodiment of the present application further provides a storage management device, including: a memory, a processor, and a communication component;
  • the memory is configured to store a program
  • the processor is coupled to the memory for executing the program for:
  • log entry to be written includes log meta information and log data to be written, where the size of the log data to be written is M times the size of the reference data block, and M is a positive integer;
  • the size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block;
  • N ⁇ M, and N is a positive integer
  • the communication component is configured to write the N memory blocks into N physical sectors in the log disk starting from the start address.
  • the embodiment of the present application further provides a log-based storage system, including the storage management device, the log disk, and the database provided by the foregoing embodiment; the storage management device is connected to the log disk and the database.
  • the address alignment is combined.
  • the data splicing can splicing the log items to be written into a memory block, so that the log items to be written can be written into the physical sector of the log disk by less IO operations, and the log entries are written to the log disk.
  • the number of IO operations required increases the efficiency of writing log entries to the log disk.
  • FIG. 1 is a schematic structural diagram of a log-based storage system according to an exemplary embodiment of the present application
  • FIG. 2 is a schematic diagram of an alignment state of an address alignment example according to an exemplary embodiment of the present application
  • FIG. 3 is a schematic flowchart of a log writing method according to another exemplary embodiment of the present application.
  • FIG. 4a is a schematic structural diagram of a log writing apparatus according to still another exemplary embodiment of the present application.
  • FIG. 4b is a schematic structural diagram of a storage management device according to another exemplary embodiment of the present application.
  • the solution of the prior art is that the efficiency of writing log data to the log disk is relatively low.
  • the embodiment of the present application provides a solution.
  • the basic principle is that the size of the physical sector in the log disk is greater than or equal to the size of the log metadata. Based on the sum of the size of the reference data block, when writing the log entry to be written to the log disk, the address alignment and data splicing can be used to splicing the log items to be written into memory blocks, so that fewer IO operations can be performed. The number of IO operations required to write log entries to the log disk is reduced in the physical sectors to be written to the log disk, which improves the efficiency of writing log entries to the log disk.
  • FIG. 1 is a schematic structural diagram of a log-based storage system 100 according to an exemplary embodiment of the present application.
  • the storage system 100 includes a storage management device 10, a log disk 20, and a database 30.
  • the storage management device 10 is primarily responsible for the storage control logic of the storage system 100, such as providing read, write, and query functions of the database 30, and the like.
  • the storage management device 10 can be any device having processing capabilities, such as a server, a desktop computer, a personal computer, a mobile phone, a tablet, and the like.
  • the server can be a regular server, a cloud server, a cloud host, a virtual center, and the like.
  • the implementation structure of the storage management device 10 may include a processor, a system bus, and at least one physical storage medium such as a hard disk, a memory, and the like.
  • Database 30 organizes, stores, and manages data in storage system 100 primarily in accordance with a certain data structure.
  • the database 30 can be various types of databases, which is not limited in this embodiment.
  • database 30 can be Oracle, DB2, Sybase, MS SQL Server, Informax, MySQL, and the like.
  • the database 30 may be a network database, a relational database, a hierarchical database, an object-oriented database, or the like.
  • the storage system 100 provided in this embodiment provides a storage function to a user.
  • the user of storage system 100 may be a computer, virtual machine, various types of applications, terminal devices, and users, etc. that have access and/or usage rights to storage system 100.
  • the user of the storage system 10 can have one or more.
  • the user may send an operation request to the storage management device 10 in the storage system 100 during use of the storage system 100.
  • the storage management device 10 receives the operation request sent by the user, and operates on the data at the corresponding address in the database 30 according to the database address in the operation request, for example, the data can be read and returned to the user, or the data is modified, or written. Enter new data and so on. Among them, how the storage management device 10 operates on the data at the corresponding address in the database 30 depends on the type of operation request.
  • the operations in the storage system 100 are recorded using WAL technology.
  • the log disk 20 is mainly used to store WAL logs, and the WAL log mainly records database operations in the storage system 100.
  • the storage management device 10 can record the operation request of the user to the log disk 20 in the process of operating the data at the corresponding address in the database 30 according to the operation request of the user.
  • the storage management device 10 may choose to record the operation request in the log disk 20, or may choose not to record the operation request.
  • the user's operation request is divided into a database update request and a non-update request based on whether the data in the database 30 is changed as a standard.
  • the database update request may change the data in the database 30, for example, may be a write request, a modification request, a delete request, etc.; the non-update request does not change the data in the database 30, and may be, for example, a query request, a read request, or the like.
  • the storage management device 10 receives the non-update request sent by the user, reads the corresponding data from the database 30 according to the database address in the non-update request, and returns it to the user.
  • the storage management device 10 may select to record the non-update request to the log disk 20, and details are not described herein.
  • the storage management device 10 For the database update request, the storage management device 10 needs to record the database update request to the log file, and persist the log file to the log disk 20; then write the data involved in the database update request into the dirty page of the memory, and adopt asynchronous The method persists the dirty pages in the memory into the database 30; after persisting the data to the database 30, a response message to the successful write is returned to the user.
  • the storage system 100 If the storage system 100 is down before the storage management device 10 persists the data to the database 30, the dirty pages in the memory are lost. Since the data update request has been persisted to the log disk 20, when the storage system 100 is restarted, the log disk 20 can be scanned, and database update requests that have not been persisted into the database 30 are obtained from the log disk 20, and these database updates are updated. The request is played back into the dirty page of the memory, and then the dirty pages in the memory are persisted into the database 30 in an asynchronous manner. It can be seen that the storage system 100 of the embodiment adopts the WAL technology and provides a good foundation for the recovery mechanism of the storage system 100.
  • the storage management device 10 needs to record a database update operation or a non-update operation to the log disk 20.
  • the storage management device 10 may generate a log entry to be written according to a database update operation or a non-update operation, and then write the log entry to be written into the log disk 20.
  • the storage management device 10 can receive the database update request sent by the user of the storage system 10, generate a log entry to be written according to the database update request, and record the log entry to be written to the log disk 20.
  • the database update request mainly includes updating the operation control information and the data block to be written into the database.
  • the update operation control information mainly includes information such as a database address, a length of a data block to be written into the database, and a check code of the data block. Based on this, the storage management device 10 can use the update operation control information and the data block to be written into the database as the log meta information and the log data to be written, respectively, to generate a log entry to be written.
  • the data block to be written into the database is generally an integer multiple of the reference data block size, denoted as M times, and M is a positive integer; accordingly, the size of the log data to be written is also M times the size of the reference data block.
  • the reference data block size refers to the size of the data block that can be read and written by a single read/write operation supported by the storage medium under normal circumstances.
  • the size of the data block is related to the development of the storage technology, and different values can be taken in different periods.
  • the reference data block size is equivalent to the size of the conventional physical sector in the current development stage of the storage technology, that is, the amount of data that the storage medium allows reading and writing operations to read and write in a normal case, for example, 512 bytes, 4096 bytes, and the like.
  • the size of the reference data block is 4 KB
  • the size of the physical sector in the log disk 20 is 4 KB
  • the size of the log data to be written is M*4 KB
  • the size of the log meta information is 64.
  • the storage control device 10 writes the log entry to be written.
  • the log disk 20 needs to perform M+1 IO operations, and the log meta information and the log data to be written are respectively written into the M+1 physical sectors in the log disk 20. It can be seen that, due to the existence of the log meta-information, when the storage management device 10 writes a log entry to the log disk 20, a write operation across the physical sector is generated once, and the execution efficiency of the write log is low.
  • the log disk 20 adopts an unconventional disk, and the size of the physical sector in the log disk 20 is greater than or equal to the size of the log meta information and the size of the reference data block. Sum.
  • the size of the physical sector in the log disk 20 may be 4160 bytes, 4224 bytes, or the like.
  • the log disk 20 may be a disk supporting a variable sector size, such as a Non-Volatile Memory Express (NVMe) disk, but is not limited thereto.
  • NVMe disks are disks that support the NVMe interface standard.
  • the log items to be written can be spliced into memory blocks so that the IO operations can be written to by less IO operations.
  • the log entry is written to the physical sector of the log disk 20, which reduces the number of IO operations across physical sectors required to write log entries to the log disk, and improves the efficiency of writing log entries to the log disk.
  • the process of the storage management device 10 writing a log entry to the log disk 20 is as follows: On the basis that the size of the physical sector in the log disk 20 is greater than or equal to the sum of the size of the log meta information and the size of the reference data block:
  • the memory block here refers to a data block that can be written to one physical sector at a time, and the size of the memory block is smaller than or equal to the size of the physical sector in the log disk 20.
  • the order of address alignment and data splicing is not limited.
  • the storage management device 10 may perform address alignment and data splicing in parallel, or perform address aligning and then perform data splicing, or may perform data splicing before performing address alignment.
  • the physical sector of the log disk is greater than or equal to the sum of the size of the log meta-information and the size of the reference data block, it is possible to splicing the log items to be written into no more than M data blocks through data splicing, thereby occupying a smaller number.
  • the physical sector does not need to occupy M+1 physical sectors, which reduces the number of IO operations across physical sectors required to write log entries to the log disk, and improves the execution of writing log entries to the log disk. effectiveness.
  • the size of the physical sector in the log disk 20 is K bytes, and K is a positive integer. Based on this, after obtaining the log entry to be written, the storage management device 10 can round up the end address of the last write operation in the log disk 20 by K bytes to obtain an address information, that is, the log disk 20 for storage. The starting address of the physical sector to be written to the log entry.
  • the size of the log meta information is 64 bytes
  • the size K of the physical sector in the log disk 20 is 4160 bytes
  • the last write operation in the log disk 20 The end address is 4150 bytes, and the 4150 bytes are rounded up according to 4160 bytes, and an address, that is, the 4160th byte, can be obtained, which means that the storage can be written from the 4160th byte in the log disk 20. Enter the log entry.
  • N memory blocks may be spliced at one time; or, N memory blocks may be spliced each time. Part of the memory block, after a number of stitching, finally get N memory blocks. For example, one memory block can be spliced each time, and N memory blocks are obtained after N times of splicing.
  • N memory blocks when N memory blocks are written into N physical sectors, N memory blocks may be written into N physical sectors after N times of writing operations after splicing out N memory blocks; or Alternatively, each time a memory block is spliced, a write operation is performed, and the spliced memory block is written into the corresponding physical sector, so that N memory blocks can be written to N physics after N write operations. Sector.
  • the log meta information and the log data to be written may be spliced through a memory buffer to form N
  • a memory block whose size is equal to the size of N physical sectors.
  • a memory block corresponds to one physical sector.
  • a memory block is a contiguous piece of data in a memory buffer.
  • the memory buffer may be a continuous area in the memory, but is not limited thereto.
  • the splicing manner of splicing the log meta-information and the data to be written into the log data into the N-segment continuous data through the memory buffer is applicable to the embodiment of the present application.
  • the storage management device 10 may split the log meta information and the log data to be written into N shares, select a continuous area in the memory buffer, and cache one of the data each time. Obtain a memory block in the contiguous area, and write the obtained memory block into the corresponding physical sector, so after N operations, N memory blocks can be spliced and N memory blocks are written into N physics. In the sector.
  • the storage management device 10 may split the log meta information and the log data to be written into N shares, and cache the N pieces of data into N consecutive areas of the memory buffer. N memory blocks are obtained, and a continuous piece of data is stored in each successive area, and the size of each continuous area is less than or equal to the size of one physical sector.
  • the storage management device 10 may cache the log meta information and the header data or the tail data to be written in the log data into a continuous area of the memory buffer to obtain a memory block; the header data or the tail data.
  • Other continuous areas are N-1 continuous areas.
  • the log meta information and the header data or the tail data to be written in the log data are buffered into one memory block, and other data to be written in the log data can be buffered in units of the reference data block size.
  • M-1 memory blocks, and finally get M memory blocks, and then the log items to be written are written into the log disk 20 by M times of IO operations across physical sectors, which is reduced compared to M+1 IO operations.
  • An IO operation is beneficial to improve the execution efficiency of the write log.
  • the storage management device 10 may splicing the log meta information and the log data to be written in a continuous manner in a memory buffer to obtain N memory blocks. In another implementation manner, the storage management device 10 may splicing the log meta information and the log data to be written in an interval in a memory buffer to obtain N memory blocks.
  • the memory blocks are sequentially adjacent to each other with no gap therebetween.
  • the extra storage space may be located at the beginning and/or the end of the memory buffer.
  • N memory blocks are spliced in an interval manner is applicable to a case where the size of the memory buffer is larger than the sum of the sizes of the N memory blocks.
  • the size of the physical sector of the log disk 20 is required to be greater than or equal to the sum of the size of the log meta information and the size of the reference data block.
  • a disk whose physical sector size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block may be directly selected as the log disk 20.
  • a disk supporting a variable sector size may be selected as the log disk 20.
  • the log disk 20 can be implemented as a regular disk whose physical sector size is equal to the reference data block size. Based on this, before the log entry is written to the log disk 20, the size of the physical sector in the log disk can be adjusted to be greater than or equal to the sum of the size of the log meta information and the size of the reference data block.
  • the lower limit value of the size of the physical sector in the log disk 20 may be calculated according to the size of the meta information and the reference data block size; at least two physical sector sizes supported from the log disk 20. In the middle, a size greater than or equal to the lower limit value is selected as the target value; the size of the physical sector in the log disk 20 is adjusted from the current value by the target value.
  • the log meta information size is 64 bytes
  • the log disk 20 supports sector sizes such as 4096 bytes, 4104 bytes, 4160 bytes, and 4224 bytes.
  • the lower limit of the size of the physical sector is calculated according to the reference data block size of 4 KB (ie, 4096 bytes) and the size of the log meta information of 64 bytes.
  • the log disk may be re-formatted according to the target value in response to the formatting request to obtain a size greater than or equal to the log meta information.
  • the embodiment of the present application is not limited to this. Any implementation manner in which the size of the physical sector in the log disk 20 can be adjusted from the current value is adapted to the embodiment of the present application.
  • the process of writing the log to the log disk 20 by the storage management device 10 is illustrated in the following with reference to the address alignment process shown in FIG. 2 .
  • the log disk 20 shown in the left side of FIG. 2 includes physical sectors denoted as A1, B1, and C1, and each physical sector.
  • the size of the log is 4096 bytes
  • the size of the log meta information to be written to the log entry is LogEntryHeaderSize
  • the size of the log data to be written is 1 times of the reference data block, that is, 4096 bytes.
  • the log entry to be written is written to the log disk 20 shown on the left side of FIG. 2, at least two IO operations are required.
  • the storage management device 10 can adjust the size of the physical sector of the log disk 20 from 4096 to 4096 bytes and 4104 supported by the log disk 20 by a Variable Sector Size (VSS) technology.
  • VSS Variable Sector Size
  • the log disk 20 after adjusting the size of the physical sector is as shown on the right side of FIG. 2, and includes three physical sectors denoted as A2, B2, and C2.
  • log disk 20 shown on the right side of FIG. 2 seems to be larger than the log disk 20 shown on the left side. This is only for convenience of illustration, and the total storage space of the log disk 20 on the left and right sides has not changed. Only the size of the physical sector has changed.
  • the size of the adjusted physical sector is recorded as SectorSize.
  • the storage management device 10 performs address alignment on the log entry to be written. The alignment result is shown in FIG. 2, and the log entry to be written is aligned with the physical sector B2 in the log disk 20.
  • the storage management device 10 writes the log entry to be written to the log disk 20
  • the log meta information to be written to the log entry and the log data to be written are first spliced in a memory buffer to obtain a size of 4160 bytes.
  • the memory block, and the spliced memory block is written once in the physical sector B2 aligned by SectorSize.
  • FIG. 3 is a schematic flowchart diagram of a log writing method according to another exemplary embodiment of the present application.
  • the method can be applied to the storage system shown in FIG. 1, but is not limited thereto.
  • the log writing method provided in this embodiment can be used in any application scenario involving a write log operation. As shown in FIG. 3, the method includes:
  • the log entry to be written includes log meta information and log data to be written.
  • the size of the log data to be written is M times the size of the reference data block, and M is a positive integer.
  • the log disk adopts an unconventional disk.
  • the unconventional mainly means that the size of the physical sector in the log disk is greater than or equal to the sum of the size of the log meta information and the size of the reference data block.
  • the reference data block size refers to the size of the data block that can be read and written by a single read/write operation supported by the storage medium.
  • the size of the data block is related to the development of the storage technology, and different values can be taken in different periods.
  • the reference data block size is equivalent to the size of the conventional physical sector in the current development stage of the storage technology, that is, the amount of data that the storage medium allows reading and writing operations to read and write in a normal case, for example, 512 bytes, 4096 bytes, and the like.
  • the memory block here refers to a data block that can be written to one physical sector at a time, and the size of the memory block is less than or equal to the size of the physical sector in the log disk.
  • the physical sector of the log disk is greater than or equal to the sum of the size of the log meta-information and the size of the reference data block, it is possible to splicing the log items to be written into no more than M data blocks through data splicing, thereby occupying a smaller number.
  • a database update request may be received, where the database update request includes update operation control information and a data block to be written into the database; and the update operation control information and the data block to be written into the database are respectively taken as Log meta information and log data to be written to generate log entries to be written.
  • the log entry to be written may also be obtained in other manners. For example, the log entry to be written may be obtained directly from the log generating device.
  • the size of the physical sector in the log disk is K bytes and K is a positive integer. Based on this, after obtaining the log entry to be written, the end address of the last write operation in the log disk can be rounded up by K bytes to obtain an address information, that is, the log disk is used to store the log entry to be written.
  • the starting address of the physical sector For example, suppose the base block size is 4KB (that is, 4096 bytes), the size of the log meta information is 64 bytes, and the size K of the physical sector in the log disk is 4160 bytes, and the end address of the last write operation in the log disk.
  • the 4150 bytes are rounded up by 4160 bytes, and an address, that is, 4160 bytes, can be obtained, which means that the log entry to be written can be stored starting from the 4160th byte in the log disk. .
  • N memory blocks may be spliced at one time; or, part of the N memory blocks may be spliced each time. Block, after multiple stitching, finally get N memory blocks. For example, one memory block can be spliced each time, and N memory blocks are obtained after N times of splicing.
  • N memory blocks when N memory blocks are written into N physical sectors, N memory blocks may be written into N physical sectors after N times of writing operations after splicing out N memory blocks; or Alternatively, each time a memory block is spliced, a write operation is performed, and the spliced memory block is written into the corresponding physical sector, so that N memory blocks can be written to N physics after N write operations. Sector.
  • the log meta information and the log data to be written may be spliced through a memory buffer to form N memory blocks.
  • the size of the memory buffer is equal to the size of N physical sectors.
  • a memory block corresponds to one physical sector.
  • a memory block is a contiguous piece of data in a memory buffer.
  • the memory buffer may be a continuous area in the memory, but is not limited thereto.
  • the splicing manner of splicing the log meta-information and the data to be written into the log data into the N-segment continuous data through the memory buffer is applicable to the embodiment of the present application.
  • the log meta information and the log data to be written may be split into N shares, and a continuous area is selected in the memory buffer, and one of the data is buffered to the continuous area each time.
  • a memory block is obtained, and the obtained memory block is written into the corresponding physical sector, so after N operations, N memory blocks can be spliced and N memory blocks are written into N physical sectors.
  • the log meta information and the log data to be written may be split into N shares, and the N pieces of data are separately cached into N consecutive areas of the memory buffer to obtain N.
  • an embodiment of data splicing is given from the perspective of spliced content.
  • the log meta information and the header data or the tail data to be written in the log data may be buffered into a continuous area of the memory buffer to obtain a memory block; the size of the header data or the tail data and the reference data.
  • Other continuous areas are M-1 continuous areas.
  • the log meta information and the header data or the tail data to be written in the log data are buffered into one memory block, and other data to be written in the log data can be buffered in units of the reference data block size.
  • M-1 memory blocks, and finally get M memory blocks, and then the log items to be written are written into the log disk 20 by M times of IO operations across physical sectors, which is reduced compared to M+1 IO operations.
  • An IO operation is beneficial to improve the execution efficiency of the write log.
  • the log meta information and the log data to be written may be spliced in a continuous manner in a memory buffer to obtain N memory blocks.
  • the log meta information and the log data to be written may be spliced in an interval in a memory buffer to obtain N memory blocks.
  • the memory blocks are sequentially adjacent to each other with no gap therebetween.
  • the extra storage space may be located at the beginning and/or the end of the memory buffer.
  • N memory blocks are spliced in an interval manner is applicable to a case where the size of the memory buffer is larger than the sum of the sizes of the N memory blocks.
  • the size of the physical sector of the log disk is required to be greater than or equal to the sum of the size of the log meta information and the size of the reference data block.
  • a disk whose physical sector size is greater than or equal to the sum of the log metadata information and the reference data block size may be directly selected as the log disk.
  • a disk supporting a variable sector size may be selected as the log disk.
  • the log disk can be implemented as a regular disk whose physical sector size is equal to the reference data block size. Based on this, before the log entry is written to the log disk, the method further includes the step of adjusting the size of the physical sector in the log disk to be greater than or equal to the sum of the size of the log meta information and the size of the reference data block.
  • the lower limit value of the size of the physical sector in the log disk may be calculated according to the size of the meta information and the reference data block size; and the at least two physical sector sizes supported by the log disk are selected to be greater than or equal to The size of the lower limit is used as the target value; the size of the physical sector in the log disk is adjusted from the current value by the target value.
  • the log disk may be re-formatted according to the target value in response to the formatting request to obtain a size greater than or equal to the size of the log meta information.
  • the embodiment of the present application does not limit this. Any implementation manner in which the size of the physical sector in the log disk can be adjusted from the current value is adapted to the embodiment of the present application.
  • the execution bodies of the steps of the method provided by the foregoing embodiments may all be the same device, or the method may also be performed by different devices.
  • the execution body of steps 301 to 304 may be device A; for example, the execution bodies of steps 301 and 302 may be device A, the execution bodies of steps 303 and 304 may be device B, and the like.
  • FIG. 4 is a schematic structural diagram of a log writing apparatus according to still another exemplary embodiment of the present application.
  • the log writing device includes an acquisition module 41, an alignment module 42, a splicing module 43, and a writing module 44.
  • the obtaining module 41 is configured to obtain a log entry to be written, where the log entry to be written includes log meta information and log data to be written, and the size of the log data to be written is M times the size of the reference data block, and M is a positive integer.
  • the aligning module 42 is configured to perform address alignment on the log entry to be written according to the size of the physical sector in the log disk to determine a starting address of a physical sector for storing the log entry to be written, and a physical sector in the log disk
  • the size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block.
  • the writing module 44 is configured to write N memory blocks into the N physical sectors in the log disk starting from the above starting address.
  • the aligning module 42 is specifically configured to: round up the last address of the last write operation in the log disk by K bytes to obtain the above starting address, and the size of the physical sector in the log disk is K. byte.
  • the splicing module 43 is specifically configured to: splicing out N memory blocks at a time; or, splicing out a portion of the N memory blocks at a time, and finally obtaining N after multiple splicing Memory block.
  • one memory block can be spliced each time, and N memory blocks are obtained after N times of splicing.
  • the writing module 44 can write N memory blocks into N physical sectors after N times of writing operations after the splicing module 43 splices out N memory blocks; or, each splicing module 43 can be spliced out.
  • a memory block performs a write operation, and the memory blocks spliced out by the splicing module 43 are written into the corresponding physical sectors, so that N memory blocks can be written into N physical sectors after N write operations.
  • the splicing module 43 is specifically configured to: splice log metadata information and log data to be written through a memory buffer to form the N memory blocks, where the size of the memory buffer is equal to The size of the N physical sectors.
  • the splicing module 43 is specifically configured to cache the log metadata information and the header data or the tail data to be written into the log data into a continuous area of the memory buffer to obtain a memory block, or the header data or The size of the tail data is the reference data block size; in the unit of the reference data block size, the other data to be written into the log data is separately buffered into other consecutive areas of the memory buffer to obtain N-1 memory blocks.
  • N M.
  • the splicing module 43 is specifically configured to: in a memory buffer, splicing the log meta information and the log data to be written in a continuous manner to obtain N memory blocks; or, in the memory buffer, at intervals The method combines the log meta information and the log data to be written to obtain N memory blocks.
  • the obtaining module 41 is specifically configured to: receive a database update request, the database update request includes updating operation control information and a data block to be written into the database; and updating the operation control information and the data block to be written into the database
  • the log metadata information and the log data to be written are respectively generated to generate a log entry to be written.
  • the log writing device further includes: an adjustment module.
  • the adjustment module is configured to adjust the size of the physical sector in the log disk to be greater than or equal to the sum of the size of the log meta information and the reference data block size before the alignment module 42 performs the address alignment operation.
  • the adjusting module is specifically configured to: calculate a lower limit value of a size of a physical sector in the log disk according to a size of the meta information and a reference data block size; and at least two physical fans supported by the log disk In the area size, a size greater than or equal to the lower limit value is selected as the target value; the size of the physical sector in the log disk is adjusted from the current value by the target value.
  • the adjustment module when the size of the physical sector in the log disk is adjusted from the current value by the target value, is specifically configured to: in response to the formatting request, re-format the log disk according to the target value, to Obtain a physical sector whose size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block; or, by using the disk tool or the command line, the size of the physical sector in the log disk is adjusted from the current value by the target value.
  • the embodiment of the present application does not limit this. Any implementation manner in which the size of the physical sector in the log disk can be adjusted from the current value is adapted to the embodiment of the present application.
  • the log writing device is based on the sum of the size of the physical sector in the log disk being greater than or equal to the size of the log metadata information and the size of the reference data block, and when writing the log entry to be written to the log disk, Combining address alignment and data splicing can splicing the log items to be written into memory blocks, so that the log items to be written can be written into the physical sectors of the log disk by less IO operations, and writing to the log disk is reduced.
  • the number of IO operations required for log entries improves the efficiency of writing log entries to the log disk.
  • the log writing device can be implemented as a storage management device, including: a memory 51, a processor 52, and a communication component 53.
  • the memory 51 can be configured to store other various data to support operations on the storage management device. Examples of such data include instructions for any application or method operating on a storage management device, phone book data, messages, pictures, videos, and the like.
  • the memory 51 can be implemented by any type of volatile or non-volatile storage medium or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • EPROM Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Disk Disk or Optical Disk.
  • the processor 52 is coupled to the memory 51 for executing a program in the memory 51 for:
  • the log entry to be written includes log meta information and log data to be written, and the size of the log data to be written is M times the size of the reference data block, and M is a positive integer;
  • the write log entry is address aligned according to the size of the physical sector in the log disk to determine the starting address of the physical sector for storing the log entry to be written.
  • the size of the physical sector in the log disk is greater than or equal to the log. The sum of the size of the meta information and the size of the reference data block;
  • N ⁇ M, and N is a positive integer
  • N memory blocks are written by the communication component 53 into N physical sectors starting from the above starting address in the log disk.
  • the communication component 53 is configured to write N memory blocks into the N physical sectors starting from the above starting address in the log disk.
  • the processor 52 when performing address alignment, is specifically configured to: round up the end address of the last write operation in the log disk by K bytes to obtain the above starting address, and physical in the log disk.
  • the size of the sector is K bytes.
  • the processor 52 when performing data splicing, is specifically configured to: splicing out N memory blocks at a time; or splicing out a part of the memory blocks in each of the N memory blocks, and splicing multiple times. Finally get N memory blocks. For example, one memory block can be spliced each time, and N memory blocks are obtained after N times of splicing.
  • the processor 52 when the N memory blocks are written into the N physical sectors, the processor 52 is specifically configured to: after splicing out the N memory blocks, write N memory blocks to N physical physics after N times of writing operations. Sector; or, each time a memory block is spliced, a write operation is performed, and the spliced memory block is written into the corresponding physical sector, so that N memory blocks can be written to N after N write operations. Physical sectors.
  • the processor 52 when performing data splicing, is specifically configured to: splice log metadata information and log data to be written through a memory buffer to form the N memory blocks, where the memory The size of the buffer is equal to the size of the N physical sectors.
  • the processor 52 when the memory block is spliced, is specifically configured to: in a memory buffer, splicing the log meta information and the log data to be written in a continuous manner to obtain N memory blocks; or In the memory buffer, the log meta information and the log data to be written are spliced in an interval manner to obtain N memory blocks.
  • the processor 52 when acquiring the log item to be written, is specifically configured to: receive a database update request, where the database update request includes updating operation control information and a data block to be written into the database; and controlling the update operation
  • the information and the data block to be written into the database are respectively used as log meta information and log data to be written to generate a log entry to be written.
  • the processor 52 is further configured to adjust the size of the physical sector in the log disk to be greater than or equal to the sum of the size of the log meta information and the reference data block size before performing the address alignment operation.
  • the processor 52 when adjusting the size of the physical sector in the log disk, is specifically configured to: calculate a lower limit of the size of the physical sector in the log disk according to the size of the meta information and the reference data block size. Value; from the at least two physical sector sizes supported by the log disk, select a size greater than or equal to the lower limit as the target value; adjust the size of the physical sector in the log disk from the current value to the target value.
  • the processor 52 when the size of the physical sector in the log disk is adjusted by the current value from the current value, the processor 52 is specifically configured to: re-format the log disk according to the target value in response to the formatting request, A physical sector having a size greater than or equal to the size of the log meta-information and the size of the reference data block is obtained; or the size of the physical sector in the log disk may be adjusted from the current value by the disk tool or the command line.
  • the embodiment of the present application does not limit this. Any implementation manner in which the size of the physical sector in the log disk can be adjusted from the current value is adapted to the embodiment of the present application.
  • the storage management device further includes: a display 54, a power supply component 55, an audio component 56, and the like. Only some of the components are schematically illustrated in Figure 4b, and it is not meant that the storage management device includes only the components shown in Figure 4b.
  • the communication component 53 can be configured to facilitate wired or wireless communication between the device to which the communication component belongs and other devices.
  • the device to which the communication component belongs can access a wireless network based on a communication standard such as WiFi, 2G or 3G, or a combination thereof.
  • the communication component receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel.
  • the communication component further includes a near field communication (NFC) module to facilitate short range communication.
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the display 54 which may include a screen, may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor may sense not only the boundary of the touch or sliding action, but also the duration and pressure associated with the touch or slide operation.
  • the power supply assembly 55 provides power to various components of the device to which the power supply component belongs.
  • the power components can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the devices to which the power components belong.
  • the audio component 56 is configured to output and/or input an audio signal.
  • the audio component includes a microphone (MIC) that is configured to receive an external audio signal when the device to which the audio component belongs is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode.
  • the received audio signal can be further stored in a memory or transmitted via a communication component.
  • the audio component further includes a speaker for outputting an audio signal.
  • the storage management device provided in this embodiment combines the size of the physical sector in the log disk to be greater than or equal to the size of the log metadata information and the size of the reference data block, and writes the log entry to be written to the log disk.
  • Address alignment and data splicing can splicing the log items to be written into memory blocks, so that the log items to be written can be written into the physical sectors of the log disk by less IO operations, and the log is written to the log disk.
  • the number of IO operations required by the item improves the efficiency of writing log entries to the log disk.
  • the embodiment of the present application further provides a computer readable storage medium storing a computer program, and the computer program can be implemented by a computer to implement the method steps or functions in the foregoing embodiments, and details are not described herein.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.

Landscapes

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

Abstract

A log writing method, apparatus and system. In this method, in the premise that the size of a physical sector in a log disk is greater than or equal to the sum of the size of log meta information and the size of a reference data block, when a log entry to be written is written into the log disk, the log entry to be written can be spliced to form a memory block by means of address alignment and data splicing, so that the log entry to be written can be written into the physical sector of the log disk in less IO operations, the required number of IO operations for writing the log entry into the log disk is reduced, and the execution efficiency for writing the log entry into the log disk is improved.

Description

日志写入方法、装置及系统Log writing method, device and system
本申请要求2017年9月21日递交的申请号为201710857455.9、发明名称为“日志写入方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Japanese Patent Application No. PCT Application No. No. No. No. No. No. No
技术领域Technical field
本申请涉及存储技术领域,尤其涉及一种日志写入方法、装置及系统。The present application relates to the field of storage technologies, and in particular, to a log writing method, apparatus, and system.
背景技术Background technique
预写式日志(Write Ahead Log,WAL)是在存储系统中保证原子性(Atomicity)和持久性(Durability)的一种技术,可为存储系统的恢复机制提供良好的基础。Write Ahead Log (WAL) is a technology that guarantees atomicity and durability in the storage system, and provides a good foundation for the recovery mechanism of the storage system.
在使用WAL的存储系统中,在将数据写入数据库之前,先将数据写入日志磁盘上的日志文件中,然后将数据持久化到数据库中,这样在存储系统发生宕机时,可以通过WAL日志恢复到宕机前的状态,以避免造成数据丢失。In a storage system using WAL, before writing data to the database, the data is written to the log file on the log disk, and then the data is persisted to the database, so that when the storage system is down, the WAL can be passed. The log is restored to the state before the downtime to avoid data loss.
在上述过程中,向日志磁盘写入日志数据的效率相对较低,有待提供一种新的方案来提高写日志的效率。In the above process, the efficiency of writing log data to the log disk is relatively low, and a new scheme is needed to improve the efficiency of writing the log.
发明内容Summary of the invention
本申请的多个方面提供一种日志写入方法、装置及系统,用以提高写日志的效率。Aspects of the present application provide a log writing method, apparatus, and system for improving the efficiency of writing a log.
本申请实施例提供一种日志写入方法,包括:The embodiment of the present application provides a log writing method, including:
获取待写入日志项,所述待写入日志项包括日志元信息和待写入日志数据,所述待写入日志数据的大小是基准数据块大小的M倍,M是正整数;Obtaining a log entry to be written, where the log entry to be written includes log meta information and log data to be written, where the size of the log data to be written is M times the size of the reference data block, and M is a positive integer;
按照日志磁盘中物理扇区的大小对所述待写入日志项进行地址对齐,以确定用于存储所述待写入日志项的物理扇区的起始地址,所述日志磁盘中物理扇区的大小大于或等于所述日志元信息的大小与所述基准数据块大小之和;Performing address alignment on the log entry to be written according to the size of the physical sector in the log disk to determine a starting address of the physical sector for storing the log entry to be written, the physical sector in the log disk The size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block;
对所述日志元信息和所述待写入日志数据进行数据拼接以形成N个内存块,N<=M,且N为正整数;Performing data splicing on the log meta information and the to-be-written log data to form N memory blocks, N<=M, and N is a positive integer;
将所述N个内存块写入所述日志磁盘中自所述起始地址开始的N个物理扇区中。Writing the N memory blocks into the N physical sectors from the start address in the log disk.
本申请实施例还提供一种存储管理设备,包括:存储器、处理器以及通信组件;The embodiment of the present application further provides a storage management device, including: a memory, a processor, and a communication component;
所述存储器,用于存储程序;The memory is configured to store a program;
所述处理器,耦合至所述存储器,用于执行所述程序以用于:The processor is coupled to the memory for executing the program for:
获取待写入日志项,所述待写入日志项包括日志元信息和待写入日志数据,所述待写入日志数据的大小是基准数据块大小的M倍,M是正整数;Obtaining a log entry to be written, where the log entry to be written includes log meta information and log data to be written, where the size of the log data to be written is M times the size of the reference data block, and M is a positive integer;
按照日志磁盘中物理扇区的大小对所述待写入日志项进行地址对齐,以确定用于存储所述待写入日志项的物理扇区的起始地址,所述日志磁盘中物理扇区的大小大于或等于所述日志元信息的大小与所述基准数据块大小之和;Performing address alignment on the log entry to be written according to the size of the physical sector in the log disk to determine a starting address of the physical sector for storing the log entry to be written, the physical sector in the log disk The size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block;
对所述日志元信息和所述待写入日志数据进行数据拼接以形成N个内存块,N<=M,且N为正整数;Performing data splicing on the log meta information and the to-be-written log data to form N memory blocks, N<=M, and N is a positive integer;
通过所述通信组件将所述N个内存块写入所述日志磁盘中自所述起始地址开始的N个物理扇区中;Writing, by the communication component, the N memory blocks into N physical sectors in the log disk starting from the start address;
所述通信组件,用于将所述N个内存块写入所述日志磁盘中自所述起始地址开始的N个物理扇区中。The communication component is configured to write the N memory blocks into N physical sectors in the log disk starting from the start address.
本申请实施例还提供一种基于日志的存储系统,包括上述实施例提供的存储管理设备、日志磁盘以及数据库;所述存储管理设备与所述日志磁盘以及所述数据库连接。The embodiment of the present application further provides a log-based storage system, including the storage management device, the log disk, and the database provided by the foregoing embodiment; the storage management device is connected to the log disk and the database.
在本申请实施例中,以日志磁盘中物理扇区的大小大于或等于日志元信息大小与基准数据块大小之和为基础,在向日志磁盘中写入待写入日志项时,结合地址对齐以及数据拼接可以将待写入日志项拼接为内存块,使得可以通过更少的IO操作将待写入日志项写入日志磁盘的物理扇区中,减小向日志磁盘中写入日志项所需要的IO操作的次数,提高了向日志磁盘中写入日志项的执行效率。In the embodiment of the present application, when the size of the physical sector in the log disk is greater than or equal to the sum of the size of the log meta information and the size of the reference data block, when the log entry to be written is written to the log disk, the address alignment is combined. And the data splicing can splicing the log items to be written into a memory block, so that the log items to be written can be written into the physical sector of the log disk by less IO operations, and the log entries are written to the log disk. The number of IO operations required increases the efficiency of writing log entries to the log disk.
附图说明DRAWINGS
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the present application, and are intended to be a part of this application. In the drawing:
图1为本申请一示例性实施例提供的基于日志的存储系统的结构示意图;FIG. 1 is a schematic structural diagram of a log-based storage system according to an exemplary embodiment of the present application;
图2为本申请一示例性实施例提供的地址对齐示例的对齐状态示意图;FIG. 2 is a schematic diagram of an alignment state of an address alignment example according to an exemplary embodiment of the present application; FIG.
图3为本申请另一示例性实施例提供的日志写入方法的流程示意图;FIG. 3 is a schematic flowchart of a log writing method according to another exemplary embodiment of the present application;
图4a为本申请又一示例性实施例提供的日志写入装置的结构示意图;4a is a schematic structural diagram of a log writing apparatus according to still another exemplary embodiment of the present application;
图4b为本申请又一示例性实施例提供的存储管理设备的结构示意图。FIG. 4b is a schematic structural diagram of a storage management device according to another exemplary embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions of the present application will be clearly and completely described in the following with reference to the specific embodiments of the present application and the corresponding drawings. It is apparent that the described embodiments are only a part of the embodiments of the present application, and not all of them. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
针对现有技术向日志磁盘写入日志数据的效率相对较低的问题,本申请实施例提供一种解决方案,基本原理是:以日志磁盘中物理扇区的大小大于或等于日志元信息大小与基准数据块大小之和为基础,在向日志磁盘中写入待写入日志项时,结合地址对齐以及数据拼接可以将待写入日志项拼接为内存块,使得可以通过更少的IO操作将待写入日志项写入日志磁盘的物理扇区中,减小向日志磁盘中写入日志项所需要的IO操作的次数,提高了向日志磁盘中写入日志项的执行效率。The solution of the prior art is that the efficiency of writing log data to the log disk is relatively low. The embodiment of the present application provides a solution. The basic principle is that the size of the physical sector in the log disk is greater than or equal to the size of the log metadata. Based on the sum of the size of the reference data block, when writing the log entry to be written to the log disk, the address alignment and data splicing can be used to splicing the log items to be written into memory blocks, so that fewer IO operations can be performed. The number of IO operations required to write log entries to the log disk is reduced in the physical sectors to be written to the log disk, which improves the efficiency of writing log entries to the log disk.
以下结合附图,详细说明本申请各实施例提供的技术方案。The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
图1为本申请一示例性实施例提供的基于日志的存储系统100的结构示意图。如图1所示,该存储系统100包括:存储管理设备10、日志磁盘20以及数据库30。FIG. 1 is a schematic structural diagram of a log-based storage system 100 according to an exemplary embodiment of the present application. As shown in FIG. 1, the storage system 100 includes a storage management device 10, a log disk 20, and a database 30.
存储管理设备10主要负责存储系统100的存储控制逻辑,例如对外提供读、写、查询数据库30的功能等。存储管理设备10可以是任何具有处理能力的设备,例如可以是服务器、台式计算机、个人计算机、手机、平板电脑等。服务器可以是常规服务器、云服务器、云主机、虚拟中心等。存储管理设备10的实现结构可以包括处理器、系统总线以及硬盘、内存等至少一块物理存储介质。The storage management device 10 is primarily responsible for the storage control logic of the storage system 100, such as providing read, write, and query functions of the database 30, and the like. The storage management device 10 can be any device having processing capabilities, such as a server, a desktop computer, a personal computer, a mobile phone, a tablet, and the like. The server can be a regular server, a cloud server, a cloud host, a virtual center, and the like. The implementation structure of the storage management device 10 may include a processor, a system bus, and at least one physical storage medium such as a hard disk, a memory, and the like.
数据库30主要按照一定的数据结构来组织、存储和管理存储系统100中的数据。数据库30可以是各种类型的数据库,本实施例对此不做限定。例如,从数据库开发者角度来看,数据库30可以是Oracle、DB2、Sybase、MS SQL Server、Informax、MySQL等。从数据组织结构角度来看,数据库30可以是网状数据库(Network Database)、关系数据库(Relational Database)、树状数据库(Hierarchical Database)、面向对象数据库(Object-oriented Database)等。 Database 30 organizes, stores, and manages data in storage system 100 primarily in accordance with a certain data structure. The database 30 can be various types of databases, which is not limited in this embodiment. For example, from a database developer's perspective, database 30 can be Oracle, DB2, Sybase, MS SQL Server, Informax, MySQL, and the like. From the perspective of data organization structure, the database 30 may be a network database, a relational database, a hierarchical database, an object-oriented database, or the like.
本实施例提供的存储系统100面向使用者提供存储功能。存储系统100的使用者可以是对存储系统100具有访问和/或使用权限的计算机、虚拟机、各类应用、终端设备以及用户等。存储系统10的使用者可以有一个或多个。使用者在使用存储系统100的过程中,可以向存储系统100中的存储管理设备10发送操作请求。存储管理设备10接收使用者发送的操作请求,根据操作请求中的数据库地址,对数据库30中相应地址处的数据进行操作,例如可以读取数据并返回给使用者,或者修改该数据,或者写入新数 据等。其中,存储管理设备10对数据库30中相应地址处的数据如何进行操作视操作请求的类型而定。The storage system 100 provided in this embodiment provides a storage function to a user. The user of storage system 100 may be a computer, virtual machine, various types of applications, terminal devices, and users, etc. that have access and/or usage rights to storage system 100. The user of the storage system 10 can have one or more. The user may send an operation request to the storage management device 10 in the storage system 100 during use of the storage system 100. The storage management device 10 receives the operation request sent by the user, and operates on the data at the corresponding address in the database 30 according to the database address in the operation request, for example, the data can be read and returned to the user, or the data is modified, or written. Enter new data and so on. Among them, how the storage management device 10 operates on the data at the corresponding address in the database 30 depends on the type of operation request.
在存储系统100中,为了实现原子性和持久性,采用WAL技术记录存储系统100中的操作。日志磁盘20主要用于存储WAL日志,WAL日志主要记录存储系统100中的数据库操作。基于此,存储管理设备10在根据使用者的操作请求,对数据库30中相应地址处的数据进行操作的过程中,可以将使用者的操作请求记录到日志磁盘20中。根据操作请求类型的不同,存储管理设备10可以选择在日志磁盘20中记录该操作请求,也可以选择不记录该操作请求。In the storage system 100, in order to achieve atomicity and durability, the operations in the storage system 100 are recorded using WAL technology. The log disk 20 is mainly used to store WAL logs, and the WAL log mainly records database operations in the storage system 100. Based on this, the storage management device 10 can record the operation request of the user to the log disk 20 in the process of operating the data at the corresponding address in the database 30 according to the operation request of the user. Depending on the type of operation request, the storage management device 10 may choose to record the operation request in the log disk 20, or may choose not to record the operation request.
在本实施例中,以是否会改变数据库30中的数据为标准,将使用者的操作请求划分为数据库更新请求和非更新请求。数据库更新请求会改变数据库30中的数据,例如可以是写请求、修改请求、删除请求等;非更新请求不会改变数据库30中的数据,例如可以是查询请求、读请求等。In the present embodiment, the user's operation request is divided into a database update request and a non-update request based on whether the data in the database 30 is changed as a standard. The database update request may change the data in the database 30, for example, may be a write request, a modification request, a delete request, etc.; the non-update request does not change the data in the database 30, and may be, for example, a query request, a read request, or the like.
对于非更新请求,存储管理设备10接收使用者发送的非更新请求,根据非更新请求中的数据库地址,从数据库30中读取相应数据并返回给使用者。可选地,存储管理设备10可以选择将非更新请求记录到日志磁盘20中,对此不做赘述。For the non-update request, the storage management device 10 receives the non-update request sent by the user, reads the corresponding data from the database 30 according to the database address in the non-update request, and returns it to the user. Optionally, the storage management device 10 may select to record the non-update request to the log disk 20, and details are not described herein.
对于数据库更新请求,存储管理设备10需要将数据库更新请求记录到日志文件,并持久化日志文件到日志磁盘20中;然后把数据库更新请求涉及到的数据写入内存的脏页中,并采用异步方式将内存中的脏页持久化到数据库30中;当将数据持久化到数据库30之后,向使用者返回写入成功的应答消息。For the database update request, the storage management device 10 needs to record the database update request to the log file, and persist the log file to the log disk 20; then write the data involved in the database update request into the dirty page of the memory, and adopt asynchronous The method persists the dirty pages in the memory into the database 30; after persisting the data to the database 30, a response message to the successful write is returned to the user.
如果在存储管理设备10将数据持久化到数据库30之前,存储系统100发生宕机,此时内存中的脏页会丢失。由于已经将数据更新请求持久化到日志磁盘20中,所以当存储系统100重启时,可以扫描日志磁盘20,从日志磁盘20中获取尚未持久化到数据库30中的数据库更新请求,将这些数据库更新请求回放到内存的脏页中,然后重新采用异步方式将内存中的脏页持久化到数据库30中。由此可见,本实施例的存储系统100采用WAL技术,为存储系统100的恢复机制提供良好的基础。If the storage system 100 is down before the storage management device 10 persists the data to the database 30, the dirty pages in the memory are lost. Since the data update request has been persisted to the log disk 20, when the storage system 100 is restarted, the log disk 20 can be scanned, and database update requests that have not been persisted into the database 30 are obtained from the log disk 20, and these database updates are updated. The request is played back into the dirty page of the memory, and then the dirty pages in the memory are persisted into the database 30 in an asynchronous manner. It can be seen that the storage system 100 of the embodiment adopts the WAL technology and provides a good foundation for the recovery mechanism of the storage system 100.
在上述过程中,存储管理设备10需要将数据库更新操作或非更新操作记录到日志磁盘20中。可选地,存储管理设备10可根据数据库更新操作或非更新操作生成待写入日志项,然后将待写入日志项写入日志磁盘20中。以数据库更新操作为例,存储管理设备10可以接收存储系统10的使用者发送的数据库更新请求,根据数据库更新请求生成待写入日志项,将该待写入日志项记录到日志磁盘20中。其中,数据库更新请求主 要包括更新操作控制信息和待写入数据库的数据块。更新操作控制信息主要包括数据库地址、待写入数据库的数据块的长度以及数据块的校验码等信息。基于此,存储管理设备10可以将更新操作控制信息和待写入数据库的数据块分别作为日志元信息和待写入日志数据,以生成待写入日志项。一般来说,待写入数据库的数据块一般是基准数据块大小的整数倍,记为M倍,M是正整数;相应地,待写入日志数据的大小也是基准数据块大小的M倍。In the above process, the storage management device 10 needs to record a database update operation or a non-update operation to the log disk 20. Alternatively, the storage management device 10 may generate a log entry to be written according to a database update operation or a non-update operation, and then write the log entry to be written into the log disk 20. Taking the database update operation as an example, the storage management device 10 can receive the database update request sent by the user of the storage system 10, generate a log entry to be written according to the database update request, and record the log entry to be written to the log disk 20. Among them, the database update request mainly includes updating the operation control information and the data block to be written into the database. The update operation control information mainly includes information such as a database address, a length of a data block to be written into the database, and a check code of the data block. Based on this, the storage management device 10 can use the update operation control information and the data block to be written into the database as the log meta information and the log data to be written, respectively, to generate a log entry to be written. Generally, the data block to be written into the database is generally an integer multiple of the reference data block size, denoted as M times, and M is a positive integer; accordingly, the size of the log data to be written is also M times the size of the reference data block.
其中,基准数据块大小是指常规情况下存储介质所支持的单次读写操作所能读写的数据块大小,该数据块大小与存储技术的发展相关,在不同时期可以取不同的值。基准数据块大小相当于在当前存储技术发展阶段,常规物理扇区的大小,也就是常规情况下存储介质允许一次读写操作读写的数据量,例如可以是512字节、4096字节等。The reference data block size refers to the size of the data block that can be read and written by a single read/write operation supported by the storage medium under normal circumstances. The size of the data block is related to the development of the storage technology, and different values can be taken in different periods. The reference data block size is equivalent to the size of the conventional physical sector in the current development stage of the storage technology, that is, the amount of data that the storage medium allows reading and writing operations to read and write in a normal case, for example, 512 bytes, 4096 bytes, and the like.
由上述对基准数据块的定义可知,假设基准数据块大小为4KB,日志磁盘20中物理扇区的大小为4KB,待写入日志数据的大小为M*4KB,且日志元信息的大小为64字节,因为待写入日志项的总大小为M*4096字节(即4KB)+64字节,超过了M个物理扇区的大小,因此存储控制设备10要将待写入日志项写入日志磁盘20中需要执行M+1次IO操作,分别将日志元信息和待写入日志数据写入日志磁盘20中的M+1个物理扇区中。由此可见,由于日志元信息的存在,存储管理设备10在将一个日志项写入日志磁盘20时,会多产生一次跨物理扇区的写入操作,写入日志的执行效率较低。It can be seen from the above definition of the reference data block that the size of the reference data block is 4 KB, the size of the physical sector in the log disk 20 is 4 KB, the size of the log data to be written is M*4 KB, and the size of the log meta information is 64. Byte, because the total size of the log entry to be written is M*4096 bytes (ie, 4 KB) + 64 bytes, which exceeds the size of M physical sectors, so the storage control device 10 writes the log entry to be written. The log disk 20 needs to perform M+1 IO operations, and the log meta information and the log data to be written are respectively written into the M+1 physical sectors in the log disk 20. It can be seen that, due to the existence of the log meta-information, when the storage management device 10 writes a log entry to the log disk 20, a write operation across the physical sector is generated once, and the execution efficiency of the write log is low.
为了提高写日志操作的执行效率,在本实施例的存储系统100中,日志磁盘20采用非常规磁盘,该日志磁盘20中物理扇区的大小大于或等于日志元信息的大小与基准数据块大小之和。例如,假设基准数据块大小为4KB,日志元信息的大小为64字节,则日志磁盘20中物理扇区的大小可以是4160字节、4224字节等。可选地,日志磁盘20可以采用支持可变扇区尺寸的磁盘,例如可以是非易失性存储器接口标准(Non-Volatile Memory Express,NVMe)磁盘,但不限于此。NVMe磁盘是支持NVMe接口标准的磁盘。In the storage system 100 of the embodiment, the log disk 20 adopts an unconventional disk, and the size of the physical sector in the log disk 20 is greater than or equal to the size of the log meta information and the size of the reference data block. Sum. For example, assuming that the reference data block size is 4 KB and the log meta information size is 64 bytes, the size of the physical sector in the log disk 20 may be 4160 bytes, 4224 bytes, or the like. Alternatively, the log disk 20 may be a disk supporting a variable sector size, such as a Non-Volatile Memory Express (NVMe) disk, but is not limited thereto. NVMe disks are disks that support the NVMe interface standard.
基于日志磁盘20在存储空间上的支持,并配合存储管理设备10提供的新的日志写入流程,可以将待写入日志项拼接为内存块,使得可以通过更少的IO操作将待写入日志项写入日志磁盘20的物理扇区中,减小向日志磁盘中写入日志项所需要的跨物理扇区的IO操作的次数,提高向日志磁盘中写入日志项的执行效率。其中,在日志磁盘20中物理扇区的大小大于或等于日志元信息的大小与基准数据块大小之和的基础上,存储管理设备10向日志磁盘20写入日志项的过程如下:Based on the support of the log disk 20 in the storage space, and in conjunction with the new log writing process provided by the storage management device 10, the log items to be written can be spliced into memory blocks so that the IO operations can be written to by less IO operations. The log entry is written to the physical sector of the log disk 20, which reduces the number of IO operations across physical sectors required to write log entries to the log disk, and improves the efficiency of writing log entries to the log disk. The process of the storage management device 10 writing a log entry to the log disk 20 is as follows: On the basis that the size of the physical sector in the log disk 20 is greater than or equal to the sum of the size of the log meta information and the size of the reference data block:
存储管理设备10可根据使用者的操作请求获得待写入日志项,该待写入日志项包括日志元信息和待写入日志数据,且待写入日志数据的大小是基准数据块大小的M倍。之后,存储管理设备10一方面按照日志磁盘20中物理扇区的大小对待写入日志项进行地址对齐,以确定日志磁盘20中用于存储待写入日志项的物理扇区的起始地址;另一方面对日志元信息和待写入日志数据进行数据拼接以形成N个内存块,并将N个内存块写入日志磁盘20中自上述起始地址开始的N个物理扇区中,完成日志项的写入操作。其中,N<=M,且N为正整数。这里的内存块是指可以一次性写入一个物理扇区的数据块,该内存块的大小小于或等于日志磁盘20中物理扇区的大小。The storage management device 10 can obtain a log entry to be written according to an operation request of the user, where the log to be written includes log meta information and log data to be written, and the size of the log data to be written is the size of the reference data block. Times. Thereafter, the storage management device 10 performs address alignment on the one hand according to the size of the physical sector in the log disk 20 to determine the starting address of the physical sector in the log disk 20 for storing the log entry to be written; On the other hand, the log metadata information and the log data to be written are spliced to form N memory blocks, and N memory blocks are written into the N physical sectors starting from the above starting address in the log disk 20, and completed. Write operation of log entries. Where N<=M and N is a positive integer. The memory block here refers to a data block that can be written to one physical sector at a time, and the size of the memory block is smaller than or equal to the size of the physical sector in the log disk 20.
值得说明的是,在本实施例中,不限定地址对齐和数据拼接的先后顺序。例如,存储管理设备10可以并行执行地址对齐和数据拼接,也可以先执行地址对齐再进行数据拼接,或者也可以先进行数据拼接再执行地址对齐。It should be noted that, in this embodiment, the order of address alignment and data splicing is not limited. For example, the storage management device 10 may perform address alignment and data splicing in parallel, or perform address aligning and then perform data splicing, or may perform data splicing before performing address alignment.
由于日志磁盘的物理扇区大于或等于日志元信息的大小与基准数据块大小之和,所以通过数据拼接有可能将待写入日志项拼接为不大于M个数据块,从而占用更少数量的物理扇区,无需占用M+1个物理扇区,减小了向日志磁盘中写入日志项所需要的跨物理扇区的IO操作的次数,提高了向日志磁盘中写入日志项的执行效率。Since the physical sector of the log disk is greater than or equal to the sum of the size of the log meta-information and the size of the reference data block, it is possible to splicing the log items to be written into no more than M data blocks through data splicing, thereby occupying a smaller number. The physical sector does not need to occupy M+1 physical sectors, which reduces the number of IO operations across physical sectors required to write log entries to the log disk, and improves the execution of writing log entries to the log disk. effectiveness.
在一些示例性实施例中,假设日志磁盘20中物理扇区的大小为K字节,K为正整数。基于此,在获得待写入日志项之后,存储管理设备10可以将日志磁盘20中最后写操作的末尾地址按照K字节向上取整,获得一地址信息,即为日志磁盘20中用于存储待写入日志项的物理扇区的起始地址。例如,假设基准数据块大小为4KB(即4096字节),日志元信息的大小为64字节,日志磁盘20中物理扇区的大小K为4160字节,而日志磁盘20中最后写操作的末尾地址为4150字节,则对4150字节按照4160字节向上取整,可以得到一地址,即第4160字节,这意味着,可以自日志磁盘20中的第4160字节开始存储待写入日志项。In some exemplary embodiments, it is assumed that the size of the physical sector in the log disk 20 is K bytes, and K is a positive integer. Based on this, after obtaining the log entry to be written, the storage management device 10 can round up the end address of the last write operation in the log disk 20 by K bytes to obtain an address information, that is, the log disk 20 for storage. The starting address of the physical sector to be written to the log entry. For example, suppose the reference data block size is 4 KB (that is, 4096 bytes), the size of the log meta information is 64 bytes, and the size K of the physical sector in the log disk 20 is 4160 bytes, and the last write operation in the log disk 20 The end address is 4150 bytes, and the 4150 bytes are rounded up according to 4160 bytes, and an address, that is, the 4160th byte, can be obtained, which means that the storage can be written from the 4160th byte in the log disk 20. Enter the log entry.
在一些示例性实施例中,存储管理设备10在对日志元信息和待写入日志数据进行数据拼接时,可以一次性拼接出N个内存块;或者,也可以每次拼接出N个内存块中的部分内存块,经过多次拼接最终得到N个内存块。例如,可以每次拼接出一个内存块,经过N次拼接得到N个内存块。相应地,在将N个内存块写入N个物理扇区时,可以是在拼接出N个内存块之后,经过N次写入操作将N个内存块写入N个物理扇区;或者,也可以是每拼接出一个内存块就执行一次写入操作,将拼接出的内存块写入相应的物理扇区中,这样经过N次写入操作后可以将N个内存块写入N个物理扇区。In some exemplary embodiments, when the storage management device 10 performs data splicing on the log meta information and the log data to be written, N memory blocks may be spliced at one time; or, N memory blocks may be spliced each time. Part of the memory block, after a number of stitching, finally get N memory blocks. For example, one memory block can be spliced each time, and N memory blocks are obtained after N times of splicing. Correspondingly, when N memory blocks are written into N physical sectors, N memory blocks may be written into N physical sectors after N times of writing operations after splicing out N memory blocks; or Alternatively, each time a memory block is spliced, a write operation is performed, and the spliced memory block is written into the corresponding physical sector, so that N memory blocks can be written to N physics after N write operations. Sector.
在一些示例性实施例中,存储管理设备10在对日志元信息和待写入日志数据进行数据拼接时,可以通过一内存缓冲区对日志元信息和待写入日志数据进行拼接以形成N个内存块,该内存缓冲区的大小等于N个物理扇区的大小。一个内存块对应一个物理扇区。一个内存块是内存缓冲区中一段连续的数据。可选地,该内存缓冲区可以是内存中一块连续的区域,但不限于此。In some exemplary embodiments, when the storage management device 10 performs data splicing on the log meta information and the log data to be written, the log meta information and the log data to be written may be spliced through a memory buffer to form N A memory block whose size is equal to the size of N physical sectors. A memory block corresponds to one physical sector. A memory block is a contiguous piece of data in a memory buffer. Optionally, the memory buffer may be a continuous area in the memory, but is not limited thereto.
凡是可以通过内存缓冲区将待写入日志项中的日志元信息和待写入日志数据拼接为N段连续数据的拼接方式均适用于本申请实施例。The splicing manner of splicing the log meta-information and the data to be written into the log data into the N-segment continuous data through the memory buffer is applicable to the embodiment of the present application.
例如,在一种示例性实施方式中,存储管理设备10可以将日志元信息和待写入日志数据拆分为N份,在内存缓冲区中选择一块连续区域,每次将其中一份数据缓存至该连续区域内得到一个内存块,并将得到的内存块写入相应物理扇区中,这样经过N次操作之后,可以拼接出N个内存块并且N个内存块会被写入N个物理扇区中。For example, in an exemplary embodiment, the storage management device 10 may split the log meta information and the log data to be written into N shares, select a continuous area in the memory buffer, and cache one of the data each time. Obtain a memory block in the contiguous area, and write the obtained memory block into the corresponding physical sector, so after N operations, N memory blocks can be spliced and N memory blocks are written into N physics. In the sector.
又例如,在另一种示例性实施方式中,存储管理设备10可以将日志元信息和待写入日志数据拆分为N份,并将N份数据分别缓存至内存缓冲区的N个连续区域内以获得N个内存块,每个连续区域中存储一段连续数据,每个连续区域的大小小于或等于一个物理扇区的大小。For another example, in another exemplary embodiment, the storage management device 10 may split the log meta information and the log data to be written into N shares, and cache the N pieces of data into N consecutive areas of the memory buffer. N memory blocks are obtained, and a continuous piece of data is stored in each successive area, and the size of each continuous area is less than or equal to the size of one physical sector.
可选地,从拼接内容的角度给出一种数据拼接的实施方式。在该实施方式中,存储管理设备10可以将日志元信息和待写入日志数据中的首部数据或尾部数据缓存至内存缓冲区的一连续区域内以获得一个内存块;首部数据或尾部数据的大小与基准数据块大小相同;然后,以基准数据块大小为单位,将待写入日志数据中的其它数据分别缓存至内存缓冲区的其它连续区域内以获得N-1个内存块,此处N=M。其它连续区域是N-1连续区域。在该实施方式中,将日志元信息和待写入日志数据中的首部数据或尾部数据缓冲为一个内存块,而以基准数据块大小为单位可以将待写入日志数据中的其它数据缓冲为M-1个内存块,最终得到M个内存块,进而可通过M次跨物理扇区的IO操作将待写入日志项写入日志磁盘20中,相比于M+1次IO操作,减少了一次IO操作,有利于提高写日志的执行效率。Optionally, an embodiment of data splicing is given from the perspective of spliced content. In this embodiment, the storage management device 10 may cache the log meta information and the header data or the tail data to be written in the log data into a continuous area of the memory buffer to obtain a memory block; the header data or the tail data. The size is the same as the size of the reference data block; then, in the unit of the reference data block size, the other data to be written into the log data is separately cached into other consecutive areas of the memory buffer to obtain N-1 memory blocks, where N=M. Other continuous areas are N-1 continuous areas. In this embodiment, the log meta information and the header data or the tail data to be written in the log data are buffered into one memory block, and other data to be written in the log data can be buffered in units of the reference data block size. M-1 memory blocks, and finally get M memory blocks, and then the log items to be written are written into the log disk 20 by M times of IO operations across physical sectors, which is reduced compared to M+1 IO operations. An IO operation is beneficial to improve the execution efficiency of the write log.
值得说明的是,除了以基准数据块大小为单位,将待写入日志数据中的其它数据缓存为M-1个内存块之外,还可以将待写入日志数据中的其它数据缓存为小于M-1个的内存块,具体个数视物理扇区的大小而定。It is worth noting that, in addition to the reference data block size, other data to be written into the log data is cached as M-1 memory blocks, and other data to be written in the log data may be cached to be smaller than M-1 memory blocks, the specific number depends on the size of the physical sector.
可选地,从内存块连续性的角度给出两种数据拼接的实施方式。在一种实施方式中,存储管理设备10可以在内存缓冲区中,以连续方式对日志元信息和待写入日志数据进 行拼接以获得N个内存块。在另一种实施方式中,储管理设备10可以在内存缓冲区中,以间隔方式对日志元信息和待写入日志数据进行拼接以获得N个内存块。Optionally, an implementation of two data splicing is given from the perspective of memory block continuity. In one embodiment, the storage management device 10 may splicing the log meta information and the log data to be written in a continuous manner in a memory buffer to obtain N memory blocks. In another implementation manner, the storage management device 10 may splicing the log meta information and the log data to be written in an interval in a memory buffer to obtain N memory blocks.
在以连续方式拼接得到N个内存块的实施方式中,各内存块依次相邻,彼此之间没有间隙。在该实施方式中,若内存缓冲区的大小大于N个内存块的大小之和,则多出的存储空间可位于内存缓冲区的首部和/或末尾。In an embodiment in which N memory blocks are spliced in a continuous manner, the memory blocks are sequentially adjacent to each other with no gap therebetween. In this embodiment, if the size of the memory buffer is greater than the sum of the sizes of the N memory blocks, the extra storage space may be located at the beginning and/or the end of the memory buffer.
其中,以间隔方式拼接得到N个内存块的实施方式适用于内存缓冲区的大小大于N个内存块的大小之和的情况。在该实施方式中,相邻两个内存块之间存在至少一个字节的间隙,通过该间隙可方便地区分不同的内存块。The embodiment in which N memory blocks are spliced in an interval manner is applicable to a case where the size of the memory buffer is larger than the sum of the sizes of the N memory blocks. In this embodiment, there is at least one byte gap between two adjacent memory blocks, through which the different memory blocks can be easily distinguished.
在本申请实施例提供的存储系统100中,要求日志磁盘20的物理扇区的大小大于或等于日志元信息的大小与基准数据块大小之和。在一些示例性实施方式中,可以直接选用物理扇区的大小大于或等于日志元信息的大小与基准数据块大小之和的磁盘作为日志磁盘20。在另一些示例性实施方式中,可以选用支持可变扇区尺寸的磁盘作为日志磁盘20。In the storage system 100 provided by the embodiment of the present application, the size of the physical sector of the log disk 20 is required to be greater than or equal to the sum of the size of the log meta information and the size of the reference data block. In some exemplary embodiments, a disk whose physical sector size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block may be directly selected as the log disk 20. In other exemplary embodiments, a disk supporting a variable sector size may be selected as the log disk 20.
在选用支持可变扇区尺寸的磁盘作为日志磁盘20的实施方式中,在开始时,日志磁盘20可以作为常规磁盘实现,其物理扇区的大小等于基准数据块大小。基于此,在向日志磁盘20写入日志项之前,可以将日志磁盘中物理扇区的大小调整为大于或等于日志元信息的大小与基准数据块大小之和。In an embodiment in which a disk supporting a variable sector size is selected as the log disk 20, at the beginning, the log disk 20 can be implemented as a regular disk whose physical sector size is equal to the reference data block size. Based on this, before the log entry is written to the log disk 20, the size of the physical sector in the log disk can be adjusted to be greater than or equal to the sum of the size of the log meta information and the size of the reference data block.
在一种示例性实施方式中,可以根据元信息的大小与基准数据块大小,计算日志磁盘20中物理扇区的大小的下限值;从日志磁盘20所支持的至少两种物理扇区尺寸中,选择大于或等于所述下限值的尺寸作为目标值;将日志磁盘20中物理扇区的大小由当前值调节目标值。In an exemplary embodiment, the lower limit value of the size of the physical sector in the log disk 20 may be calculated according to the size of the meta information and the reference data block size; at least two physical sector sizes supported from the log disk 20. In the middle, a size greater than or equal to the lower limit value is selected as the target value; the size of the physical sector in the log disk 20 is adjusted from the current value by the target value.
例如,假设基准数据块大小为4KB(即4096字节),日志元信息的大小为64字节,日志磁盘20支持4096字节、4104字节、4160字节以及4224字节等扇区尺寸,并假设一开始日志磁盘20中物理扇区的大小为4096字节,则根据基准数据块大小4KB(即4096字节)和日志元信息的大小64字节计算出物理扇区的大小的下限值为4096字节+64字节=4160字节,然后从4096字节、4104字节、4160字节以及4224字节等扇区尺寸中,选择大于或等于4160字节的扇区尺寸,例如选择4160字节作为目标值,然后将日志磁盘20中物理扇区的大小由4096字节调整为4160字节,使得物理扇区的大小满足大于或等于日志元信息的大小与基准数据块大小之和。For example, assuming that the reference data block size is 4 KB (ie, 4096 bytes), the log meta information size is 64 bytes, and the log disk 20 supports sector sizes such as 4096 bytes, 4104 bytes, 4160 bytes, and 4224 bytes. Assuming that the size of the physical sector in the log disk 20 is 4096 bytes at the beginning, the lower limit of the size of the physical sector is calculated according to the reference data block size of 4 KB (ie, 4096 bytes) and the size of the log meta information of 64 bytes. The value is 4096 bytes + 64 bytes = 4160 bytes, and then the sector size greater than or equal to 4160 bytes is selected from sector sizes such as 4096 bytes, 4104 bytes, 4160 bytes, and 4224 bytes, for example, Select 4160 bytes as the target value, and then adjust the size of the physical sector in the log disk 20 from 4096 bytes to 4160 bytes, so that the size of the physical sector satisfies the size of the log meta information and the size of the reference data block. with.
进一步,在将日志磁盘20中物理扇区的大小由当前值调节目标值时,可以响应于格式化请求,按照目标值重新对日志磁盘进行格式化,以获得大小大于或等于日志元信息的大小与基准数据块大小之和的物理扇区;或者,也可以借助磁盘工具或命令行,将日志磁盘20中物理扇区的大小由当前值调节目标值。本申请实施例对此不做限定,凡是可以将日志磁盘20中物理扇区的大小由当前值调节目标值的实施方式均适应于本申请实施例。Further, when the size of the physical sector in the log disk 20 is adjusted from the current value by the current value, the log disk may be re-formatted according to the target value in response to the formatting request to obtain a size greater than or equal to the log meta information. The physical sector that is the sum of the size of the reference data block; alternatively, the size of the physical sector in the log disk 20 can be adjusted from the current value by the disk tool or the command line. The embodiment of the present application is not limited to this. Any implementation manner in which the size of the physical sector in the log disk 20 can be adjusted from the current value is adapted to the embodiment of the present application.
为便于理解本申请实施例的技术方案,下面结合图2所示地址对齐过程,对存储管理设备10向日志磁盘20中写日志的过程进行举例说明。To facilitate the understanding of the technical solution of the embodiment of the present application, the process of writing the log to the log disk 20 by the storage management device 10 is illustrated in the following with reference to the address alignment process shown in FIG. 2 .
如图2所示,以基准数据块大小为4KB(即4096字节)为例,如图2中左侧所示日志磁盘20包括物理扇区记为A1、B1以及C1,每个物理扇区的大小为4096字节,同时假设待写入日志项的日志元信息的大小为LogEntryHeaderSize,待写入日志数据的大小为基准数据块的1倍,即4096字节。如图2所示,如果向图2中左侧所示日志磁盘20写入待写入日志项,至少需要两次IO操作。在本实施例中,存储管理设备10可通过可变扇区大小(Variable Sector Size,VSS)技术将日志磁盘20的物理扇区的大小由4096调整为日志磁盘20所支持的4096字节、4104字节、4160字节以及4224字节等扇区尺寸中大于或等于(LogEntryHeaderSize+4096)的一个数值。在图2所示实施例中,以LogEntryHeaderSize=64字节为例,则4096+64=4160字节,则可以选择4160字节或者4224字节,图2所示实施例以选择4160字节为例。其中,调整物理扇区的大小之后的日志磁盘20如图2中右侧所示,包括三个物理扇区记为A2、B2以及C2。As shown in FIG. 2, taking the reference data block size as 4 KB (that is, 4096 bytes) as an example, the log disk 20 shown in the left side of FIG. 2 includes physical sectors denoted as A1, B1, and C1, and each physical sector. The size of the log is 4096 bytes, and the size of the log meta information to be written to the log entry is LogEntryHeaderSize, and the size of the log data to be written is 1 times of the reference data block, that is, 4096 bytes. As shown in FIG. 2, if the log entry to be written is written to the log disk 20 shown on the left side of FIG. 2, at least two IO operations are required. In this embodiment, the storage management device 10 can adjust the size of the physical sector of the log disk 20 from 4096 to 4096 bytes and 4104 supported by the log disk 20 by a Variable Sector Size (VSS) technology. A value greater than or equal to (LogEntryHeaderSize+4096) in sector sizes such as bytes, 4160 bytes, and 4224 bytes. In the embodiment shown in FIG. 2, taking LogEntryHeaderSize=64 bytes as an example, if 4096+64=4160 bytes, 4160 bytes or 4224 bytes can be selected, and the embodiment shown in FIG. 2 selects 4160 bytes as example. The log disk 20 after adjusting the size of the physical sector is as shown on the right side of FIG. 2, and includes three physical sectors denoted as A2, B2, and C2.
值得说明的是,图2中右侧所示日志磁盘20貌似比左侧所示日志磁盘20大一些,这仅是为了便于图示,左右两侧的日志磁盘20的总存储空间并未发生变化,仅仅是物理扇区的大小发生了变化。It should be noted that the log disk 20 shown on the right side of FIG. 2 seems to be larger than the log disk 20 shown on the left side. This is only for convenience of illustration, and the total storage space of the log disk 20 on the left and right sides has not changed. Only the size of the physical sector has changed.
为便于描述,将调整后物理扇区的大小记为SectorSize,为了保证每个日志项在日志磁盘20中的起始位置都能按照SectorSize对齐,存储管理设备10对待写入日志项进行地址对齐,对齐结果如图2所示,待写入日志项与日志磁盘20中的物理扇区B2对齐。存储管理设备10在向日志磁盘20写入待写入日志项时,先将待写入日志项的日志元信息和待写入日志数据在一内存缓冲区中进行拼接以获得大小为4160字节的内存块,并将拼接后的内存块一次性写入按SectorSize对齐的物理扇区B2中。由此可见,基于图2右侧所示日志磁盘20,如果向图2中右侧所示日志磁盘20写入待写入日志项,只 需一次IO操作即可,由于减少了IO操作的次数,可以提高写日志的执行效率。For the convenience of description, the size of the adjusted physical sector is recorded as SectorSize. To ensure that each log entry can be aligned according to SectorSize at the starting position in the log disk 20, the storage management device 10 performs address alignment on the log entry to be written. The alignment result is shown in FIG. 2, and the log entry to be written is aligned with the physical sector B2 in the log disk 20. When the storage management device 10 writes the log entry to be written to the log disk 20, the log meta information to be written to the log entry and the log data to be written are first spliced in a memory buffer to obtain a size of 4160 bytes. The memory block, and the spliced memory block is written once in the physical sector B2 aligned by SectorSize. It can be seen that, based on the log disk 20 shown on the right side of FIG. 2, if the log entry to be written is written to the log disk 20 shown on the right side of FIG. 2, only one IO operation is required, since the number of IO operations is reduced. Can improve the efficiency of writing logs.
图3为本申请另一示例性实施例提供的日志写入方法的流程示意图。该方法可应用于图1所示存储系统,但不限于此。凡是涉及写日志操作的应用场景均可采用本实施例提供的日志写入方法。如图3所示,该方法包括:FIG. 3 is a schematic flowchart diagram of a log writing method according to another exemplary embodiment of the present application. The method can be applied to the storage system shown in FIG. 1, but is not limited thereto. The log writing method provided in this embodiment can be used in any application scenario involving a write log operation. As shown in FIG. 3, the method includes:
301、获取待写入日志项,该待写入日志项包括日志元信息和待写入日志数据,待写入日志数据的大小是基准数据块大小的M倍,M是正整数。301. Obtain a log entry to be written. The log entry to be written includes log meta information and log data to be written. The size of the log data to be written is M times the size of the reference data block, and M is a positive integer.
302、按照日志磁盘中物理扇区的大小对待写入日志项进行地址对齐,以确定用于存储待写入日志项的物理扇区的起始地址,该日志磁盘中物理扇区的大小大于或等于日志元信息的大小与基准数据块大小之和。302. Perform address alignment on the log entry according to the size of the physical sector in the log disk to determine a starting address of a physical sector for storing the log entry to be written, where the size of the physical sector is greater than or It is equal to the sum of the size of the log meta information and the size of the reference data block.
303、对日志元信息和待写入日志数据进行数据拼接以形成N个内存块,N<=M,且N为正整数。303. Perform data splicing on the log meta information and the log data to be written to form N memory blocks, where N<=M, and N is a positive integer.
304、将N个内存块写入日志磁盘中自上述起始地址开始的N个物理扇区中。304. Write N memory blocks into the log disk in N physical sectors starting from the above starting address.
在本实施例中,日志磁盘采用非常规磁盘,所述非常规主要是指该日志磁盘中物理扇区的大小大于或等于日志元信息的大小与基准数据块大小之和。基准数据块大小是指常规情况下存储介质所支持的单次读写操作所能读写的数据块大小,该数据块大小与存储技术的发展相关,在不同时期可以取不同的值。基准数据块大小相当于在当前存储技术发展阶段,常规物理扇区的大小,也就是常规情况下存储介质允许一次读写操作读写的数据量,例如可以是512字节、4096字节等。In this embodiment, the log disk adopts an unconventional disk. The unconventional mainly means that the size of the physical sector in the log disk is greater than or equal to the sum of the size of the log meta information and the size of the reference data block. The reference data block size refers to the size of the data block that can be read and written by a single read/write operation supported by the storage medium. The size of the data block is related to the development of the storage technology, and different values can be taken in different periods. The reference data block size is equivalent to the size of the conventional physical sector in the current development stage of the storage technology, that is, the amount of data that the storage medium allows reading and writing operations to read and write in a normal case, for example, 512 bytes, 4096 bytes, and the like.
基于上述,当需要向日志磁盘写入日志项时,可以获取待写入日志项。该待写入日志项包括日志元信息和待写入日志数据,且待写入日志数据的大小是基准数据块大小的M倍。之后,一方面按照日志磁盘中物理扇区的大小对待写入日志项进行地址对齐,以确定日志磁盘中用于存储待写入日志项的物理扇区的起始地址;另一方面对日志元信息和待写入日志数据进行数据拼接以形成N个内存块,N<=M,且N为正整数。之后,将N个内存块写入日志磁盘中自上述起始地址开始的N个物理扇区中,完成日志项的写入操作。这里的内存块是指可以一次性写入一个物理扇区的数据块,该内存块的大小小于或等于日志磁盘中物理扇区的大小。Based on the above, when a log entry needs to be written to the log disk, the log entry to be written can be obtained. The log entry to be written includes log meta information and log data to be written, and the size of the log data to be written is M times the size of the reference data block. Then, on the one hand, according to the size of the physical sector in the log disk, the log entry is to be aligned to determine the starting address of the physical sector in the log disk for storing the log entry to be written; The information and the log data to be written are spliced to form N memory blocks, N <= M, and N is a positive integer. After that, N memory blocks are written into the log disk in the N physical sectors starting from the above starting address, and the log entry is completed. The memory block here refers to a data block that can be written to one physical sector at a time, and the size of the memory block is less than or equal to the size of the physical sector in the log disk.
由于日志磁盘的物理扇区大于或等于日志元信息的大小与基准数据块大小之和,所以通过数据拼接有可能将待写入日志项拼接为不大于M个数据块,从而占用更少数量的物理扇区,而不再是M+1个,从而减小向日志磁盘中写入日志项所需要的跨物理扇区的IO操作的次数,提高向日志磁盘中写入日志项的执行效率。Since the physical sector of the log disk is greater than or equal to the sum of the size of the log meta-information and the size of the reference data block, it is possible to splicing the log items to be written into no more than M data blocks through data splicing, thereby occupying a smaller number. Physical sectors, instead of M+1, reduce the number of IO operations across physical sectors required to write log entries to the log disk, improving the efficiency of writing log entries to the log disk.
根据应用场景的不同,获取待写入日志项的方式也会有所不同。举例说明,在基于WAL日志的存储系统中,可以接收数据库更新请求,数据库更新请求包括更新操作控制信息和待写入数据库的数据块;将更新操作控制信息和待写入数据库的数据块分别作为日志元信息和待写入日志数据,以生成待写入日志项。除此方式之外,也可以采用其他方式获取待写入日志项,例如可以直接从日志生成装置获取待写入日志项。Depending on the application scenario, the way to get log entries to be written varies. For example, in the WAL log-based storage system, a database update request may be received, where the database update request includes update operation control information and a data block to be written into the database; and the update operation control information and the data block to be written into the database are respectively taken as Log meta information and log data to be written to generate log entries to be written. In addition to this method, the log entry to be written may also be obtained in other manners. For example, the log entry to be written may be obtained directly from the log generating device.
在一些示例性实施例中,假设日志磁盘中物理扇区的大小为K字节,K为正整数。基于此,在获得待写入日志项之后,可以将日志磁盘中最后写操作的末尾地址按照K字节向上取整,获得一地址信息,即为日志磁盘中用于存储待写入日志项的物理扇区的起始地址。例如,假设基准数据块大小为4KB(即4096字节),日志元信息的大小为64字节,日志磁盘中物理扇区的大小K为4160字节,而日志磁盘中最后写操作的末尾地址为4150字节,则对4150字节按照4160字节向上取整,可以得到一地址,即第4160字节,这意味着,可以自日志磁盘中的第4160字节开始存储待写入日志项。In some exemplary embodiments, assume that the size of the physical sector in the log disk is K bytes and K is a positive integer. Based on this, after obtaining the log entry to be written, the end address of the last write operation in the log disk can be rounded up by K bytes to obtain an address information, that is, the log disk is used to store the log entry to be written. The starting address of the physical sector. For example, suppose the base block size is 4KB (that is, 4096 bytes), the size of the log meta information is 64 bytes, and the size K of the physical sector in the log disk is 4160 bytes, and the end address of the last write operation in the log disk. For 4150 bytes, the 4150 bytes are rounded up by 4160 bytes, and an address, that is, 4160 bytes, can be obtained, which means that the log entry to be written can be stored starting from the 4160th byte in the log disk. .
在一些示例性实施例中,在对日志元信息和待写入日志数据进行数据拼接时,可以一次性拼接出N个内存块;或者,也可以每次拼接出N个内存块中的部分内存块,经过多次拼接最终得到N个内存块。例如,可以每次拼接出一个内存块,经过N次拼接得到N个内存块。相应地,在将N个内存块写入N个物理扇区时,可以是在拼接出N个内存块之后,经过N次写入操作将N个内存块写入N个物理扇区;或者,也可以是每拼接出一个内存块就执行一次写入操作,将拼接出的内存块写入相应的物理扇区中,这样经过N次写入操作后可以将N个内存块写入N个物理扇区。In some exemplary embodiments, when data splicing is performed on the log meta information and the log data to be written, N memory blocks may be spliced at one time; or, part of the N memory blocks may be spliced each time. Block, after multiple stitching, finally get N memory blocks. For example, one memory block can be spliced each time, and N memory blocks are obtained after N times of splicing. Correspondingly, when N memory blocks are written into N physical sectors, N memory blocks may be written into N physical sectors after N times of writing operations after splicing out N memory blocks; or Alternatively, each time a memory block is spliced, a write operation is performed, and the spliced memory block is written into the corresponding physical sector, so that N memory blocks can be written to N physics after N write operations. Sector.
在一些示例性实施例中,在对日志元信息和待写入日志数据进行数据拼接时,可以通过一内存缓冲区对日志元信息和待写入日志数据进行拼接以形成N个内存块,该内存缓冲区的大小等于N个物理扇区的大小。一个内存块对应一个物理扇区。一个内存块是内存缓冲区中一段连续的数据。可选地,该内存缓冲区可以是内存中一块连续的区域,但不限于此。In some exemplary embodiments, when data splicing is performed on the log meta information and the log data to be written, the log meta information and the log data to be written may be spliced through a memory buffer to form N memory blocks. The size of the memory buffer is equal to the size of N physical sectors. A memory block corresponds to one physical sector. A memory block is a contiguous piece of data in a memory buffer. Optionally, the memory buffer may be a continuous area in the memory, but is not limited thereto.
凡是可以通过内存缓冲区将待写入日志项中的日志元信息和待写入日志数据拼接为N段连续数据的拼接方式均适用于本申请实施例。The splicing manner of splicing the log meta-information and the data to be written into the log data into the N-segment continuous data through the memory buffer is applicable to the embodiment of the present application.
例如,在一种示例性实施方式中,可以将日志元信息和待写入日志数据拆分为N份,在内存缓冲区中选择一块连续区域,每次将其中一份数据缓存至该连续区域内得到一个内存块,并将得到的内存块写入相应物理扇区中,这样经过N次操作之后,可以拼接出N个内存块并且N个内存块会被写入N个物理扇区中。For example, in an exemplary embodiment, the log meta information and the log data to be written may be split into N shares, and a continuous area is selected in the memory buffer, and one of the data is buffered to the continuous area each time. A memory block is obtained, and the obtained memory block is written into the corresponding physical sector, so after N operations, N memory blocks can be spliced and N memory blocks are written into N physical sectors.
又例如,在另一种示例性实施方式中,可以将日志元信息和待写入日志数据拆分为N份,并将N份数据分别缓存至内存缓冲区的N个连续区域内以获得N个内存块,每个连续区域中存储一段连续数据,每个连续区域的大小小于或等于一个物理扇区的大小。For another example, in another exemplary embodiment, the log meta information and the log data to be written may be split into N shares, and the N pieces of data are separately cached into N consecutive areas of the memory buffer to obtain N. A memory block in which a continuous piece of data is stored in each successive area, and the size of each successive area is less than or equal to the size of one physical sector.
可选地,从拼接内容的角度给出一种数据拼接的实施方式。在该实施方式中,可以将日志元信息和待写入日志数据中的首部数据或尾部数据缓存至内存缓冲区的一连续区域内以获得一个内存块;首部数据或尾部数据的大小与基准数据块大小相同;然后,以基准数据块大小为单位,将待写入日志数据中的其它数据分别缓存至内存缓冲区的其它连续区域内以获得N-1个内存块,此处N=M。其它连续区域是M-1连续区域。在该实施方式中,将日志元信息和待写入日志数据中的首部数据或尾部数据缓冲为一个内存块,而以基准数据块大小为单位可以将待写入日志数据中的其它数据缓冲为M-1个内存块,最终得到M个内存块,进而可通过M次跨物理扇区的IO操作将待写入日志项写入日志磁盘20中,相比于M+1次IO操作,减少了一次IO操作,有利于提高写日志的执行效率。Optionally, an embodiment of data splicing is given from the perspective of spliced content. In this embodiment, the log meta information and the header data or the tail data to be written in the log data may be buffered into a continuous area of the memory buffer to obtain a memory block; the size of the header data or the tail data and the reference data. The block size is the same; then, in the unit of the reference data block size, the other data to be written into the log data is separately cached into other consecutive areas of the memory buffer to obtain N-1 memory blocks, where N=M. Other continuous areas are M-1 continuous areas. In this embodiment, the log meta information and the header data or the tail data to be written in the log data are buffered into one memory block, and other data to be written in the log data can be buffered in units of the reference data block size. M-1 memory blocks, and finally get M memory blocks, and then the log items to be written are written into the log disk 20 by M times of IO operations across physical sectors, which is reduced compared to M+1 IO operations. An IO operation is beneficial to improve the execution efficiency of the write log.
值得说明的是,除了以基准数据块大小为单位,将待写入日志数据中的其它数据缓存为M-1个内存块之外,还可以将待写入日志数据中的其它数据缓存为小于M-1个的内存块,具体个数视物理扇区的大小而定。It is worth noting that, in addition to the reference data block size, other data to be written into the log data is cached as M-1 memory blocks, and other data to be written in the log data may be cached to be smaller than M-1 memory blocks, the specific number depends on the size of the physical sector.
可选地,从内存块连续性的角度给出两种数据拼接的实施方式。在一种实施方式中,可以在内存缓冲区中,以连续方式对日志元信息和待写入日志数据进行拼接以获得N个内存块。在另一种实施方式中,可以在内存缓冲区中,以间隔方式对日志元信息和待写入日志数据进行拼接以获得N个内存块。Optionally, an implementation of two data splicing is given from the perspective of memory block continuity. In an embodiment, the log meta information and the log data to be written may be spliced in a continuous manner in a memory buffer to obtain N memory blocks. In another implementation manner, the log meta information and the log data to be written may be spliced in an interval in a memory buffer to obtain N memory blocks.
在以连续方式拼接得到N个内存块的实施方式中,各内存块依次相邻,彼此之间没有间隙。在该实施方式中,若内存缓冲区的大小大于N个内存块的大小之和,则多出的存储空间可位于内存缓冲区的首部和/或末尾。In an embodiment in which N memory blocks are spliced in a continuous manner, the memory blocks are sequentially adjacent to each other with no gap therebetween. In this embodiment, if the size of the memory buffer is greater than the sum of the sizes of the N memory blocks, the extra storage space may be located at the beginning and/or the end of the memory buffer.
其中,以间隔方式拼接得到N个内存块的实施方式适用于内存缓冲区的大小大于N个内存块的大小之和的情况。在该实施方式中,相邻两个内存块之间存在至少一个字节的间隙,通过该间隙可方便地区分不同的内存块。The embodiment in which N memory blocks are spliced in an interval manner is applicable to a case where the size of the memory buffer is larger than the sum of the sizes of the N memory blocks. In this embodiment, there is at least one byte gap between two adjacent memory blocks, through which the different memory blocks can be easily distinguished.
在上述方法实施例中,要求日志磁盘的物理扇区的大小大于或等于日志元信息的大小与基准数据块大小之和。在一些示例性实施方式中,可以直接选用物理扇区的大小大于或等于日志元信息的大小与基准数据块大小之和的磁盘作为日志磁盘。在另一些示例性实施方式中,可以选用支持可变扇区尺寸的磁盘作为日志磁盘。In the above method embodiment, the size of the physical sector of the log disk is required to be greater than or equal to the sum of the size of the log meta information and the size of the reference data block. In some exemplary embodiments, a disk whose physical sector size is greater than or equal to the sum of the log metadata information and the reference data block size may be directly selected as the log disk. In other exemplary embodiments, a disk supporting a variable sector size may be selected as the log disk.
在选用支持可变扇区尺寸的磁盘作为日志磁盘的实施方式中,在开始时,日志磁盘可以作为常规磁盘实现,其物理扇区的大小等于基准数据块大小。基于此,在向日志磁盘写入日志项之前,还包括将日志磁盘中物理扇区的大小调整为大于或等于日志元信息的大小与基准数据块大小之和的步骤。In an embodiment where a variable sector size disk is selected as the log disk, at the beginning, the log disk can be implemented as a regular disk whose physical sector size is equal to the reference data block size. Based on this, before the log entry is written to the log disk, the method further includes the step of adjusting the size of the physical sector in the log disk to be greater than or equal to the sum of the size of the log meta information and the size of the reference data block.
可选地,可以根据元信息的大小与基准数据块大小,计算日志磁盘中物理扇区的大小的下限值;从日志磁盘所支持的至少两种物理扇区尺寸中,选择大于或等于所述下限值的尺寸作为目标值;将日志磁盘中物理扇区的大小由当前值调节目标值。Optionally, the lower limit value of the size of the physical sector in the log disk may be calculated according to the size of the meta information and the reference data block size; and the at least two physical sector sizes supported by the log disk are selected to be greater than or equal to The size of the lower limit is used as the target value; the size of the physical sector in the log disk is adjusted from the current value by the target value.
进一步,在将日志磁盘中物理扇区的大小由当前值调节目标值时,可以响应于格式化请求,按照目标值重新对日志磁盘进行格式化,以获得大小大于或等于日志元信息的大小与基准数据块大小之和的物理扇区;或者,也可以借助磁盘工具或命令行,将日志磁盘中物理扇区的大小由当前值调节目标值。本申请实施例对此不做限定,凡是可以将日志磁盘中物理扇区的大小由当前值调节目标值的实施方式均适应于本申请实施例。Further, when the size of the physical sector in the log disk is adjusted from the current value by the current value, the log disk may be re-formatted according to the target value in response to the formatting request to obtain a size greater than or equal to the size of the log meta information. The physical sector of the sum of the reference block sizes; alternatively, the size of the physical sector in the log disk can be adjusted from the current value by the disk tool or the command line. The embodiment of the present application does not limit this. Any implementation manner in which the size of the physical sector in the log disk can be adjusted from the current value is adapted to the embodiment of the present application.
需要说明的是,上述实施例所提供方法的各步骤的执行主体均可以是同一设备,或者,该方法也由不同设备作为执行主体。比如,步骤301至步骤304的执行主体可以为设备A;又比如,步骤301和302的执行主体可以为设备A,步骤303和304的执行主体可以为设备B;等等。It should be noted that the execution bodies of the steps of the method provided by the foregoing embodiments may all be the same device, or the method may also be performed by different devices. For example, the execution body of steps 301 to 304 may be device A; for example, the execution bodies of steps 301 and 302 may be device A, the execution bodies of steps 303 and 304 may be device B, and the like.
另外,在上述实施例及附图中的描述的一些流程中,包含了按照特定顺序出现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如301、302等,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。In addition, some of the processes described in the above-described embodiments and the accompanying drawings include a plurality of operations occurring in a specific order, but it should be clearly understood that the operations may be performed in the order in which they are presented or executed in parallel. The serial number of the operation, such as 301, 302, etc., is only used to distinguish the different operations, and the serial number itself does not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be performed sequentially or in parallel. It should be noted that the descriptions of “first” and “second” in this document are used to distinguish different messages, devices, modules, etc., and do not represent the order, nor the “first” and “second”. It is a different type.
图4a为本申请又一示例性实施例提供的日志写入装置的结构示意图。如图4a所示,该日志写入装置包括:获取模块41、对齐模块42、拼接模块43以及写入模块44。FIG. 4 is a schematic structural diagram of a log writing apparatus according to still another exemplary embodiment of the present application. As shown in FIG. 4a, the log writing device includes an acquisition module 41, an alignment module 42, a splicing module 43, and a writing module 44.
获取模块41,用于获取待写入日志项,该待写入日志项包括日志元信息和待写入日志数据,待写入日志数据的大小是基准数据块大小的M倍,M是正整数。The obtaining module 41 is configured to obtain a log entry to be written, where the log entry to be written includes log meta information and log data to be written, and the size of the log data to be written is M times the size of the reference data block, and M is a positive integer.
对齐模块42,用于按照日志磁盘中物理扇区的大小对待写入日志项进行地址对齐,以确定用于存储待写入日志项的物理扇区的起始地址,该日志磁盘中物理扇区的大小大于或等于日志元信息的大小与基准数据块大小之和。The aligning module 42 is configured to perform address alignment on the log entry to be written according to the size of the physical sector in the log disk to determine a starting address of a physical sector for storing the log entry to be written, and a physical sector in the log disk The size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block.
拼接模块43,用于对日志元信息和待写入日志数据进行数据拼接以形成N个内存块,N<=M,且N为正整数。The splicing module 43 is configured to perform data splicing on the log meta information and the log data to be written to form N memory blocks, N<=M, and N is a positive integer.
写入模块44,用于将N个内存块写入日志磁盘中自上述起始地址开始的N个物理扇区中。The writing module 44 is configured to write N memory blocks into the N physical sectors in the log disk starting from the above starting address.
在一些示例性实施例中,对齐模块42具体用于:将日志磁盘中最后写操作的末尾地址按照K字节向上取整,以获得上述起始地址,日志磁盘中物理扇区的大小为K字节。In some exemplary embodiments, the aligning module 42 is specifically configured to: round up the last address of the last write operation in the log disk by K bytes to obtain the above starting address, and the size of the physical sector in the log disk is K. byte.
在一些示例性实施例中,拼接模块43具体用于:一次性拼接出N个内存块;或者,也可以每次拼接出N个内存块中的部分内存块,经过多次拼接最终得到N个内存块。例如,可以每次拼接出一个内存块,经过N次拼接得到N个内存块。相应地,写入模块44可以在拼接模块43拼接出N个内存块之后,经过N次写入操作将N个内存块写入N个物理扇区;或者,也可以在拼接模块43每拼接出一个内存块就执行一次写入操作,将拼接模块43拼接出的内存块写入相应的物理扇区中,这样经过N次写入操作后可以将N个内存块写入N个物理扇区。In some exemplary embodiments, the splicing module 43 is specifically configured to: splicing out N memory blocks at a time; or, splicing out a portion of the N memory blocks at a time, and finally obtaining N after multiple splicing Memory block. For example, one memory block can be spliced each time, and N memory blocks are obtained after N times of splicing. Correspondingly, the writing module 44 can write N memory blocks into N physical sectors after N times of writing operations after the splicing module 43 splices out N memory blocks; or, each splicing module 43 can be spliced out. A memory block performs a write operation, and the memory blocks spliced out by the splicing module 43 are written into the corresponding physical sectors, so that N memory blocks can be written into N physical sectors after N write operations.
在一些示例性实施例中,拼接模块43具体用于:通过一内存缓冲区对日志元信息和待写入日志数据进行拼接以形成所述N个内存块,所述内存缓冲区的大小等于所述N个物理扇区的大小。In some exemplary embodiments, the splicing module 43 is specifically configured to: splice log metadata information and log data to be written through a memory buffer to form the N memory blocks, where the size of the memory buffer is equal to The size of the N physical sectors.
进一步可选地,拼接模块43具体用于:将日志元信息和待写入日志数据中的首部数据或尾部数据缓存至内存缓冲区的一连续区域内以获得一个内存块,所述首部数据或尾部数据的大小为基准数据块大小;以基准数据块大小为单位,将待写入日志数据中的其它数据分别缓存至内存缓冲区的其它连续区域内以获得N-1个内存块,此时N=M。Further, the splicing module 43 is specifically configured to cache the log metadata information and the header data or the tail data to be written into the log data into a continuous area of the memory buffer to obtain a memory block, or the header data or The size of the tail data is the reference data block size; in the unit of the reference data block size, the other data to be written into the log data is separately buffered into other consecutive areas of the memory buffer to obtain N-1 memory blocks. N=M.
进一步可选地,拼接模块43具体用于:在内存缓冲区中,以连续方式对日志元信息和待写入日志数据进行拼接以获得N个内存块;或者,在内存缓冲区中,以间隔方式对日志元信息和待写入日志数据进行拼接以获得N个内存块。Further, the splicing module 43 is specifically configured to: in a memory buffer, splicing the log meta information and the log data to be written in a continuous manner to obtain N memory blocks; or, in the memory buffer, at intervals The method combines the log meta information and the log data to be written to obtain N memory blocks.
在一些示例性实施例中,获取模块41具体用于:接收数据库更新请求,数据库更新请求包括更新操作控制信息和待写入数据库的数据块;将更新操作控制信息和待写入数据库的数据块分别作为日志元信息和待写入日志数据,以生成待写入日志项。In some exemplary embodiments, the obtaining module 41 is specifically configured to: receive a database update request, the database update request includes updating operation control information and a data block to be written into the database; and updating the operation control information and the data block to be written into the database The log metadata information and the log data to be written are respectively generated to generate a log entry to be written.
在一些示例性实施例中,日志写入装置还包括:调整模块。该调整模块,用于在对齐模块42执行地址对齐操作之前,将日志磁盘中物理扇区的大小调整为大于或等于日志元信息的大小与基准数据块大小之和。In some exemplary embodiments, the log writing device further includes: an adjustment module. The adjustment module is configured to adjust the size of the physical sector in the log disk to be greater than or equal to the sum of the size of the log meta information and the reference data block size before the alignment module 42 performs the address alignment operation.
在一些示例性实施例中,调整模块具体用于:根据元信息的大小与基准数据块大小, 计算日志磁盘中物理扇区的大小的下限值;从日志磁盘所支持的至少两种物理扇区尺寸中,选择大于或等于下限值的尺寸作为目标值;将日志磁盘中物理扇区的大小由当前值调节目标值。In some exemplary embodiments, the adjusting module is specifically configured to: calculate a lower limit value of a size of a physical sector in the log disk according to a size of the meta information and a reference data block size; and at least two physical fans supported by the log disk In the area size, a size greater than or equal to the lower limit value is selected as the target value; the size of the physical sector in the log disk is adjusted from the current value by the target value.
在一些示例性实施例中,调整模块在将日志磁盘中物理扇区的大小由当前值调节目标值时,具体用于:响应于格式化请求,按照目标值重新对日志磁盘进行格式化,以获得大小大于或等于日志元信息的大小与基准数据块大小之和的物理扇区;或者,也可以借助磁盘工具或命令行,将日志磁盘中物理扇区的大小由当前值调节目标值。本申请实施例对此不做限定,凡是可以将日志磁盘中物理扇区的大小由当前值调节目标值的实施方式均适应于本申请实施例。In some exemplary embodiments, when the size of the physical sector in the log disk is adjusted from the current value by the target value, the adjustment module is specifically configured to: in response to the formatting request, re-format the log disk according to the target value, to Obtain a physical sector whose size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block; or, by using the disk tool or the command line, the size of the physical sector in the log disk is adjusted from the current value by the target value. The embodiment of the present application does not limit this. Any implementation manner in which the size of the physical sector in the log disk can be adjusted from the current value is adapted to the embodiment of the present application.
本实施例提供的日志写入装置,以日志磁盘中物理扇区的大小大于或等于日志元信息大小与基准数据块大小之和为基础,在向日志磁盘中写入待写入日志项时,结合地址对齐以及数据拼接可以将待写入日志项拼接为内存块,使得可以通过更少的IO操作将待写入日志项写入日志磁盘的物理扇区中,减小向日志磁盘中写入日志项所需要的IO操作的次数,提高了向日志磁盘中写入日志项的执行效率。The log writing device provided in this embodiment is based on the sum of the size of the physical sector in the log disk being greater than or equal to the size of the log metadata information and the size of the reference data block, and when writing the log entry to be written to the log disk, Combining address alignment and data splicing can splicing the log items to be written into memory blocks, so that the log items to be written can be written into the physical sectors of the log disk by less IO operations, and writing to the log disk is reduced. The number of IO operations required for log entries improves the efficiency of writing log entries to the log disk.
以上描述了日志写入装置的内部功能和结构,如图4b所示,实际中,该日志写入装置可实现为存储管理设备,包括:存储器51、处理器52以及通信组件53。The internal function and structure of the log writing device are described above, as shown in FIG. 4b. In practice, the log writing device can be implemented as a storage management device, including: a memory 51, a processor 52, and a communication component 53.
存储器51,可被配置为存储其它各种数据以支持在存储管理设备上的操作。这些数据的示例包括用于在存储管理设备上操作的任何应用程序或方法的指令,电话簿数据,消息,图片,视频等。The memory 51 can be configured to store other various data to support operations on the storage management device. Examples of such data include instructions for any application or method operating on a storage management device, phone book data, messages, pictures, videos, and the like.
存储器51可以由任何类型的易失性或非易失性存储介质或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 51 can be implemented by any type of volatile or non-volatile storage medium or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable. Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Disk or Optical Disk.
处理器52与存储器51耦合,用于执行存储器51中的程序,以用于:The processor 52 is coupled to the memory 51 for executing a program in the memory 51 for:
获取待写入日志项,该待写入日志项包括日志元信息和待写入日志数据,待写入日志数据的大小是基准数据块大小的M倍,M是正整数;Obtaining a log entry to be written, the log entry to be written includes log meta information and log data to be written, and the size of the log data to be written is M times the size of the reference data block, and M is a positive integer;
按照日志磁盘中物理扇区的大小对待写入日志项进行地址对齐,以确定用于存储待写入日志项的物理扇区的起始地址,该日志磁盘中物理扇区的大小大于或等于日志元信息的大小与基准数据块大小之和;The write log entry is address aligned according to the size of the physical sector in the log disk to determine the starting address of the physical sector for storing the log entry to be written. The size of the physical sector in the log disk is greater than or equal to the log. The sum of the size of the meta information and the size of the reference data block;
对日志元信息和待写入日志数据进行数据拼接以形成N个内存块,N<=M,且N为正 整数;Performing data splicing on the log meta information and the log data to be written to form N memory blocks, N<=M, and N is a positive integer;
通过通信组件53将N个内存块写入日志磁盘中自上述起始地址开始的N个物理扇区中。N memory blocks are written by the communication component 53 into N physical sectors starting from the above starting address in the log disk.
相应地,通信组件53,用于将N个内存块写入日志磁盘中自上述起始地址开始的N个物理扇区中。Correspondingly, the communication component 53 is configured to write N memory blocks into the N physical sectors starting from the above starting address in the log disk.
在一些示例性实施例中,处理器52在进行地址对齐时,具体用于:将日志磁盘中最后写操作的末尾地址按照K字节向上取整,以获得上述起始地址,日志磁盘中物理扇区的大小为K字节。In some exemplary embodiments, when performing address alignment, the processor 52 is specifically configured to: round up the end address of the last write operation in the log disk by K bytes to obtain the above starting address, and physical in the log disk. The size of the sector is K bytes.
在一些示例性实施例中,处理器52在进行数据拼接时,具体用于:一次性拼接出N个内存块;或者,每次拼接出N个内存块中的部分内存块,经过多次拼接最终得到N个内存块。例如,可以每次拼接出一个内存块,经过N次拼接得到N个内存块。相应地,处理器52在将N个内存块写入N个物理扇区时,具体用于:在拼接出N个内存块之后,经过N次写入操作将N个内存块写入N个物理扇区;或者,每拼接出一个内存块就执行一次写入操作,将拼接出的内存块写入相应的物理扇区中,这样经过N次写入操作后可以将N个内存块写入N个物理扇区。In some exemplary embodiments, when performing data splicing, the processor 52 is specifically configured to: splicing out N memory blocks at a time; or splicing out a part of the memory blocks in each of the N memory blocks, and splicing multiple times. Finally get N memory blocks. For example, one memory block can be spliced each time, and N memory blocks are obtained after N times of splicing. Correspondingly, when the N memory blocks are written into the N physical sectors, the processor 52 is specifically configured to: after splicing out the N memory blocks, write N memory blocks to N physical physics after N times of writing operations. Sector; or, each time a memory block is spliced, a write operation is performed, and the spliced memory block is written into the corresponding physical sector, so that N memory blocks can be written to N after N write operations. Physical sectors.
在一些示例性实施例中,处理器52在进行数据拼接时,具体用于:通过一内存缓冲区对日志元信息和待写入日志数据进行拼接以形成所述N个内存块,所述内存缓冲区的大小等于所述N个物理扇区的大小。In some exemplary embodiments, when performing data splicing, the processor 52 is specifically configured to: splice log metadata information and log data to be written through a memory buffer to form the N memory blocks, where the memory The size of the buffer is equal to the size of the N physical sectors.
在一些示例性实施例中,处理器52在拼接内存块时,具体用于:将日志元信息和待写入日志数据中的首部数据或尾部数据缓存至内存缓冲区的一连续区域内以获得一个内存块,所述首部数据或尾部数据的大小为基准数据块大小;以基准数据块大小为单位,将待写入日志数据中的其它数据分别缓存至内存缓冲区的其它连续区域内以获得N-1个内存块,此时N=M。In some exemplary embodiments, when splicing a memory block, the processor 52 is specifically configured to: cache log metadata and header data or tail data to be written into the log data into a continuous area of the memory buffer to obtain a memory block, the size of the header data or the tail data is a reference data block size; in the unit of the reference data block size, the other data to be written into the log data is separately cached in other consecutive areas of the memory buffer to obtain N-1 memory blocks, at this time N=M.
在一些示例性实施例中,处理器52在拼接内存块时,具体用于:在内存缓冲区中,以连续方式对日志元信息和待写入日志数据进行拼接以获得N个内存块;或者,在内存缓冲区中,以间隔方式对日志元信息和待写入日志数据进行拼接以获得N个内存块。In some exemplary embodiments, when the memory block is spliced, the processor 52 is specifically configured to: in a memory buffer, splicing the log meta information and the log data to be written in a continuous manner to obtain N memory blocks; or In the memory buffer, the log meta information and the log data to be written are spliced in an interval manner to obtain N memory blocks.
在一些示例性实施例中,处理器52在获取待写入日志项时,具体用于:接收数据库更新请求,数据库更新请求包括更新操作控制信息和待写入数据库的数据块;将更新操作控制信息和待写入数据库的数据块分别作为日志元信息和待写入日志数据,以生成待写入日志项。In some exemplary embodiments, when acquiring the log item to be written, the processor 52 is specifically configured to: receive a database update request, where the database update request includes updating operation control information and a data block to be written into the database; and controlling the update operation The information and the data block to be written into the database are respectively used as log meta information and log data to be written to generate a log entry to be written.
在一些示例性实施例中,处理器52还用于:在执行地址对齐操作之前,将日志磁盘中物理扇区的大小调整为大于或等于日志元信息的大小与基准数据块大小之和。In some exemplary embodiments, the processor 52 is further configured to adjust the size of the physical sector in the log disk to be greater than or equal to the sum of the size of the log meta information and the reference data block size before performing the address alignment operation.
在一些示例性实施例中,处理器52在调整日志磁盘中物理扇区的大小时,具体用于:根据元信息的大小与基准数据块大小,计算日志磁盘中物理扇区的大小的下限值;从日志磁盘所支持的至少两种物理扇区尺寸中,选择大于或等于下限值的尺寸作为目标值;将日志磁盘中物理扇区的大小由当前值调节目标值。In some exemplary embodiments, when adjusting the size of the physical sector in the log disk, the processor 52 is specifically configured to: calculate a lower limit of the size of the physical sector in the log disk according to the size of the meta information and the reference data block size. Value; from the at least two physical sector sizes supported by the log disk, select a size greater than or equal to the lower limit as the target value; adjust the size of the physical sector in the log disk from the current value to the target value.
在一些示例性实施例中,处理器52在将日志磁盘中物理扇区的大小由当前值调节目标值时,具体用于:响应于格式化请求,按照目标值重新对日志磁盘进行格式化,以获得大小大于或等于日志元信息的大小与基准数据块大小之和的物理扇区;或者,也可以借助磁盘工具或命令行,将日志磁盘中物理扇区的大小由当前值调节目标值。本申请实施例对此不做限定,凡是可以将日志磁盘中物理扇区的大小由当前值调节目标值的实施方式均适应于本申请实施例。In some exemplary embodiments, when the size of the physical sector in the log disk is adjusted by the current value from the current value, the processor 52 is specifically configured to: re-format the log disk according to the target value in response to the formatting request, A physical sector having a size greater than or equal to the size of the log meta-information and the size of the reference data block is obtained; or the size of the physical sector in the log disk may be adjusted from the current value by the disk tool or the command line. The embodiment of the present application does not limit this. Any implementation manner in which the size of the physical sector in the log disk can be adjusted from the current value is adapted to the embodiment of the present application.
进一步,如图4b所示,存储管理设备还包括:显示器54、电源组件55、音频组件56等其它组件。图4b中仅示意性给出部分组件,并不意味着存储管理设备只包括图4b所示组件。Further, as shown in FIG. 4b, the storage management device further includes: a display 54, a power supply component 55, an audio component 56, and the like. Only some of the components are schematically illustrated in Figure 4b, and it is not meant that the storage management device includes only the components shown in Figure 4b.
通信组件53,可被配置为便于通信组件所属设备和其他设备之间有线或无线方式的通信。通信组件所属设备可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication component 53, can be configured to facilitate wired or wireless communication between the device to which the communication component belongs and other devices. The device to which the communication component belongs can access a wireless network based on a communication standard such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component further includes a near field communication (NFC) module to facilitate short range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
显示器54,可以包括屏幕,其屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。The display 54, which may include a screen, may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor may sense not only the boundary of the touch or sliding action, but also the duration and pressure associated with the touch or slide operation.
电源组件55,为电源组件所属设备的各种组件提供电力。电源组件可以包括电源管理系统,一个或多个电源,及其他与为电源组件所属设备生成、管理和分配电力相关联的组件。The power supply assembly 55 provides power to various components of the device to which the power supply component belongs. The power components can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the devices to which the power components belong.
音频组件56,被配置为输出和/或输入音频信号。例如,音频组件包括一个麦克风 (MIC),当音频组件所属设备处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器或经由通信组件发送。在一些实施例中,音频组件还包括一个扬声器,用于输出音频信号。The audio component 56 is configured to output and/or input an audio signal. For example, the audio component includes a microphone (MIC) that is configured to receive an external audio signal when the device to which the audio component belongs is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in a memory or transmitted via a communication component. In some embodiments, the audio component further includes a speaker for outputting an audio signal.
本实施例提供的存储管理设备,以日志磁盘中物理扇区的大小大于或等于日志元信息大小与基准数据块大小之和为基础,在向日志磁盘中写入待写入日志项时,结合地址对齐以及数据拼接可以将待写入日志项拼接为内存块,使得可以通过更少的IO操作将待写入日志项写入日志磁盘的物理扇区中,减小向日志磁盘中写入日志项所需要的IO操作的次数,提高了向日志磁盘中写入日志项的执行效率。The storage management device provided in this embodiment combines the size of the physical sector in the log disk to be greater than or equal to the size of the log metadata information and the size of the reference data block, and writes the log entry to be written to the log disk. Address alignment and data splicing can splicing the log items to be written into memory blocks, so that the log items to be written can be written into the physical sectors of the log disk by less IO operations, and the log is written to the log disk. The number of IO operations required by the item improves the efficiency of writing log entries to the log disk.
相应地,本申请实施例还提供一种存储有计算机程序的计算机可读存储介质,所述计算机程序被计算机执行时能够实现上述各实施例中的方法步骤或功能,在此不再赘述。Correspondingly, the embodiment of the present application further provides a computer readable storage medium storing a computer program, and the computer program can be implemented by a computer to implement the method steps or functions in the foregoing embodiments, and details are not described herein.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或 其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory. Memory is an example of a computer readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer readable media includes both permanent and non-persistent, removable and non-removable media. Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It is also to be understood that the terms "comprises" or "comprising" or "comprising" or any other variations are intended to encompass a non-exclusive inclusion, such that a process, method, article, Other elements not explicitly listed, or elements that are inherent to such a process, method, commodity, or equipment. An element defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device including the element.
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above description is only an embodiment of the present application and is not intended to limit the application. Various changes and modifications can be made to the present application by those skilled in the art. Any modifications, equivalents, improvements, etc. made within the spirit and scope of the present application are intended to be included within the scope of the appended claims.

Claims (16)

  1. 一种日志写入方法,其特征在于,包括:A log writing method, comprising:
    获取待写入日志项,所述待写入日志项包括日志元信息和待写入日志数据,所述待写入日志数据的大小是基准数据块大小的M倍,M是正整数;Obtaining a log entry to be written, where the log entry to be written includes log meta information and log data to be written, where the size of the log data to be written is M times the size of the reference data block, and M is a positive integer;
    按照日志磁盘中物理扇区的大小对所述待写入日志项进行地址对齐,以确定用于存储所述待写入日志项的物理扇区的起始地址,所述日志磁盘中物理扇区的大小大于或等于所述日志元信息的大小与所述基准数据块大小之和;Performing address alignment on the log entry to be written according to the size of the physical sector in the log disk to determine a starting address of the physical sector for storing the log entry to be written, the physical sector in the log disk The size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block;
    对所述日志元信息和所述待写入日志数据进行数据拼接以形成N个内存块,N<=M,且N为正整数;Performing data splicing on the log meta information and the to-be-written log data to form N memory blocks, N<=M, and N is a positive integer;
    将所述N个内存块写入所述日志磁盘中自所述起始地址开始的N个物理扇区中。Writing the N memory blocks into the N physical sectors from the start address in the log disk.
  2. 根据权利要求1所述的方法,其特征在于,所述按照日志磁盘中物理扇区的大小对所述待写入日志项进行地址对齐,以确定用于存储所述待写入日志项的物理扇区的起始地址,包括:The method according to claim 1, wherein the log entry to be written is address aligned according to the size of a physical sector in the log disk to determine a physics for storing the log entry to be written. The starting address of the sector, including:
    将所述日志磁盘中最后写操作的末尾地址按照K字节向上取整,以获得所述起始地址,所述日志磁盘中物理扇区的大小为K字节,K为正整数。The end address of the last write operation in the log disk is rounded up by K bytes to obtain the start address, and the size of the physical sector in the log disk is K bytes, and K is a positive integer.
  3. 根据权利要求1所述的方法,其特征在于,所述对所述日志元信息和所述待写入日志数据进行数据拼接以形成N个内存块,包括:The method according to claim 1, wherein the data splicing of the log meta information and the log data to be written to form N memory blocks comprises:
    通过一内存缓冲区对所述日志元信息和所述待写入日志数据进行拼接以形成所述N个内存块,所述内存缓冲区的大小等于所述N个物理扇区的大小。The log metadata information and the to-be-written log data are spliced by a memory buffer to form the N memory blocks, and the size of the memory buffer is equal to the size of the N physical sectors.
  4. 根据权利要求3所述的方法,其特征在于,所述通过一内存缓冲区对所述日志元信息和所述待写入日志数据进行拼接以形成所述N个内存块,包括:The method according to claim 3, wherein the splicing the log meta information and the log data to be written by a memory buffer to form the N memory blocks comprises:
    将所述日志元信息和所述待写入日志数据中的首部数据或尾部数据缓存至所述内存缓冲区的一连续区域内以获得一个内存块,所述首部数据或尾部数据的大小为所述基准数据块大小;Cacheing the log meta information and the header data or the tail data in the log data to be cached into a contiguous area of the memory buffer to obtain a memory block, where the size of the header data or the tail data is The reference data block size;
    以所述基准数据块大小为单位,将所述待写入日志数据中的其它数据分别缓存至所述内存缓冲区的其它连续区域内以获得N-1个内存块,N=M。All other data in the log data to be written are respectively buffered into other consecutive areas of the memory buffer in units of the reference data block size to obtain N-1 memory blocks, N=M.
  5. 根据权利要求3所述的方法,其特征在于,所述通过一内存缓冲区对所述日志元信息和所述待写入日志数据进行拼接以形成所述N个内存块,包括:The method according to claim 3, wherein the splicing the log meta information and the log data to be written by a memory buffer to form the N memory blocks comprises:
    在所述内存缓冲区中,以连续方式对所述日志元信息和所述待写入日志数据进行拼接以获得N个内存块;或者In the memory buffer, splicing the log meta information and the to-be-written log data in a continuous manner to obtain N memory blocks; or
    在所述内存缓冲区中,以间隔方式对所述日志元信息和所述待写入日志数据进行拼接以获得N个内存块。In the memory buffer, the log meta information and the log data to be written are spliced in an interval manner to obtain N memory blocks.
  6. 根据权利要求1所述的方法,其特征在于,所述获取待写入日志项,包括:The method according to claim 1, wherein the obtaining a log entry to be written comprises:
    接收数据库更新请求,所述数据库更新请求包括更新操作控制信息和待写入数据库的数据块;Receiving a database update request, the database update request including update operation control information and a data block to be written into the database;
    将所述更新操作控制信息和所述待写入数据库的数据块分别作为所述日志元信息和所述待写入日志数据,以生成所述待写入日志项。The update operation control information and the data block to be written into the database are respectively used as the log meta information and the log data to be written to generate the log entry to be written.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,在按照日志磁盘中物理扇区的大小对所述待写入日志项进行地址对齐之前,所述方法还包括:The method according to any one of claims 1-6, wherein before the address alignment of the log entry to be written is performed according to the size of the physical sector in the log disk, the method further includes:
    将所述日志磁盘中物理扇区的大小调整为大于或等于所述日志元信息的大小与所述基准数据块大小之和。The size of the physical sector in the log disk is adjusted to be greater than or equal to the sum of the size of the log meta information and the size of the reference data block.
  8. 根据权利要求7所述的方法,其特征在于,所述将所述日志磁盘中物理扇区的大小调整为大于或等于所述日志元信息的大小与所述基准数据块大小之和,包括:The method according to claim 7, wherein the adjusting the size of the physical sector in the log disk to be greater than or equal to the sum of the size of the log meta information and the size of the reference data block comprises:
    根据所述元信息的大小与所述基准数据块大小,计算所述日志磁盘中物理扇区的大小的下限值;Calculating a lower limit value of a size of a physical sector in the log disk according to the size of the meta information and the reference data block size;
    从所述日志磁盘所支持的至少两种物理扇区尺寸中,选择大于或等于所述下限值的尺寸作为目标值;Selecting, from the at least two physical sector sizes supported by the log disk, a size greater than or equal to the lower limit value as a target value;
    将所述日志磁盘中物理扇区的大小由当前值调节所述目标值。The target value is adjusted from the current value by the size of the physical sector in the log disk.
  9. 一种存储管理设备,其特征在于,包括:存储器、处理器以及通信组件;A storage management device, comprising: a memory, a processor, and a communication component;
    所述存储器,用于存储程序;The memory is configured to store a program;
    所述处理器,耦合至所述存储器,用于执行所述程序以用于:The processor is coupled to the memory for executing the program for:
    获取待写入日志项,所述待写入日志项包括日志元信息和待写入日志数据,所述待写入日志数据的大小是基准数据块大小的M倍,M是正整数;Obtaining a log entry to be written, where the log entry to be written includes log meta information and log data to be written, where the size of the log data to be written is M times the size of the reference data block, and M is a positive integer;
    按照日志磁盘中物理扇区的大小对所述待写入日志项进行地址对齐,以确定用于存储所述待写入日志项的物理扇区的起始地址,所述日志磁盘中物理扇区的大小大于或等于所述日志元信息的大小与所述基准数据块大小之和;Performing address alignment on the log entry to be written according to the size of the physical sector in the log disk to determine a starting address of the physical sector for storing the log entry to be written, the physical sector in the log disk The size is greater than or equal to the sum of the size of the log meta information and the size of the reference data block;
    对所述日志元信息和所述待写入日志数据进行数据拼接以形成N个内存块,N<=M,且N为正整数;Performing data splicing on the log meta information and the to-be-written log data to form N memory blocks, N<=M, and N is a positive integer;
    通过所述通信组件将所述N个内存块写入所述日志磁盘中自所述起始地址开始的N个物理扇区中;Writing, by the communication component, the N memory blocks into N physical sectors in the log disk starting from the start address;
    所述通信组件,用于将所述N个内存块写入所述日志磁盘中自所述起始地址开始的N个物理扇区中。The communication component is configured to write the N memory blocks into N physical sectors in the log disk starting from the start address.
  10. 根据权利要求9所述的存储管理设备,其特征在于,所述处理器在进行地址对齐时,具体用于:The storage management device according to claim 9, wherein when the processor performs address alignment, the processor is specifically configured to:
    将所述日志磁盘中最后写操作的末尾地址按照K字节向上取整,以获得所述起始地址,所述日志磁盘中物理扇区的大小为K字节,K为正整数。The end address of the last write operation in the log disk is rounded up by K bytes to obtain the start address, and the size of the physical sector in the log disk is K bytes, and K is a positive integer.
  11. 根据权利要求9所述的存储管理设备,其特征在于,所述处理器在进行数据拼接时,具体用于:The storage management device according to claim 9, wherein the processor is specifically configured to:
    通过一内存缓冲区对所述日志元信息和所述待写入日志数据进行拼接以形成所述N个内存块,所述内存缓冲区的大小等于所述N个物理扇区的大小。The log metadata information and the to-be-written log data are spliced by a memory buffer to form the N memory blocks, and the size of the memory buffer is equal to the size of the N physical sectors.
  12. 根据权利要求11所述的存储管理设备,其特征在于,所述处理器在形成所述N个内存块时,具体用于:The storage management device according to claim 11, wherein when the processor forms the N memory blocks, the processor is specifically configured to:
    将所述日志元信息和所述待写入日志数据中的首部数据或尾部数据缓存至所述内存缓冲区的一连续区域内以获得一个内存块,所述首部数据或尾部数据的大小为所述基准数据块大小;Cacheing the log meta information and the header data or the tail data in the log data to be cached into a contiguous area of the memory buffer to obtain a memory block, where the size of the header data or the tail data is The reference data block size;
    以所述基准数据块大小为单位,将所述待写入日志数据中的其它数据分别缓存至所述内存缓冲区的其它连续区域内以获得N-1个内存块,N=M。All other data in the log data to be written are respectively buffered into other consecutive areas of the memory buffer in units of the reference data block size to obtain N-1 memory blocks, N=M.
  13. 根据权利要求11所述的存储管理设备,其特征在于,所述处理器在形成所述N个内存块时,具体用于:The storage management device according to claim 11, wherein when the processor forms the N memory blocks, the processor is specifically configured to:
    在所述内存缓冲区中,以连续方式对所述日志元信息和所述待写入日志数据进行拼接以获得N个内存块;或者In the memory buffer, splicing the log meta information and the to-be-written log data in a continuous manner to obtain N memory blocks; or
    在所述内存缓冲区中,以间隔方式对所述日志元信息和所述待写入日志数据进行拼接以获得N个内存块。In the memory buffer, the log meta information and the log data to be written are spliced in an interval manner to obtain N memory blocks.
  14. 根据权利要求9-13任一项所述的存储管理设备,其特征在于,所述处理器还用于:将所述日志磁盘中物理扇区的大小调整为大于或等于所述日志元信息的大小与所述基准数据块大小之和。The storage management device according to any one of claims 9 to 13, wherein the processor is further configured to: adjust a size of a physical sector in the log disk to be greater than or equal to the log meta information. The sum of the size and the size of the reference data block.
  15. 根据权利要求14所述的存储管理设备,其特征在于,所述处理器具体用于:The storage management device according to claim 14, wherein the processor is specifically configured to:
    根据所述元信息的大小与所述基准数据块大小,计算所述日志磁盘中物理扇区的大小的下限值;Calculating a lower limit value of a size of a physical sector in the log disk according to the size of the meta information and the reference data block size;
    从所述日志磁盘所支持的至少两种物理扇区尺寸中,选择大于或等于所述下限值的 尺寸作为目标值;Selecting, from the at least two physical sector sizes supported by the log disk, a size greater than or equal to the lower limit value as a target value;
    将所述日志磁盘中物理扇区的大小由当前值调节所述目标值。The target value is adjusted from the current value by the size of the physical sector in the log disk.
  16. 一种基于日志的存储系统,其特征在于,包括:权利要求9-15任一项所述的存储管理设备、日志磁盘以及数据库;所述存储管理设备与所述日志磁盘以及所述数据库连接。A log-based storage system, comprising: the storage management device, the log disk, and the database according to any one of claims 9-15; wherein the storage management device is connected to the log disk and the database.
PCT/CN2018/105904 2017-09-21 2018-09-17 Log writing method, apparatus and system WO2019057000A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710857455.9 2017-09-21
CN201710857455.9A CN109542329B (en) 2017-09-21 2017-09-21 Log writing method, storage management equipment and system

Publications (1)

Publication Number Publication Date
WO2019057000A1 true WO2019057000A1 (en) 2019-03-28

Family

ID=65811065

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/105904 WO2019057000A1 (en) 2017-09-21 2018-09-17 Log writing method, apparatus and system

Country Status (2)

Country Link
CN (1) CN109542329B (en)
WO (1) WO2019057000A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532123A (en) * 2019-08-30 2019-12-03 北京小米移动软件有限公司 The failover method and device of HBase system
CN112631957A (en) * 2020-12-14 2021-04-09 深兰人工智能(深圳)有限公司 Data acquisition method and device, electronic equipment and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727608B (en) * 2019-09-03 2022-07-12 深圳市道通智能航空技术股份有限公司 Log data storage method, electronic equipment and storage medium
CN111625546B (en) * 2020-05-07 2022-08-19 苏州浪潮智能科技有限公司 Data writing method, device, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6751750B1 (en) * 2001-06-01 2004-06-15 Lsi Logic Corporation Method to protect and recover a write ahead log from interruptions
CN101183322A (en) * 2006-11-16 2008-05-21 三星电子株式会社 Method for deferred logging and apparatus thereof
CN104615504A (en) * 2015-02-06 2015-05-13 浪潮(北京)电子信息产业有限公司 Method and device for achieving data protection

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100583059C (en) * 2007-12-28 2010-01-20 祥硕科技股份有限公司 Data access integration method and its system
US8516190B1 (en) * 2008-09-26 2013-08-20 Nvidia Corporation Reporting logical sector alignment for ATA mass storage devices
CN102866862A (en) * 2012-07-26 2013-01-09 浪潮电子信息产业股份有限公司 4-kilobyte (4K)-sector-based hard disk drive performance optimization method
US9672237B2 (en) * 2013-03-15 2017-06-06 Amazon Technologies, Inc. System-wide checkpoint avoidance for distributed database systems
CN105893172A (en) * 2015-11-30 2016-08-24 乐视云计算有限公司 Hard disk data recovery method and system
CN105528183B (en) * 2016-01-26 2019-01-18 华为技术有限公司 A kind of method and storage equipment of storing data
CN106340161A (en) * 2016-08-25 2017-01-18 山东联科云计算科技有限公司 Public security early warning system based on big data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6751750B1 (en) * 2001-06-01 2004-06-15 Lsi Logic Corporation Method to protect and recover a write ahead log from interruptions
CN101183322A (en) * 2006-11-16 2008-05-21 三星电子株式会社 Method for deferred logging and apparatus thereof
CN104615504A (en) * 2015-02-06 2015-05-13 浪潮(北京)电子信息产业有限公司 Method and device for achieving data protection

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532123A (en) * 2019-08-30 2019-12-03 北京小米移动软件有限公司 The failover method and device of HBase system
CN110532123B (en) * 2019-08-30 2023-08-04 北京小米移动软件有限公司 Fault transfer method and device of HBase system
CN112631957A (en) * 2020-12-14 2021-04-09 深兰人工智能(深圳)有限公司 Data acquisition method and device, electronic equipment and storage medium
CN112631957B (en) * 2020-12-14 2024-04-05 深兰人工智能(深圳)有限公司 Data acquisition method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109542329B (en) 2022-04-12
CN109542329A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
WO2019057000A1 (en) Log writing method, apparatus and system
WO2019114655A1 (en) Data compression method, electronic device and computer readable storage medium
US8868882B2 (en) Storage architecture for backup application
US10649852B1 (en) Index metadata for inode based backups
US10521126B2 (en) Systems and methods for writing back data to a storage device
US10303806B2 (en) Method and system for providing concurrent buffer pool and page cache
WO2021073635A1 (en) Data storage method and device
WO2016095151A1 (en) Storing log records in a non-volatile memory
CN103577470B (en) A kind of file system and method for lifting web server performance
KR101548689B1 (en) Method and apparatus for partial garbage collection in filesystems
WO2012083754A1 (en) Method and device for processing dirty data
US20130138612A1 (en) Provisioning and/or synchronizing using common metadata
WO2015024406A1 (en) Data file management method and device
US8738858B1 (en) System and method for improving cache performance
KR20160002109A (en) Method and apparatus of journaling by block group unit for ordered mode journaling file system
JP7295422B2 (en) Information processing device and information processing program
US11176034B2 (en) System and method for inline tiering of write data
WO2018077092A1 (en) Saving method applied to distributed file system, apparatus and distributed file system
US10007692B2 (en) Partition filtering using smart index in memory
US10210165B2 (en) File management for eDiscovery
US10585802B1 (en) Method and system for caching directories in a storage system
WO2018176804A1 (en) Data write-in method and apparatus
CN102467557B (en) Data de-duplication processing method
KR20150128714A (en) Grouping files for optimized file operations
WO2023070462A1 (en) File deduplication method and apparatus, and device

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

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

Country of ref document: EP

Kind code of ref document: A1