WO2023206968A1 - Data storage method and system, and computer readable storage medium - Google Patents

Data storage method and system, and computer readable storage medium Download PDF

Info

Publication number
WO2023206968A1
WO2023206968A1 PCT/CN2022/122872 CN2022122872W WO2023206968A1 WO 2023206968 A1 WO2023206968 A1 WO 2023206968A1 CN 2022122872 W CN2022122872 W CN 2022122872W WO 2023206968 A1 WO2023206968 A1 WO 2023206968A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
solid
state storage
logical address
physical address
Prior art date
Application number
PCT/CN2022/122872
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 WO2023206968A1 publication Critical patent/WO2023206968A1/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/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • 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
    • 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/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7201Logical to physical mapping or translation of blocks or pages

Definitions

  • the present application relates to a data storage method, system and computer-readable storage medium.
  • Solid-state storage devices SSD, Solid-state memory
  • SSD Solid-state memory
  • traditional solid-state disks can only protect the latest data when protecting the reliability of data, and directly give up protection for old data in overwritten logical addresses. This means that if the storage system needs to protect old data, it needs to add complex redundant protection mechanisms to the upper-layer software, which is not only detrimental to system maintenance but also affects system performance.
  • a data storage method that includes:
  • the solid-state storage device receives the data writing request sent by the data writing device, and extracts the data to be written and the logical address from the data writing request;
  • a data storage system including: a solid-state storage device and a data writing device, wherein,
  • the solid-state storage device is used to receive the data writing request sent by the data writing device, and extract the data to be written and the logical address from the data writing request; to find the original physical address corresponding to the logical address, and to add the data to be written to the original physical address. Recycle the mark and set the preset retention time for the original physical address; write the data to be written into the new physical address, and map the new physical address to the logical address; receive the data recovery request for the logical address sent by the data writing device, and respond When the preset retention time has not expired, the original data corresponding to the original physical address is returned to the data writing device;
  • a data writing device is used to send data writing requests and data recovery requests.
  • a computer device including a memory and one or more processors.
  • Computer-readable instructions are stored in the memory.
  • the processor When the computer-readable instructions are executed by the processor, they cause the one or more processors to execute any one of the above. Data storage method steps.
  • a non-volatile computer-readable storage medium Computer-readable instructions are stored in the non-volatile computer-readable storage medium. When the computer-readable instructions are loaded and executed by a processor, the data described in any of the above items is realized. Store the steps of the method.
  • Figure 1 is a flow chart of a data storage method provided by one or more embodiments of the present application.
  • Figure 2 is a schematic diagram of a traditional data consistency protection method provided by one or more embodiments of the present application.
  • Figure 3 is a schematic diagram of the data rollback process provided by one or more embodiments of the present application.
  • Figure 4 is a structural block diagram of a data storage system provided by one or more embodiments of the present application.
  • Figure 5 is a structural block diagram of a computer device provided by one or more embodiments of the present application.
  • Figure 6 is a structural block diagram of a non-volatile computer-readable storage medium provided by one or more embodiments of the present application.
  • the present application provides a data storage method, in which a solid-state storage device can temporarily store old data that needs to be overwritten, thereby achieving protection of the old data.
  • Figure 1 is a flow chart of a data storage method provided by one or more embodiments of the present application. The method may include:
  • the solid-state storage device receives the data writing request sent by the data writing device, and extracts the data to be written and the logical address from the data writing request.
  • the data writing device is upper-layer software that manages and controls the solid-state storage device.
  • the data writing request sent by the device usually includes the data to be written and the corresponding logical address of the data in the solid-state storage device.
  • the meaning of the data write request is to overwrite the original data originally stored in the logical address with the data to be written.
  • the logical address refers to the address of the memory unit, storage unit or network host seen from the perspective of the application program in the computer architecture, which is often different from the physical address.
  • the relationship between logical address and physical address is: the logical address can be converted into a physical address through an address translator or mapping function.
  • the original physical address refers to the physical address that was originally mapped to the above-mentioned logical address, in which the above-mentioned original data is stored.
  • the original data in the original physical address becomes invalid immediately, and the address is automatically added to the garbage collection space of the solid-state storage device.
  • the original physical address and the data therein will not become invalid immediately, but will be marked with a to-be-recycled mark and set with a preset retention time. The mark indicates that the address and the data therein will be recycled.
  • Temporary storage, and the preset retention time represents the temporary storage time, which can be implemented using a countdown.
  • the original data corresponding to the overwritten logical address will not be deleted immediately, but will continue to be saved for a period of time.
  • the upper-layer software can directly export the original data from the solid-state storage device and perform data rollback.
  • the solid-state storage devices in the embodiments of the present application can protect old data, thereby avoiding the storage system from adding complex redundant protection mechanisms in upper-layer software, and can improve storage The processing performance of the system and the convenience of system maintenance.
  • the embodiment of the present application does not limit the specific form of the mark to be recycled, as long as the mark can represent the original data temporarily stored in the marked physical address, and the garbage collection mechanism of the solid-state storage device reads the mark. , automatically skip the marked physical address.
  • the embodiments of the present application do not limit the specific value of the preset retention time, which can be set according to actual application requirements.
  • the physical address marked with the to-be-reclaimed mark can only be read and cannot be modified (such as written and deleted), and the to-be-reclaimed space composed of this part of the physical address reduces the available storage in the solid-state storage device. space, the larger the space to be reclaimed, the more serious the shrinkage impact will be.
  • all physical addresses added with a to-be-reclaimed mark constitute a space to be reclaimed, and the size of the space to be reclaimed does not exceed a preset multiple of the maximum bandwidth of the solid-state storage device.
  • the data to be written will be written to a new physical address, and the new physical address will also be mapped to a logical address. In this way, when the data at the logical address is read normally, new data can be read in the new physical address according to the new mapping relationship corresponding to the logical address.
  • the solid-state storage device can provide external data recovery functions, that is, the data writing device can send the data to the solid-state storage device for a recently overwritten logical address.
  • Data recovery request and when the latter determines that the preset retention time of the original physical address corresponding to the logical address has not expired, the corresponding original data can be sent back to the data writing device for the data writing device to perform data rollback. recover.
  • the solid-state storage device can provide a data recovery interface, and the data writing device only needs to call this interface to achieve the corresponding effect of step S104.
  • the original physical address can be added to the garbage collection space of the solid-state storage device and restored to a writable state.
  • the original physical address after adding a to-be-recycled mark to the original physical address and setting a preset retention time for the original physical address, it may also include:
  • Step 11 In response to the preset retention time having expired, add the original physical address to the garbage collection space.
  • the solid-state storage device can also send a writing success message to the data writing device to inform the latter that the data writing is completed.
  • mapping the new physical address to the logical address it may also include:
  • Step 21 Send writing success information to the data writing device.
  • the solid-state storage device of the present application when it receives a data writing request issued by the data writing device, it will first extract the logical address from the request, and search the device for the original physical address corresponding to the address. ;Further, the solid-state storage device will set a pending recovery mark for the original physical address and set a preset retention time.
  • the pending recovery mark indicates that the original data in the original physical address can be temporarily retained without deletion, and the preset retention time indicates that the original The length of time that the data can be temporarily retained; while the new data in the data write request is written to the new physical address, and the new physical address is corresponding to the above logical address.
  • this application can save the new data that needs to cover the logical address in the new physical address in the solid-state storage device, and at the same time, continue to store the original data in the original physical address corresponding to the logical address before the preset retention time expires. to save.
  • the data writing device needs to recover the original data, it only needs to send a data recovery request for the logical address to the solid-state storage device before the preset retention time expires to control the latter to re-extract the data in the original physical address. It can realize the protection of old data by solid-state storage devices and avoid the storage system adding complex redundant protection mechanisms in the upper-layer software, thereby improving the processing performance of the storage system and the convenience of system maintenance.
  • the solid-state storage device before the solid-state storage device receives the data writing request sent by the data writing device, it may also include:
  • the data writing device receives the file coverage request, and reads the new file and the logical address to be overwritten corresponding to the new file from the file coverage request.
  • the data writing device will interface with multiple solid-state storage devices.
  • the embodiments of the present application do not limit the number of solid-state storage devices in the storage system, which can be set according to actual application requirements.
  • the logical address to be overwritten in this step is a logical address set based on considering these solid-state storage devices as a whole (i.e., system logical address), which is different from the internal logical address of each solid-state storage device. .
  • the mapping relationship between each file in the distributed storage system and the system logical address is stored in the database. Therefore, you can use the logical address to be overwritten in the file overwrite request to query the database for the old file that establishes a mapping relationship with the address.
  • a single file is usually divided into several data blocks and stored in different solid-state storage devices. Each data block also has a corresponding logical address in the corresponding solid-state storage device. Therefore, the mapping relationship between the system logical address and the logical address of each storage device is also recorded in the database.
  • mapping relationship between each file and the system logical address does not limit the mapping relationship between each file and the system logical address, as well as the storage form of the mapping relationship between the system logical address and the logical address of each solid-state storage device in the database, and querying the above-mentioned
  • mapping relationship for the specific method of mapping relationship, please refer to the related technologies of distributed storage systems.
  • the embodiments of the present application do not limit the specific method of block processing, which can be set according to actual application requirements.
  • new files can be simply divided into blocks, or new files can be processed using erasure coding mechanisms and other technologies.
  • Blocking is performed.
  • the erasure coding mechanism is a redundant protection mechanism that ensures that when part of a data block is lost, the remaining data blocks can be used to restore the original file.
  • the data writing device can use the obtained data blocks and the previously queried data writing requests to generate data writing requests for each solid-state storage device and issue the requests.
  • the data writing device determines whether the solid-state storage device returns writing success information within a preset time. If yes, go to step S205; if not, go to step S206.
  • a data writing time that is, a preset time
  • the solid-state storage device can return writing success information within a preset time, it is determined that the device does not have a writing error; otherwise, the device is considered to have a writing error.
  • the data writing device determines that all solid-state storage devices can return writing success information within a preset time, it can be determined that the new file has been written correctly, and then the relevant information in the database can be processed.
  • the data writing device determines that some solid-state storage devices do not return writing success information within a preset time, it can be determined that the new file encounters a writing problem. In the latter case, since it can be determined that the solid-state storage device that has returned the writing success information has completed the data writing, that is, data recovery is required. At this time, the data writing device can call the solid-state storage device that has returned the writing success information. Data recovery interface to obtain original data and perform data rollback.
  • the data writing device can create a writing transaction and set the corresponding transaction before writing the data. Expiration time, in which all write sub-operations in the same transaction either succeed or fail. When some write sub-operations encounter write failures, the remaining successful sub-operations will also be judged to have failed when the transaction expiration time expires.
  • before performing block processing on the new file to obtain the data blocks it may also include:
  • Step 31 The data writing device creates a writing transaction and sets the transaction expiration time; the transaction expiration time is greater than the preset time.
  • Figure 2 is a schematic diagram of the traditional data consistency protection method, in which disk0 ⁇ disk5 represent 6 solid-state storage devices, 0, 1, 2, 3, P, and Q represent data blocks, DB ( Database) means database.
  • DB Database
  • the data writing device can use the new mapping relationship between the new file and the logical address to be overwritten to protect the old file and the same system logic.
  • the old mapping relationship between addresses is directly overwritten, which can effectively avoid additional deletion operations, thereby effectively improving the write performance of the storage system.
  • the data writing device When some solid-state storage devices have writing exceptions, the data writing device will perform data rollback on the solid-state storage devices that have completed data writing. Specifically, the device will send a data recovery request to the solid-state storage device that has sent write success information, receive the original data returned by these devices, and then rewrite the original data back to the original location in the solid-state storage device.
  • the data rollback recovery should wait until the transaction expiration time expires to avoid data writing chaos.
  • rewriting the original data to the corresponding logical address in the corresponding solid-state storage device may include:
  • Step 41 In response to the transaction expiration time having expired, rewrite the original data to the corresponding logical address in the corresponding solid-state storage device.
  • performing block processing on a new file to obtain data blocks may include:
  • Step 51 Use the erasure coding mechanism to perform block processing on the new file to obtain data blocks; when the number of lost data blocks does not exceed the preset value, the remaining data blocks can be used to restore the new file.
  • the default value here refers to the protection level of the erasure coding mechanism.
  • the mechanism can use the remaining data blocks to restore the new file.
  • the embodiments of the present application do not limit specific preset values, which can be set according to actual application requirements.
  • the embodiments of this application do not limit the specific erasure coding mechanism. For example, it can be a 4+2 erasure code, an 8+3 erasure code, a 6+2 erasure code, etc., which can be set according to actual application requirements. .
  • Step 61 The data writing device determines whether the number of solid-state storage devices that have not sent writing success information is greater than the preset value; if so, proceed to step 62; if not, proceed to step S205;
  • erasure coding can redundantly protect new files, as long as the number of abnormal solid-state storage devices does not exceed the protection level of erasure coding, there is no need to perform data rollback. Otherwise, data rollback is required.
  • Step 62 Execute the steps of sending a data recovery request to the solid-state storage device that has sent the write success information and receiving old data.
  • Figure 3 is a schematic diagram of a data rollback process provided by one or more embodiments of the present application.
  • Disk2, 3, and 4 were successfully written, but disk0, 1, and 5 suffered a power outage and the writing was unsuccessful. At this time, disks 2, 3, and 4 mark the original data as "to be recycled" and start the 3-second timer;
  • Disk2, 3, and 4 change the data block from the "to be recycled” state to the "deleted” state, and move the old data into the garbage collection space;
  • the embodiments of the present application can use the improved solid-state storage device to change the data deletion action from the active deletion of the upper-layer software to the internal aging of the solid-state disk, thereby reducing one deletion action and thus significantly reducing the recording time.
  • the amount of data reduces the pressure on the distributed storage system and improves system performance.
  • Figure 4 is a structural block diagram of a data storage system provided by one or more embodiments of the present application.
  • the system may include: a solid-state storage device 401 and a data writing device 402, wherein,
  • the solid-state storage device 401 is used to receive the data writing request sent by the data writing device 402, and extract the data to be written and the logical address from the data writing request; find the original physical address corresponding to the logical address, and obtain the original physical address Add a mark to be recycled and set a preset retention time for the original physical address; write the data to be written into the new physical address, and map the new physical address to the logical address; receive data recovery for the logical address sent by the data writing device 402 Request, in response to the fact that the preset retention time has not expired, return the original data corresponding to the original physical address to the data writing device 402;
  • the data writing device 402 is used to send data writing requests and data recovery requests.
  • solid-state storage device 401 can also be used for:
  • the original physical address is added to the garbage collection space.
  • all physical addresses added with a to-be-reclaimed mark constitute a space to be reclaimed, and the size of the space to be reclaimed does not exceed a preset multiple of the maximum bandwidth of the solid-state storage device 401 .
  • solid-state storage device 401 can also be used for:
  • the data writing device 402 can also be used for:
  • Receive the file overwrite request read the new file and the corresponding logical address to be overwritten from the file overwrite request; query the database for the old file corresponding to the logical address to be overwritten and the corresponding logical addresses of the old files in multiple solid-state storage devices 401; Perform block processing on the new file to obtain data blocks, use the data blocks and logical addresses to generate data write requests, and send the data write requests to the corresponding solid-state storage device 401;
  • the data writing device 402 can also be used for:
  • the data writing device 402 can also be used for:
  • the data writing device 402 can also be used to:
  • the data writing device 402 can also be used for:
  • the data writing device 402 can also be used for:
  • the original data is rewritten to the corresponding logical address in the corresponding solid-state storage device 401 .
  • a computer device is also provided, as shown in FIG. 5 , which is a schematic structural diagram of the computer device in one or more embodiments.
  • the computer device includes a memory 50 and one or more processors 51.
  • Computer-readable instructions are stored in the memory 50.
  • the one or more processors 51 execute any of the above. Steps of the data storage method of one or more embodiments.
  • a non-volatile computer-readable storage medium 60 is also provided.
  • Computer-readable instructions 61 are stored on the non-volatile computer-readable storage medium 60 .
  • the readable instructions 61 are executed by the processor, the steps of the data storage method of any one or more of the above embodiments are implemented.
  • RAM random access memory
  • ROM read-only memory
  • electrically programmable ROM electrically erasable programmable ROM
  • registers hard disks, removable disks, CD-ROMs, or anywhere in the field of technology. any other known form of storage media.

