Data writing method and related device of storage system

文档序号:1888624 发布日期:2021-11-26 浏览:3次 中文

阅读说明:本技术 一种存储系统的写数据方法及相关装置 (Data writing method and related device of storage system ) 是由 夏方健 于 2021-07-30 设计创作,主要内容包括:本申请公开了一种存储系统的写数据方法,包括:对待写入数据对应的条带创建第一条带锁请求;将有效区域置位信息添加至所述第一条带锁请求中,得到第二条带锁请求;向对端控制器发送所述第二条带锁请求,以便所述对端控制器对所述第二条带锁请求中的所述第一条带锁请求和所述有效区域置位信息进行处理,当处理成功时发送处理成功消息;当接收到所述处理成功消息时,对所述待写入数据执行写数据操作,并对有效区域位图进行置位,以提高数据写入的效率,避免出现延迟的问题。本申请还公开了一种存储系统的写数据装置、服务器以及计算机可读存储介质,具有以上有益效果。(The application discloses a data writing method of a storage system, which comprises the following steps: creating a first stripe lock request for a stripe corresponding to data to be written; adding effective region setting information to the first strip lock request to obtain a second strip lock request; sending the second strip lock request to a peer controller so that the peer controller processes the first strip lock request and the effective region setting information in the second strip lock request, and sending a processing success message when the processing is successful; and when the processing success message is received, performing data writing operation on the data to be written, and setting the effective area bitmap to improve the data writing efficiency and avoid the delay problem. The application also discloses a data writing device, a server and a computer readable storage medium of the storage system, which have the beneficial effects.)

1. A method for writing data in a memory system, comprising:

creating a first stripe lock request for a stripe corresponding to data to be written;

adding effective region setting information to the first strip lock request to obtain a second strip lock request;

sending the second strip lock request to a peer controller so that the peer controller processes the first strip lock request and the effective region setting information in the second strip lock request, and sending a processing success message when the processing is successful;

and when the processing success message is received, performing data writing operation on the data to be written, and setting an effective area bitmap.

2. The data writing method of claim 1, wherein adding valid region setting information to the first stripe lock request to obtain a second stripe lock request comprises:

coding the effective region setting information to obtain an effective region setting code;

and adding the effective region setting code to the structure of the first strip lock request to obtain the second strip lock request.

3. The data writing method of claim 1, further comprising:

judging whether the strip corresponding to the data to be written has an effective area bitmap or not;

and if so, sending the first strip lock request to the opposite-end controller so that the opposite-end controller can process the first strip lock request.

4. The data writing method of claim 1, wherein the process success message comprises set information and lock information.

5. The data writing method of claim 4, wherein when the processing success message is received, performing a data writing operation on the data to be written and setting a valid region bitmap comprise:

when the processing success message is received, performing data writing operation on the data to be written according to the setting information of the processing success message;

and setting the effective region bitmap according to the setting information of the successful processing message.

6. The data writing method of claim 1, wherein creating a first stripe lock request for a stripe corresponding to data to be written comprises:

receiving the data to be written;

determining a stripe corresponding to the data to be written;

a first stripe lock request is created for the corresponding stripe.

7. A data writing apparatus of a memory system, comprising:

the device comprises a lock request application module, a first stripe lock request creation module and a second stripe lock request module, wherein the lock request application module is used for creating a first stripe lock request for a stripe corresponding to data to be written;

the setting information adding module is used for adding effective region setting information into the first strip lock request to obtain a second strip lock request;

a lock request sending module, configured to send the second striped lock request to a peer controller, so that the peer controller processes the first striped lock request and the valid region setting information in the second striped lock request, and sends a processing success message when the processing is successful;

and the local end processing module is used for executing data writing operation on the data to be written and setting the effective area bitmap when the processing success message is received.

8. The data writing device according to claim 7, wherein the setting information adding module is specifically configured to encode the valid region setting information to obtain a valid region setting code; and adding the effective region setting code to the structure of the first strip lock request to obtain the second strip lock request.

9. A server, comprising:

a memory for storing a computer program;

a processor for implementing the steps of the data writing method of any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the data writing method according to any one of claims 1 to 6.

Technical Field

The present application relates to the field of computer technologies, and in particular, to a data writing method, a data writing device, a server, and a computer-readable storage medium for a storage system.

Background

With the continuous development of data storage technology, in a RAID (Redundant Arrays of Independent Disks) software architecture, a hot spare disk and data reconstruction are implemented in order to ensure that data is not lost under a disk offline condition. Specifically, the method is a process of recovering the data of the offline disk through the data of other online hard disks by a verification algorithm and rewriting the data into the hot spare disk. In the process of reconstruction, management of storage units in a disk is involved, in RAID, the disk is divided into blocks, then the blocks form a strip, and the strip is provided for an upper layer to use, each block has several specifications, and the huge block interval needs to be managed uniformly.

