WO2021184901A1 - 一种数据的写入方法、装置以及设备 - Google Patents

一种数据的写入方法、装置以及设备 Download PDF

Info

Publication number
WO2021184901A1
WO2021184901A1 PCT/CN2020/140632 CN2020140632W WO2021184901A1 WO 2021184901 A1 WO2021184901 A1 WO 2021184901A1 CN 2020140632 W CN2020140632 W CN 2020140632W WO 2021184901 A1 WO2021184901 A1 WO 2021184901A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
storage
read
file
local server
Prior art date
Application number
PCT/CN2020/140632
Other languages
English (en)
French (fr)
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 WO2021184901A1 publication Critical patent/WO2021184901A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • 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/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files

Definitions

  • This application relates to the field of computer technology, and in particular to a method, device and equipment for writing data.
  • Storage strips refer to collections used to store data. When the collection stores data, continuous data can be written to multiple servers, and the data belonging to the same storage strip is associated. If a server fails, causing the server's data to be lost, the lost data can be recovered through other servers in the same storage strip, making the written data safer and more reliable. For example, if a piece of continuous data is written to a storage stripe, the storage stripe is distributed on 6 servers. If two of the servers fail, causing the data on the server to be lost, you can use the storage stripe on the storage stripe. Other servers recover lost data.
  • the embodiments of the present application provide a data writing method, device, and equipment, which are used to solve the problem of poor data reading performance of the server.
  • the embodiment of the application adopts the following technical solution: the embodiment of the application provides a data writing method, the method includes: if the number of data blocks m of the file to be read is less than or equal to the number of storage spaces of the storage strip n , Write the data of at least two data blocks in the file to be read to the local server; if the number of data blocks m of the file to be read is greater than the number of storage space n of the storage strip, write the data in the file to be read For the data of the first n data blocks, write the data of at least two data blocks to the local server, where the storage strips are located on different servers.
  • An embodiment of the present application also provides a data writing device.
  • the device includes: a writing unit configured to: Read the data of at least two data blocks in the file and write it to the local server; if the number of data blocks m of the file to be read is greater than the number of storage space n of the storage strip, write the first n of the files to be read When the data of the data block, the data of at least two data blocks are written to the local server, where the storage strips are located on different servers.
  • the embodiment of the present application also provides a data writing device.
  • the device includes a memory for storing computer program instructions and a processor for executing the program instructions. When the computer program instructions are executed by the processor, the device triggers The device implements the following device: a writing unit for writing data of at least two data blocks in the file to be read if the number of data blocks m of the file to be read is less than or equal to the number of storage spaces n of the storage strip To the local server; if the number of data blocks m of the file to be read is greater than the number of storage space n of the storage strip, when writing the data of the first n data blocks in the file to be read, at least two data blocks The data of is written to the local server, where the storage strips are located on different servers.
  • the embodiment of the present application writes more data blocks of data required by the local server to the local server, thereby improving the performance of the server when reading data.
  • FIG. 1 is a schematic flowchart of a data writing method provided in Embodiment 1 of the specification;
  • FIG. 2 is a schematic flowchart of a method for writing data provided in Embodiment 2 of the specification;
  • FIG. 3 is a data writing method of a storage strip in the prior art provided in the second embodiment of the specification;
  • FIG. 4 is the data writing method of the storage strip of this application provided in the second embodiment of the specification.
  • Fig. 5 is a schematic diagram of the structure of the data writing device provided in the third embodiment of the specification.
  • FIG. 1 is a schematic flowchart of a method for writing data provided in Embodiment 1 of this specification, and the schematic flowchart includes step S101.
  • Step S101 if the number m of data blocks of the file to be read is less than or equal to the number n of storage space of the storage strip, the data of at least two data blocks in the file to be read is written to the local server; if the file is to be read The number of data blocks m is greater than the number of storage space n of the storage strip.
  • the data of at least two data blocks is written to the local server, where, The storage strips are located on different servers.
  • FIG. 2 is a schematic flowchart of a data writing method provided in the second embodiment of this specification.
  • the schematic flowchart includes steps S201 to S202.
  • Step S201 Generate storage strips corresponding to the attribute information according to business requirements, and divide the storage strips into multiple storage blocks.
  • the attribute information includes the type of the storage strip or the storage space of the storage strip.
  • the storage strip of the attribute information may be The storage strip of the corresponding type; if the business type is a storage strip of a specific storage space, the storage strip of the attribute information can correspond to the storage strip of the storage space.
  • the business requirement is to produce a storage strip with 3M storage space. Or the business requirement is to produce 4+2 storage strips.
  • the storage block is an independent storage unit, and each storage block is used to store data.
  • the system is initialized according to business requirements, and data strips with one or more attribute information can be produced. Take erasure coding as an example.
  • different 4+2 and 8+3 strips can be generated in the system; according to different data storage space requirements, 3M or other storage can be generated in the system Storage strips of space.
  • a 4+2 storage strip is distributed on 6 servers, and the storage strip is divided into 6 storage blocks. If two of the servers fail, the storage blocks distributed on the remaining 4 servers can be used to restore writing To the failed server; the storage space of the storage strip is 3M. If the storage strip needs to be applied to a 4+2 storage strip, it can be determined that the storage space of each storage block is 500kb, and then determine The division position of the storage strip, and further divide the storage strip into 6 storage blocks.
  • Step S202 if the number m of data blocks of the file to be read is less than or equal to the number n of storage space of the storage strip, the data of at least two data blocks in the file to be read is written to the local server; if the file is to be read The number of data blocks m is greater than the number of storage space n of the storage strip.
  • the data of at least two data blocks is written to the local server, where, The storage strips are located on different servers.
  • step S202 of the embodiment of the present specification the storage strips need to be placed on different servers, so that when the server fails, data can be restored through other storage blocks in the same storage strip.
  • step S202 it is more preferable to write all the data of the file to be read to the local server.
  • the server to read the file can be designated as the local server.
  • server A can be designated as the local server when reading file a.
  • This embodiment takes 4+2 storage strips as an example.
  • the storage strips will be distributed on 4 servers, even if any two servers fail, the data will not be It will be lost and can be restored through the remaining 4 servers.
  • the entire write is used, that is, when continuous data is written to a storage stripe, the storage space of the storage stripe is not fully occupied. Write to other storage strips; or, if the storage space of the storage strip is large enough, all continuous data is written to one storage strip.
  • the server needs to read continuously when it is running, but usually, because continuous data is written to different servers, when the local server needs to read the subsequent data distributed on other servers, it needs to borrow the network or Other transmission methods, which may reduce the performance of the entire system, increase the delay of the entire system, and may also cause network and CPU consumption.
  • the continuous files read by the local server in this embodiment are files required by the server.
  • the four pieces of continuous data are respectively data segment one: S1d1, S2d1, S3d1, S4d1; data segment two: S1d2, S2d2, S3d3, S4d4; data Segment three: S1d3, S2d3, S3d3, S4d3; data segment four: S1d4, S2d4, S3d4, S4d4.
  • the six servers are Client1, Client2, Client3, Client4, Client5, and Client6.
  • the four storage stripes are Stripe1, Stripe2, Stripe3, and Stripe4.
  • Client1 needs to read data segment one: S1d1, S2d1, S3d1 , S4d1, Client1 needs to read S2d1, S3d1, S4d1 after reading S1d1 locally, and S2d1, S3d1, S4d1 are distributed on other servers, and the network or other transmission methods need to be borrowed when reading, which may reduce The performance of the entire system, and increasing the delay of the entire system, may also cause network and CPU consumption.
  • This embodiment takes 4+2 storage strips as an example to describe the technical solution of the present application.
  • the storage strips may be distributed on 4 servers, even if any The failure data of 2 servers will not be lost, and it can be recovered by the remaining 4 servers.
  • a storage strip is divided into multiple storage blocks for storing data, and the data is written into different storage strips located on a local server. Specifically, the data needs to be written to the local server first. If the storage space of the local server is not convenient for storing the data, the remaining data can be written to the adjacent server.
  • the continuous data is written to the local server, when the local server reads the continuous data, it does not need to borrow the network or other transmission means to read the required data, thereby improving the performance of the system.
  • the continuous files read by the local server in this embodiment are data required by the server.
  • the four pieces of continuous data are respectively data segment one: S1d1, S2d1, S3d1, S4d1; data segment two: S1d2, S2d2, S3d3, S4d4; data segment Three: S1d3, S2d3, S3d3, S4d3; data segment four: S1d4, S2d4, S3d4, S4d4.
  • the six servers are Client1, Client2, Client3, Client4, Client5, and Client6.
  • the four storage stripes are Stripe1, Stripe2, Stripe3, and Stripe4.
  • the S1d1, S2d1, S3d1, and S4d1 of data segment 1 are written to Client1;
  • the S1d2, S2d2, S3d3, and S4d4 of data segment 2 are written to Client2;
  • the data segment 3 Write S1d3, S2d3, S3d3, and S4d3 to Client3; write S1d4, S2d4, S3d4, and S4d4 of data segment four to Client4.
  • data segment one is data required by Client1
  • data segment two is data required by Client2
  • data segment three is data required by Client3
  • data segment four is data required by Client4.
  • this application only needs to write more data that should be distributed across multiple servers to the local server, reducing the number of calls to local server data.
  • the storage block may include a data block storing data and a check block storing a check code, wherein the check code is used to check the data stored in the storage strip. Marking the storage block specifically includes: marking the data block as distributable and readable and writable; and marking the check block as distributable.
  • S1p1, S2p1, S3p1, and S4p1 are distributed in the check block of Client5 according to the marking situation
  • S1p2, S2p2, S3p2, and S4p2 are distributed in the check block of Client6, S1d1, S2d1 in the figure
  • S3d1, S4d1, etc. are data blocks
  • S1p1, S2p1, S3p1, S4p1, etc. are check blocks.
  • the method further includes: marking the storage blocks in the storage strips corresponding to the type of the predefined storage block Function.
  • the types of storage blocks include data blocks storing data and check blocks storing check codes, where the check codes are used to check the data in the storage strips.
  • Marking the function corresponding to the storage block in the storage strip specifically includes: marking the data block as allocatable and readable and writable; and marking the check block as allocatable.
  • the method further includes:
  • the check code in the check block is updated.
  • a check code will be generated in S1p1 of Client5 and S1p2 of Client6.
  • S1d2 is written to Client2 since S1d1 and S1d2 are in the same storage stripe, Therefore, the check codes in S1p1 of Client5 and S1p2 of Client6 will be recalculated, and the calculation results will be updated to the check codes in S1p1 of Client5 and S1p2 of Client6.
  • the data of at least two data blocks in the file to be read is written to the local server; if the file is to be read The number of data blocks m is greater than the number of storage space n of the storage strip.
  • the method further includes: judging whether the pre-input instruction is convenient for the local server to read the data of the file to be read; if it is judged that the pre-input instruction is convenient for the local server to read the data of the file to be read, executing If the number m of data blocks of the file to be read is less than or equal to the number n of storage space of the storage strip, the data of at least two data blocks in the file to be read is written to the local server; If the number m of data blocks is greater than the number n of storage space of the storage strip, when writing the data of the first n data blocks in the file to be read, the step of writing the data of at least two data blocks to the local server; if It is determined that the pre-input instruction is not convenient for the local server to read the data of the file to be read, and then the data of the file to be read is continuously written to different servers according to the location of the storage strip on the server. .
  • the above solution can be applied to a distributed storage system, can also be applied to a distributed memory system, and can also be applied to a storage system that requires high-reliability data.
  • the storage block in this application can be stored in the hard disk, or in the internal memory or other storage devices.
  • FIG. 5 is a schematic structural diagram of a data writing device provided in the third embodiment of this specification.
  • the schematic structural diagram includes: a writing unit 1, a generating unit 2, a marking unit 3, and an updating unit 4 , Judgment unit 5 and execution unit 6.
  • the writing unit 1 is used to write the data of at least two data blocks in the file to be read to the local server if the number m of data blocks of the file to be read is less than or equal to the number n of storage space of the storage strip; The number m of data blocks to read the file is greater than the number n of storage space of the storage strip.
  • write the data of the first n data blocks in the file to be read write the data of at least two data blocks to the local server , Wherein the storage strips are located on different servers.
  • the generating unit 2 is configured to generate a storage strip corresponding to the attribute information according to business requirements, and divide the storage strip into a plurality of storage blocks, wherein the attribute information includes the type of the storage strip and the storage strip Band storage space.
  • the marking unit 3 is used for marking the storage block in the storage strip with the corresponding function according to the predefined storage block type.
  • the type of the storage block includes a data block storing data and a check block storing a check code, wherein the check code is used to check the data in the storage strip.
  • the marking unit 3 is specifically configured to: mark the data block as distributable and readable and writable; and mark the check block as distributable.
  • the update unit 4 is used to update the check code in the check block according to all the written data.
  • the judging unit 5 is used to judge whether the pre-input instruction is convenient for the local server to read the data of the file to be read;
  • the execution unit 6 is configured to, if it is determined that the pre-input instruction is convenient for the local server to read the data of the file to be read, then execute if the number m of data blocks of the file to be read is less than or equal to the storage space of the storage strip Number n, write the data of at least two data blocks in the file to be read to the local server; if the number of data blocks m of the file to be read is greater than the number of storage space n of the storage strip, write the data to be read When the data of the first n data blocks in the file, the step of writing the data of at least two data blocks to the local server; if it is determined that the pre-input instruction is not convenient for the local server to read the data of the file to be read, Then, according to the position of the storage strip on the server, the data of the file to be read is continuously written to different servers.
  • the embodiment of the present application also provides a data writing device.
  • the device includes a memory for storing computer program instructions and a processor for executing the program instructions. When the computer program instructions are executed by the processor, the device triggers
  • the equipment implements the following devices:
  • the writing unit is used to write the data of at least two data blocks in the file to be read to the local server if the number m of data blocks of the file to be read is less than or equal to the number n of storage space of the storage strip; The number m of data blocks to read the file is greater than the number n of storage space of the storage strip.
  • a Programmable Logic Device (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user's programming of the device.
  • HDL Hardware Description Language
  • the controller can be implemented in any suitable manner.
  • the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program codes (such as software or firmware) executable by the (micro)processor. , Logic gates, switches, application specific integrated circuits (ASICs), programmable logic controllers and embedded microcontrollers. Examples of controllers include but are not limited to the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicon Labs C8051F320, the memory controller can also be implemented as part of the memory control logic.
  • controllers in addition to implementing the controller in a purely computer-readable program code manner, it is entirely possible to program the method steps to make the controller use logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded logic.
  • the same function can be realized in the form of a microcontroller or the like. Therefore, such a controller can be regarded as a hardware component, and the devices included in it for realizing various functions can also be regarded as a structure within the hardware component. Or even, the device for realizing various functions can be regarded as both a software module for realizing the method and a structure within a hardware component.
  • a typical implementation device is a computer.
  • the computer may be, for example, a personal computer, a laptop computer, a cell phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or Any combination of these devices.
  • the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory in a computer readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cartridges, magnetic tape storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • This application may be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • This application can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

Landscapes

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

Abstract

一种数据的写入方法,所述方法包括:若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器,其中,所述存储条带位于不同的服务器(S101)。上述方法将更多的本地服务器所需数据的数据块写入至本地服务器,提高了服务器在读取数据时的性能。

Description

一种数据的写入方法、装置以及设备 技术领域
本申请涉及计算机技术领域,尤其涉及一种数据的写入方法、装置及设备。
背景技术
存储条带是指用来存储数据的集合。该集合在存储数据时,可以将连续的数据写入至多个服务器,并且属于同一存储条带中数据存在关联。若某个服务器发生故障,导致该服务器的数据丢失,可以通过处在同一存储条带的其他服务器恢复丢失的数据,使得写入的数据更加安全可靠。比如,将一段连续数据写入至存储条带中,该存储条带分布在6台服务器上,若是其中2台服务器发生故障,导致存在于服务器的数据丢失,可以通过处在该存储条带的其他服务器恢复丢失的数据。
应用现有的数据写入存储条带的方法时,是将连续的数据写入至不同的服务器,服务器在读取数据时性能较差。
发明内容
有鉴于此,本申请实施例提供了一种数据的写入方法、装置及设备,用于解决服务器读取数据性能较差的问题。
本申请实施例采用下述技术方案:本申请实施例提供一种数据的写入方法,所述方法包括:若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器,其中,所述存储条带位于不同的服务器。
本申请实施例还提供一种数据的写入装置,所述装置包括:写入单元,用于若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器,其中,所述存储条带位于不同的服务器。
本申请实施例还提供一种数据的写入设备,该设备包括用于存储计算机程序指令 的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被该处理器执行时,触发该设备执行下述装置:写入单元,用于若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器,其中,所述存储条带位于不同的服务器。
本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:本申请实施例将更多的本地服务器所需数据的数据块写入至本地服务器,提高了服务器在读取数据时的性能。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1为说明书实施例一提供的数据的写入方法的流程示意图;
图2为说明书实施例二提供的数据的写入方法的流程示意图;
图3为说明书实施例二提供的现有技术中存储条带的数据写入方式;
图4为说明书实施例二提供的本申请存储条带的数据写入方式;
图5为说明书实施例三提供的数据的写入装置的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
以下结合附图,详细说明本申请各实施例提供的技术方案。
图1为本说明书实施例一提供的一种数据的写入方法的流程示意图,该流程示意图包括步骤S101。
步骤S101,若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n, 将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器,其中,所述存储条带位于不同的服务器。
与上述实施例一对应的,图2为本说明书实施例二提供的一种数据的写入方法的流程示意图,该流程示意图包括步骤S201~步骤S202。
步骤S201,根据业务需求生成对应属性信息的存储条带,并将所述存储条带划分成多个存储块。
在本说明书实施例的步骤S201中,属性信息包括所述存储条带的类型或所述存储条带的存储空间,若是业务需求是特定类型的存储条带,则属性信息的存储条带可以是对应类型的存储条带;若业务类型是特定存储空间的存储条带,则属性信息的存储条带可以对应存储空间的存储条带,比如,业务需求是生产存储空间为3M的存储条带,或者业务需求为生产类型为4+2型的存储条带。
在本说明书实施例的步骤S201中,储存块为独立的存储单元,每个存储块用于存储数据。根据业务需求对***进行初始化,可以生产一种或多种属性信息的数据条带。以纠删码为例,根据不同的数据可靠性需求,可以在***中生成不同的4+2和8+3等条带;根据不同的数据存储空间需求,可以在***中生成3M或其它存储空间的存储条带。比如,4+2型的存储条带分布于6个服务器,将该存储条带划分成6个存储块,若是其中2台服务器发生故障,可以通过分布在其余4台服务器的存储块恢复写入至发生故障的服务器;存储条带的存储空间为3M,若是需要将该存储条带应用于4+2型的存储条带中,则可以确定出每个存储块的存储空间为500kb,确定出存储条带的划分位置,进而将该存储条带划分成6个存储块。
步骤S202,若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器,其中,所述存储条带位于不同的服务器。
在本说明书实施例的步骤S202中,需要将存储条带放置于不同的服务器,以便服务器发生故障时可通过同一存储条带中的其他存储块恢复数据。
针对步骤S202,更优的是,将所要读取文件的全部数据写入至本地服务器。
需要说明的是,根据任务需求,所要读取文件的服务器可以指定为本地服务器, 比如,服务器A需要读取文件a,则服务器A在读取文件a时,可以被指定为本地服务器。
在向存储条带中写入数据时,先是写满一条存储条带后再写入其他的存储条带,由于存储条带放置于不同的服务器,使得本地服务器只能存储一部分本地服务器所需的数据,由于本地服务器需要读取该数据,读取时需要进行跨服务器的调用,由此给本地服务器的读取工作带来很大的不便,可能因此而造成网络延时等问题,针对此问题,作出详细的说明。
本实施例以4+2类型的存储条带为例进行说明,存储条带为了使得数据的可靠性更好,会将存储条带分布于4台服务器上,即使任意2台服务器故障数据也不会丢失,可以通过其余4台服务器进行恢复。但现有技术中,向存储条带写入连续的数据时会采用整体写入,即将连续的数据向一条存储条带写入数据时,直到该条存储条带的存储空间占满后,再写入至其他的存储条带;或者,在存储条带的存储空间足够大的情况下,将连续的数据全部写入到了一条存储条带中。
由于数据存在连续性,服务器在运行时需要连续进行读取,但通常,由于将连续的数据写入到不同的服务器,本地的服务器需要读取后续分布在其他服务器的数据时,需要借用网络或其他传输手段,这可能会降低整个***的性能,并且增加整个***的延时,还可能造成网络和CPU的消耗。需要说明的是,本实施例中的本地服务器读取的连续文件为该服务器所需的文件。
本实施例将对上述现有技术的技术方案进一步说明,参见图3,四段连续数据分别为数据段一:S1d1、S2d1、S3d1、S4d1;数据段二:S1d2、S2d2、S3d3、S4d4;数据段三:S1d3、S2d3、S3d3、S4d3;数据段四:S1d4、S2d4、S3d4、S4d4。六个服务器分别为Client1、Client2、Client3、Client4、Client5、Client6。四段存储条带分别为Stripe1、Stripe2、Stripe3、Stripe4。将四段连续数据写入服务器时,是将数据段一的S1d1、S2d1、S3d1、S4d1写入至Stripe1;将数据段二的S1d2、S2d2、S3d3、S4d4写入至Stripe2;将数据段三的S1d3、S2d3、S3d3、S4d3写入至Stripe3;将数据段四的S1d4、S2d4、S3d4、S4d4写入至Stripe4。由此可以看出,现有技术在处理连续的数据段时,为了保证数据的可靠安全,而将连续的数据段分布于不同的服务器,若Client1需要读取数据段一:S1d1、S2d1、S3d1、S4d1,Client1在本地读取完S1d1后,还需要读取S2d1、S3d1、S4d1,而S2d1、S3d1、S4d1分布于其他服务器,读取时就需要借用网络或其他传输手段,这就可能会降低整个***的性能,并且增加整个***的延时,还可能造成网络和 CPU的消耗。
本实施例以4+2类型的存储条带为例,对本申请的技术方案进行说明,存储条带为了使得数据的可靠性更好,可能会将存储条带分布于4台服务器上,即使任意2台服务器故障数据也不会丢失,可以通过其余4台服务器进行恢复。本申请是将存储条带划分成多个用于存储数据的存储块,将数据写入位于本地服务器的不同存储条带。具体的,数据先往需要本地服务器写入,若是本地服务器的存储空间不便于存放该数据,可以将剩余的数据写入至相邻的服务器。这种情况下,由于将连续的数据写入到本地的服务器,本地的服务器读取该连续数据时,不需要借用网络或其他传输手段读取所需的数据,从而提升了***的性能。需要说明的是,本实施例中的本地服务器读取的连续文件为该服务器所需的数据。
本实施例将对上述本申请的技术方案进一步说明,参见图4,四段连续数据分别为数据段一:S1d1、S2d1、S3d1、S4d1;数据段二:S1d2、S2d2、S3d3、S4d4;数据段三:S1d3、S2d3、S3d3、S4d3;数据段四:S1d4、S2d4、S3d4、S4d4。六个服务器分别为Client1、Client2、Client3、Client4、Client5、Client6。四段存储条带分别为Stripe1、Stripe2、Stripe3、Stripe4。将四段连续数据写入服务器时,是将数据段一的S1d1、S2d1、S3d1、S4d1写入至Client1;将数据段二的S1d2、S2d2、S3d3、S4d4写入至Client2;将数据段三的S1d3、S2d3、S3d3、S4d3写入至Client3;将数据段四的S1d4、S2d4、S3d4、S4d4写入至Client4。其中,数据段一为Client1所需的数据,数据段二为Client2所需的数据,数据段三为Client3所需的数据,数据段四为Client4所需的数据。由此可以看出,本申请在写入连续的数据段S1d1、S2d1、S3d1、S4d1时,是将连续的数据段S1d1、S2d1、S3d1、S4d1写入于Client1(Client1后续需要读取S1d1、S2d1、S3d1、S4d1),同时,由于该段连续数据S1d1、S2d1、S3d1、S4d1处于Stripe1、Stripe2、Stripe3、Stripe4四条存储条带中,若是Client1发生故障,也是可以通过其他的服务器进行恢复。此时,Client1可以在本地读取S2d1、S3d1、S4d1,并不需要借用网络或其他传输手段,从而提升了***的性能。
另外,在现有技术中,还有采用有磁盘阵列(RAID)技术,该技术是将连续的数据存储于单个服务器上,使得本地服务器在读取该连续的数据时更加方便,但该服务器发生故障时,无法通过其他的服务器进行恢复。在现有技术中,还有采用有多副本技术,该技术是为了避免单个服务器发生故障,使得数据无法恢复的问题,又可以实现在本地服务器读取所需的连续数据,但多副本最大的缺陷是成本,比如,两副本需要设立两个 相同的服务器,这两个服务器存储的数据实时进行同步,若是其中一个服务器发生故障,可以应用另一个服务器;三副本需要设立三个相同的服务器。由此可以看出,多副本技术相较于本申请的存储条带,需要建立占用更多的存储空间,使得建造的成本高。
需要说明的是,本申请只需将本应分布于多个服务器的数据,更多的写入本地服务器,降低本地服务器数据的调用次数。
进一步的,在执行步骤根据第一业务需求将数据写入至对应服务器的所述存储块之前,还需执行步骤:将所述存储块进行标记。存储块可以包括存储数据的数据块以及存储校验码的校验块,其中,校验码用于校验存储于所述存储条带中的数据。将存储块进行标记,具体包括:将所述数据块标记为可分配以及可读写;将校验块标记为可分配。比如,参见图4,根据标记的情况将S1p1、S2p1、S3p1、S4p1为分布在Client5的校验块,将S1p2、S2p2、S3p2、S4p2位分布在Client6的校验块,图中的S1d1、S2d1、S3d1、S4d1等为数据块,S1p1、S2p1、S3p1、S4p1等为校验块。
进一步的,在执行完将所述存储条带划分成多个存储块的步骤后,所述方法还包括:根据预先定义的存储块的类型,对所述存储条带中的存储块标记对应的功能。存储块的类型包括存储数据的数据块以及存储校验码的校验块,其中,校验码用于校验所述存储条带中的数据。
对所述存储条带中的存储块标记对应的功能,具体包括:对所述数据块标记为可分配以及可读写;将所述校验块标记为可分配。
在执行完若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器的步骤后,所述方法还包括:
根据写入的所有数据,更新所述校验块中的校验码。比如,参见图4,数据块S1d1写入至Client1后,将会在Client5的S1p1和Client6的S1p2中生成校验码,当S1d2写入至Client2时,由于S1d1与S1d2处于同一条储存条带,所以Client5的S1p1和Client6的S1p2中的校验码将会重新计算,并将计算结果对Client5的S1p1和Client6的S1p2中的校验码进行更新。
进一步的,若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块 个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器前,所述方法还包括:判断预先输入的指令是否为便于本地服务器读取所述所要读取文件的数据;若判断出预先输入的指令为便于本地服务器读取所述所要读取文件的数据,则执行所述若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器的步骤;若判断出预先输入的指令不是便于本地服务器读取所述所要读取文件的数据,则根据所述存储条带处在服务器的位置,将所述所要读取文件的数据连续写入至不同的服务器。
另外需要说明的是,上述方案可以应用在分布式存储***中,还可以应用于分布式内存***中,还可以应用在需要高可靠性数据的存储***中。本申请中存储块可以存储在硬盘里,也可以存储在内存或其他存储装置中。
本申请实施例将更多的本地服务器所需数据的数据块写入至本地服务器,提高了服务器在读取数据时的性能。
与上述实施例二对应的,图5为本说明书实施例三提供的一种数据的写入装置的结构示意图,该结构示意图包括:写入单元1、生成单元2、标记单元3、更新单元4、判断单元5以及执行单元6。
写入单元1用于若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器,其中,所述存储条带位于不同的服务器。
生成单元2用于根据业务需求生成对应属性信息的存储条带,并将所述存储条带划分成多个存储块,其中,所述属性信息包括所述存储条带的类型与所述存储条带的存储空间。
标记单元3用于根据预先定义的存储块的类型,对所述存储条带中的存储块标记对应的功能。
进一步的,所述存储块的类型包括存储数据的数据块以及存储校验码的校验块, 其中,所述校验码用于校验所述存储条带中的数据。
进一步的,标记单元3具体用于:对所述数据块标记为可分配以及可读写;将所述校验块标记为可分配。
更新单元4用于根据写入的所有数据,更新所述校验块中的校验码。
判断单元5用于判断预先输入的指令是否为便于本地服务器读取所述所要读取文件的数据;
执行单元6用于若判断出预先输入的指令为便于本地服务器读取所述所要读取文件的数据,则执行所述若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器的步骤;若判断出预先输入的指令不是便于本地服务器读取所述所要读取文件的数据,则根据所述存储条带处在服务器的位置,将所述所要读取文件的数据连续写入至不同的服务器。
本申请实施例还提供一种数据的写入设备,该设备包括用于存储计算机程序指令的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被该处理器执行时,触发该设备执行下述装置:
写入单元,用于若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器,其中,所述存储条带位于不同的服务器。
本申请实施例将更多的本地服务器所需数据的数据块写入至本地服务器,提高了服务器在读取数据时的性能。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field  Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字***“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的***、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施 本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
本领域内的技术人员应明白,本发明的实施例可提供为方法、***、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(***)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储 器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带式磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于***实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的范围之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。

Claims (15)

  1. 一种数据的写入方法,所述方法包括:
    若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;
    若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器,其中,所述存储条带位于不同的服务器。
  2. 根据权利要求1所述的数据的写入方法,所述若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器前,所述方法还包括:
    根据业务需求生成对应属性信息的存储条带,并将所述存储条带划分成多个存储块,其中,所述属性信息包括所述存储条带的类型与所述存储条带的存储空间。
  3. 根据权利要求2所述的数据的写入方法,所述将所述存储条带划分成多个存储块后,所述方法还包括:
    根据预先定义的存储块的类型,对所述存储条带中的存储块标记对应的功能。
  4. 根据权利要求3所述的数据的写入方法,所述存储块的类型包括存储数据的数据块以及存储校验码的校验块,其中,所述校验码用于校验所述存储条带中的数据。
  5. 根据权利要求4所述的数据的写入方法,所述对所述存储条带中的存储块标记对应的功能,具体包括:
    对所述数据块标记为可分配以及可读写;
    将所述校验块标记为可分配。
  6. 根据权利要求4所述的数据的写入方法,所述若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器后,所述方法还包括:
    根据写入的所有数据,更新所述校验块中的校验码。
  7. 根据权利要求1所述的数据的写入方法,所述若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至 本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器前,所述方法还包括:
    判断预先输入的指令是否为便于本地服务器读取所述所要读取文件的数据;
    若判断出预先输入的指令为便于本地服务器读取所述所要读取文件的数据,则执行所述若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器的步骤;
    若判断出预先输入的指令不是便于本地服务器读取所述所要读取文件的数据,则根据所述存储条带处在服务器的位置,将所述所要读取文件的数据连续写入至不同的服务器。
  8. 一种数据的写入装置,所述装置包括:
    写入单元,用于若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器,其中,所述存储条带位于不同的服务器。
  9. 根据权利要求8所述的数据的写入装置,所述装置还包括:
    生成单元,用于根据业务需求生成对应属性信息的存储条带,并将所述存储条带划分成多个存储块,其中,所述属性信息包括所述存储条带的类型与所述存储条带的存储空间。
  10. 根据权利要求9所述的数据的写入装置,所述装置还包括:
    标记单元,用于根据预先定义的存储块的类型,对所述存储条带中的存储块标记对应的功能。
  11. 根据权利要求10所述的数据的写入装置,所述存储块的类型包括存储数据的数据块以及存储校验码的校验块,其中,所述校验码用于校验所述存储条带中的数据。
  12. 根据权利要求11所述的数据的写入装置,所述标记单元具体用于:
    对所述数据块标记为可分配以及可读写;
    将所述校验块标记为可分配。
  13. 根据权利要求11所述的数据的写入装置,所述装置还包括:
    更新单元,用于根据写入的所有数据,更新所述校验块中的校验码。
  14. 根据权利要求8所述的数据的写入装置,所述装置还包括:
    判断单元,用于判断预先输入的指令是否为便于本地服务器读取所述所要读取文件的数据;
    执行单元,用于若判断出预先输入的指令为便于本地服务器读取所述所要读取文件的数据,则执行所述若所要读取文件的数据块个数m小于等于存储条带的存储空间个数n,将所要读取文件中至少两个数据块的数据写入至本地服务器;若所要读取文件的数据块个数m大于存储条带的存储空间个数n,写入所要读取文件中的前n个数据块的数据时,将至少两个数据块的数据写入至本地服务器的步骤;若判断出预先输入的指令不是便于本地服务器读取所述所要读取文件的数据,则根据所述存储条带处在服务器的位置,将所述所要读取文件的数据连续写入至不同的服务器。
  15. 一种数据的写入设备,该设备包括用于存储计算机程序指令的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被该处理器执行时,触发该设备执行权利要求1至7中任一项所述的方法。
PCT/CN2020/140632 2020-03-19 2020-12-29 一种数据的写入方法、装置以及设备 WO2021184901A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010198337.3 2020-03-19
CN202010198337.3A CN111399780B (zh) 2020-03-19 2020-03-19 一种数据的写入方法、装置以及设备

Publications (1)

Publication Number Publication Date
WO2021184901A1 true WO2021184901A1 (zh) 2021-09-23

Family

ID=71432684

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/140632 WO2021184901A1 (zh) 2020-03-19 2020-12-29 一种数据的写入方法、装置以及设备

Country Status (2)

Country Link
CN (2) CN113835637A (zh)
WO (1) WO2021184901A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117873789A (zh) * 2024-03-13 2024-04-12 之江实验室 一种基于分段量化的检查点写入方法及装置

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113835637A (zh) * 2020-03-19 2021-12-24 北京奥星贝斯科技有限公司 一种数据的写入方法、装置以及设备

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060112221A1 (en) * 2004-11-19 2006-05-25 Guoyu Hu Method and Related Apparatus for Data Migration Utilizing Disk Arrays
US20090144497A1 (en) * 2006-05-24 2009-06-04 Oxford Semiconductor Limited Redundant Storage of Data on an Array of Storage Devices
US20130246842A1 (en) * 2012-03-19 2013-09-19 Fujitsu Limited Information processing apparatus, program, and data allocation method
US20180203615A1 (en) * 2017-01-19 2018-07-19 Toshiba Memory Corporation Storage control device, storage control method, and computer readable recording medium
CN109814807A (zh) * 2018-12-28 2019-05-28 曙光信息产业(北京)有限公司 一种数据存储方法及装置
CN110347340A (zh) * 2019-07-05 2019-10-18 北京谷数科技有限公司 一种提高存储***raid性能的方法和装置
CN111399780A (zh) * 2020-03-19 2020-07-10 支付宝(杭州)信息技术有限公司 一种数据的写入方法、装置以及设备

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8117388B2 (en) * 2009-04-30 2012-02-14 Netapp, Inc. Data distribution through capacity leveling in a striped file system
CN102566942A (zh) * 2011-12-28 2012-07-11 华为技术有限公司 一种文件条带化写入方法、装置及***
CN103577339B (zh) * 2012-07-27 2018-01-30 深圳市腾讯计算机***有限公司 一种数据存储方法及***
CN104881242A (zh) * 2014-02-28 2015-09-02 中兴通讯股份有限公司 数据写入方法及装置
WO2016051512A1 (ja) * 2014-09-30 2016-04-07 株式会社日立製作所 分散型ストレージシステム
CN109445687B (zh) * 2015-09-30 2022-04-26 华为技术有限公司 一种数据存储方法以及协议服务器
CN107885612B (zh) * 2016-09-30 2020-02-21 华为技术有限公司 数据处理方法和***及装置
CN108008909B (zh) * 2016-10-31 2019-11-22 杭州海康威视数字技术股份有限公司 一种数据存储方法、装置及***
WO2019080015A1 (zh) * 2017-10-25 2019-05-02 华为技术有限公司 一种数据读写方法、装置和存储服务器
CN111095217B (zh) * 2017-11-13 2024-02-06 清华大学 资源全局共享的基于raid机制的数据存储***
CN110058961B (zh) * 2018-01-18 2023-05-05 伊姆西Ip控股有限责任公司 用于管理存储***的方法和设备
JP2019159416A (ja) * 2018-03-07 2019-09-19 Necソリューションイノベータ株式会社 データ管理装置、ファイルシステム、データ管理方法、及びプログラム

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060112221A1 (en) * 2004-11-19 2006-05-25 Guoyu Hu Method and Related Apparatus for Data Migration Utilizing Disk Arrays
US20090144497A1 (en) * 2006-05-24 2009-06-04 Oxford Semiconductor Limited Redundant Storage of Data on an Array of Storage Devices
US20130246842A1 (en) * 2012-03-19 2013-09-19 Fujitsu Limited Information processing apparatus, program, and data allocation method
US20180203615A1 (en) * 2017-01-19 2018-07-19 Toshiba Memory Corporation Storage control device, storage control method, and computer readable recording medium
CN109814807A (zh) * 2018-12-28 2019-05-28 曙光信息产业(北京)有限公司 一种数据存储方法及装置
CN110347340A (zh) * 2019-07-05 2019-10-18 北京谷数科技有限公司 一种提高存储***raid性能的方法和装置
CN111399780A (zh) * 2020-03-19 2020-07-10 支付宝(杭州)信息技术有限公司 一种数据的写入方法、装置以及设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117873789A (zh) * 2024-03-13 2024-04-12 之江实验室 一种基于分段量化的检查点写入方法及装置
CN117873789B (zh) * 2024-03-13 2024-05-10 之江实验室 一种基于分段量化的检查点写入方法及装置

Also Published As

Publication number Publication date
CN111399780B (zh) 2021-08-24
CN113835637A (zh) 2021-12-24
CN111399780A (zh) 2020-07-10

Similar Documents

Publication Publication Date Title
CN107220148B (zh) 针对独立磁盘冗余阵列的重建方法和设备
US11093162B2 (en) Method and apparatus for deleting cascaded snapshot
US9317214B2 (en) Operating a memory management controller
US11226861B1 (en) Systems and methods for distributing information across failure domains in servers
WO2021184901A1 (zh) 一种数据的写入方法、装置以及设备
US10853199B2 (en) Techniques for managing context information for a storage device while maintaining responsiveness
WO2021000570A1 (zh) 模型加载方法及***、控制节点及执行节点
CN103513938A (zh) 一种独立磁盘冗余阵列raid***扩容方法及装置
US10437691B1 (en) Systems and methods for caching in an erasure-coded system
US20140164828A1 (en) Consistency of data in persistent memory
CN107632779B (zh) 数据处理方法和装置、服务器
US20190354452A1 (en) Parity log with delta bitmap
KR20220125198A (ko) 데이터의 추가 기록 방법, 장치, 전자 기기, 저장 매체 및 컴퓨터 프로그램매체
TW202008267A (zh) 記帳方法、裝置及業務財務一體化系統
CN112119380B (zh) 带有旁路的奇偶校验记录
CN108647112B (zh) 数据备份的方法、装置及分布式事务处理***
US11055017B1 (en) Throttling a point-in-time snapshot copy operation within a data consistency application
US9977599B2 (en) Data deduplication with support for both thick and thin provisioning of storage objects
CN115391337A (zh) 数据库分区的方法、装置、存储介质及电子设备
US20200264800A1 (en) Erasure coding write hole closure for solid-state drive (ssd) erasure coding
CN111435331B (zh) 存储卷写数据方法、装置、电子设备及机器可读存储介质
US20200363958A1 (en) Efficient recovery of resilient spaces
CN107645541B (zh) 数据存储方法、装置及服务器
KR20170019729A (ko) 전자 장치 및 이의 데이터 압축 방법
US11042374B2 (en) Non-volatile dual in-line memory module storage

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

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

Country of ref document: EP

Kind code of ref document: A1