Abstract

A data storage method and system, and a computer readable storage medium. The method comprises: a solid-state storage device receiving a data writing request sent by a data writing apparatus, and extracting from the data writing request data to be written and a logic address; searching for an original physical address corresponding to the logic address, adding to the original physical address a "to be recovered" label, and setting a default retention time for the original physical address; writing into a new physical address the data to be written, and mapping the new physical address to the logic address; and receiving a data recovery request for the logic address sent by the data writing apparatus, and, in response to determining that the default retention time has not ended, returning to the data writing apparatus original data corresponding to the original physical address.

Description

一种数据存储方法、系统及计算机可读存储介质A data storage method, system and computer-readable storage medium
相关申请的交叉引用Cross-references to related applications
本申请要求于2022年04月29日提交中国专利局,申请号为202210467206.X,申请名称为“一种数据存储方法、系统及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application submitted to the China Patent Office on April 29, 2022, with the application number 202210467206.X, and the application name is "A data storage method, system and computer-readable storage medium", all of which The contents are incorporated into this application by reference.
技术领域Technical field
本申请涉及一种数据存储方法、系统及计算机可读存储介质。The present application relates to a data storage method, system and computer-readable storage medium.
背景技术Background technique
固态存储设备(SSD,Solid-state memory)由于具有较快的读写速度,因此常被设置于存储系统中,用于提升存储系统的读写性能。然而,发明人意识到,传统的固态盘在保护数据的可靠性时仅能保护最新数据,对被覆盖逻辑地址中的旧数据则直接放弃保护。这导致存储系统若需对旧数据进行保护,则需要在上层软件中增加复杂的冗余保护机制,不仅不利于系统维护,同时也对系统性能造成了影响。Solid-state storage devices (SSD, Solid-state memory) have fast read and write speeds, so they are often installed in storage systems to improve the read and write performance of storage systems. However, the inventor realized that traditional solid-state disks can only protect the latest data when protecting the reliability of data, and directly give up protection for old data in overwritten logical addresses. This means that if the storage system needs to protect old data, it needs to add complex redundant protection mechanisms to the upper-layer software, which is not only detrimental to system maintenance but also affects system performance.
发明内容Contents of the invention
根据本申请公开的各种实施例,提供一种本申请一种数据存储方法、系统及计算机可读存储介质。According to various embodiments disclosed in this application, a data storage method, system and computer-readable storage medium in this application are provided.
一种数据存储方法,包括:A data storage method that includes:
固态存储设备接收数据写入装置发送的数据写入请求,并从数据写入请求中提取待写入数据及逻辑地址;The solid-state storage device receives the data writing request sent by the data writing device, and extracts the data to be written and the logical address from the data writing request;
查找逻辑地址对应的原物理地址,并为原物理地址添加待回收标记及为原物理地址设置预设保留时间;Find the original physical address corresponding to the logical address, add a pending recycling mark to the original physical address, and set a preset retention time for the original physical address;
将待写入数据写入新物理地址,并将新物理地址映射至逻辑地址;以及Write the data to be written to the new physical address and map the new physical address to the logical address; and
接收数据写入装置发送的针对逻辑地址的数据恢复请求,响应于确定预设保留时间未截止,向数据写入装置返回原物理地址对应的原始数据。Receive the data recovery request for the logical address sent by the data writing device, and return the original data corresponding to the original physical address to the data writing device in response to determining that the preset retention time has not expired.
一种数据存储系统,包括:固态存储设备及数据写入装置,其中,A data storage system, including: a solid-state storage device and a data writing device, wherein,
固态存储设备,用于接收数据写入装置发送的数据写入请求,并从数据写入请求中提取待写入数据及逻辑地址;查找逻辑地址对应的原物理地址,并为原物理地址添加待回收标记及为原物理地址设置预设保留时间;将待写入数据写入新物理地址,并将新物理地址映射至逻辑地址;接收数据写入装置发送的针对逻辑地址的数据恢复请求,响应于预设保留时间未截止,向数据写入装置返回原物理地址对应的原始数据;The solid-state storage device is used to receive the data writing request sent by the data writing device, and extract the data to be written and the logical address from the data writing request; to find the original physical address corresponding to the logical address, and to add the data to be written to the original physical address. Recycle the mark and set the preset retention time for the original physical address; write the data to be written into the new physical address, and map the new physical address to the logical address; receive the data recovery request for the logical address sent by the data writing device, and respond When the preset retention time has not expired, the original data corresponding to the original physical address is returned to the data writing device;
数据写入装置,用于发送数据写入请求及数据恢复请求。A data writing device is used to send data writing requests and data recovery requests.
一种计算机设备,包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被所述处理器执行时,使得一个或多个处理器执行如上任一项所述的数据存储方法的步骤。A computer device, including a memory and one or more processors. Computer-readable instructions are stored in the memory. When the computer-readable instructions are executed by the processor, they cause the one or more processors to execute any one of the above. Data storage method steps.
一种非易失性计算机可读存储介质,非易失性计算机可读存储介质中存储有计算机可读指令,计算机可读指令被处理器加载并执行时,实现如上任一项所述的数据存储方法的步骤。A non-volatile computer-readable storage medium. Computer-readable instructions are stored in the non-volatile computer-readable storage medium. When the computer-readable instructions are loaded and executed by a processor, the data described in any of the above items is realized. Store the steps of the method.
附图说明Description of the drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to explain the embodiments of the present application or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only This is an embodiment of the present application. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without exerting creative efforts.
图1为本申请一个或多个实施例所提供的数据存储方法的流程图;Figure 1 is a flow chart of a data storage method provided by one or more embodiments of the present application;
图2为本申请一个或多个实施例所提供的传统数据一致性保护方式的示意图;Figure 2 is a schematic diagram of a traditional data consistency protection method provided by one or more embodiments of the present application;
图3为本申请一个或多个实施例所提供的数据回滚流程的示意图;Figure 3 is a schematic diagram of the data rollback process provided by one or more embodiments of the present application;
图4为本申请一个或多个实施例所提供的数据存储系统的结构框图;Figure 4 is a structural block diagram of a data storage system provided by one or more embodiments of the present application;
图5为本申请一个或多个实施例所提供的计算机设备的结构框图;Figure 5 is a structural block diagram of a computer device provided by one or more embodiments of the present application;
图6为本申请一个或多个实施例所提供的非易失性计算机可读存储介质的结构框图。Figure 6 is a structural block diagram of a non-volatile computer-readable storage medium provided by one or more embodiments of the present application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments These are part of the embodiments of this application, but not all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
传统的固态盘在保护数据的可靠性时仅能保护最新数据,对被覆盖的旧数据则直接放弃保护。这导致存储系统若需对旧数据进行保护,则需要在上层软件中增加复杂的冗余保护机制,不仅不利于系统维护,同时也对系统性能造成了影响。有鉴于此,本申请提供一种数据存储方法,其中固态存储设备可对需要被覆盖的旧数据进行暂存,进而可实现对旧数据的保护。请参考图1,图1为本申请一个或多个实施例所提供的数据存储方法的流程图,该方法可以包括:When protecting the reliability of data, traditional solid-state disks can only protect the latest data, and directly give up protection for overwritten old data. This means that if the storage system needs to protect old data, it needs to add complex redundant protection mechanisms to the upper-layer software, which is not only detrimental to system maintenance but also affects system performance. In view of this, the present application provides a data storage method, in which a solid-state storage device can temporarily store old data that needs to be overwritten, thereby achieving protection of the old data. Please refer to Figure 1, which is a flow chart of a data storage method provided by one or more embodiments of the present application. The method may include:
S101、固态存储设备接收数据写入装置发送的数据写入请求,并从数据写入请求中提取待写入数据及逻辑地址。S101. The solid-state storage device receives the data writing request sent by the data writing device, and extracts the data to be written and the logical address from the data writing request.
需要说明的是,在本申请实施例中,数据写入装置为管控固态存储设备的上层软件。一般情况中,该装置所发送的数据写入请求通常包含有待写入的数据,以及该数据在固态存储设备中对应的逻辑地址。换而言之,数据写入请求的含义为:利用待写入数据对逻辑地址中原先存放的原始数据进行覆盖。应当指出的是,逻辑地址是指在计算机体系结构中以应用程序角度看到的内存单元、存储单元或网络主机的地址,往往不同于物理地址。逻辑地址与物理地址之间的关系为:可通过地址翻译器或映射函数把逻辑地址转化为物理地址。It should be noted that in this embodiment of the present application, the data writing device is upper-layer software that manages and controls the solid-state storage device. Generally, the data writing request sent by the device usually includes the data to be written and the corresponding logical address of the data in the solid-state storage device. In other words, the meaning of the data write request is to overwrite the original data originally stored in the logical address with the data to be written. It should be noted that the logical address refers to the address of the memory unit, storage unit or network host seen from the perspective of the application program in the computer architecture, which is often different from the physical address. The relationship between logical address and physical address is: the logical address can be converted into a physical address through an address translator or mapping function.
S102、查找逻辑地址对应的原物理地址,并为原物理地址添加待回收标记及为原物理地址设置预设保留时间。S102. Find the original physical address corresponding to the logical address, add a to-be-recycled mark to the original physical address, and set a preset retention time for the original physical address.
原物理地址是指原先被映射至上述逻辑地址的物理地址,其中存放有上述原始数据。传统技术中,在待写入数据覆盖逻辑地址之后,原物理地址中的原始数据便立刻失效,而该地址也会被自动添加至固态存储设备的垃圾回收空间。而在本申请实施例中,原物理地址及其中的数据并不会立刻失效,而是会被添加待回收标记,并设置预设保留时间,其中该标记表示该地址及其中的数据将会被暂存,而预设保留时间则表示暂存时间,该时间可利用倒计时进行实现。换而言之,在本申请实施例中,被覆盖的逻辑地址对应的原始数据并不会被立刻删除,而是会被继续保存一段时间。这样,当新数据发生写入错误,或是存储系统发生异常状况时,上层软件可直接从固态存储设备中导出原始数据并进行数据回滚。显然,相较于传统的固态存储设备,本申请实施例中的固态存储设备能够实现对旧数据的保护,进而可避免存储系统在上层软件中增加复杂的冗余保护机制的情况,能够提升存储系统的处理性能及系统维护便捷性。The original physical address refers to the physical address that was originally mapped to the above-mentioned logical address, in which the above-mentioned original data is stored. In traditional technology, after the data to be written overwrites the logical address, the original data in the original physical address becomes invalid immediately, and the address is automatically added to the garbage collection space of the solid-state storage device. In this embodiment of the present application, the original physical address and the data therein will not become invalid immediately, but will be marked with a to-be-recycled mark and set with a preset retention time. The mark indicates that the address and the data therein will be recycled. Temporary storage, and the preset retention time represents the temporary storage time, which can be implemented using a countdown. In other words, in this embodiment of the present application, the original data corresponding to the overwritten logical address will not be deleted immediately, but will continue to be saved for a period of time. In this way, when a writing error occurs in new data or an abnormality occurs in the storage system, the upper-layer software can directly export the original data from the solid-state storage device and perform data rollback. Obviously, compared with traditional solid-state storage devices, the solid-state storage devices in the embodiments of the present application can protect old data, thereby avoiding the storage system from adding complex redundant protection mechanisms in upper-layer software, and can improve storage The processing performance of the system and the convenience of system maintenance.
需要说明的是,本申请实施例并不限定待回收标记的具体形式,只要该标记能够表示暂存被标记物理地址中的原始数据,而固态存储设备的垃圾回收机制在读取到该标记时,自动跳过被标记的物理地址即可。本申请实施例也不限定预设保留时间的具体数值, 可根据实际应用需求进行设定。进一步,可以理解的是,标记有待回收标记的物理地址仅能被读取而无法被修改(如写入及删除),而由这部分物理地址组成的待回收空间缩小固态存储设备中的可用存储空间,待回收空间越大则缩小影响越严重。换而言之,待回收空间应当设置上限大小。在本申请实施例中,待回收空间的上限大小可依照固态存储设备的最大带宽进行设置,例如可设置为最大带宽的预设倍数,例如带宽为3GB/s,则待回收空间的大小可以为2GB×3=6GB,以保证固态存储设备在最大带宽进行数据写入的情况下,3秒内被覆盖的原始数据不会丢失。即固态存储设备能够确保在最恶劣的数据写入情况下,尽可能地对需要被覆盖的旧数据进行保护。It should be noted that the embodiment of the present application does not limit the specific form of the mark to be recycled, as long as the mark can represent the original data temporarily stored in the marked physical address, and the garbage collection mechanism of the solid-state storage device reads the mark. , automatically skip the marked physical address. The embodiments of the present application do not limit the specific value of the preset retention time, which can be set according to actual application requirements. Furthermore, it can be understood that the physical address marked with the to-be-reclaimed mark can only be read and cannot be modified (such as written and deleted), and the to-be-reclaimed space composed of this part of the physical address reduces the available storage in the solid-state storage device. space, the larger the space to be reclaimed, the more serious the shrinkage impact will be. In other words, there should be an upper limit on the space to be reclaimed. In this embodiment of the present application, the upper limit of the space to be reclaimed can be set according to the maximum bandwidth of the solid-state storage device. For example, it can be set to a preset multiple of the maximum bandwidth. For example, if the bandwidth is 3GB/s, then the size of the space to be reclaimed can be 2GB×3=6GB to ensure that when the solid-state storage device writes data at the maximum bandwidth, the original data overwritten within 3 seconds will not be lost. That is, solid-state storage devices can ensure that old data that needs to be overwritten is protected as much as possible under the worst data writing conditions.
在一个或多个实施例中,所有添加有待回收标记的物理地址组成待回收空间,待回收空间的大小不超过固态存储设备最大带宽的预设倍数。In one or more embodiments, all physical addresses added with a to-be-reclaimed mark constitute a space to be reclaimed, and the size of the space to be reclaimed does not exceed a preset multiple of the maximum bandwidth of the solid-state storage device.
需要说明的是,本申请实施例并不限定预设倍数的具体数值,可根据实际应用需求进行设定。It should be noted that the embodiments of the present application do not limit the specific value of the preset multiple, which can be set according to actual application requirements.
S103、将待写入数据写入新物理地址,并将新物理地址映射至逻辑地址。S103. Write the data to be written into a new physical address, and map the new physical address to a logical address.
在本申请实施例中,待写入数据将被写入至新的物理地址,且新物理地址也会被映射至逻辑地址。这样,在正常读取逻辑地址的数据时,便可依照逻辑地址对应的新映射关系,在新物理地址中读取新数据。In this embodiment of the present application, the data to be written will be written to a new physical address, and the new physical address will also be mapped to a logical address. In this way, when the data at the logical address is read normally, new data can be read in the new physical address according to the new mapping relationship corresponding to the logical address.
S104、接收数据写入装置发送的针对逻辑地址的数据恢复请求,响应于预设保留时间未截止,向数据写入装置返回原物理地址对应的原始数据。S104. Receive the data recovery request for the logical address sent by the data writing device, and return the original data corresponding to the original physical address to the data writing device in response to the fact that the preset retention time has not expired.
由于本申请实施例对原物理地址中的数据进行了暂存,因此固态存储设备可向外提供数据恢复功能,即数据写入装置可向固态存储设备发送针对某个近期覆写的逻辑地址的数据恢复请求,而后者在确定该逻辑地址对应的原物理地址的预设保留时间未截止时,便可将对应的原始数据回传给数据写入装置,以供数据写入装置进行数据回滚恢复。可以理解的是,固态存储设备可提供一个数据恢复接口,而数据写入装置仅需调用这一接口,便能够实现步骤S104的对应效果。Since the embodiment of the present application temporarily stores the data in the original physical address, the solid-state storage device can provide external data recovery functions, that is, the data writing device can send the data to the solid-state storage device for a recently overwritten logical address. Data recovery request, and when the latter determines that the preset retention time of the original physical address corresponding to the logical address has not expired, the corresponding original data can be sent back to the data writing device for the data writing device to perform data rollback. recover. It can be understood that the solid-state storage device can provide a data recovery interface, and the data writing device only needs to call this interface to achieve the corresponding effect of step S104.
当然,值得指出的是,假若固态存储设备遭遇了掉电或重启,此时标记有待回收标识的物理地址所存储的数据依旧不会被删除,在固态存储设备再次恢复正常工作状态时,假若这些数据对应的预设保留时间并未耗尽,则会继续进行保存。Of course, it is worth pointing out that if the solid-state storage device encounters a power outage or restarts, the data stored in the physical address marked with the recovery flag will still not be deleted. When the solid-state storage device returns to normal working status again, if these If the preset retention time corresponding to the data has not been exhausted, saving will continue.
进一步,当原物理地址对应的预设保留时间截止后,原物理地址便可添加至固态存储设备的垃圾回收空间,重新恢复可写状态。Furthermore, when the preset retention time corresponding to the original physical address expires, the original physical address can be added to the garbage collection space of the solid-state storage device and restored to a writable state.
在一个或多个实施例中,在为原物理地址添加待回收标记及为原物理地址设置预设保留时间之后,还可以包括:In one or more embodiments, after adding a to-be-recycled mark to the original physical address and setting a preset retention time for the original physical address, it may also include:
步骤11:响应于预设保留时间已截止,将原物理地址添加至垃圾回收空间。Step 11: In response to the preset retention time having expired, add the original physical address to the garbage collection space.
当然,在完成原物理地址设置及新数据写入后,固态存储设备还可以向数据写入装置发送写入成功信息,以告知后者数据写入已完成。Of course, after completing the original physical address setting and new data writing, the solid-state storage device can also send a writing success message to the data writing device to inform the latter that the data writing is completed.
在一个或多个实施例中,在将新物理地址映射至逻辑地址之后,还可以包括:In one or more embodiments, after mapping the new physical address to the logical address, it may also include:
步骤21:向数据写入装置发送写入成功信息。Step 21: Send writing success information to the data writing device.
基于上述实施例,本申请的固态存储设备在接收到数据写入装置下发的数据写入请求时,首先会从该请求中提取逻辑地址,并在设备中查找与该地址对应的原物理地址;进一步,固态存储设备会为原物理地址设置待回收标记并设置预设保留时间,其中待回收标记表示原物理地址中的原始数据可暂时保留,无需删除,而预设保留时间则表示该原始数据可暂时保留的时长;而数据写入请求中的新数据则写入新物理地址,并将新物理地址与上述逻辑地址建立对应关系。换而言之,本申请可将需要覆盖逻辑地址的新数据保存在固态存储设备中的新物理地址中,同时在预设保留时间截止之前,对该逻辑地址对应原物理地址中的原始数据继续进行保存。这样当数据写入装置需要恢复原始数据时,仅需在预设保留时间截止之前,向固态存储设备发送针对所述逻辑地址的数据恢复请求,以控制后者将原物理地址中的数据重新提取出来,即能够实现固态存储设备对旧数据的保护,避免存储系统在上层软件中增加复杂的冗余保护机制的情况,进而可提升存储系统的处理性能及系统维护便捷性。Based on the above embodiments, when the solid-state storage device of the present application receives a data writing request issued by the data writing device, it will first extract the logical address from the request, and search the device for the original physical address corresponding to the address. ;Further, the solid-state storage device will set a pending recovery mark for the original physical address and set a preset retention time. The pending recovery mark indicates that the original data in the original physical address can be temporarily retained without deletion, and the preset retention time indicates that the original The length of time that the data can be temporarily retained; while the new data in the data write request is written to the new physical address, and the new physical address is corresponding to the above logical address. In other words, this application can save the new data that needs to cover the logical address in the new physical address in the solid-state storage device, and at the same time, continue to store the original data in the original physical address corresponding to the logical address before the preset retention time expires. to save. In this way, when the data writing device needs to recover the original data, it only needs to send a data recovery request for the logical address to the solid-state storage device before the preset retention time expires to control the latter to re-extract the data in the original physical address. It can realize the protection of old data by solid-state storage devices and avoid the storage system adding complex redundant protection mechanisms in the upper-layer software, thereby improving the processing performance of the storage system and the convenience of system maintenance.
基于上述实施例,下面将具体介绍将本申请所提供的固态存储设备引入存储系统的一个或多个实施方式。在一个或多个实施例中,在固态存储设备接收数据写入装置发送的数据写入请求之前,还可以包括:Based on the above embodiments, one or more implementations of introducing the solid-state storage device provided by this application into a storage system will be introduced in detail below. In one or more embodiments, before the solid-state storage device receives the data writing request sent by the data writing device, it may also include:
S201、数据写入装置接收文件覆盖请求,从文件覆盖请求中读取新文件及新文件对应的待覆盖逻辑地址。S201. The data writing device receives the file coverage request, and reads the new file and the logical address to be overwritten corresponding to the new file from the file coverage request.
首先应当说明的是,在本申请实施例中,将同时使用多个固态存储设备进行分布式数据存储。换而言之,数据写入装置将会对接多个固态存储设备。需要说明的是,本申请实施例并不限定存储系统中固态存储设备的数量,可根据实际应用需求进行设定。同样应当指出的是,本步骤所出现的待覆盖逻辑地址是在将这些固态存储设备视为整体的基础上所设置的逻辑地址(即系统逻辑地址),不同于各固态存储设备内部的逻辑地址。First of all, it should be noted that in this embodiment of the present application, multiple solid-state storage devices will be used simultaneously for distributed data storage. In other words, the data writing device will interface with multiple solid-state storage devices. It should be noted that the embodiments of the present application do not limit the number of solid-state storage devices in the storage system, which can be set according to actual application requirements. It should also be pointed out that the logical address to be overwritten in this step is a logical address set based on considering these solid-state storage devices as a whole (i.e., system logical address), which is different from the internal logical address of each solid-state storage device. .
S202、在数据库中查询待覆盖逻辑地址对应的旧文件及旧文件在多个固态存储设备中对应的逻辑地址。S202. Query in the database the old file corresponding to the logical address to be overwritten and the logical addresses corresponding to the old files in multiple solid-state storage devices.
在本申请实施例中,数据库中存放有分布式存储系统中各文件与系统逻辑地址之间的映射关系。因此,可利用文件覆盖请求中的待覆盖逻辑地址,在数据库查询到与该地 址建立映射关系的旧文件。另外,可以理解的是,单个文件通常会被划分为若干个数据块,并存放在不同的固态存储设备中,每个数据块在对应固态存储设备中也有对应的逻辑地址。因此,数据库中也记录有系统逻辑地址与各存储设备逻辑地址之间的映射关系。需要说明的是,本申请实施例并不限定各文件与系统逻辑地址之间的映射关系,以及系统逻辑地址与各固态存储设备逻辑地址之间的映射关系在数据库中的存储形式,以及查询上述映射关系的具体方式,可参考分布式存储系统的相关技术。In this embodiment of the present application, the mapping relationship between each file in the distributed storage system and the system logical address is stored in the database. Therefore, you can use the logical address to be overwritten in the file overwrite request to query the database for the old file that establishes a mapping relationship with the address. In addition, it can be understood that a single file is usually divided into several data blocks and stored in different solid-state storage devices. Each data block also has a corresponding logical address in the corresponding solid-state storage device. Therefore, the mapping relationship between the system logical address and the logical address of each storage device is also recorded in the database. It should be noted that the embodiments of the present application do not limit the mapping relationship between each file and the system logical address, as well as the storage form of the mapping relationship between the system logical address and the logical address of each solid-state storage device in the database, and querying the above-mentioned For the specific method of mapping relationship, please refer to the related technologies of distributed storage systems.
S203、对新文件进行分块处理得到数据块,利用数据块及对应逻辑地址生成数据写入请求,并将数据写入请求下发至对应的固态存储设备。S203. Perform block processing on the new file to obtain data blocks, generate a data write request using the data blocks and corresponding logical addresses, and send the data write request to the corresponding solid-state storage device.
需要说明的是,本申请实施例并不限定分块处理的具体方式,可根据实际应用需求进行设定,例如可对新文件进行简单分块,也可利用纠删码机制等技术对新文件进行分块,其中纠删码机制是一种冗余保护机制,可确保在数据块存在部分丢失时,还可利用剩余的数据块恢复原文件。进一步,在完成数据分块后,数据写入装置可利用得到的数据块及先前查询到的数据写入请求,为各固态存储设备生成数据写入请求并进行请求下发。It should be noted that the embodiments of the present application do not limit the specific method of block processing, which can be set according to actual application requirements. For example, new files can be simply divided into blocks, or new files can be processed using erasure coding mechanisms and other technologies. Blocking is performed. The erasure coding mechanism is a redundant protection mechanism that ensures that when part of a data block is lost, the remaining data blocks can be used to restore the original file. Further, after the data is divided into blocks, the data writing device can use the obtained data blocks and the previously queried data writing requests to generate data writing requests for each solid-state storage device and issue the requests.
相应地,还可以包括:Correspondingly, it can also include:
S204、数据写入装置判断固态存储设备是否在预设时间内返回写入成功信息。若是,则进入步骤S205;若否,则进入步骤S206。S204. The data writing device determines whether the solid-state storage device returns writing success information within a preset time. If yes, go to step S205; if not, go to step S206.
可以理解的是,固态存储设备在不遭遇异常的情况下,通常能够在可预期的时间内完成数据写入。因此,在本申请实施例中,将会为各固态存储设备设置一个数据写入时间,即预设时间。当固态存储设备可在预设时间内返回写入成功信息时,则判定该设备不存在写入错误,反之则认为该设备存在写入错误。在此基础上,若数据写入装置确定所有固态存储设备均能够在预设时间内返回写入成功信息,则可确定新文件已被正确写入,此时便可对数据库中的相关信息进行更新;反之,若数据写入装置确定部分固态存储设备并未在预设时间内返回写入成功信息,则可确定新文件遭遇写入问题。在后一种情况中,由于可确定已返回写入成功信息的固态存储设备已完成数据写入,即需要进行数据恢复,此时数据写入装置可调用已返回写入成功信息的固态存储设备的数据恢复接口,以获取原始数据并进行数据回滚。It can be understood that solid-state storage devices can usually complete data writing within a predictable time without encountering abnormalities. Therefore, in this embodiment of the present application, a data writing time, that is, a preset time, will be set for each solid-state storage device. When the solid-state storage device can return writing success information within a preset time, it is determined that the device does not have a writing error; otherwise, the device is considered to have a writing error. On this basis, if the data writing device determines that all solid-state storage devices can return writing success information within a preset time, it can be determined that the new file has been written correctly, and then the relevant information in the database can be processed. Update; conversely, if the data writing device determines that some solid-state storage devices do not return writing success information within a preset time, it can be determined that the new file encounters a writing problem. In the latter case, since it can be determined that the solid-state storage device that has returned the writing success information has completed the data writing, that is, data recovery is required. At this time, the data writing device can call the solid-state storage device that has returned the writing success information. Data recovery interface to obtain original data and perform data rollback.
当然,由于新文件的写入涉及与多个固态存储设备之间的写入子操作,为保障数据一致性,数据写入装置可以在进行数据写入之前,创建写入事务并设置对应的事务过期时间,其中同一事务中的所有写入子操作要么都成功要么都失败,在部分写入子操作遭遇写入失败时,剩余成功的子操作在事务过期时间截止时也会被判定为失败。Of course, since writing a new file involves writing sub-operations with multiple solid-state storage devices, in order to ensure data consistency, the data writing device can create a writing transaction and set the corresponding transaction before writing the data. Expiration time, in which all write sub-operations in the same transaction either succeed or fail. When some write sub-operations encounter write failures, the remaining successful sub-operations will also be judged to have failed when the transaction expiration time expires.
在一个或多个实施例中,在对新文件进行分块处理得到数据块之前,还可以包括:In one or more embodiments, before performing block processing on the new file to obtain the data blocks, it may also include:
步骤31:数据写入装置创建写入事务,并设置事务过期时间;事务过期时间大于预设时间。Step 31: The data writing device creates a writing transaction and sets the transaction expiration time; the transaction expiration time is greater than the preset time.
S205、在数据库中,利用新文件与待覆盖逻辑地址之间的新映射关系覆盖旧文件与待覆盖逻辑地址之间的旧映射关系。S205. In the database, use the new mapping relationship between the new file and the logical address to be overwritten to overwrite the old mapping relationship between the old file and the logical address to be overwritten.
应当指出的是,由于传统的固态存储设备并不能够对被覆盖旧数据进行保护,因此现有的数据存储系统需要额外设置冗余保护机制,以通过上层软件来实现对旧数据的保护。具体的,请参考图2,图2为传统的数据一致性保护方式的示意图,其中的disk0~disk5表示6个固态存储设备,0、1、2、3、P、Q表示数据块、DB(Database)表示数据库。传统数据一致性保护的工作流程如下:It should be noted that since traditional solid-state storage devices cannot protect overwritten old data, existing data storage systems need to set up additional redundancy protection mechanisms to protect old data through upper-layer software. Specifically, please refer to Figure 2, which is a schematic diagram of the traditional data consistency protection method, in which disk0~disk5 represent 6 solid-state storage devices, 0, 1, 2, 3, P, and Q represent data blocks, DB ( Database) means database. The workflow of traditional data consistency protection is as follows:
1)在数据未写入时,条带数据由浅灰色标记,假设这些数据对应的系统逻辑地址为A;1) When data is not written, the stripe data is marked in light gray. It is assumed that the system logical address corresponding to these data is A;
2)在进行数据更新时,更新的数据由深灰色标记,这些数据并不会直接写入系统逻辑地址A,而是会写入系统逻辑地址B;2) When updating data, the updated data is marked in dark gray. These data will not be written directly to system logical address A, but will be written to system logical address B;
3)在数据库记录新的地址B和数据之间的映射关系;3) Record the mapping relationship between the new address B and the data in the database;
4)删除数据库记录的地址A和数据之间的映射关系;4) Delete the mapping relationship between address A and data recorded in the database;
5)删除地址A所对应的数据;5) Delete the data corresponding to address A;
6)数据完成更新。6) The data is updated.
可见,完成数据写入时,数据写入装置需要在数据库中额外执行一次数据写入及一次删除操作,而这与固态存储设备内部操作方式重复,在进行大规模数据写入时,额外的删除操作将带来额外的系统性能损耗。这是由于传统的固态存储设备在通过空间冗余和各种算法保护数据的可靠性时,只能保护最新数据,对被覆盖的旧数据则直接放弃保护,因此只能通过上层软件用追加写方式防止数据丢失。而在本申请中,由于固态存储设备能够对被覆盖的旧数据继续保护若干时间,因此数据写入装置可利用新文件与待覆盖逻辑地址之间的新映射关系,对旧文件与同一系统逻辑地址之间的旧映射关系进行直接覆盖,进而可有效避免额外的删除操作,进而能够有效提升存储系统的写入性能。It can be seen that when completing data writing, the data writing device needs to perform an additional data writing and deletion operation in the database, and this is repeated with the internal operation mode of the solid-state storage device. When large-scale data writing is performed, additional deletion operations are required. Operation will cause additional system performance loss. This is because when traditional solid-state storage devices protect the reliability of data through space redundancy and various algorithms, they can only protect the latest data and directly give up the protection of overwritten old data. Therefore, they can only use append writing through upper-layer software. way to prevent data loss. In this application, since the solid-state storage device can continue to protect the overwritten old data for a certain period of time, the data writing device can use the new mapping relationship between the new file and the logical address to be overwritten to protect the old file and the same system logic. The old mapping relationship between addresses is directly overwritten, which can effectively avoid additional deletion operations, thereby effectively improving the write performance of the storage system.
S206、向已发送写入成功信息的固态存储设备发送数据恢复请求及接收原始数据,并将原始数据重新写入对应的固态存储设备中对应的逻辑地址。S206. Send a data recovery request to the solid-state storage device that has sent the write success information and receive the original data, and rewrite the original data to the corresponding logical address in the corresponding solid-state storage device.
当部分固态存储设备存在写入异常时,数据写入装置将会对已完成数据写入的固态存储设备进行数据回滚。具体的,该装置会向已发送写入成功信息的固态存储设备发送数据恢复请求,并接收这些设备返回的原始数据,进而会将这些原始数据重新写回至固 态存储设备中的原始位置。When some solid-state storage devices have writing exceptions, the data writing device will perform data rollback on the solid-state storage devices that have completed data writing. Specifically, the device will send a data recovery request to the solid-state storage device that has sent write success information, receive the original data returned by these devices, and then rewrite the original data back to the original location in the solid-state storage device.
进一步,假若数据写入装置设置有事务,则数据回滚恢复应等待至事务过期时间截止之后再进行,以避免数据写入混乱,Furthermore, if the data writing device is set with a transaction, the data rollback recovery should wait until the transaction expiration time expires to avoid data writing chaos.
在一个或多个实施例中,将原始数据重新写入对应的固态存储设备中对应的逻辑地址,可以包括:In one or more embodiments, rewriting the original data to the corresponding logical address in the corresponding solid-state storage device may include:
步骤41:响应于事务过期时间已截止,将原始数据重新写入对应的固态存储设备中对应的逻辑地址。Step 41: In response to the transaction expiration time having expired, rewrite the original data to the corresponding logical address in the corresponding solid-state storage device.
当然,可以理解的是,若所有存在写入异常的固态存储设备能够在事务过期时间截止之前返回写入成功信息,则也可不执行数据回滚操作。Of course, it can be understood that if all solid-state storage devices with write exceptions can return write success information before the transaction expiration time expires, the data rollback operation may not be performed.
下面对引入纠删码机制的实施方式进行介绍,在一个或多个实施例中,对新文件进行分块处理得到数据块,可以包括:The following is an introduction to the implementation of introducing an erasure coding mechanism. In one or more embodiments, performing block processing on a new file to obtain data blocks may include:
步骤51:利用纠删码机制对新文件进行分块处理得到数据块;在数据块丢失数量不超过预设值时,剩余的数据块可恢复新文件。Step 51: Use the erasure coding mechanism to perform block processing on the new file to obtain data blocks; when the number of lost data blocks does not exceed the preset value, the remaining data blocks can be used to restore the new file.
需要说明的是,此处的预设值指代的是纠删码机制的保护级别。换而言之,只要新文件的数据块的丢失数量不超过纠删码的保护级别,该机制便能够利用剩余的数据块恢复新文件。需要说明的是,本申请实施例并不限定具体的预设值,可根据实际应用需求进行设定。本申请实施例也不限定具体的纠删码机制,例如可以为4+2纠删码,也可以为8+3纠删码、6+2纠删码等,可根据实际应用需求进行设定。It should be noted that the default value here refers to the protection level of the erasure coding mechanism. In other words, as long as the number of lost data blocks of the new file does not exceed the erasure coding protection level, the mechanism can use the remaining data blocks to restore the new file. It should be noted that the embodiments of the present application do not limit specific preset values, which can be set according to actual application requirements. The embodiments of this application do not limit the specific erasure coding mechanism. For example, it can be a 4+2 erasure code, an 8+3 erasure code, a 6+2 erasure code, etc., which can be set according to actual application requirements. .
相应的,在向已发送写入成功信息的固态存储设备发送数据恢复请求及接收旧数据之前,还包括:Correspondingly, before sending a data recovery request to the solid-state storage device that has sent write success information and receiving old data, it also includes:
步骤61:数据写入装置判断未发送写入成功信息的固态存储设备的数量是否大于预设值;若是,则进入步骤62;若否,在进入步骤S205;Step 61: The data writing device determines whether the number of solid-state storage devices that have not sent writing success information is greater than the preset value; if so, proceed to step 62; if not, proceed to step S205;
由于纠删码能够对新文件进行冗余保护,因此只要存在异常的固态存储设备的数量不超过纠删码的保护级别,可无需进行数据回滚,反之则需要进行数据回滚。Since erasure coding can redundantly protect new files, as long as the number of abnormal solid-state storage devices does not exceed the protection level of erasure coding, there is no need to perform data rollback. Otherwise, data rollback is required.
步骤62:执行向已发送写入成功信息的固态存储设备发送数据恢复请求及接收旧数据的步骤。Step 62: Execute the steps of sending a data recovery request to the solid-state storage device that has sent the write success information and receiving old data.
为便于理解,下面将结合具体的流程图介绍本申请实施例所提供的数据回滚流程。请参考图3,图3为本申请一个或多个实施例所提供的数据回滚流程的示意图。在数据更新失败时,所有数据块需要恢复至原始状态,流程如下:For ease of understanding, the data rollback process provided by the embodiment of the present application will be introduced below in conjunction with a specific flow chart. Please refer to Figure 3, which is a schematic diagram of a data rollback process provided by one or more embodiments of the present application. When data update fails, all data blocks need to be restored to their original state. The process is as follows:
1)在数据未写入时,条带数据由浅灰色标记,对应系统逻辑地址为A;1) When data is not written, the stripe data is marked in light gray, and the corresponding system logical address is A;
2)在进行数据写入时,更新的数据由深灰色标记,并直接覆盖系统逻辑地址A;2) When writing data, the updated data is marked in dark gray and directly overwrites the system logical address A;
3)disk2、3、4写入成功,但disk0、1、5遭遇掉电,写入未成功。此时disk2、3、4将原始数据被标记为“待回收”状态,并启动3秒定时器;3) Disk2, 3, and 4 were successfully written, but disk0, 1, and 5 suffered a power outage and the writing was unsuccessful. At this time, disks 2, 3, and 4 mark the original data as "to be recycled" and start the 3-second timer;
4)在1.5秒(可设置调整)后,上层软件发现disk0、1、5耗时远大于正常耗时(一般SSD写入为0.1毫秒以内),而此时4+2纠删码不能恢复数据,于是调用固态盘提供的旧数据恢复接口,读取条带内包括disk2、3、4在内的全部旧数据并保存。4) After 1.5 seconds (can be set and adjusted), the upper-layer software found that disk0, 1, and 5 took much longer than the normal time (generally SSD writing is within 0.1 milliseconds), and at this time the 4+2 erasure code cannot recover the data. , so the old data recovery interface provided by the solid-state disk is called to read all the old data in the strip including disk2, 3, and 4 and save it.
6)Disk2、3、4在3秒定时器到时后,将数据块从“待回收”状态,改为“删除”状态,并将旧数据移入垃圾回收空间;6) After the 3-second timer expires, Disk2, 3, and 4 change the data block from the "to be recycled" state to the "deleted" state, and move the old data into the garbage collection space;
7)上层软件等待事务机制超时后(如在超时时间内disk0、1、5回复成功则事务成功,不需要后续动作),向disk2,3,4地址A写入旧数据,事务回滚成功,条带内所有数据恢复为浅灰色旧数据。7) After the upper-layer software waits for the transaction mechanism to time out (if disk0, 1, and 5 reply successfully within the timeout period, the transaction is successful and no follow-up action is required), the old data is written to disk2, 3, and 4 address A, and the transaction rollback is successful. All data within the stripe is restored to light gray old data.
基于上述实施例,本申请实施例可利用改进后的固态存储设备,将数据的删除动作,从上层软件的主动删除转变为固态盘的内部老化,减少了一次删除动作,进而可大幅降低了记录的数据量,降低分布式存储系统的压力并提升系统性能。Based on the above embodiments, the embodiments of the present application can use the improved solid-state storage device to change the data deletion action from the active deletion of the upper-layer software to the internal aging of the solid-state disk, thereby reducing one deletion action and thus significantly reducing the recording time. The amount of data reduces the pressure on the distributed storage system and improves system performance.
下面对本申请实施例提供的数据存储系统及计算机可读存储介质进行介绍,下文描述的数据存储系统及计算机可读存储介质与上文描述的数据存储方法可相互对应参照。The data storage system and computer-readable storage medium provided by the embodiments of the present application are introduced below. The data storage system and computer-readable storage medium described below and the data storage method described above can be mutually referenced.
请参考图4,图4为本申请一个或多个实施例所提供的一种数据存储系统的结构框图,该系统可以包括:固态存储设备401及数据写入装置402,其中,Please refer to Figure 4. Figure 4 is a structural block diagram of a data storage system provided by one or more embodiments of the present application. The system may include: a solid-state storage device 401 and a data writing device 402, wherein,
固态存储设备401,用于接收数据写入装置402发送的数据写入请求,并从数据写入请求中提取待写入数据及逻辑地址;查找逻辑地址对应的原物理地址,并为原物理地址添加待回收标记及为原物理地址设置预设保留时间;将待写入数据写入新物理地址,并将新物理地址映射至逻辑地址;接收数据写入装置402发送的针对逻辑地址的数据恢复请求,响应于预设保留时间未截止,向数据写入装置402返回原物理地址对应的原始数据;The solid-state storage device 401 is used to receive the data writing request sent by the data writing device 402, and extract the data to be written and the logical address from the data writing request; find the original physical address corresponding to the logical address, and obtain the original physical address Add a mark to be recycled and set a preset retention time for the original physical address; write the data to be written into the new physical address, and map the new physical address to the logical address; receive data recovery for the logical address sent by the data writing device 402 Request, in response to the fact that the preset retention time has not expired, return the original data corresponding to the original physical address to the data writing device 402;
数据写入装置402,用于发送数据写入请求及数据恢复请求。The data writing device 402 is used to send data writing requests and data recovery requests.
在一个或多个实施例中,固态存储设备401,还可以用于:In one or more embodiments, solid-state storage device 401 can also be used for:
响应于预设保留时间已截止,将原物理地址添加至垃圾回收空间。In response to the preset retention time having expired, the original physical address is added to the garbage collection space.
在一个或多个实施例中,所有添加有待回收标记的物理地址组成待回收空间,待回收空间的大小不超过固态存储设备401最大带宽的预设倍数。In one or more embodiments, all physical addresses added with a to-be-reclaimed mark constitute a space to be reclaimed, and the size of the space to be reclaimed does not exceed a preset multiple of the maximum bandwidth of the solid-state storage device 401 .
在一个或多个实施例中,固态存储设备401,还可以用于:In one or more embodiments, solid-state storage device 401 can also be used for:
向数据写入装置402发送写入成功信息。Send writing success information to the data writing device 402.
在一个或多个实施例中,数据写入装置402,还可以用于:In one or more embodiments, the data writing device 402 can also be used for:
接收文件覆盖请求,从文件覆盖请求中读取新文件及对应的待覆盖逻辑地址;在数据库中查询待覆盖逻辑地址对应的旧文件及旧文件在多个固态存储设备401中对应的逻辑地址;对新文件进行分块处理得到数据块,利用数据块及逻辑地址生成数据写入请求,并将数据写入请求下发对应的固态存储设备401;Receive the file overwrite request, read the new file and the corresponding logical address to be overwritten from the file overwrite request; query the database for the old file corresponding to the logical address to be overwritten and the corresponding logical addresses of the old files in multiple solid-state storage devices 401; Perform block processing on the new file to obtain data blocks, use the data blocks and logical addresses to generate data write requests, and send the data write requests to the corresponding solid-state storage device 401;
相应地,数据写入装置402,还可以用于:Correspondingly, the data writing device 402 can also be used for:
判断存储设备是否在预设时间内返回写入成功信息;若是,则在数据库中,利用新文件与待覆盖逻辑地址之间的新映射关系覆盖旧文件与待覆盖逻辑地址之间的旧映射关系;若否,则向已发送写入成功信息的固态存储设备401发送数据恢复请求及接收原始数据,并将原始数据重新写入对应的固态存储设备401中对应的逻辑地址。Determine whether the storage device returns write success information within the preset time; if so, use the new mapping relationship between the new file and the logical address to be overwritten to overwrite the old mapping relationship between the old file and the logical address to be overwritten in the database ; If not, send a data recovery request and receive the original data to the solid-state storage device 401 that has sent the write success information, and rewrite the original data to the corresponding logical address in the corresponding solid-state storage device 401.
在一个或多个实施例中,数据写入装置402,还可以用于:In one or more embodiments, the data writing device 402 can also be used for:
利用纠删码机制对新文件进行分块处理得到数据块;在数据块丢失数量不超过预设值时,剩余的数据块可恢复新文件;Use the erasure coding mechanism to process the new file into blocks to obtain data blocks; when the number of lost data blocks does not exceed the preset value, the remaining data blocks can be used to restore the new file;
相应地,在向已发送写入成功信息的固态存储设备401发送数据恢复请求及接收旧数据之前,数据写入装置402,还可以用于:Correspondingly, before sending a data recovery request and receiving old data to the solid-state storage device 401 that has sent the writing success information, the data writing device 402 can also be used to:
判断未发送写入成功信息的固态存储设备401的数量是否大于预设值;若是,则执行向已发送写入成功信息的固态存储设备401发送数据恢复请求及接收旧数据的步骤。Determine whether the number of solid-state storage devices 401 that have not sent write success information is greater than a preset value; if so, perform the steps of sending a data recovery request and receiving old data to the solid-state storage devices 401 that have sent write success information.
在一个或多个实施例中,数据写入装置402,还可以用于:In one or more embodiments, the data writing device 402 can also be used for:
创建写入事务,并设置事务过期时间;事务过期时间大于预设时间;Create a write transaction and set the transaction expiration time; the transaction expiration time is greater than the preset time;
相应地,数据写入装置402,还可以用于:Correspondingly, the data writing device 402 can also be used for:
响应于事务过期时间已截止,将原始数据重新写入对应的固态存储设备401中对应的逻辑地址。In response to the transaction expiration time having expired, the original data is rewritten to the corresponding logical address in the corresponding solid-state storage device 401 .
在一个或多个实施例中,还提供一种计算机设备,参考图5所示,图5为一个或多个实施例中计算机设备的结构示意图。计算机设备包括存储器50及一个或多个处理器51,存储器50中储存有计算机可读指令,计算机可读指令被一个或多个处理器51执行时,使得一个或多个处理器51执行上述任意一个或多个实施例的数据存储方法的步骤。In one or more embodiments, a computer device is also provided, as shown in FIG. 5 , which is a schematic structural diagram of the computer device in one or more embodiments. The computer device includes a memory 50 and one or more processors 51. Computer-readable instructions are stored in the memory 50. When the computer-readable instructions are executed by the one or more processors 51, the one or more processors 51 execute any of the above. Steps of the data storage method of one or more embodiments.
在一个或多个实施例中,参考图6所示,还提供一种非易失性计算机可读存储介质60,非易失性计算机可读存储介质60上存储有计算机可读指令61,计算机可读指令61被处理器执行时实现上述任意一个或多个实施例的数据存储方法的步骤。In one or more embodiments, as shown in FIG. 6 , a non-volatile computer-readable storage medium 60 is also provided. Computer-readable instructions 61 are stored on the non-volatile computer-readable storage medium 60 . When the readable instructions 61 are executed by the processor, the steps of the data storage method of any one or more of the above embodiments are implemented.
由于计算机可读存储介质部分的实施例与数据存储方法部分的实施例相互对应,因此存储介质部分的实施例请参见数据存储方法部分的实施例的描述,这里不再赘述。Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the data storage method part, for the embodiments of the storage medium part, please refer to the description of the embodiments of the data storage method part and will not be described again here.
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施 例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in the specification is described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple. For relevant details, please refer to the description in the method section.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art may further realize that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. In order to clearly illustrate the possible functions of hardware and software, Interchangeability, in the above description, the composition and steps of each example have been generally described according to functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly in hardware, in software modules executed by a processor, or in a combination of both. Software modules may be located in random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or anywhere in the field of technology. any other known form of storage media.
以上对本申请所提供的一种数据存储方法、系统及计算机可读存储介质进行了详细介绍。本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。The above describes in detail a data storage method, system and computer-readable storage medium provided by this application. This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art, several improvements and modifications can be made to the present application without departing from the principles of the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims (20)

  1. 一种数据存储方法,其特征在于,包括:A data storage method, characterized by including:
    固态存储设备接收数据写入装置发送的数据写入请求,并从所述数据写入请求中提取待写入数据及逻辑地址;The solid-state storage device receives the data writing request sent by the data writing device, and extracts the data to be written and the logical address from the data writing request;
    查找所述逻辑地址对应的原物理地址,并为所述原物理地址添加待回收标记及为所述原物理地址设置预设保留时间;Find the original physical address corresponding to the logical address, add a to-be-recycled mark to the original physical address, and set a preset retention time for the original physical address;
    将所述待写入数据写入新物理地址,并将所述新物理地址映射至所述逻辑地址;以及Write the data to be written to a new physical address, and map the new physical address to the logical address; and
    接收所述数据写入装置发送的针对所述逻辑地址的数据恢复请求,响应于所述预设保留时间未截止,向所述数据写入装置返回所述原物理地址对应的原始数据。Receive the data recovery request for the logical address sent by the data writing device, and return the original data corresponding to the original physical address to the data writing device in response to the fact that the preset retention time has not expired.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, further comprising:
    响应于所述预设保留时间已截止,将所述原物理地址添加至垃圾回收空间。In response to the preset retention time having expired, the original physical address is added to the garbage collection space.
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, further comprising:
    根据添加有所述待回收标记的物理地址组成待回收空间。The space to be reclaimed is formed according to the physical address added with the to-be-reclaimed mark.
  4. 根据权利要求1所述的方法,其特征在于,所述待回收空间的大小不超过所述固态存储设备最大带宽的预设倍数。The method of claim 1, wherein the size of the space to be reclaimed does not exceed a preset multiple of the maximum bandwidth of the solid-state storage device.
  5. 根据权利要求1至4任一项所述的方法,其特征在于,所述将所述新物理地址映射至所述逻辑地址之后,还包括:The method according to any one of claims 1 to 4, characterized in that after mapping the new physical address to the logical address, it further includes:
    向所述数据写入装置发送写入成功信息。Send writing success information to the data writing device.
  6. 根据权利要求5所述的方法,其特征在于,所述固态存储设备接收数据写入装置发送的数据写入请求之前,还包括:The method according to claim 5, characterized in that before the solid-state storage device receives the data writing request sent by the data writing device, it further includes:
    所述数据写入装置接收文件覆盖请求,从所述文件覆盖请求中读取新文件及所述新文件对应的待覆盖逻辑地址;The data writing device receives a file coverage request and reads a new file and the logical address to be overwritten corresponding to the new file from the file coverage request;
    在数据库中查询所述待覆盖逻辑地址对应的旧文件及所述旧文件在多个所述固态存储设备中对应的逻辑地址;以及Query in the database the old file corresponding to the logical address to be overwritten and the logical addresses corresponding to the old file in multiple solid-state storage devices; and
    对所述新文件进行分块处理得到数据块,利用所述数据块及所述逻辑地址生成所述数据写入请求。The new file is divided into blocks to obtain data blocks, and the data write request is generated using the data blocks and the logical address.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method of claim 6, further comprising:
    将生成的所述数据写入请求下发至对应的所述固态存储设备。Send the generated data write request to the corresponding solid-state storage device.
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method of claim 7, further comprising:
    所述数据写入装置判断对应的所述固态存储设备是否在预设时间内返回所述写入成 功信息;以及The data writing device determines whether the corresponding solid-state storage device returns the writing success information within a preset time; and
    响应于对应的所述固态存储设备在预设时间内返回所述写入成功信息,在所述数据库中,利用所述新文件与所述待覆盖逻辑地址之间的新映射关系覆盖所述旧文件与所述待覆盖逻辑地址之间的旧映射关系。In response to the corresponding solid-state storage device returning the writing success information within a preset time, in the database, the new mapping relationship between the new file and the logical address to be overwritten is used to overwrite the old file. The old mapping relationship between the file and the logical address to be overwritten.
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:The method of claim 8, further comprising:
    响应于对应的所述固态存储设备在预设时间内未返回所述写入成功信息,向已发送所述写入成功信息的所述固态存储设备发送所述数据恢复请求及接收所述原始数据,并将所述原始数据重新写入对应的所述固态存储设备中对应的所述逻辑地址。In response to the corresponding solid-state storage device not returning the write success information within a preset time, sending the data recovery request to the solid-state storage device that has sent the write success information and receiving the original data , and rewrite the original data to the corresponding logical address in the corresponding solid-state storage device.
  10. 根据权利要求6所述的方法,其特征在于,所述对所述新文件进行分块处理得到数据块,包括:The method according to claim 6, characterized in that said performing block processing on the new file to obtain data blocks includes:
    利用纠删码机制对所述新文件进行分块处理得到所述数据块。The new file is divided into blocks using an erasure coding mechanism to obtain the data blocks.
  11. 根据权利要求10所述的方法,其特征在于,所述数据块的丢失数量不超过预设值,未丢失的剩余数据块用于恢复所述新文件。The method according to claim 10, characterized in that the number of lost data blocks does not exceed a preset value, and the remaining data blocks that are not lost are used to restore the new file.
  12. 根据权利要求11所述的方法,其特征在于,所述向已发送所述写入成功信息的所述固态存储设备发送所述数据恢复请求及接收所述旧数据之前,还包括:The method according to claim 11, characterized in that, before sending the data recovery request to the solid-state storage device that has sent the writing success information and receiving the old data, it further includes:
    所述数据写入装置判断未发送所述写入成功信息的所述固态存储设备的数量是否大于所述预设值;以及The data writing device determines whether the number of solid-state storage devices that have not sent the writing success information is greater than the preset value; and
    响应于未发送所述写入成功信息的所述固态存储设备的数量大于所述预设值,执行向已发送所述写入成功信息的所述固态存储设备发送所述数据恢复请求及接收所述旧数据的步骤。In response to the number of the solid-state storage devices that have not sent the write success information being greater than the preset value, sending the data recovery request to the solid-state storage devices that have sent the write success information and receiving all Describe the steps for old data.
  13. 根据权利要求12所述的方法,其特征在于,所述方法还包括:The method of claim 12, further comprising:
    响应于未发送所述写入成功信息的固态存储设备的数量不大于所述预设值,执行在所述数据库中,利用所述新文件与所述待覆盖逻辑地址之间的新映射关系覆盖所述旧文件与所述待覆盖逻辑地址之间的旧映射关系的步骤。In response to the number of solid-state storage devices that have not sent the write success information being no greater than the preset value, executing in the database overwriting using a new mapping relationship between the new file and the logical address to be overwritten. The step of establishing an old mapping relationship between the old file and the logical address to be overwritten.
  14. 根据权利要求11所述的方法,其特征在于,所述对所述新文件进行分块处理得到数据块之前,还包括:The method according to claim 11, characterized in that before performing block processing on the new file to obtain data blocks, it further includes:
    所述数据写入装置创建写入事务,并设置事务过期时间。The data writing device creates a writing transaction and sets the transaction expiration time.
  15. 根据权利要求14所述的方法,其特征在于,所述事务过期时间大于所述预设时间。The method according to claim 14, characterized in that the transaction expiration time is greater than the preset time.
  16. 根据权利要求14所述的方法,其特征在于,所述将所述原始数据重新写入对应的所述固态存储设备中对应的所述逻辑地址,包括:The method of claim 14, wherein rewriting the original data to the corresponding logical address in the corresponding solid-state storage device includes:
    响应于所述事务过期时间已截止,将所述原始数据重新写入对应的所述固态存储设备中对应的所述逻辑地址。In response to the transaction expiration time having expired, the original data is rewritten to the corresponding logical address in the corresponding solid-state storage device.
  17. 一种数据存储系统,其特征在于,包括:固态存储设备及数据写入装置,其中,A data storage system, characterized by including: a solid-state storage device and a data writing device, wherein,
    所述固态存储设备,用于接收所述数据写入装置发送的数据写入请求,并从所述数据写入请求中提取待写入数据及逻辑地址;查找所述逻辑地址对应的原物理地址,并为所述原物理地址添加待回收标记及为所述原物理地址设置预设保留时间;将所述待写入数据写入新物理地址,并将所述新物理地址映射至所述逻辑地址;接收所述数据写入装置发送的针对所述逻辑地址的数据恢复请求,响应于所述预设保留时间未截止,向所述数据写入装置返回所述原物理地址对应的原始数据;The solid-state storage device is configured to receive a data writing request sent by the data writing device, and extract the data to be written and a logical address from the data writing request; and search for the original physical address corresponding to the logical address. , and add a to-be-recycled mark to the original physical address and set a preset retention time for the original physical address; write the data to be written into a new physical address, and map the new physical address to the logical Address; receive a data recovery request for the logical address sent by the data writing device, and return the original data corresponding to the original physical address to the data writing device in response to the fact that the preset retention time has not expired;
    所述数据写入装置,用于发送所述数据写入请求及所述数据恢复请求。The data writing device is used to send the data writing request and the data recovery request.
  18. 根据权利要求17所述的系统,其特征在于,所述固态存储设备还用于响应于所述预设保留时间已截止,将所述原物理地址添加至垃圾回收空间。The system of claim 17, wherein the solid-state storage device is further configured to add the original physical address to the garbage collection space in response to the expiration of the preset retention time.
  19. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行如权利要求1至16任一项所述的数据存储方法。A computer device includes a memory and one or more processors. Computer-readable instructions are stored in the memory. When the computer-readable instructions are executed by the one or more processors, the one or more processors cause the one or more processors to A processor executes the data storage method according to any one of claims 1 to 16.
  20. 一种非易失性计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机可读指令,所述计算机可读指令被一个或多个处理器加载并执行时,实现如权利要求1至16任一项所述的数据存储方法。A non-volatile computer-readable storage medium, characterized in that computer-readable instructions are stored in the computer-readable storage medium, and when the computer-readable instructions are loaded and executed by one or more processors, The data storage method according to any one of claims 1 to 16.