In the related art, whether a block is reconstructed is recorded while synchronizing processing results of metadata records in a plurality of controllers of a storage device to prevent the same block from being processed by different controllers a plurality of times. In order to determine the effective area bitmap, a corresponding bitmap operation request needs to be issued in the data writing process, so that the flow of data writing operation is increased, and the data writing efficiency is reduced.

Therefore, how to improve the efficiency of writing data in a storage system is a key issue of attention for those skilled in the art.

Disclosure of Invention

The application aims to provide a data writing method, a data writing device, a server and a computer readable storage medium of a storage system, so as to improve the efficiency of data writing and avoid the problem of delay.

In order to solve the above technical problem, the present application provides a data writing method for a storage system, including:

creating a first stripe lock request for a stripe corresponding to data to be written;

adding effective region setting information to the first strip lock request to obtain a second strip lock request;

sending the second strip lock request to a peer controller so that the peer controller processes the first strip lock request and the effective region setting information in the second strip lock request, and sending a processing success message when the processing is successful;

and when the processing success message is received, performing data writing operation on the data to be written, and setting an effective area bitmap.

Optionally, adding valid area setting information to the first stripe lock request to obtain a second stripe lock request, where the method includes:

coding the effective region setting information to obtain an effective region setting code;

and adding the effective region setting code to the structure of the first strip lock request to obtain the second strip lock request.

Optionally, the method further includes:

judging whether the strip corresponding to the data to be written has an effective area bitmap or not;

and if so, sending the first strip lock request to the opposite-end controller so that the opposite-end controller can process the first strip lock request.

Optionally, the processing success message includes setting information and lock information.

Optionally, when the processing success message is received, performing a data writing operation on the data to be written, and setting an effective area bitmap, including:

when the processing success message is received, performing data writing operation on the data to be written according to the setting information of the processing success message;

and setting the effective region bitmap according to the setting information of the successful processing message.

Optionally, the creating a first stripe lock request for a stripe corresponding to data to be written includes:

receiving the data to be written;

determining a stripe corresponding to the data to be written;

a first stripe lock request is created for the corresponding stripe.

The present application further provides a data writing device of a storage system, including:

the device comprises a lock request application module, a first stripe lock request creation module and a second stripe lock request module, wherein the lock request application module is used for creating a first stripe lock request for a stripe corresponding to data to be written;

the setting information adding module is used for adding effective region setting information into the first strip lock request to obtain a second strip lock request;

a lock request sending module, configured to send the second striped lock request to a peer controller, so that the peer controller processes the first striped lock request and the valid region setting information in the second striped lock request, and sends a processing success message when the processing is successful;

and the local end processing module is used for executing data writing operation on the data to be written and setting the effective area bitmap when the processing success message is received.

Optionally, the set information adding module is specifically configured to encode the valid region set information to obtain a valid region set code; and adding the effective region setting code to the structure of the first strip lock request to obtain the second strip lock request.

The present application further provides a server, comprising:

a memory for storing a computer program;

a processor for implementing the steps of the data writing method as described above when executing the computer program.

The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the data writing method as described above.

The application provides a data writing method of a storage system, which comprises the following steps: creating a first stripe lock request for a stripe corresponding to data to be written; adding effective region setting information to the first strip lock request to obtain a second strip lock request; sending the second strip lock request to a peer controller so that the peer controller processes the first strip lock request and the effective region setting information in the second strip lock request, and sending a processing success message when the processing is successful; and when the processing success message is received, performing data writing operation on the data to be written, and setting an effective area bitmap.

The effective area setting information is added into the first stripe lock request to obtain a second stripe lock request, and then the second stripe lock request is sent to the opposite-end controller, so that the opposite-end controller can process the lock request and the setting information by receiving the request once without receiving the corresponding request again, the steps of receiving the request are reduced, the data writing operation is simplified, and the data writing efficiency under the condition of recording the effective area bitmap is improved.

The application also provides a data writing device, a server and a computer readable storage medium of the storage system, which have the above beneficial effects and are not described herein again.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.

Fig. 1 is a flowchart of a data writing method of a memory system according to an embodiment of the present disclosure;

fig. 2 is a schematic structural diagram of a data writing device of a memory system according to an embodiment of the present disclosure.

Detailed Description

The core of the application is to provide a data writing method, a data writing device, a server and a computer readable storage medium of a storage system, so as to improve the efficiency of data writing and avoid the problem of delay.

