WO2018176811A1 - Hard disk write-in method and apparatus - Google Patents

Hard disk write-in method and apparatus Download PDF

Info

Publication number
WO2018176811A1
WO2018176811A1 PCT/CN2017/107005 CN2017107005W WO2018176811A1 WO 2018176811 A1 WO2018176811 A1 WO 2018176811A1 CN 2017107005 W CN2017107005 W CN 2017107005W WO 2018176811 A1 WO2018176811 A1 WO 2018176811A1
Authority
WO
WIPO (PCT)
Prior art keywords
hard disk
cache
physical hard
written
data
Prior art date
Application number
PCT/CN2017/107005
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 WO2018176811A1 publication Critical patent/WO2018176811A1/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/062Securing storage systems
    • G06F3/0622Securing storage systems in relation to access
    • 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/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0667Virtualisation aspects at data level, e.g. file, record or object virtualisation
    • 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

Definitions

  • the present disclosure relates to the field of smart device storage, and in particular, to a hard disk writing method and apparatus.
  • An object of the present disclosure is to provide a hard disk writing method and device capable of improving hard disk writing performance of a smart device, which can increase the sequential writing operation of the hard disk of the smart device to improve the writing efficiency of the hard disk.
  • An aspect of the present disclosure provides a hard disk writing method, including: generating a virtual hard disk by using a non-volatile memory technology and a physical hard disk of the smart device, where the virtual hard disk stores a data block that needs to be written into the physical hard disk; Writing the data block to the cache corresponding to the physical hard disk; and acquiring, according to the location information of the data stored by the physical hard disk, related information of consecutive free sectors in the physical hard disk, and according to the related information and the foregoing data The length of the block sequentially writes the data blocks temporarily stored in the above buffer into successive consecutive free sectors.
  • the method further includes: determining whether the cache is full; and determining, when the cache is full, determining the data in the cache. Whether the block has been written to the physical hard disk; and if not yet written to the physical hard disk, the data blocks in the cache are sequentially written to consecutive free sectors of the physical hard disk, and the data block is released. The corresponding space occupied by the above cache.
  • the method further includes: if the data block in the cache is already written to the physical hard disk, determining whether the data block in the cache is changed; if no change occurs, releasing the data block in the cache Corresponding space; and if the change has occurred, the data blocks in the cache are sequentially written to the consecutive free sectors in the physical hard disk, and the fan of the physical hard disk occupied by the data block before the change is released. Area.
  • the method further includes: defragmenting the free sectors in the physical hard disk in the process of writing the data block stored in the cache to the physical hard disk.
  • defragmenting the free sectors in the physical hard disk includes: when the data blocks in the cache are sequentially written to consecutive sectors of the physical hard disk, adjacent fans of sectors that have written data District to judge; and as If the adjacent sector is a free sector, the location of the data block in the sector is moved to merge the adjacent sectors.
  • An aspect of the present disclosure provides a hard disk writing device including an interconnected processor and a physical hard disk, wherein the physical hard disk has a cache, and the processor executes: generating a virtual hard disk by using a non-volatile memory technology and the physical hard disk.
  • the virtual hard disk stores a data block that needs to be written into the physical hard disk; the data block is written into a cache corresponding to the physical hard disk; and the continuous storage in the physical hard disk is obtained according to the location information of the data stored by the physical hard disk.
  • the processor further performs: determining, before writing the data block to the cache corresponding to the physical hard disk, whether the cache is full; when the cache is full, determining the cache Whether the above data block has been written into the physical hard disk; and if not yet written into the physical hard disk, the data blocks in the cache are sequentially written to consecutive free sectors of the physical hard disk and the data is released. The corresponding space of the above cache occupied by the block.
  • the processor further performs: if the data block in the cache is already written to the physical hard disk, determining whether the data block in the cache changes; if no change occurs, releasing the data block in the cache Corresponding space; and if the change has occurred, the data blocks in the cache are sequentially written to the consecutive free sectors in the physical hard disk, and the physical hard disk occupied by the data block before the change is released. Sector.
  • the processor further performs: defragmenting the free sectors in the physical hard disk in the process of writing the data blocks stored in the cache to the physical hard disk.
  • the foregoing processor performs: during the defragmentation process, after the data blocks in the cache are sequentially written to the sectors of the consecutive physical hard disks, performing adjacent sectors of the sectors in which the data has been written Judging; and if the adjacent sector is a free sector, moving the position of the data block in the sector to merge the adjacent sectors.
  • FIG. 1 is a flowchart of a method for writing a hard disk according to an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of a first case of writing data to a physical hard disk according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of a second scenario in which data is written into a physical hard disk according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a third scenario in which data is written into a physical hard disk according to an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of a fourth situation in which data is written into a physical hard disk according to an embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of a fifth situation in which data is written into a physical hard disk according to an embodiment of the present disclosure
  • FIG. 7 is a specific flowchart of a method for improving hard disk write performance of a smart device according to an embodiment of the present disclosure
  • FIG. 8 is a structural block diagram of a hard disk writing device according to an embodiment of the present disclosure.
  • the techniques of this disclosure may be implemented in the form of hardware and/or software (including firmware, microcode, etc.). Additionally, the techniques of this disclosure may take the form of a computer program product on a computer readable medium storing instructions for use by or in connection with an instruction execution system.
  • a computer readable medium can be any medium that can contain, store, communicate, propagate or transport the instructions.
  • a computer readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium.
  • the computer readable medium include: a magnetic storage device such as a magnetic tape or a hard disk (HDD); an optical storage device such as a compact disk (CD-ROM); a memory such as a random access memory (RAM) or a flash memory; and/or a wired /Wireless communication link.
  • a magnetic storage device such as a magnetic tape or a hard disk (HDD)
  • an optical storage device such as a compact disk (CD-ROM)
  • a memory such as a random access memory (RAM) or a flash memory
  • RAM random access memory
  • a method for writing a hard disk which can operate a hard disk of a smart device such as a computer (such as an SMR hard disk) and improve write performance of the hard disk to avoid non-continuous writing as shown in FIG. 1
  • the data in the sector number c1 in the buffer 3 is written to the sector of the physical hard disk 4 numbered as d1
  • the data in the c2 is written into the d4, c3.
  • the data is written to d3, the data in c4 is written to d8, the data in c5 is written to d6, and the data in c6 is written to d7, and the above writing method reduces the writing performance of the hard disk.
  • the method for writing a hard disk in conjunction with the embodiment of the present disclosure in conjunction with FIG. 7 includes:
  • the virtual hard disk 2 is generated by using the non-volatile memory technology (NVDIMM) and the physical hard disk 4 of the smart device, and the virtual hard disk 2 stores the data block that needs to be written into the physical hard disk 4.
  • Non-Volatile Memory Technology NVDIMM
  • DRAM dynamic random access memory
  • the virtual hard disk 2 can be generated by using the technology in combination with the physical hard disk 4.
  • the virtual hard disk 2 is provided with at least one sector sequentially arranged, and the data block in which the physical hard disk 4 needs to be written is stored in the sector.
  • the data block is written into the cache 3 corresponding to the physical hard disk 4.
  • the cache 3 also has consecutive sectors and can store data blocks, and the writing manner can be in various forms, for example, the data blocks can be arranged according to The order of the sequences is written into the cache 3 one by one, and the data blocks can also be randomly written into the cache 3, and can also be written into the cache 3 according to a predetermined rule.
  • the related information of the consecutive free sectors in the physical hard disk 4 is acquired, and the data blocks temporarily stored in the cache 3 are sequentially written according to the related information and the length of the data block. Enter into consecutive free sectors.
  • the data block in the cache 3 is stored in the physical hard disk 4, the data block has a certain length (for example, each data block has a certain length, and a plurality of consecutive data blocks are operated during storage), and a certain length
  • a plurality of data blocks necessarily require a sufficient number of free sectors for storage.
  • a sufficient number of consecutive free sectors are required for storage, thereby ensuring that the data blocks can be consecutively written (sequentially written) into the physical according to the arrangement order.
  • the hard disk 4 when the related information of consecutive free sectors in the physical hard disk 4 is acquired, relevant information such as the length, position and number of consecutive free sectors can be detected, so that the positions of consecutive free sectors can be accurately found. And successively writing (sequentially writing) the data blocks having a certain length into the free sectors according to the arrangement order.
  • the sectors of the physical hard disk 4 are all free sectors.
  • the data in the cache 3 can be consecutively written (sequentially written) in the order of the order into the physical hard disk 4, and the number in the sector numbered c1 to c6 in the cache 3
  • the blocks are successively written into consecutive sectors of the physical hard disk 4, and the data blocks in c1 are written into d1, the data blocks in c2 are written into d2, the data blocks in c3 are written into d3, and the data blocks in c4 are written.
  • the data block in c5 is written into d5
  • the data block in c6 is written into d6, where d1 to d6 are consecutive sectors.
  • the writing method can effectively improve the writing efficiency of the hard disk and improve the overall performance of the hard disk.
  • the probability of continuously writing data to the hard disk can be effectively improved, the probability of randomly writing data to the hard disk is reduced, the time for writing data to the hard disk is saved, and the writing performance of the hard disk is improved.
  • the cache 3 before the data block is written to the cache 3 corresponding to the physical hard disk 4, it is determined whether the cache 3 has been filled; when the cache 3 has been filled, the cached data block is determined. Whether it has been written to the physical hard disk 4; if it has not been written into the physical hard disk 4, the data blocks in the cache 3 are sequentially written to the consecutive free sectors of the physical hard disk 4 and the cache occupied by the data block is released. 3 corresponding space. If the cache 3 has been filled with data, then the original data will be overwritten when the data is written to the cache 3, which will cause the original data to be lost, so the data block is written to the object.
  • the cache 3 Before determining whether the cache 3 is full before the cache 3 corresponding to the hard disk 4 can avoid data loss caused by erroneous operations. If it is determined that the cache 3 has been filled with data, it is further determined whether the data block in the cache 3 is written to the physical hard disk 4. For example, the cache 3 in FIG. 4 has been filled, and then the cache 3 is numbered c2.
  • the data block in the cache 3 has been written to the physical hard disk 4, it is determined whether the data block in the cache 3 has changed (for example, if the new data block is written in the cache 3, the data block has been changed), If no changes have occurred (for example, the data block in cache 3 has not been updated, and at this time the data has been written to physical hard disk 4), the corresponding space of the data block in cache 3 is released, so that the fan in cache 3 The zone can be written to a new block of data.
  • the data blocks in the cache 3 are sequentially written to consecutive free sectors in the physical hard disk 4, and Release the sector of physical hard disk 4 occupied by the data block before the change. Further, with reference to FIG. 5, if it is judged that the data blocks in the sectors numbered c1, c3, and c4 in the cache 3 are not updated, and at this time, the data has been written to the physical hard disk 4, c1 is released.
  • FIG. 4 has a plurality of consecutive sectors in the virtual hard disk 2, numbered from m1 to mN, and the cache 3 has consecutive sectors, numbered c1.
  • the physical hard disk 4 has a plurality of consecutive sectors d1 to dN, the shaded sectors in the figure represent that the data block has occupied the corresponding sector, and the blank sector represents the free sector, in the virtual
  • the data in m6, m8, and m9 of hard disk 2 is requested to be written to physical hard disk 4.
  • m1, m3, and m4 have respectively stored data to c1, c3, and c4, and c2, c5, and c6 in cache 3 are already occupied.
  • the data block is not written to the physical hard disk 4.
  • the search satisfies the free sector with sufficient length.
  • the original data blocks in c2, c5 and c6 are written to d7, d8 and d9.
  • the data in m6, m8, and m9 is written into c2, c5, and c6, and the information in the m6, m8, and m9 data is successfully written.
  • the virtual hard disk 2 has a plurality of consecutive sectors, numbered m1 to mN, and the cache 3 has a plurality of consecutive sectors, and the numbers are respectively C1 to c6, things
  • the hard disk 4 has a plurality of consecutive sectors d1 to dN, and the shaded sectors in the figure represent that the data block has occupied the corresponding sector, and new data requests are written in the virtual hard disk 2 in m6, m8 and m9.
  • the data in c1, c3 and c4 can be transferred to the physical hard disk 4, in The physical hard disk 4 searches for consecutive sectors d7, d8, and d9, and successively writes the data in c1, c3, and c4 to the sectors d7, d8, and d9 in accordance with the arrangement order, respectively, (for example, the data in c1 is written to d7.
  • the data in c2 is written to d8, the data in c4 is written to d9), and the data in the sector numbered d1, d3, d6 in the physical hard disk 4 originally occupied by the c1, c3, and c4 data blocks is released, and then The data in m6, m8 and m9 are written to c1, c3 and c4, and the information in m6, m8 and m9 is successfully written.
  • the hard disk writing method capable of improving the hard disk writing performance of the smart device further includes: in the process of writing the data block stored in the cache 3 into the physical hard disk 4, in the physical hard disk 4 Free sectors are defragmented. Defragmentation can combine free sectors scattered in different locations so that these free sectors have enough space or length to store new data, and enable the data in cache 3 to be consecutively written in the order of the order (sequence Write) into multiple consecutive free sectors.
  • defragmenting the free sectors in the physical hard disk includes: when the data blocks in the cache 3 are sequentially written to the sectors of the consecutive physical hard disks 4, adjacent sectors of the sectors to which the data has been written A determination is made as to if the neighboring sector is a free sector, then the location of the data block in the sector is moved to merge adjacent sectors. For example, the sectors on which the data is written in the physical hard disk 4 have free sectors on the left and right sides, and the data blocks are moved to the left or right so that the left and right sides have free sectors merged into consecutive free sectors. In order to achieve the purpose of finishing debris. As further described below with reference to FIG.
  • the original data in c1, c3 and c4 are continuously written (sequentially written) into d1, d2 and d3 according to the new mapping relationship, and then m6 is added.
  • the data in m8 and m9 are written to c1, c3, and c4, and the information in the m6, m8, and m9 data is successfully written.
  • the original d1 and d5 fragments can be organized to form consecutive free sectors d4 and d5 for storing new data.
  • the embodiment of the present disclosure further provides a hard disk writing device capable of improving the hard disk writing performance of the smart device.
  • a hard disk writing device capable of improving the hard disk writing performance of the smart device.
  • the processor 1 and the physical hard disk 4 are connected to each other, and the physical hard disk 4 has a cache 3 , which is combined with FIG. 7 .
  • Processor 1 executes:
  • the virtual hard disk 2 is generated by the non-volatile memory technology (NVDIMM) and the physical hard disk 4 of the smart device, and the virtual hard disk 2 stores data blocks that need to be written to the physical hard disk 4.
  • Non-Volatile Memory Technology (NVDIMM) is in an integration
  • DRAM dynamic random access memory
  • non-volatile memory chip can still save the complete memory data when the power is completely cut off.
  • the technology can be used in combination with the physical hard disk 4 to generate the virtual hard disk 2
  • the virtual hard disk 2 is provided with at least one sector sequentially arranged, and the sector stores data blocks that need to be written to the physical hard disk 4.
  • the processor 1 can write the data block into the cache 3 corresponding to the physical hard disk 4.
  • the cache 3 also has consecutive sectors and can store the data block, and the writing manner can be in various forms, for example, the data block can be followed.
  • the order of the arrangement is written into the cache 3 one by one, and the data blocks can also be randomly written into the cache 3, and can also be written into the cache 3 according to a predetermined rule.
  • the processor 1 can acquire related information of consecutive free sectors in the physical hard disk 4 according to the location information of the data stored by the physical hard disk 4, and sequentially store the data block order in the cache 3 according to the related information and the length of the data block. Write to consecutive free sectors.
  • the data block in the cache 3 is stored in the physical hard disk 4, the data block has a certain length (for example, each data block has a certain length, and a plurality of consecutive data blocks are operated during storage), and a certain length
  • a plurality of data blocks necessarily require a sufficient number of free sectors for storage.
  • a sufficient number of consecutive free sectors are required for storage, thereby ensuring that the data blocks can be consecutively written (sequentially written) into the physical according to the arrangement order.
  • the data blocks in the sectors numbered c1 to c6 in the cache 3 are consecutive Write to the contiguous sector of the physical hard disk 4, and the data block in c1 is written into d1, the data block in c2 is written in d2, and the data block in c3 is written in d3, the number in c4 According to the block write d4, the data block in c5 is written into d5, and the data block in c6 is written into d6, where d1 to d6 are consecutive sectors.
  • the writing method can effectively improve the writing efficiency of the hard disk and improve the overall performance of the hard disk.
  • the processor 1 further performs: determining whether the cache 3 has been filled before writing the data block to the cache 3 corresponding to the physical hard disk 4; when the cache 3 has been filled, Determining whether the data block in the cache is written into the physical hard disk 4; and if not yet written into the physical hard disk 4, sequentially writing the data blocks in the cache 3 to consecutive free sectors of the physical hard disk 4 and The corresponding space of the cache 3 occupied by the data block is released. If the cache 3 has been filled with data, then the original data will be overwritten when the data is written to the cache 3, which will cause the original data to be lost.
  • the data block is written to the cache corresponding to the physical hard disk 4 Before determining whether the cache 3 is full, it can avoid data loss caused by misoperation. If it is determined that the cache 3 has been filled with data, it is further determined whether the data block in the cache 3 is written to the physical hard disk 4. For example, the cache 3 in FIG. 4 has been filled, and then the cache 3 is numbered c2.
  • the processor 1 further performs: if the data block in the cache 3 has been written into the physical hard disk 4, it is determined whether the data block in the cache 3 is changed (for example, the new data block is written in the cache 3 to indicate the data. The block has been changed), if no changes have occurred (for example, the data block in cache 3 has not been updated, and at this time the data has been written to physical hard disk 4), then the corresponding space of the data block in cache 3 is released, The sectors in cache 3 can be written to new data blocks. If the processor 1 judges that the data block in the cache 3 has changed (for example, a new data block is written in the cache 3), the data blocks in the cache 3 are sequentially written to consecutive free sectors in the physical hard disk 4.
  • the virtual hard disk 2 has a plurality of consecutive sectors, numbered m1 to mN, and the cache 3 has a plurality of consecutive sectors, respectively numbered c1.
  • the physical hard disk 4 has a plurality of consecutive sectors d1 to dN, the shaded sectors in the figure represent that the data block has occupied the corresponding sector, and the blank sector represents the free sector
  • the processor 1 requires that the data in m6, m8 and m9 in virtual hard disk 2 be written to physical hard disk 4, at this time m1, m3 and m4 have respectively stored data to c1, c3 and c4, and c2, c5 and c6 have been cached 3 Occupied but the data block is not written to the physical hard disk 4, the processor 1 searches the physical hard disk 4 to satisfy a free sector having a sufficient length, and after finding d7, d8 and d9, the original c2, c5 and c6 The
  • the virtual hard disk 2 has a plurality of consecutive sectors, numbered m1 to mN, respectively, and the cache 3 has a plurality of consecutive sectors, and the numbers are respectively C1 to c6, the physical hard disk 4 has a plurality of consecutive sectors d1 to dN, the shaded sectors in the figure represent that the data block has occupied the corresponding sector, and the processor 1 requires m6, m8 in the virtual hard disk 2.
  • the data in m9 is written to the physical hard disk 4, at this time m1, m3 and m4 have respectively stored the data to c1, c3 and c4, and the cache 3 has been filled, and the data in c1, c3 and c4 can be transferred to
  • the processor 1 searches the physical hard disk 4 for consecutive sectors d7, d8, and d9, and successively writes the data in c1, c3, and c4 to the sectors d7, d8, and d9 in accordance with the arrangement order.
  • the processor 1 further performs: during the process of writing the data block stored in the cache 3 to the physical hard disk 4 Defragment the free sectors in physical hard disk 4. Defragmentation can combine free sectors scattered in different locations so that these free sectors have enough space or length to store new data, and enable the data in cache 3 to be consecutively written in the order of the order (sequence Write) into multiple consecutive free sectors.
  • the processor 1 performs during the defragmentation process: when the data blocks in the cache 3 are sequentially written to the sectors of the contiguous physical hard disk 4, the neighboring sectors of the sectors in which the data has been written are judged. If the neighboring sector is a free sector, the location of the data block in the sector is moved to merge adjacent sectors. For example, the sectors on which the data is written in the physical hard disk 4 have free sectors on the left and right sides, and the processor 1 moves the data blocks to the left or right so that the left and right sides have free sectors merged into continuous idle. Sectors to achieve the purpose of defragmentation. As further described below in conjunction with FIG.
  • the processor 1 requests that data in m6, m8, and m9 in the virtual hard disk 2 be written to the physical hard disk 4, at which time m1, m3, and m4 have respectively stored data to c1, c3, and c4, And the cache 3 has been filled, the processor 1 can transfer the data in c1, c3 and c4 to d2, d3 and d4 in the physical hard disk 4 (if the data in c1 is written to d2, the data in c3 is written The data in d3, c4 is written to d4), although d2, d3 and d4 are consecutive sectors, but the free sectors d1 and d5 appear on both sides thereof, and d1 and d5 cannot store data separately due to the small length, the processor 1 adjust the mapping relationship, the original m4 is finally stored in d4 and adjusted to store m4 in d1, and the original data in c1, c3 and c4 are continuously written (sequentially written) to d1 according to the
  • the data in m6, m8, and m9 are correspondingly written to c1, c3, and c4, and the information in m6, m8, and m9 is successfully written.
  • the original d1 and d5 fragments can be organized to form consecutive free sectors d4 and d5 for storing new data.
  • processor 1 may, for example, comprise a general purpose microprocessor, an instruction set processor and/or a related chipset and/or a special purpose microprocessor (e.g., an application specific integrated circuit (ASIC)), and the like.
  • the processor 1 may also include an onboard memory for caching purposes.
  • the hard disk includes a computer readable storage medium.
  • a computer readable storage medium may be, for example, any medium that can contain, store, communicate, propagate or transport the instructions.
  • a readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium.
  • Specific examples of the readable storage medium include: a magnetic storage device such as a magnetic tape or a hard disk (HDD); an optical storage device such as a compact disk (CD-ROM); a memory such as a random access memory (RAM) or a flash memory; and/or a wired /Wireless communication link.
  • the computer readable storage medium can include a computer program, which can include code/computer executable instructions that, when executed by processor 1, cause processor 1 to perform, for example, the method flow described above in the method embodiments and any What is the deformation.
  • the computer program can be configured to have, for example, computer program code comprising a computer program module.
  • the code in a computer program can include one or more program modules, including, for example, A, module B, .
  • the division manner and number of modules are not fixed, and those skilled in the art may use suitable program modules or program module combinations according to actual conditions.
  • the processor 1 may be The method flow as described in the above method embodiments and any variations thereof are performed.