PCT/CN2022/122872 2022-04-29 2022-09-29 Data storage method and system, and computer readable storage medium WO2023206968A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210467206.XA CN114756178A (en) 2022-04-29 2022-04-29 Data storage method, system and computer readable storage medium
CN202210467206.X 2022-04-29

Publications (1)

Publication Number Publication Date
WO2023206968A1 true WO2023206968A1 (en) 2023-11-02

Family

ID=82333669

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/122872 WO2023206968A1 (en) 2022-04-29 2022-09-29 Data storage method and system, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN114756178A (en)
WO (1) WO2023206968A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114756178A (en) * 2022-04-29 2022-07-15 浪潮电子信息产业股份有限公司 Data storage method, system and computer readable storage medium
CN116069685B (en) * 2023-03-07 2023-07-14 浪潮电子信息产业股份有限公司 Storage system write control method, device, equipment and readable storage medium
CN115951846B (en) * 2023-03-15 2023-06-13 苏州浪潮智能科技有限公司 Data writing method, device, equipment and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110238888A1 (en) * 2010-03-29 2011-09-29 International Business Machines Corporation Providing versioning in a storage device
US20140089264A1 (en) * 2012-09-24 2014-03-27 Fusion-Io, Inc. Snapshots for a non-volatile device
US10290331B1 (en) * 2017-04-28 2019-05-14 EMC IP Holding Company LLC Method and system for modulating read operations to support error correction in solid state memory
CN111488126A (en) * 2020-04-12 2020-08-04 华中科技大学 Flash memory block management method and device of self-heating solid state disk and solid state disk
CN113761059A (en) * 2021-08-03 2021-12-07 阿里云计算有限公司 Data processing method and device
CN114756178A (en) * 2022-04-29 2022-07-15 浪潮电子信息产业股份有限公司 Data storage method, system and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110238888A1 (en) * 2010-03-29 2011-09-29 International Business Machines Corporation Providing versioning in a storage device
US20140089264A1 (en) * 2012-09-24 2014-03-27 Fusion-Io, Inc. Snapshots for a non-volatile device
US10290331B1 (en) * 2017-04-28 2019-05-14 EMC IP Holding Company LLC Method and system for modulating read operations to support error correction in solid state memory
CN111488126A (en) * 2020-04-12 2020-08-04 华中科技大学 Flash memory block management method and device of self-heating solid state disk and solid state disk
CN113761059A (en) * 2021-08-03 2021-12-07 阿里云计算有限公司 Data processing method and device
CN114756178A (en) * 2022-04-29 2022-07-15 浪潮电子信息产业股份有限公司 Data storage method, system and computer readable storage medium