In order to make the objects, 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 with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

In the related art, whether a block is reconstructed is recorded while synchronizing processing results of metadata records in a plurality of controllers of a storage device to prevent the same block from being processed by different controllers a plurality of times. In order to determine the effective area bitmap, a corresponding bitmap operation request needs to be issued in the data writing process, so that the flow of data writing operation is increased, and the data writing efficiency is reduced.

Therefore, the application provides a data writing method of a storage system, a second stripe lock request is obtained by adding effective area setting information to the first stripe lock request, and then the second stripe lock request is sent to an opposite end controller, so that the opposite end controller can process the lock request and the setting information by receiving the request once without receiving the corresponding request again, the steps of receiving the request are reduced, the data writing operation is simplified, and the data writing efficiency under the condition of recording the effective area bitmap is improved.

The following describes a data writing method of a memory system provided in the present application, by an embodiment.

Referring to fig. 1, fig. 1 is a flowchart illustrating a data writing method of a memory system according to an embodiment of the present disclosure.

In this embodiment, the apparatus may include:

s101, establishing a first stripe lock request for a stripe corresponding to data to be written;

this step is intended to create a first stripe lock request for the stripe to which the data to be written corresponds. The first stripe lock request is mainly used for locking a stripe, preventing the stripe from being operated by a plurality of devices and avoiding data from appearing as data.

Wherein, the local controller executes the step.

Further, the step may include:

step 1, receiving data to be written;

step 2, determining a stripe corresponding to data to be written;

and 3, creating a first stripe lock request for the corresponding stripe.

It can be seen that the present alternative is primarily illustrative of how to create a stripe lock request. In this alternative, data to be written is received, a stripe corresponding to the data to be written is determined, and a first stripe lock request is created for the corresponding stripe.

Obviously, in order to avoid multiple devices operating on a stripe, in this alternative, a first stripe lock request is first created for received data to be written, so as to apply for the lock request and lock the stripe.

In addition, the embodiment in this embodiment may include:

step 1, judging whether a strip corresponding to data to be written has an effective area bitmap;

and 2, if so, sending a first strip lock request to the opposite-end controller so as to process the first strip lock request by the opposite-end controller.

It can be seen that the present alternative further includes sending the first striped lock request directly. When the corresponding stripe does not have the corresponding effective area bitmap, the first stripe lock request is directly sent so as to directly perform corresponding processing. In this alternative, it is mainly determined whether a valid area bitmap exists in a stripe corresponding to data to be written, and if so, a first stripe lock request is sent to the peer controller, so that the peer controller processes the first stripe lock request.

S102, adding the effective region setting information into the first strip lock request to obtain a second strip lock request;

on the basis of S101, this step is intended to add valid region set information to the first stripe lock request, resulting in a second stripe lock request.

The valid area setting information is mainly used for setting the valid area of the data to be written so as to be set as a presence flag bit, and the position presence data corresponding to the mark is the valid area.

In the prior art, the valid region setting information is mainly sent to the peer controller separately, so that the peer controller sets the bitmap of the valid region, so as to represent the bitmap as presence data and valid region data.

Further, the step may include:

step 1, coding effective region setting information to obtain an effective region setting code;

and 2, adding the effective region setting code to the structure of the first striped lock request to obtain a second striped lock request.

It can be seen that the present alternative scheme is primarily illustrative of how the second striped lock request may be obtained. In this alternative, the valid region set information is encoded to obtain a valid region set code, and the valid region set code is added to the structure of the first striped lock request to obtain a second striped lock request.

S103, sending a second strip lock request to the opposite-end controller so that the opposite-end controller can process the first strip lock request and the effective region setting information in the second strip lock request, and sending a processing success message when the processing is successful;

on the basis of S102, this step is intended to send a second stripe lock request to the peer controller, so that the peer controller processes the first stripe lock request and the valid region setting information in the second stripe lock request, and sends a processing success message when the processing is successful.

Therefore, the second striped lock request can be sent to the opposite-end controller through the step, so that the opposite-end controller can perform corresponding processing. That is, the present embodiment is mainly applied to a dual-end controller. The local terminal mainly sends a corresponding processing request to the opposite terminal so as to realize double-terminal control and improve the reliability of control.

And S104, when the processing success message is received, executing data writing operation on the data to be written, and setting the effective area bitmap.

On the basis of S103, this step is intended to, when a processing success message is received, perform a write data operation on the data to be written, and set the effective area bitmap.

It can be seen that, on the basis that the opposite end successfully processes the request, the controller of the local end performs the write operation on the data to be written, and performs the setting operation of the bitmap again.