Abstract

A hard disk write-in method and apparatus. The method comprises: generating a virtual hard disk (2) by utilizing a non-volatile memory technology and a physical hard disk (4) of a smart device (S102), the virtual hard disk (2) storing data blocks that need to be written in the physical hard disk (4); writing the data blocks into a cache (3) corresponding to the physical hard disk (4) (S104); and obtaining related information of continuous idle sectors in the physical hard disk (4) according to position information of data stored in the physical hard disk (4), and writing the data blocks temporarily stored in the cache (3) into the continuous idle sectors according to the related information and lengths of the data blocks (S106).

Description

一种硬盘写入方法及装置Hard disk writing method and device 技术领域Technical field
本公开涉及智能设备存储领域,特别涉及一种硬盘写入方法及装置。The present disclosure relates to the field of smart device storage, and in particular, to a hard disk writing method and apparatus.
背景技术Background technique
在计算机等智能设备的使用过程中,需要将数据存储在计算机等智能设备的硬盘中,在进行数据写入硬盘的操作时需要将数据块写入硬盘相应的扇区中,但是目前在数据块写入扇区时为随机写入,尤其在对多个数据块操作时该写入方式使得多个数据块分散写入不同的扇区中,复杂的写入的方式会增加写入时间,并造成数据输入和输出的延迟,影响写入性能。In the process of using a smart device such as a computer, data needs to be stored in a hard disk of a smart device such as a computer. When writing data to the hard disk, the data block needs to be written into the corresponding sector of the hard disk, but currently in the data block. When writing a sector, it is random write, especially when operating on multiple data blocks, the write mode causes multiple data blocks to be written into different sectors, and the complicated write mode increases the write time, and Causes delays in data input and output, affecting write performance.
发明内容Summary of the invention
本公开实施例的目的在于提供一种能够提高智能设备的硬盘写入性能的硬盘写入方法及装置,该方法能够增加对智能设备的硬盘进行顺序写的动作,以提高硬盘的写入效率。An object of the present disclosure is to provide a hard disk writing method and device capable of improving hard disk writing performance of a smart device, which can increase the sequential writing operation of the hard disk of the smart device to improve the writing efficiency of the hard disk.
本公开的一个方面提供了一种硬盘写入方法,包括:利用非易失性内存技术和上述智能设备的物理硬盘生成虚拟硬盘,上述虚拟硬盘中存储有需要写入上述物理硬盘的数据块;将上述数据块写入到上述物理硬盘对应的缓存中;以及根据上述物理硬盘存储的数据的位置信息,获取上述物理硬盘中的连续的空闲扇区的相关信息,并根据上述相关信息和上述数据块的长度将暂存在上述缓存中的数据块顺序写入到连续的上述空闲扇区中。An aspect of the present disclosure provides a hard disk writing method, including: generating a virtual hard disk by using a non-volatile memory technology and a physical hard disk of the smart device, where the virtual hard disk stores a data block that needs to be written into the physical hard disk; Writing the data block to the cache corresponding to the physical hard disk; and acquiring, according to the location information of the data stored by the physical hard disk, related information of consecutive free sectors in the physical hard disk, and according to the related information and the foregoing data The length of the block sequentially writes the data blocks temporarily stored in the above buffer into successive consecutive free sectors.
可选地,在将上述数据块写入到上述物理硬盘对应的缓存中之前,上述方法还包括:判断上述缓存是否已被写满;当上述缓存已被写满时,判断上述缓存中的数据块是否已写入到上述物理硬盘中;以及如果还没有写入上述物理硬盘中,则将上述缓存中的数据块顺序写入到上述物理硬盘的连续的空闲扇区上,并释放该数据块占用的上述缓存的相应空间。Optionally, before the foregoing data block is written into the cache corresponding to the physical hard disk, the method further includes: determining whether the cache is full; and determining, when the cache is full, determining the data in the cache. Whether the block has been written to the physical hard disk; and if not yet written to the physical hard disk, the data blocks in the cache are sequentially written to consecutive free sectors of the physical hard disk, and the data block is released. The corresponding space occupied by the above cache.
可选地,上述方法还包括:如果上述缓存中的数据块已经写入到上述物理硬盘中,判断上述缓存中的数据块是否发生更改;如果未发生更改,则释放该数据块在上述缓存的相应空间;以及如果已经发生更改时,则将上述缓存中的数据块顺序写入到上述物理硬盘中的连续的上述空闲扇区上,并释放更改前的上述数据块占用的上述物理硬盘的扇区。Optionally, the method further includes: if the data block in the cache is already written to the physical hard disk, determining whether the data block in the cache is changed; if no change occurs, releasing the data block in the cache Corresponding space; and if the change has occurred, the data blocks in the cache are sequentially written to the consecutive free sectors in the physical hard disk, and the fan of the physical hard disk occupied by the data block before the change is released. Area.
可选地,上述方法还包括:在存储在上述缓存中的数据块写入上述物理硬盘的过程中,对上述物理硬盘中的空闲扇区进行碎片整理。Optionally, the method further includes: defragmenting the free sectors in the physical hard disk in the process of writing the data block stored in the cache to the physical hard disk.
可选地,对上述物理硬盘中的空闲扇区进行碎片整理包括:当上述缓存中的数据块顺序写入到连续的上述物理硬盘的扇区后,对已经写入数据的扇区的临近扇区进行判断;以及如 果上述临近扇区为空闲扇区,则移动上述数据块在扇区中的位置,以合并上述临近扇区。Optionally, defragmenting the free sectors in the physical hard disk includes: when the data blocks in the cache are sequentially written to consecutive sectors of the physical hard disk, adjacent fans of sectors that have written data District to judge; and as If the adjacent sector is a free sector, the location of the data block in the sector is moved to merge the adjacent sectors.
本公开的一个方面提供了一种硬盘写入装置,包括相互连接的处理器和物理硬盘,上述物理硬盘具有缓存,上述处理器执行:利用非易失性内存技术和上述物理硬盘生成虚拟硬盘,上述虚拟硬盘中存储有需要写入上述物理硬盘的数据块;将上述数据块写入到上述物理硬盘对应的缓存中;以及根据上述物理硬盘存储的数据的位置信息,获取上述物理硬盘中的连续的空闲扇区的相关信息,并根据上述相关信息和上述数据块的长度将暂存在上述缓存中的数据块顺序写入到连续的上述空闲扇区中。An aspect of the present disclosure provides a hard disk writing device including an interconnected processor and a physical hard disk, wherein the physical hard disk has a cache, and the processor executes: generating a virtual hard disk by using a non-volatile memory technology and the physical hard disk. The virtual hard disk stores a data block that needs to be written into the physical hard disk; the data block is written into a cache corresponding to the physical hard disk; and the continuous storage in the physical hard disk is obtained according to the location information of the data stored by the physical hard disk. Information about the free sector, and sequentially writing the data blocks temporarily stored in the cache to the consecutive free sectors according to the related information and the length of the data block.
可选地,上述处理器进一步执行:在将上述数据块写入到上述物理硬盘对应的缓存中之前,判断上述缓存是否已被写满;当上述缓存已被写满时,判断上述缓存中的上述数据块是否已写入到上述物理硬盘中;以及如果还没有写入上述物理硬盘中,则将上述缓存中的数据块顺序写入到上述物理硬盘的连续的空闲扇区上并释放该数据块占用的上述缓存的相应空间。Optionally, the processor further performs: determining, before writing the data block to the cache corresponding to the physical hard disk, whether the cache is full; when the cache is full, determining the cache Whether the above data block has been written into the physical hard disk; and if not yet written into the physical hard disk, the data blocks in the cache are sequentially written to consecutive free sectors of the physical hard disk and the data is released. The corresponding space of the above cache occupied by the block.
可选地,上述处理器进一步执行:如果上述缓存中的数据块已经写入到上述物理硬盘中,判断上述缓存中的数据块是否发生更改;如果未发生更改,则释放该数据块在上述缓存的相应空间;以及如果已经发生更改时,则将上述缓存中的数据块顺序写入到上述物理硬盘中的连续的上述空闲扇区上,并释放更改前的上述数据块占用的上述物理硬盘的扇区。Optionally, the processor further performs: if the data block in the cache is already written to the physical hard disk, determining whether the data block in the cache changes; if no change occurs, releasing the data block in the cache Corresponding space; and if the change has occurred, the data blocks in the cache are sequentially written to the consecutive free sectors in the physical hard disk, and the physical hard disk occupied by the data block before the change is released. Sector.
可选地,上述处理器进一步执行:在存储在上述缓存中的数据块写入上述物理硬盘的过程中,对上述物理硬盘中的空闲扇区进行碎片整理。Optionally, the processor further performs: defragmenting the free sectors in the physical hard disk in the process of writing the data blocks stored in the cache to the physical hard disk.
可选地,上述处理器在进行碎片整理的过程中执行:当上述缓存中的数据块顺序写入到连续的上述物理硬盘的扇区后,对已经写入数据的扇区的临近扇区进行判断;以及如果上述临近扇区为空闲扇区,则移动上述数据块在扇区中的位置,以合并上述临近扇区。Optionally, the foregoing processor performs: during the defragmentation process, after the data blocks in the cache are sequentially written to the sectors of the consecutive physical hard disks, performing adjacent sectors of the sectors in which the data has been written Judging; and if the adjacent sector is a free sector, moving the position of the data block in the sector to merge the adjacent sectors.
附图说明DRAWINGS
为了更完整地理解本公开及其优势,现在将参考结合附图的以下描述,其中:For a more complete understanding of the present disclosure and its advantages, reference will now be made to the following description
图1为本公开实施例的硬盘写入方法的流程图;1 is a flowchart of a method for writing a hard disk according to an embodiment of the present disclosure;
图2为本公开实施例的数据写入物理硬盘的第一种情况示意图;2 is a schematic diagram of a first case of writing data to a physical hard disk according to an embodiment of the present disclosure;
图3为本公开实施例的数据写入物理硬盘的第二种情况示意图;3 is a schematic diagram of a second scenario in which data is written into a physical hard disk according to an embodiment of the present disclosure;
图4为本公开实施例的数据写入物理硬盘的第三种情况示意图;4 is a schematic diagram of a third scenario in which data is written into a physical hard disk according to an embodiment of the present disclosure;
图5为本公开实施例的数据写入物理硬盘的第四种情况示意图;5 is a schematic diagram of a fourth situation in which data is written into a physical hard disk according to an embodiment of the present disclosure;
图6为本公开实施例的数据写入物理硬盘的第五种情况示意图;6 is a schematic diagram of a fifth situation in which data is written into a physical hard disk according to an embodiment of the present disclosure;
图7为本公开实施例的提高智能设备的硬盘写入性能的方法的具体流程图;以及FIG. 7 is a specific flowchart of a method for improving hard disk write performance of a smart device according to an embodiment of the present disclosure;
图8为本公开实施例的硬盘写入装置的结构框图。 FIG. 8 is a structural block diagram of a hard disk writing device according to an embodiment of the present disclosure.
附图标记说明Description of the reference numerals
1-处理器   2-虚拟硬盘   3-缓存1-processor 2-virtual hard disk 3-cache
4-物理硬盘4-physical hard disk
具体实施方式detailed description
此处参考附图描述本公开的各种方案以及特征。Various aspects and features of the present disclosure are described herein with reference to the drawings.
应理解的是,可以对此处公开的实施例做出各种修改。因此,上述说明书不应该视为限制,而仅是作为实施例的范例。本领域的技术人员将想到在本公开的范围和精神内的其他修改。It should be understood that various modifications may be made to the embodiments disclosed herein. Therefore, the above description should not be taken as limiting, but merely as an example of the embodiments. Other modifications within the scope and spirit of the present disclosure will occur to those skilled in the art.
包含在说明书中并构成说明书的一部分的附图示出了本公开的实施例,并且与上面给出的对本公开的大致描述以及下面给出的对实施例的详细描述一起用于解释本公开的原理。The accompanying drawings, which are incorporated in FIG principle.
通过下面参照附图对给定为非限制性实例的实施例的优选形式的描述,本公开的这些和其它特性将会变得显而易见。These and other features of the present disclosure will become apparent from the following description of the preferred embodiments of the embodiments.
还应当理解,尽管已经参照一些具体实例对本公开进行了描述,但本领域技术人员能够确定地实现本公开的很多其它等效形式,它们具有如权利要求所述的特征并因此都位于借此所限定的保护范围内。It should also be understood that, although the present invention has been described with reference to the specific embodiments thereof, those skilled in the art Within the limits of protection.
当结合附图时,鉴于以下详细说明,本公开的上述和其他方面、特征和优势将变得更为显而易见。The above and other aspects, features, and advantages of the present disclosure will become more apparent from the aspects of the appended claims.
此后参照附图描述本公开的具体实施例;然而,应当理解,所公开的实施例仅仅是本公开的实例,其可采用多种方式实施。熟知和/或重复的功能和结构并未详细描述以避免不必要或多余的细节使得本公开模糊不清。因此,本文所公开的具体的结构性和功能性细节并非意在限定,而是仅仅作为权利要求的基础和代表性基础用于教导本领域技术人员以实质上任意合适的详细结构多样地使用本公开。Specific embodiments of the present disclosure are described hereinbelow with reference to the drawings; however, it is understood that the disclosed embodiments are only examples of the present disclosure, which can be implemented in various ways. The well-known and/or repeated functions and structures are not described in detail to avoid unnecessary or unnecessary details. Therefore, the specific structural and functional details disclosed herein are not intended to be limiting, but are merely to be used as a basis and representative basis of the claims to teach one skilled in the art to use the invention in virtually any suitable detail. public.
本说明书可使用词组“在一种实施例中”、“在另一个实施例中”、“在又一实施例中”或“在其他实施例中”,其均可指代根据本公开的相同或不同实施例中的一个或多个。The description may use the phrases "in one embodiment", "in another embodiment", "in another embodiment" or "in other embodiments", which may refer to the same in accordance with the present disclosure. Or one or more of the different embodiments.
以下,将参照附图来描述本公开的实施例。但是应该理解,这些描述只是示例性的,而并非要限制本公开的范围。此外,在以下说明中,省略了对公知结构和技术的描述,以避免不必要地混淆本公开的概念。Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. It should be understood, however, that the description is only illustrative, and is not intended to limit the scope of the disclosure. In addition, descriptions of well-known structures and techniques are omitted in the following description in order to avoid unnecessarily obscuring the concept of the present disclosure.
在此使用的术语仅仅是为了描述具体实施例,而并非意在限制本公开。在此使用的术语“包括”、“包含”等表明了所述特征、步骤、操作和/或部件的存在,但是并不排除存在或添加一个或多个其他特征、步骤、操作或部件。 The terminology used herein is for the purpose of describing the particular embodiments, The use of the terms "comprising", "comprising" or "an"
在此使用的所有术语(包括技术和科学术语)具有本领域技术人员通常所理解的含义,除非另外定义。应注意,这里使用的术语应解释为具有与本说明书的上下文相一致的含义,而不应以理想化或过于刻板的方式来解释。All terms (including technical and scientific terms) used herein have the meaning commonly understood by one of ordinary skill in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted as having a meaning consistent with the context of the present specification and should not be interpreted in an ideal or too rigid manner.
在使用类似于“A、B和C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B和C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。在使用类似于“A、B或C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B或C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。本领域技术人员还应理解,实质上任意表示两个或更多可选项目的转折连词和/或短语,无论是在说明书、权利要求书还是附图中,都应被理解为给出了包括这些项目之一、这些项目任一方、或两个项目的可能性。例如,短语“A或B”应当被理解为包括“A”或“B”、或“A和B”的可能性。Where an expression similar to "at least one of A, B, and C, etc." is used, it should generally be interpreted in accordance with the meaning of the expression as commonly understood by those skilled in the art (for example, "having A, B, and C" "Systems of at least one of" shall include, but are not limited to, systems having A alone, B alone, C alone, A and B, A and C, B and C, and/or A, B, C, etc. ). Where an expression similar to "at least one of A, B or C, etc." is used, it should generally be interpreted according to the meaning of the expression as commonly understood by those skilled in the art (for example, "having A, B or C" "Systems of at least one of" shall include, but are not limited to, systems having A alone, B alone, C alone, A and B, A and C, B and C, and/or A, B, C, etc. ). Those skilled in the art will also appreciate that transitional conjunctions and/or phrases that are arbitrarily arbitrarily representing two or more optional items, whether in the specification, claims, or drawings, are to be construed as The possibility of one of the projects, either or both of these projects. For example, the phrase "A or B" should be understood to include the possibility of "A" or "B", or "A and B."
附图中示出了一些方框图和/或流程图。应理解,方框图和/或流程图中的一些方框或其组合可以由计算机程序指令来实现。这些计算机程序指令可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器,从而这些指令在由该处理器执行时可以创建用于实现这些方框图和/或流程图中所说明的功能/操作的装置。Some block diagrams and/or flowcharts are shown in the drawings. It will be understood that some blocks or combinations of the block diagrams and/or flowcharts can be implemented by computer program instructions. These computer program instructions may be provided to a general purpose computer, a special purpose computer or a processor of other programmable data processing apparatus such that when executed by the processor, the instructions may be used to implement the functions illustrated in the block diagrams and/or flowcharts. / operating device.
因此,本公开的技术可以硬件和/或软件(包括固件、微代码等)的形式来实现。另外,本公开的技术可以采取存储有指令的计算机可读介质上的计算机程序产品的形式,该计算机程序产品可供指令执行系统使用或者结合指令执行系统使用。在本公开的上下文中,计算机可读介质可以是能够包含、存储、传送、传播或传输指令的任意介质。例如,计算机可读介质可以包括但不限于电、磁、光、电磁、红外或半导体系统、装置、器件或传播介质。计算机可读介质的具体示例包括:磁存储装置,如磁带或硬盘(HDD);光存储装置,如光盘(CD-ROM);存储器,如随机存取存储器(RAM)或闪存;和/或有线/无线通信链路。Thus, the techniques of this disclosure may be implemented in the form of hardware and/or software (including firmware, microcode, etc.). Additionally, the techniques of this disclosure may take the form of a computer program product on a computer readable medium storing instructions for use by or in connection with an instruction execution system. In the context of the present disclosure, a computer readable medium can be any medium that can contain, store, communicate, propagate or transport the instructions. For example, a computer readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. Specific examples of the computer readable medium include: a magnetic storage device such as a magnetic tape or a hard disk (HDD); an optical storage device such as a compact disk (CD-ROM); a memory such as a random access memory (RAM) or a flash memory; and/or a wired /Wireless communication link.
本公开实施例的一种硬盘写入方法,该方法能够对计算机等智能设备的硬盘(如SMR硬盘)进行操作并提高硬盘的写入性能,避免出现如图1所示的非连续写(如随机写)的情况,如该非连续写的方式将缓存3中扇区编号为c1中的数据写入到物理硬盘4编号为d1的扇区中,c2中的数据写入到d4,c3中的数据写入到d3,c4中的数据写入到d8,c5中的数据写入到d6,c6中的数据写入到d7,上述写入方法降低了硬盘的写入性能。而结合图7本公开实施例的硬盘写入方法包括: A method for writing a hard disk according to an embodiment of the present disclosure, which can operate a hard disk of a smart device such as a computer (such as an SMR hard disk) and improve write performance of the hard disk to avoid non-continuous writing as shown in FIG. 1 In the case of random write), the data in the sector number c1 in the buffer 3 is written to the sector of the physical hard disk 4 numbered as d1, and the data in the c2 is written into the d4, c3. The data is written to d3, the data in c4 is written to d8, the data in c5 is written to d6, and the data in c6 is written to d7, and the above writing method reduces the writing performance of the hard disk. The method for writing a hard disk in conjunction with the embodiment of the present disclosure in conjunction with FIG. 7 includes:
操作S102,利用非易失性内存技术(NVDIMM)和智能设备的物理硬盘4生成虚拟硬盘2,虚拟硬盘2中存储需要写入物理硬盘4的数据块。非易失性内存技术(NVDIMM)是在一种集成了动态随机存取存储器(DRAM)和非易失性内存芯片的技术,能够在完全断电的时候依然保存完整内存数据,在本实施例中可以使用该技术并结合物理硬盘4生成虚拟硬盘2,虚拟硬盘2中设有顺序排列的至少一个扇区,扇区中存储有需要写入物理硬盘4的数据块。In operation S102, the virtual hard disk 2 is generated by using the non-volatile memory technology (NVDIMM) and the physical hard disk 4 of the smart device, and the virtual hard disk 2 stores the data block that needs to be written into the physical hard disk 4. Non-Volatile Memory Technology (NVDIMM) is a technology that integrates dynamic random access memory (DRAM) and non-volatile memory chips to retain full memory data when completely powered down, in this embodiment. The virtual hard disk 2 can be generated by using the technology in combination with the physical hard disk 4. The virtual hard disk 2 is provided with at least one sector sequentially arranged, and the data block in which the physical hard disk 4 needs to be written is stored in the sector.
操作S104,将数据块写入到物理硬盘4对应的缓存3中,缓存3也具有连续的扇区,能够存储数据块,而该写入方式可以为多种形式,例如可以将数据块按照排列的顺序的逐一的顺序写入缓存3中,也可以将数据块随机的写入缓存3中,还可以将按照预定规则写入缓存3中。In operation S104, the data block is written into the cache 3 corresponding to the physical hard disk 4. The cache 3 also has consecutive sectors and can store data blocks, and the writing manner can be in various forms, for example, the data blocks can be arranged according to The order of the sequences is written into the cache 3 one by one, and the data blocks can also be randomly written into the cache 3, and can also be written into the cache 3 according to a predetermined rule.
操作S106,根据物理硬盘4存储的数据的位置信息,获取物理硬盘4中的连续的空闲扇区的相关信息,并根据该相关信息和数据块的长度将暂存在缓存3中的数据块顺序写入到连续的空闲扇区中。通常情况下将缓存3中的数据块存储到物理硬盘4中时,数据块具有一定的长度(例如每个数据块均具有一定长度,存储时对多个连续的数据块进行操作),一定长度的多个数据块必然需要足够多的空闲扇区才能进行存储,作为优选需要足够多的连续的空闲扇区进行存储,进而保证数据块能够按照排列顺序对应的连续写(顺序写)入到物理硬盘4中,而在获取物理硬盘4中的连续的空闲扇区的相关信息时可以检测连续的空闲扇区的长度,位置和编号等相关信息,从而能够准确寻找到连续的空闲扇区的位置,并将具有一定长度的数据块按照排列顺序对应的连续写(顺序写)入到这些空闲扇区中,在一个实施例中如图3所示,物理硬盘4的扇区均为空闲扇区,则可以将缓存3中的数据按照排列顺序对应的连续写(顺序写)入到物理硬盘4中,缓存3中编号为c1至c6的扇区中的数据块连续写入到物理硬盘4的连续扇区中,并且c1中的数据块写入d1中,c2中的数据块写入d2中,c3中的数据块写入d3中,c4中的数据块写入d4中,c5中的数据块写入d5中,c6中的数据块写入d6中,其中d1至d6为连续的扇区。该写入方法能够有效提高硬盘的写入效率,提高硬盘的整体性能。In operation S106, according to the location information of the data stored in the physical hard disk 4, the related information of the consecutive free sectors in the physical hard disk 4 is acquired, and the data blocks temporarily stored in the cache 3 are sequentially written according to the related information and the length of the data block. Enter into consecutive free sectors. Generally, when the data block in the cache 3 is stored in the physical hard disk 4, the data block has a certain length (for example, each data block has a certain length, and a plurality of consecutive data blocks are operated during storage), and a certain length A plurality of data blocks necessarily require a sufficient number of free sectors for storage. Preferably, a sufficient number of consecutive free sectors are required for storage, thereby ensuring that the data blocks can be consecutively written (sequentially written) into the physical according to the arrangement order. In the hard disk 4, when the related information of consecutive free sectors in the physical hard disk 4 is acquired, relevant information such as the length, position and number of consecutive free sectors can be detected, so that the positions of consecutive free sectors can be accurately found. And successively writing (sequentially writing) the data blocks having a certain length into the free sectors according to the arrangement order. In one embodiment, as shown in FIG. 3, the sectors of the physical hard disk 4 are all free sectors. , the data in the cache 3 can be consecutively written (sequentially written) in the order of the order into the physical hard disk 4, and the number in the sector numbered c1 to c6 in the cache 3 The blocks are successively written into consecutive sectors of the physical hard disk 4, and the data blocks in c1 are written into d1, the data blocks in c2 are written into d2, the data blocks in c3 are written into d3, and the data blocks in c4 are written. In d4, the data block in c5 is written into d5, and the data block in c6 is written into d6, where d1 to d6 are consecutive sectors. The writing method can effectively improve the writing efficiency of the hard disk and improve the overall performance of the hard disk.
通过本公开实施例,能够有效提高数据连续写入硬盘(物理硬盘)的概率,而降低了随机将数据写入硬盘的概率,节省了数据写入硬盘的时间,提高了硬盘写入性能。Through the embodiments of the present disclosure, the probability of continuously writing data to the hard disk (physical hard disk) can be effectively improved, the probability of randomly writing data to the hard disk is reduced, the time for writing data to the hard disk is saved, and the writing performance of the hard disk is improved.
在本公开的一个实施例中,在将数据块写入到物理硬盘4对应的缓存3上之前,判断缓存3是否已被写满;当缓存3已被写满时,判断该缓存的数据块是否已写入到物理硬盘4中;如果还没有写入物理硬盘4中,则将缓存3中的数据块顺序写入到物理硬盘4的连续的空闲扇区上并释放该数据块占用的缓存3的相应空间。如果缓存3已经被写满数据那么再向缓存3写入数据时会将原有的数据覆盖掉,则会造成原有的数据丢失,因此在将数据块写入到物 理硬盘4对应的缓存3上之前判断缓存3是否写满能够避免误操作造成数据丢失。如果判断缓存3已经被写满数据,还要进一步判断缓存3中的数据块是否写入到物理硬盘4中,例如图4中的缓存3已经被写满,进而判断缓存3中编号为c2,c5,c6的扇区中的数据是否被写入了物理硬盘4,如果没有写入物理硬盘4中,则首先在物力硬盘中寻找连续的空闲扇区,并保证该连续的空闲扇区能够满足c2,c5,c6的扇区中的数据写入,如经过寻找后在物理硬盘4中获得编号为d7,d8,d9的连续的空闲扇区,将c2,c5,c6中的数据块分别写入到d7,d8,d9中,并释放缓存3中编号为c2,c5,c6的扇区中的空间,这样保证缓存3中的数据不会被丢失而且缓存3中还有空闲的扇区可以使用。In an embodiment of the present disclosure, before the data block is written to the cache 3 corresponding to the physical hard disk 4, it is determined whether the cache 3 has been filled; when the cache 3 has been filled, the cached data block is determined. Whether it has been written to the physical hard disk 4; if it has not been written into the physical hard disk 4, the data blocks in the cache 3 are sequentially written to the consecutive free sectors of the physical hard disk 4 and the cache occupied by the data block is released. 3 corresponding space. If the cache 3 has been filled with data, then the original data will be overwritten when the data is written to the cache 3, which will cause the original data to be lost, so the data block is written to the object. Before determining whether the cache 3 is full before the cache 3 corresponding to the hard disk 4 can avoid data loss caused by erroneous operations. If it is determined that the cache 3 has been filled with data, it is further determined whether the data block in the cache 3 is written to the physical hard disk 4. For example, the cache 3 in FIG. 4 has been filled, and then the cache 3 is numbered c2. Whether the data in the sector of c5, c6 is written to the physical hard disk 4, if not written to the physical hard disk 4, first find a continuous free sector in the hard disk, and ensure that the continuous free sector can satisfy The data in the sectors of c2, c5, and c6 is written, and after searching, the consecutive free sectors numbered d7, d8, and d9 are obtained in the physical hard disk 4, and the data blocks in c2, c5, and c6 are respectively written. Enter d7, d8, d9, and release the space in the sector numbered c2, c5, c6 in cache 3, so that the data in cache 3 is not lost and there are free sectors in cache 3. use.
进一步的,如果缓存3中的数据块已经写入到物理硬盘4中,判断缓存3中的数据块是否发生更改(例如缓存3中被写入新的数据块则说明数据块已经被更改),如果未发生更改(例如缓存3中的数据块没有被更新,而此时这些数据已经被写入到了物理硬盘4中)则释放该数据块在缓存3的相应空间,以使缓存3中的扇区能够被写入新的数据块。如果判断缓存3中数据块已经发生更改时(例如缓存3中被写入新的数据块),则将缓存3中的数据块顺序写入到物理硬盘4中的连续的空闲扇区上,并释放更改前的数据块占用的物理硬盘4的扇区。结合图5进行进一步说明,如果判断缓存3中的编号为c1,c3,c4的扇区中的数据块没有被更新,而此时这些数据已经被写入到了物理硬盘4中,则释放c1,c3,c4的空间;如果判断缓存3中的编号为c1,c3,c4的扇区中的数据块为新写入的数据,将缓存3中的数据块顺序写入到物理硬盘4中的编号为d7,d8,d9的扇区中,并且释放c1,c3,c4数据块原本占用的物理硬盘4中编号为d1,d3,d6的扇区中的数据,以清空相应扇区,而不会给物理硬盘4造成数据冗余。Further, if the data block in the cache 3 has been written to the physical hard disk 4, it is determined whether the data block in the cache 3 has changed (for example, if the new data block is written in the cache 3, the data block has been changed), If no changes have occurred (for example, the data block in cache 3 has not been updated, and at this time the data has been written to physical hard disk 4), the corresponding space of the data block in cache 3 is released, so that the fan in cache 3 The zone can be written to a new block of data. If it is judged that the data block in the cache 3 has changed (for example, a new data block is written in the cache 3), the data blocks in the cache 3 are sequentially written to consecutive free sectors in the physical hard disk 4, and Release the sector of physical hard disk 4 occupied by the data block before the change. Further, with reference to FIG. 5, if it is judged that the data blocks in the sectors numbered c1, c3, and c4 in the cache 3 are not updated, and at this time, the data has been written to the physical hard disk 4, c1 is released. C3, c4 space; if it is judged that the data block in the sector numbered c1, c3, and c4 in the cache 3 is newly written data, the data block in the buffer 3 is sequentially written to the number in the physical hard disk 4. For the sectors of d7, d8, and d9, and release the data in the sector numbered d1, d3, and d6 of the physical hard disk 4 originally occupied by the c1, c3, and c4 data blocks, to clear the corresponding sectors without Causes data redundancy for the physical hard disk 4.
下面结合图4对上述方法的一个实施例进行进一步说明,在虚拟硬盘2中具有连续的多个扇区,编号分别为m1至mN,缓存3中具有连续的多个扇区,编号分别为c1至c6,物理硬盘4中具有多个连续的扇区d1至dN,图中有阴影的扇区代表有数据块已经占用了相应的扇区,空白的扇区代表其为空闲扇区,在虚拟硬盘2中m6,m8和m9中的数据请求写入物理硬盘4,此时m1,m3和m4已经分别将数据存储到了c1,c3和c4,并且缓存3中c2,c5和c6已经被占用但其中的数据块没有被写入到物理硬盘4中,搜索满足具有足够长度的空闲扇区,找到d7,d8和d9后将c2,c5和c6中原有的数据块写入到d7,d8和d9中,然后在将m6,m8和m9中的数据写入c2,c5和c6中,返回m6,m8和m9中的数据写入成功的信息。An embodiment of the foregoing method is further described with reference to FIG. 4, which has a plurality of consecutive sectors in the virtual hard disk 2, numbered from m1 to mN, and the cache 3 has consecutive sectors, numbered c1. To c6, the physical hard disk 4 has a plurality of consecutive sectors d1 to dN, the shaded sectors in the figure represent that the data block has occupied the corresponding sector, and the blank sector represents the free sector, in the virtual The data in m6, m8, and m9 of hard disk 2 is requested to be written to physical hard disk 4. At this time, m1, m3, and m4 have respectively stored data to c1, c3, and c4, and c2, c5, and c6 in cache 3 are already occupied. The data block is not written to the physical hard disk 4. The search satisfies the free sector with sufficient length. After finding d7, d8 and d9, the original data blocks in c2, c5 and c6 are written to d7, d8 and d9. Then, the data in m6, m8, and m9 is written into c2, c5, and c6, and the information in the m6, m8, and m9 data is successfully written.
下面结合图5对上述方法的另一个实施例进行进一步说明,在虚拟硬盘2中具有连续的多个扇区,编号分别为m1至mN,缓存3中具有连续的多个扇区,编号分别为c1至c6,物 理硬盘4中具有多个连续的扇区d1至dN,图中有阴影的扇区代表有数据块已经占用了相应的扇区,在虚拟硬盘2中m6,m8和m9中有新数据请求写入物理硬盘4,此时m1,m3和m4已经分别将数据存储到了c1,c3和c4,并且缓存3已经被存满,c1,c3和c4中的数据可以转存到物理硬盘4中,在物理硬盘4中搜索连续的扇区d7,d8,d9,将c1,c3和c4中的数据分别按照排列顺序对应的连续写入到扇区d7,d8,d9(如c1中的数据写入d7,c2中的数据写入d8,c4中的数据写入d9),并且释放c1,c3,c4数据块原本占用的物理硬盘4中编号为d1,d3,d6的扇区中的数据,然后将m6,m8和m9中的数据对应写入到c1,c3和c4中,返回m6,m8和m9中的数据写入成功的信息。Another embodiment of the foregoing method is further described below with reference to FIG. 5. The virtual hard disk 2 has a plurality of consecutive sectors, numbered m1 to mN, and the cache 3 has a plurality of consecutive sectors, and the numbers are respectively C1 to c6, things The hard disk 4 has a plurality of consecutive sectors d1 to dN, and the shaded sectors in the figure represent that the data block has occupied the corresponding sector, and new data requests are written in the virtual hard disk 2 in m6, m8 and m9. Into the physical hard disk 4, at this time m1, m3 and m4 have respectively stored the data to c1, c3 and c4, and the cache 3 has been filled, the data in c1, c3 and c4 can be transferred to the physical hard disk 4, in The physical hard disk 4 searches for consecutive sectors d7, d8, and d9, and successively writes the data in c1, c3, and c4 to the sectors d7, d8, and d9 in accordance with the arrangement order, respectively, (for example, the data in c1 is written to d7. The data in c2 is written to d8, the data in c4 is written to d9), and the data in the sector numbered d1, d3, d6 in the physical hard disk 4 originally occupied by the c1, c3, and c4 data blocks is released, and then The data in m6, m8 and m9 are written to c1, c3 and c4, and the information in m6, m8 and m9 is successfully written.
在本公开的一个实施例中,该能够提高智能设备的硬盘写入性能的硬盘写入方法还包括在存储在缓存3中的数据块写入物理硬盘4的过程中,对物理硬盘4中的空闲扇区进行碎片整理。碎片整理可以将分散在不同位置的空闲扇区合并起来,以使这些空闲扇区具有足够的空间或长度能够存储新的数据,并且使缓存3中的数据能够按照排列顺序对应的连续写(顺序写)入到连续的多个空闲扇区中。In an embodiment of the present disclosure, the hard disk writing method capable of improving the hard disk writing performance of the smart device further includes: in the process of writing the data block stored in the cache 3 into the physical hard disk 4, in the physical hard disk 4 Free sectors are defragmented. Defragmentation can combine free sectors scattered in different locations so that these free sectors have enough space or length to store new data, and enable the data in cache 3 to be consecutively written in the order of the order (sequence Write) into multiple consecutive free sectors.
进一步来说,对物理硬盘中的空闲扇区进行碎片整理包括:当缓存3中的数据块顺序写入到连续的物理硬盘4的扇区后,对已经写入数据的扇区的临近扇区进行判断,如果临近扇区为空闲扇区,则移动数据块在扇区中的位置,以合并临近扇区。例如物理硬盘4中的写入数据的扇区临近的左右两侧均有空闲扇区,将数据块向左或向右进行移动使得左右两侧均有空闲扇区合并为连续的空闲扇区,以达到整理碎片的目的。下面结合图6进一步进行说明,在虚拟硬盘2中m6,m8和m9中有新数据请求写入物理硬盘4,此时m1,m3和m4已经分别将数据存储到了c1,c3和c4,并且缓存3已经被存满,c1,c3和c4中的数据可以转存到物理硬盘4中的d2,d3和d4(如c1中的数据写入d2,c3中的数据写入d3,c4中的数据写入d4),虽然d2,d3和d4连续的扇区,但是在其两侧出现了空闲扇区d1和d5,d1和d5由于长度小不能单独的存储数据,调整映射关系,将原本为m4最终存入到d4中调整为将m4最终存入到d1中,按照新的映射关系将c1,c3和c4中的原数据连续写(顺序写)入到d1,d2和d3中,然后将m6,m8和m9中的数据对应写入到c1,c3和c4中,返回m6,m8和m9中的数据写入成功的信息。这样以来能够对原d1和d5的碎片进行整理形成连续的空闲扇区d4和d5,以备存储新的数据。Further, defragmenting the free sectors in the physical hard disk includes: when the data blocks in the cache 3 are sequentially written to the sectors of the consecutive physical hard disks 4, adjacent sectors of the sectors to which the data has been written A determination is made as to if the neighboring sector is a free sector, then the location of the data block in the sector is moved to merge adjacent sectors. For example, the sectors on which the data is written in the physical hard disk 4 have free sectors on the left and right sides, and the data blocks are moved to the left or right so that the left and right sides have free sectors merged into consecutive free sectors. In order to achieve the purpose of finishing debris. As further described below with reference to FIG. 6, new data requests in m6, m8, and m9 of the virtual hard disk 2 are written to the physical hard disk 4, at which time m1, m3, and m4 have respectively stored data to c1, c3, and c4, and cached. 3 has been filled, the data in c1, c3 and c4 can be transferred to d2, d3 and d4 in physical hard disk 4 (if the data in c1 is written to d2, the data in c3 is written into the data in d3, c4 Write d4), although d2, d3 and d4 consecutive sectors, but there are free sectors d1 and d5 on both sides, d1 and d5 can not store data separately due to the small length, adjust the mapping relationship, which will be originally m4 Finally, it is stored in d4 and adjusted to store m4 in d1. The original data in c1, c3 and c4 are continuously written (sequentially written) into d1, d2 and d3 according to the new mapping relationship, and then m6 is added. The data in m8 and m9 are written to c1, c3, and c4, and the information in the m6, m8, and m9 data is successfully written. Thus, the original d1 and d5 fragments can be organized to form consecutive free sectors d4 and d5 for storing new data.
本公开实施例还一种能够提高智能设备的硬盘写入性能的硬盘写入装置,如图8所示,包括相互连接的处理器1和物理硬盘4,物理硬盘4具有缓存3,结合图7处理器1执行:The embodiment of the present disclosure further provides a hard disk writing device capable of improving the hard disk writing performance of the smart device. As shown in FIG. 8 , the processor 1 and the physical hard disk 4 are connected to each other, and the physical hard disk 4 has a cache 3 , which is combined with FIG. 7 . Processor 1 executes:
利用非易失性内存技术(NVDIMM)和智能设备的物理硬盘4生成虚拟硬盘2,虚拟硬盘2中存储有需要写入物理硬盘4的数据块。非易失性内存技术(NVDIMM)是在一种集成 了动态随机存取存储器(DRAM)和非易失性内存芯片的技术,能够在完全断电的时候依然保存完整内存数据,在本实施例中可以使用该技术并结合物理硬盘4生成虚拟硬盘2,虚拟硬盘2中设有顺序排列的至少一个扇区,扇区中存储有需要写入物理硬盘4的数据块。The virtual hard disk 2 is generated by the non-volatile memory technology (NVDIMM) and the physical hard disk 4 of the smart device, and the virtual hard disk 2 stores data blocks that need to be written to the physical hard disk 4. Non-Volatile Memory Technology (NVDIMM) is in an integration The technology of dynamic random access memory (DRAM) and non-volatile memory chip can still save the complete memory data when the power is completely cut off. In this embodiment, the technology can be used in combination with the physical hard disk 4 to generate the virtual hard disk 2 The virtual hard disk 2 is provided with at least one sector sequentially arranged, and the sector stores data blocks that need to be written to the physical hard disk 4.
处理器1能将数据块写入到物理硬盘4对应的缓存3中,缓存3也具有连续的扇区,能够存储数据块,而该写入方式可以为多种形式,例如可以将数据块按照排列的顺序的逐一的顺序写入缓存3中,也可以将数据块随机的写入缓存3中,还可以将按照预定规则写入缓存3中。The processor 1 can write the data block into the cache 3 corresponding to the physical hard disk 4. The cache 3 also has consecutive sectors and can store the data block, and the writing manner can be in various forms, for example, the data block can be followed. The order of the arrangement is written into the cache 3 one by one, and the data blocks can also be randomly written into the cache 3, and can also be written into the cache 3 according to a predetermined rule.
处理器1能根据物理硬盘4存储的数据的位置信息,获取物理硬盘4中的连续的空闲扇区的相关信息,并根据该相关信息和数据块的长度将暂存在缓存3中的数据块顺序写入到连续的空闲扇区中。通常情况下将缓存3中的数据块存储到物理硬盘4中时,数据块具有一定的长度(例如每个数据块均具有一定长度,存储时对多个连续的数据块进行操作),一定长度的多个数据块必然需要足够多的空闲扇区才能进行存储,作为优选需要足够多的连续的空闲扇区进行存储,进而保证数据块能够按照排列顺序对应的连续写(顺序写)入到物理硬盘4中,而在获取物理硬盘4中的连续的空闲扇区的相关信息时可以检测连续的空闲扇区的长度,位置和编号等相关信息,从而能够准确寻找到连续的空闲扇区的位置,并将具有一定长度的数据块按照排列顺序对应的连续写(顺序写)入到这些空闲扇区中,例如图3所示,缓存3中编号为c1至c6的扇区中的数据块连续写入到物理硬盘4的连续扇区中,并且c1中的数据块写入d1中,c2中的数据块写入d2中,c3中的数据块写入d3中,c4中的数据块写入d4中,c5中的数据块写入d5中,c6中的数据块写入d6中,其中d1至d6为连续的扇区。该写入方法能够有效提高硬盘的写入效率,提高硬盘的整体性能。The processor 1 can acquire related information of consecutive free sectors in the physical hard disk 4 according to the location information of the data stored by the physical hard disk 4, and sequentially store the data block order in the cache 3 according to the related information and the length of the data block. Write to consecutive free sectors. Generally, when the data block in the cache 3 is stored in the physical hard disk 4, the data block has a certain length (for example, each data block has a certain length, and a plurality of consecutive data blocks are operated during storage), and a certain length A plurality of data blocks necessarily require a sufficient number of free sectors for storage. Preferably, a sufficient number of consecutive free sectors are required for storage, thereby ensuring that the data blocks can be consecutively written (sequentially written) into the physical according to the arrangement order. In the hard disk 4, when the related information of consecutive free sectors in the physical hard disk 4 is acquired, relevant information such as the length, position and number of consecutive free sectors can be detected, so that the positions of consecutive free sectors can be accurately found. And successively writing (sequentially writing) the data blocks having a certain length according to the arrangement order into the free sectors, for example, as shown in FIG. 3, the data blocks in the sectors numbered c1 to c6 in the cache 3 are consecutive Write to the contiguous sector of the physical hard disk 4, and the data block in c1 is written into d1, the data block in c2 is written in d2, and the data block in c3 is written in d3, the number in c4 According to the block write d4, the data block in c5 is written into d5, and the data block in c6 is written into d6, where d1 to d6 are consecutive sectors. The writing method can effectively improve the writing efficiency of the hard disk and improve the overall performance of the hard disk.
在本公开的一个实施例中,处理器1进一步执行:在将数据块写入到物理硬盘4对应的缓存3中之前,判断缓存3是否已被写满;当缓存3已被写满时,判断该缓存中的数据块是否写入到物理硬盘4中;以及如果还没有写入物理硬盘4中,则将缓存3中的数据块顺序写入到物理硬盘4的连续的空闲扇区上并释放该数据块占用的缓存3的相应空间。如果缓存3已经被写满数据那么再向缓存3写入数据时会将原有的数据覆盖掉,则会造成原有的数据丢失,因此在将数据块写入到物理硬盘4对应的缓存3上之前判断缓存3是否写满能够避免误操作造成数据丢失。如果判断缓存3已经被写满数据,还要进一步判断缓存3中的数据块是否写入到物理硬盘4中,例如图4中的缓存3已经被写满,进而判断缓存3中编号为c2,c5,c6的扇区中的数据是否被写入了物理硬盘4,如果没有写入物理硬盘4中,则首先在物力硬盘中寻找连续的空闲扇区,并保证该连续的空闲扇区能够满足c2,c5,c6的扇区中的数据写入,如经过寻找后在物理硬盘4中获得编号为d7,d8,d9的连续的空闲扇区,将c2,c5,c6 中的数据块分别写入到d7,d8,d9中,并释放缓存3中编号为c2,c5,c6的扇区中的空间,这样保证缓存3中的数据不会被丢失而且缓存3中还有空闲的扇区可以使用。In an embodiment of the present disclosure, the processor 1 further performs: determining whether the cache 3 has been filled before writing the data block to the cache 3 corresponding to the physical hard disk 4; when the cache 3 has been filled, Determining whether the data block in the cache is written into the physical hard disk 4; and if not yet written into the physical hard disk 4, sequentially writing the data blocks in the cache 3 to consecutive free sectors of the physical hard disk 4 and The corresponding space of the cache 3 occupied by the data block is released. If the cache 3 has been filled with data, then the original data will be overwritten when the data is written to the cache 3, which will cause the original data to be lost. Therefore, the data block is written to the cache corresponding to the physical hard disk 4 Before determining whether the cache 3 is full, it can avoid data loss caused by misoperation. If it is determined that the cache 3 has been filled with data, it is further determined whether the data block in the cache 3 is written to the physical hard disk 4. For example, the cache 3 in FIG. 4 has been filled, and then the cache 3 is numbered c2. Whether the data in the sector of c5, c6 is written to the physical hard disk 4, if not written to the physical hard disk 4, first find a continuous free sector in the hard disk, and ensure that the continuous free sector can satisfy The data in the sectors of c2, c5, and c6 is written, and after searching, the consecutive free sectors numbered d7, d8, and d9 are obtained in the physical hard disk 4, and c2, c5, and c6 are obtained. The data blocks in the data are written to d7, d8, and d9, respectively, and the space in the sector numbered c2, c5, and c6 in the cache 3 is released, so that the data in the cache 3 is not lost and the cache 3 is still There are free sectors available.
进一步的,处理器1进一步执行:如果缓存3中的数据块已经写入到物理硬盘4中,则判断缓存3中数据块是否发生更改(例如缓存3中被写入新的数据块则说明数据块已经被更改),如果未发生更改(例如缓存3中的数据块没有被更新,而此时这些数据已经被写入到了物理硬盘4中)则释放该数据块在缓存3的相应空间,以使缓存3中的扇区能够被写入新的数据块。如果处理器1判断缓存3中数据块已经发生更改时(例如缓存3中被写入新的数据块),则将缓存3中的数据块顺序写入到物理硬盘4中的连续的空闲扇区上,并释放更改前的数据块占用的物理硬盘4的扇区。结合图5进行进一步说明,如果处理器1判断缓存3中的编号为c1,c3,c4的扇区中的数据块没有被更新,而此时这些数据已经被写入到了物理硬盘4中,则释放c1,c3,c4的空间;如果处理器1判断缓存3中的编号为c1,c3,c4的扇区中的数据块为新写入的数据,将缓存3中的数据块顺序写入到物理硬盘4中的编号为d7,d8,d9的扇区中,并且释放c1,c3,c4数据块原本占用的物理硬盘4中编号为d1,d3,d6的扇区中的数据,以清空相应扇区,而不会给物理硬盘4造成数据冗余。Further, the processor 1 further performs: if the data block in the cache 3 has been written into the physical hard disk 4, it is determined whether the data block in the cache 3 is changed (for example, the new data block is written in the cache 3 to indicate the data. The block has been changed), if no changes have occurred (for example, the data block in cache 3 has not been updated, and at this time the data has been written to physical hard disk 4), then the corresponding space of the data block in cache 3 is released, The sectors in cache 3 can be written to new data blocks. If the processor 1 judges that the data block in the cache 3 has changed (for example, a new data block is written in the cache 3), the data blocks in the cache 3 are sequentially written to consecutive free sectors in the physical hard disk 4. On, and release the sector of the physical hard disk 4 occupied by the data block before the change. Further, with reference to FIG. 5, if the processor 1 determines that the data blocks in the sectors numbered c1, c3, and c4 in the cache 3 are not updated, and the data has been written to the physical hard disk 4 at this time, The space of c1, c3, and c4 is released; if the processor 1 determines that the data block in the sector numbered c1, c3, and c4 in the cache 3 is newly written data, the data block in the buffer 3 is sequentially written to The physical hard disk 4 is numbered in the sectors of d7, d8, and d9, and releases the data in the sector numbered d1, d3, and d6 of the physical hard disk 4 originally occupied by the c1, c3, and c4 data blocks to clear the corresponding data. Sectors do not cause data redundancy for physical hard disk 4.
下面结合图4对上述装置的一个实施例进行进一步说明,在虚拟硬盘2中具有连续的多个扇区,编号分别为m1至mN,缓存3中具有连续的多个扇区,编号分别为c1至c6,物理硬盘4中具有多个连续的扇区d1至dN,图中有阴影的扇区代表有数据块已经占用了相应的扇区,空白的扇区代表其为空闲扇区,处理器1要求在虚拟硬盘2中m6,m8和m9中的数据写入物理硬盘4,此时m1,m3和m4已经分别将数据存储到了c1,c3和c4,并且缓存3中c2,c5和c6已经被占用但其中的数据块没有被写入到物理硬盘4中,处理器1在物理硬盘4中搜索满足具有足够长度的空闲扇区,找到d7,d8和d9后将c2,c5和c6中原有的数据块写入到d7,d8和d9中,然后在将m6,m8和m9中的数据写入c2,c5和c6中,返回m6,m8和m9中的数据写入成功的信息。An embodiment of the foregoing apparatus is further described below with reference to FIG. 4. The virtual hard disk 2 has a plurality of consecutive sectors, numbered m1 to mN, and the cache 3 has a plurality of consecutive sectors, respectively numbered c1. To c6, the physical hard disk 4 has a plurality of consecutive sectors d1 to dN, the shaded sectors in the figure represent that the data block has occupied the corresponding sector, and the blank sector represents the free sector, the processor 1 requires that the data in m6, m8 and m9 in virtual hard disk 2 be written to physical hard disk 4, at this time m1, m3 and m4 have respectively stored data to c1, c3 and c4, and c2, c5 and c6 have been cached 3 Occupied but the data block is not written to the physical hard disk 4, the processor 1 searches the physical hard disk 4 to satisfy a free sector having a sufficient length, and after finding d7, d8 and d9, the original c2, c5 and c6 The data block is written to d7, d8, and d9, and then the data in m6, m8, and m9 is written into c2, c5, and c6, and the data in m6, m8, and m9 is successfully written.
下面结合图5对上述装置的另一个实施例进行进一步说明,在虚拟硬盘2中具有连续的多个扇区,编号分别为m1至mN,缓存3中具有连续的多个扇区,编号分别为c1至c6,物理硬盘4中具有多个连续的扇区d1至dN,图中有阴影的扇区代表有数据块已经占用了相应的扇区,处理器1要求在虚拟硬盘2中m6,m8和m9中的数据写入物理硬盘4,此时m1,m3和m4已经分别将数据存储到了c1,c3和c4,并且缓存3已经被存满,c1,c3和c4中的数据可以转存到物理硬盘4中,处理器1在物理硬盘4中搜索连续的扇区d7,d8,d9,将c1,c3和c4中的数据分别按照排列顺序对应的连续写入到扇区d7,d8,d9(如c1中的数据写入d7,c2中的数据写入d8,c4中的数据写入d9),并且释放c1,c3,c4数据块原本占用的物 理硬盘4中编号为d1,d3,d6的扇区中的数据,然后将m6,m8和m9中的数据对应写入到c1,c3和c4中,返回m6,m8和m9中的数据写入成功的信息。Another embodiment of the foregoing apparatus is further described below with reference to FIG. 5. The virtual hard disk 2 has a plurality of consecutive sectors, numbered m1 to mN, respectively, and the cache 3 has a plurality of consecutive sectors, and the numbers are respectively C1 to c6, the physical hard disk 4 has a plurality of consecutive sectors d1 to dN, the shaded sectors in the figure represent that the data block has occupied the corresponding sector, and the processor 1 requires m6, m8 in the virtual hard disk 2. And the data in m9 is written to the physical hard disk 4, at this time m1, m3 and m4 have respectively stored the data to c1, c3 and c4, and the cache 3 has been filled, and the data in c1, c3 and c4 can be transferred to In the physical hard disk 4, the processor 1 searches the physical hard disk 4 for consecutive sectors d7, d8, and d9, and successively writes the data in c1, c3, and c4 to the sectors d7, d8, and d9 in accordance with the arrangement order. (If the data in c1 is written to d7, the data in c2 is written to d8, the data in c4 is written to d9), and the original occupied contents of c1, c3, and c4 data blocks are released. The data in the sector numbered d1, d3, and d6 in the hard disk 4 is written, and the data in m6, m8, and m9 is correspondingly written into c1, c3, and c4, and data in m6, m8, and m9 is written. Successful information.
在本公开的一个实施例中,在能够提高智能设备的硬盘写入性能的硬盘写入装置中,处理器1进一步执行:在存储在缓存3中的数据块写入物理硬盘4的过程中还要对物理硬盘4中的空闲扇区进行碎片整理。碎片整理可以将分散在不同位置的空闲扇区合并起来,以使这些空闲扇区具有足够的空间或长度能够存储新的数据,并且使缓存3中的数据能够按照排列顺序对应的连续写(顺序写)入到连续的多个空闲扇区中。In an embodiment of the present disclosure, in a hard disk writing device capable of improving hard disk write performance of a smart device, the processor 1 further performs: during the process of writing the data block stored in the cache 3 to the physical hard disk 4 Defragment the free sectors in physical hard disk 4. Defragmentation can combine free sectors scattered in different locations so that these free sectors have enough space or length to store new data, and enable the data in cache 3 to be consecutively written in the order of the order (sequence Write) into multiple consecutive free sectors.
进一步来说,处理器1在碎片整理的过程中执行:当缓存3中的数据块顺序写入到连续的物理硬盘4的扇区后,对已经写入数据的扇区的临近扇区进行判断,如果临近扇区为空闲扇区,则移动数据块在扇区中的位置,以合并临近扇区。例如物理硬盘4中的写入数据的扇区临近的左右两侧均有空闲扇区,处理器1将数据块向左或向右进行移动使得左右两侧均有空闲扇区合并为连续的空闲扇区,以达到整理碎片的目的。下面结合图6进一步进行说明,处理器1要求在虚拟硬盘2中m6,m8和m9中的数据写入物理硬盘4,此时m1,m3和m4已经分别将数据存储到了c1,c3和c4,并且缓存3已经被存满,处理器1可以将c1,c3和c4中的数据转存到物理硬盘4中的d2,d3和d4(如c1中的数据写入d2,c3中的数据写入d3,c4中的数据写入d4),虽然d2,d3和d4连续的扇区,但是在其两侧出现了空闲扇区d1和d5,d1和d5由于长度小不能单独的存储数据,处理器1调整映射关系,将原本为m4最终存入到d4中调整为将m4最终存入到d1中,按照新的映射关系将c1,c3和c4中的原数据连续写(顺序写)入到d1,d2和d3中,然后将m6,m8和m9中的数据对应写入到c1,c3和c4中,返回m6,m8和m9中的数据写入成功的信息。这样以来能够对原d1和d5的碎片进行整理形成连续的空闲扇区d4和d5,以备存储新的数据。Further, the processor 1 performs during the defragmentation process: when the data blocks in the cache 3 are sequentially written to the sectors of the contiguous physical hard disk 4, the neighboring sectors of the sectors in which the data has been written are judged. If the neighboring sector is a free sector, the location of the data block in the sector is moved to merge adjacent sectors. For example, the sectors on which the data is written in the physical hard disk 4 have free sectors on the left and right sides, and the processor 1 moves the data blocks to the left or right so that the left and right sides have free sectors merged into continuous idle. Sectors to achieve the purpose of defragmentation. As further described below in conjunction with FIG. 6, the processor 1 requests that data in m6, m8, and m9 in the virtual hard disk 2 be written to the physical hard disk 4, at which time m1, m3, and m4 have respectively stored data to c1, c3, and c4, And the cache 3 has been filled, the processor 1 can transfer the data in c1, c3 and c4 to d2, d3 and d4 in the physical hard disk 4 (if the data in c1 is written to d2, the data in c3 is written The data in d3, c4 is written to d4), although d2, d3 and d4 are consecutive sectors, but the free sectors d1 and d5 appear on both sides thereof, and d1 and d5 cannot store data separately due to the small length, the processor 1 adjust the mapping relationship, the original m4 is finally stored in d4 and adjusted to store m4 in d1, and the original data in c1, c3 and c4 are continuously written (sequentially written) to d1 according to the new mapping relationship. In d2 and d3, the data in m6, m8, and m9 are correspondingly written to c1, c3, and c4, and the information in m6, m8, and m9 is successfully written. Thus, the original d1 and d5 fragments can be organized to form consecutive free sectors d4 and d5 for storing new data.
具体地,处理器1例如可以包括通用微处理器、指令集处理器和/或相关芯片组和/或专用微处理器(例如,专用集成电路(ASIC)),等等。处理器1还可以包括用于缓存用途的板载存储器。In particular, processor 1 may, for example, comprise a general purpose microprocessor, an instruction set processor and/or a related chipset and/or a special purpose microprocessor (e.g., an application specific integrated circuit (ASIC)), and the like. The processor 1 may also include an onboard memory for caching purposes.
硬盘包括计算机可读存储介质。计算机可读存储介质,例如可以是能够包含、存储、传送、传播或传输指令的任意介质。例如,可读存储介质可以包括但不限于电、磁、光、电磁、红外或半导体系统、装置、器件或传播介质。可读存储介质的具体示例包括:磁存储装置,如磁带或硬盘(HDD);光存储装置,如光盘(CD-ROM);存储器,如随机存取存储器(RAM)或闪存;和/或有线/无线通信链路。The hard disk includes a computer readable storage medium. A computer readable storage medium may be, for example, any medium that can contain, store, communicate, propagate or transport the instructions. For example, a readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. Specific examples of the readable storage medium include: a magnetic storage device such as a magnetic tape or a hard disk (HDD); an optical storage device such as a compact disk (CD-ROM); a memory such as a random access memory (RAM) or a flash memory; and/or a wired /Wireless communication link.
计算机可读存储介质可以包括计算机程序,该计算机程序可以包括代码/计算机可执行指令,其在由处理器1执行时使得处理器1执行例如上面方法实施例所描述的方法流程及其任 何变形。The computer readable storage medium can include a computer program, which can include code/computer executable instructions that, when executed by processor 1, cause processor 1 to perform, for example, the method flow described above in the method embodiments and any What is the deformation.
计算机程序可被配置为具有例如包括计算机程序模块的计算机程序代码。例如,在示例实施例中,计算机程序中的代码可以包括一个或多个程序模块,例如包括A、模块B、……。应当注意,模块的划分方式和个数并不是固定的,本领域技术人员可以根据实际情况使用合适的程序模块或程序模块组合,当这些程序模块组合被处理器1执行时,使得处理器1可以执行例如上面方法实施例所描述的方法流程及其任何变形。The computer program can be configured to have, for example, computer program code comprising a computer program module. For example, in an example embodiment, the code in a computer program can include one or more program modules, including, for example, A, module B, . It should be noted that the division manner and number of modules are not fixed, and those skilled in the art may use suitable program modules or program module combinations according to actual conditions. When these program module combinations are executed by the processor 1, the processor 1 may be The method flow as described in the above method embodiments and any variations thereof are performed.
本领域技术人员可以理解,本公开的各个实施例和/或权利要求中记载的特征可以进行多种组合或/或结合,即使这样的组合或结合没有明确记载于本公开中。特别地,在不脱离本公开精神和教导的情况下,本公开的各个实施例和/或权利要求中记载的特征可以进行多种组合和/或结合。所有这些组合和/或结合均落入本公开的范围。It will be appreciated by those skilled in the art that the various features and/or combinations of the various embodiments of the present disclosure and/or the claims may be made, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, various combinations and/or combinations of the features described in the various embodiments and/or claims of the present disclosure can be made without departing from the spirit and scope of the disclosure. All such combinations and/or combinations fall within the scope of the disclosure.
以上实施例仅为本公开的示例性实施例,不用于限制本公开,本公开的保护范围由权利要求书限定。本领域技术人员可以在本公开的实质和保护范围内,对本公开做出各种修改或等同替换,这种修改或等同替换也应视为落在本公开的保护范围内。 The above embodiments are merely exemplary embodiments of the present disclosure, and are not intended to limit the disclosure, and the scope of the disclosure is defined by the claims. A person skilled in the art can make various modifications or equivalents to the present disclosure within the spirit and scope of the disclosure, and such modifications or equivalents are also considered to be within the scope of the disclosure.