Also Published As

Publication number Publication date
CN114756178A (en) 2022-07-15

Similar Documents

Publication Publication Date Title
WO2023206968A1 (en) Data storage method and system, and computer readable storage medium
CN111480149B (en) Pre-written logging in persistent memory devices
US20190073277A1 (en) Transaction Recovery Method in Database System, and Database Management System
US6523087B2 (en) Utilizing parity caching and parity logging while closing the RAID5 write hole
US6678809B1 (en) Write-ahead log in directory management for concurrent I/O access for block storage
EP1770492B1 (en) A method for improving writing data efficiency and storage subsystem and system implementing the same
US6795890B1 (en) Data storage method, and data processing device using an erasure block buffer and write buffer for writing and erasing data in memory
US20150331624A1 (en) Host-controlled flash translation layer snapshot
KR100515890B1 (en) Method of efficiently recovering database
US20090216973A1 (en) Computer system, storage subsystem, and data management method
US11030092B2 (en) Access request processing method and apparatus, and computer system
CN111552437B (en) Snapshot method and snapshot device applied to distributed storage system
US8019953B2 (en) Method for providing atomicity for host write input/outputs (I/Os) in a continuous data protection (CDP)-enabled volume using intent log
US20220129420A1 (en) Method for facilitating recovery from crash of solid-state storage device, method of data synchronization, computer system, and solid-state storage device
CN115705152A (en) Metadata management in non-volatile memory devices using in-memory logs
KR100866513B1 (en) Data Process Method Using Journaling File System Based on Flash Memory
US20230113507A1 (en) Storage system and data restoration method
CN115705153A (en) Conditional update and deferred lookup
CN114327292A (en) File management method, system, electronic device and storage medium
JP4204060B2 (en) Data recovery method for information processing system and disk subsystem
CN114880277B (en) Block device snapshot method, system and storage medium
US20240070264A1 (en) Data storage device performing data protection and host device supporting a data protection function using a program context
US11928497B2 (en) Implementing erasure coding with persistent memory
JP2000267936A (en) Disk sub-system
CN115705263A (en) In-memory journaling

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

Country of ref document: EP

Kind code of ref document: A1