Wherein the processing success message includes setting information and lock information.

Correspondingly, when receiving the processing success message, executing a data writing operation on the data to be written, and setting the effective area bitmap, including:

step 1, when a successful processing message is received, performing data writing operation on data to be written according to setting information of the successful processing message;

and 2, setting the effective region bitmap according to the setting information of the successful processing message.

It can be seen that the present alternative is primarily illustrative of how this may be done. In this alternative, when a processing success message is received, a data writing operation is performed on data to be written according to the set information of the processing success message, and the effective area bitmap is set according to the set information of the processing success message.

It can be seen that, in this alternative, the writing process is performed first, and then the setting process is performed on the effective area bitmap, so as to obtain the effective area bitmap. Furthermore, when the reconstruction operation of the storage device is carried out, the range of the reconstruction operation is reduced according to the effective area bitmap, and the efficiency of the reconstruction operation is improved.

In summary, in the embodiment, the valid area setting information is added to the first stripe lock request to obtain the second stripe lock request, and then the second stripe lock request is sent to the peer controller, so that the peer controller can process the lock request and the setting information by receiving the request once without receiving the corresponding request again, steps of receiving the request are reduced, data writing operation is simplified, and data writing efficiency under the condition of recording the valid area bitmap is improved.

The following further describes a data writing method of a memory system provided in the present application by a specific embodiment.

In this embodiment, the Io write flow may include:

step 1, preparing a strip for applying a strip lock, and searching a corresponding effective area bitmap according to the strip;

step 2, judging whether the current strip is an effective area; if yes, executing step 3; if not, executing the step 4;

step 3, coding the information of the effective region without setting to a strip lock application structure;

step 4, coding the effective region setting information to a strip lock application structure;

step 5, sending a request to a peer controller;

step 6, decoding the end controller to obtain a locking request and a bitmap setting mark;

step 7, setting request processing;

step 8, when the processing is successful, waiting for locking information;

step 9, locking request processing;

step 10, the locking request processing is completed;

step 11, setting information is coded into lock information and sent back to the local terminal;

and step 12, decoding by the local terminal, processing the lock and the subsequent io flow, and setting and correlating the processing bitmap.

Therefore, in the embodiment, bitmap updating is integrated into the io writing process, and the setting information and the locking message are merged and sent, so that two times of communication between double controls are reduced, and no obvious influence is caused on a normal io writing scene. The queue queuing phenomenon in bitmap updating is omitted, and because the bitmap updating mechanism depends on the lock message mechanism, the bitmap updating mechanism depends on io processing and does not wait, but updates once every write io, and the updating efficiency is improved.

It can be seen that, in the embodiment, the valid region setting information is added to the first stripe lock request to obtain the second stripe lock request, and then the second stripe lock request is sent to the peer controller, so that the peer controller can process the lock request and the setting information by receiving the request once, without receiving the corresponding request again, thereby reducing the steps of receiving the request, simplifying the data writing operation, and improving the data writing efficiency under the condition of recording the valid region bitmap.

In the following, a data writing device provided by an embodiment of the present application is introduced, and the data writing device described below and the data writing method described above may be referred to correspondingly.

Referring to fig. 2, fig. 2 is a schematic structural diagram of a data writing device of a memory system according to an embodiment of the present disclosure.

In this embodiment, the apparatus may include:

a lock request application module 100, configured to create a first stripe lock request for a stripe corresponding to data to be written;

a setting information adding module 200, configured to add valid region setting information to the first striped lock request to obtain a second striped lock request;

a lock request sending module 300, configured to send a second stripe lock request to the peer controller, so that the peer controller processes the first stripe lock request and the valid region setting information in the second stripe lock request, and sends a processing success message when the processing is successful;

the local processing module 400 is configured to, when receiving the processing success message, perform a data writing operation on the data to be written, and set the effective area bitmap.

Optionally, the setting information adding module 200 is specifically configured to encode the valid region setting information to obtain a valid region setting code; and adding the effective region setting code to the structure of the first strip lock request to obtain a second strip lock request.

The embodiment of the application provides a server, including:

a memory for storing a computer program;

a processor for implementing the steps of the data writing method as described in the above embodiments when executing the computer program.

A computer-readable storage medium is provided in an embodiment of the present application, and has a computer program stored thereon, where the computer program, when executed by a processor, implements the steps of the data writing method according to the above embodiment.

The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.

Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.

The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

The above detailed description is provided for a data writing method, a data writing device, a server and a computer readable storage medium of a storage system provided by the present application. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种在客户端实现分级存储的方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类