Claims (10)

  1. 一种硬盘写入方法,包括:A hard disk writing method includes:
    利用非易失性内存技术和所述智能设备的物理硬盘生成虚拟硬盘,所述虚拟硬盘中存储有需要写入所述物理硬盘的数据块;Generating a virtual hard disk by using a non-volatile memory technology and a physical hard disk of the smart device, where the virtual hard disk stores a data block that needs to be written into the physical hard disk;
    将所述数据块写入到所述物理硬盘对应的缓存中;以及Writing the data block to a cache corresponding to the physical hard disk;
    根据所述物理硬盘存储的数据的位置信息,获取所述物理硬盘中的连续的空闲扇区的相关信息,并根据所述相关信息和所述数据块的长度将暂存在所述缓存中的数据块顺序写入到连续的所述空闲扇区中。Obtaining, according to the location information of the data stored by the physical hard disk, related information of consecutive free sectors in the physical hard disk, and temporarily storing the data in the cache according to the related information and the length of the data block. The blocks are sequentially written into consecutive free sectors.
  2. 根据权利要求1所述的方法,其中,在将所述数据块写入到所述物理硬盘对应的缓存中之前,所述方法还包括:The method of claim 1, wherein before the writing the data block to the cache corresponding to the physical hard disk, the method further comprises:
    判断所述缓存是否已被写满;Determining whether the cache has been filled;
    当所述缓存已被写满时,判断所述缓存中的数据块是否已写入到所述物理硬盘中;以及Determining whether a data block in the cache has been written to the physical hard disk when the cache has been filled;
    如果还没有写入所述物理硬盘中,则将所述缓存中的数据块顺序写入到所述物理硬盘的连续的空闲扇区上,并释放该数据块占用的所述缓存的相应空间。If the physical hard disk has not been written, the data blocks in the cache are sequentially written to consecutive free sectors of the physical hard disk, and the corresponding space of the cache occupied by the data block is released.
  3. 根据权利要求2所述的方法,其中,所述方法还包括:The method of claim 2, wherein the method further comprises:
    如果所述缓存中的数据块已经写入到所述物理硬盘中,判断所述缓存中的数据块是否发生更改;If the data block in the cache has been written to the physical hard disk, determining whether the data block in the cache is changed;
    如果未发生更改,则释放该数据块在所述缓存的相应空间;以及If no changes have occurred, release the data block in the corresponding space of the cache;
    如果已经发生更改时,则将所述缓存中的数据块顺序写入到所述物理硬盘中的连续的所述空闲扇区上,并释放更改前的所述数据块占用的所述物理硬盘的扇区。If the change has occurred, the data blocks in the cache are sequentially written to the consecutive free sectors in the physical hard disk, and the physical hard disk occupied by the data block before the change is released. Sector.
  4. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:
    在存储在所述缓存中的数据块写入所述物理硬盘的过程中,对所述物理硬盘中的空闲扇区进行碎片整理。A free sector in the physical hard disk is defragmented in a process in which a data block stored in the cache is written to the physical hard disk.
  5. 根据权利要求4所述的方法,其中,对所述物理硬盘中的空闲扇区进行碎片整理包括:The method of claim 4 wherein defragmenting the free sectors in the physical hard disk comprises:
    当所述缓存中的数据块顺序写入到连续的所述物理硬盘的扇区后,对已经写入数据的扇区的临近扇区进行判断;以及Determining an adjacent sector of a sector in which data has been written after the data blocks in the cache are sequentially written to consecutive sectors of the physical hard disk;
    如果所述临近扇区为空闲扇区,则移动所述数据块在扇区中的位置,以合并所述临近扇区。If the neighboring sector is a free sector, the location of the data block in the sector is moved to merge the neighboring sectors.
  6. 一种硬盘写入的装置,包括相互连接的处理器和物理硬盘,所述物理硬盘具有缓存,所述处理器执行: A device for writing a hard disk, comprising a processor and a physical hard disk connected to each other, the physical hard disk having a cache, the processor executing:
    利用非易失性内存技术和所述物理硬盘生成虚拟硬盘,所述虚拟硬盘中存储有需要写入所述物理硬盘的数据块;Generating a virtual hard disk by using a non-volatile memory technology and the physical hard disk, where the virtual hard disk stores data blocks that need to be written into the physical hard disk;
    将所述数据块写入到所述物理硬盘对应的缓存中;以及Writing the data block to a cache corresponding to the physical hard disk;
    根据所述物理硬盘存储的数据的位置信息,获取所述物理硬盘中的连续的空闲扇区的相关信息,并根据所述相关信息和所述数据块的长度将暂存在所述缓存中的数据块顺序写入到连续的所述空闲扇区中。Obtaining, according to the location information of the data stored by the physical hard disk, related information of consecutive free sectors in the physical hard disk, and temporarily storing the data in the cache according to the related information and the length of the data block. The blocks are sequentially written into consecutive free sectors.
  7. 根据权利要求6所述的装置,其中,所述处理器进一步执行:The apparatus of claim 6 wherein said processor is further operative to:
    在将所述数据块写入到所述物理硬盘对应的缓存中之前,判断所述缓存是否已被写满;Determining whether the cache has been filled before writing the data block to a cache corresponding to the physical hard disk;
    当所述缓存已被写满时,判断所述缓存中的所述数据块是否已写入到所述物理硬盘中;以及Determining, when the cache has been filled, whether the data block in the cache has been written to the physical hard disk;
    如果还没有写入所述物理硬盘中,则将所述缓存中的数据块顺序写入到所述物理硬盘的连续的空闲扇区上并释放该数据块占用的所述缓存的相应空间。If the physical hard disk has not been written, the data blocks in the cache are sequentially written to consecutive free sectors of the physical hard disk and the corresponding space of the cache occupied by the data block is released.
  8. 根据权利要求7所述的装置,其中,所述处理器进一步执行:The apparatus of claim 7 wherein said processor is further operative to:
    如果所述缓存中的数据块已经写入到所述物理硬盘中,则判断所述缓存中的数据块是否发生更改;If the data block in the cache has been written to the physical hard disk, determining whether the data block in the cache is changed;
    如果未发生更改,则释放该数据块在所述缓存的相应空间;以及If no changes have occurred, release the data block in the corresponding space of the cache;
    如果已经发生更改时,则将所述缓存中的数据块顺序写入到所述物理硬盘中的连续的所述空闲扇区上,并释放更改前的所述数据块占用的所述物理硬盘的扇区。If the change has occurred, the data blocks in the cache are sequentially written to the consecutive free sectors in the physical hard disk, and the physical hard disk occupied by the data block before the change is released. Sector.
  9. 根据权利要求7所述的装置,其中,所述处理器进一步执行:The apparatus of claim 7 wherein said processor is further operative to:
    在存储在所述缓存中的数据块写入所述物理硬盘的过程中,对所述物理硬盘中的空闲扇区进行碎片整理。A free sector in the physical hard disk is defragmented in a process in which a data block stored in the cache is written to the physical hard disk.
  10. 根据权利要求7所述的装置,其中,所述处理器在进行碎片整理的过程中执行:The apparatus of claim 7 wherein said processor is executed during defragmentation:
    当所述缓存中的数据块顺序写入到连续的所述物理硬盘的扇区后,对已经写入数据的扇区的临近扇区进行判断;以及Determining an adjacent sector of a sector in which data has been written after the data blocks in the cache are sequentially written to consecutive sectors of the physical hard disk;
    如果所述临近扇区为空闲扇区,则移动所述数据块在扇区中的位置,以合并所述临近扇区。 If the neighboring sector is a free sector, the location of the data block in the sector is moved to merge the neighboring sectors.
PCT/CN2017/107005 2017-03-27 2017-10-20 Hard disk write-in method and apparatus WO2018176811A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710188400.3 2017-03-27
CN201710188400.3A CN106980471B (en) 2017-03-27 2017-03-27 Method and device for improving hard disk writing performance of intelligent equipment

Publications (1)

Publication Number Publication Date
WO2018176811A1 true WO2018176811A1 (en) 2018-10-04

Family

ID=59338981

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/107005 WO2018176811A1 (en) 2017-03-27 2017-10-20 Hard disk write-in method and apparatus

Country Status (2)

Country Link
CN (1) CN106980471B (en)
WO (1) WO2018176811A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106980471B (en) * 2017-03-27 2020-08-25 联想(北京)有限公司 Method and device for improving hard disk writing performance of intelligent equipment
CN110968271B (en) * 2019-11-25 2024-02-20 北京劲群科技有限公司 High-performance data storage method, system and device
CN113282582B (en) * 2021-05-21 2023-06-20 海南超船电子商务有限公司 Efficient storage method and system for ship position data

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101539842A (en) * 2009-04-27 2009-09-23 杭州华三通信技术有限公司 Data wiring method of disk array system and disk array system
CN102185929A (en) * 2011-06-02 2011-09-14 杭州华三通信技术有限公司 Storage area network (SAN)-resource-based video monitoring data storage method and device
CN102622412A (en) * 2011-11-28 2012-08-01 中兴通讯股份有限公司 Method and device of concurrent writes for distributed file system
CN105306865A (en) * 2015-10-29 2016-02-03 南京秦杜明视信息技术有限公司 Video monitoring data system
US9268709B2 (en) * 2012-10-18 2016-02-23 Marvell International Ltd. Storage controllers and storage control methods
CN106980471A (en) * 2017-03-27 2017-07-25 联想(北京)有限公司 A kind of method and device for the hard disk write performance for improving smart machine

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398823B (en) * 2007-09-26 2012-05-09 新奥特硅谷视频技术有限责任公司 Method and system for implementing remote storage by virtual file systems technology
US9729659B2 (en) * 2013-03-14 2017-08-08 Microsoft Technology Licensing, Llc Caching content addressable data chunks for storage virtualization
CN105138286A (en) * 2015-08-11 2015-12-09 智云创新(北京)科技有限公司 Method for mixed utilization of SSD and SMR hard disks in disk file system
CN105353985A (en) * 2015-11-03 2016-02-24 国云科技股份有限公司 Method for improving reading speed of virtual machine temporary file

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101539842A (en) * 2009-04-27 2009-09-23 杭州华三通信技术有限公司 Data wiring method of disk array system and disk array system
CN102185929A (en) * 2011-06-02 2011-09-14 杭州华三通信技术有限公司 Storage area network (SAN)-resource-based video monitoring data storage method and device
CN102622412A (en) * 2011-11-28 2012-08-01 中兴通讯股份有限公司 Method and device of concurrent writes for distributed file system
US9268709B2 (en) * 2012-10-18 2016-02-23 Marvell International Ltd. Storage controllers and storage control methods
CN105306865A (en) * 2015-10-29 2016-02-03 南京秦杜明视信息技术有限公司 Video monitoring data system
CN106980471A (en) * 2017-03-27 2017-07-25 联想(北京)有限公司 A kind of method and device for the hard disk write performance for improving smart machine

Also Published As

Publication number Publication date
CN106980471A (en) 2017-07-25
CN106980471B (en) 2020-08-25

Similar Documents

Publication Publication Date Title
US9928167B2 (en) Information processing system and nonvolatile storage unit
CN108459826B (en) Method and device for processing IO (input/output) request
US11126544B2 (en) Method and apparatus for efficient garbage collection based on access probability of data
US9697116B2 (en) Storage system and writing method thereof
JP2001209500A (en) Disk device and read/write processing method threof
WO2015145647A1 (en) Storage device, data processing method, and storage system
JP2011253251A (en) Data storage device and data writing method
KR20090032821A (en) Method for prefetching of hard disk drive, recording medium and apparatus therefor
WO2018176811A1 (en) Hard disk write-in method and apparatus
EP3043267A1 (en) Storage apparatus, storage system, data readout method, and storage program
TW201643690A (en) Data storage system and specific instruction executing method thereof
US11132145B2 (en) Techniques for reducing write amplification on solid state storage devices (SSDs)
CN103678166A (en) Method and system for using solid-state disk as cache of computer
WO2018082695A1 (en) Cache replacement method and device
US10503608B2 (en) Efficient management of reference blocks used in data deduplication
WO2017113059A1 (en) Discrepant data backup method, storage system and discrepant data backup device
US20190042134A1 (en) Storage control apparatus and deduplication method
CN113282234B (en) Storage device, storage system, and method of operating the same
US9471227B2 (en) Implementing enhanced performance with read before write to phase change memory to avoid write cancellations
TWI652570B (en) Non-volatile memory apparatus and address classification method thereof
JP6790515B2 (en) Solid state drive
US20230273878A1 (en) Storage device for classifying data based on stream class number, storage system, and operating method thereof
US8655892B2 (en) Data reorganization
KR20130089324A (en) Data i/o controller and system having the same
JP2004086295A (en) Nand type flash memory disk drive and method for logical address detection

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

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

Country of ref document: EP

Kind code of ref document: A1