WO2016086342A1 - Data write-in method, apparatus and device, and storage system - Google Patents

Data write-in method, apparatus and device, and storage system Download PDF

Info

Publication number
WO2016086342A1
WO2016086342A1 PCT/CN2014/092702 CN2014092702W WO2016086342A1 WO 2016086342 A1 WO2016086342 A1 WO 2016086342A1 CN 2014092702 W CN2014092702 W CN 2014092702W WO 2016086342 A1 WO2016086342 A1 WO 2016086342A1
Authority
WO
WIPO (PCT)
Prior art keywords
write request
atomic
write
written
address
Prior art date
Application number
PCT/CN2014/092702
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 华为技术有限公司
Priority to PCT/CN2014/092702 priority Critical patent/WO2016086342A1/en
Priority to CN201480038253.6A priority patent/CN105849688B/en
Publication of WO2016086342A1 publication Critical patent/WO2016086342A1/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

Definitions

  • the present invention relates to computer technology, and in particular, to a data writing method, apparatus, device and storage system.
  • the server writes data to the memory for caching, and then fetches the data from the memory to the disk; and, while the data is written to the disk, the memory also updates the metadata describing the data attributes. If a failure occurs during the process of writing data from the disk to the disk, the updated metadata will be inconsistent with the data actually written to the disk, making the file system inconsistent.
  • the prior art adopts various methods, such as fsck mode, write-ahead log or Journal mode, and copy-on-write (Copy-on- Write) and so on.
  • the server stores the data in the form of a log to the disk before actually writing the data, and then the server writes the data to the memory.
  • the server can reload the log stored by the disk into the memory, and then find the original corresponding data according to the log, that is, rewrite the data to the disk according to the log. Until the data is successfully written to disk, this ensures that the updated metadata is consistent with the data stored on the disk.
  • the invention provides a method, a device, a device and a storage system for data writing, which are used to solve the technical problem that the prior art guarantees high consistency of the file system and low efficiency of writing data to the disk.
  • the present invention provides a data writing method, including:
  • the non-volatile storage device NVM controller receives a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations;
  • the NVM controller stores the data corresponding to the first atomic write request and the to-be-written address corresponding to the first atomic write request to a write request memory; wherein the first atomic write request corresponds to be written
  • the address is an address in the NVM medium, and the to-be-written address corresponding to the first atomic write request includes a to-be-written address corresponding to each write operation in the first atomic write request;
  • the NVM controller performs collision detection on the first atomic write request, determines at least one first write operation concurrent group in the first atomic write request, and determines to each of the first atomic write requests Writing a data to a first sequence of data of the concurrent set of writes to the NVM medium; wherein the first write operation concurrent set of the first atomic write request includes writing at least one write of data to the NVM medium in parallel operating;
  • the NVM controller according to the first sequence and the to-be-written address corresponding to the first atomic write request, data corresponding to each first write operation concurrent group in the first atomic write request from the write The memory is requested to be written to the NVM medium.
  • the NVM controller performs collision detection on the first atomic write request, and determines at least one of the first atomic write requests.
  • the write operation concurrently groups and determines a first sequence of writing data corresponding to each of the first write operations in the first atomic write request to the NVM medium, including:
  • the NVM controller performs address conflict detection on each write operation in the first atomic write request to obtain a second write operation concurrent group in the first atomic write request; wherein, the first atomic write request The write-to-write address corresponding to each write operation in the second write operation concurrent group does not conflict;
  • the NVM controller performs channel conflict detection on each write operation in the second write operation concurrent group of the first atomic write request, and determines at least one first write operation concurrent group in the first atomic write request;
  • the first write operation of the first atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium;
  • the NVM controller determines a first order in which data corresponding to each of the first write operations in the first atomic write request is written to the NVM medium.
  • the second possible implementation in the first aspect performs an address conflict detection on each of the first atomic write requests, and obtains a second write operation in the first atomic write request.
  • the NVM controller maps a to-be-written address corresponding to each write operation in the first atomic write request to a Bloom filter bitmap
  • the NVM controller performs address conflict detection on each write operation in the first atomic write request according to the Bloom filter bitmap to obtain a second write operation concurrent group in the first atomic write request.
  • the method further includes:
  • the NVM controller receives a second atomic write request sent by the central processor; wherein the second atomic write request includes at least two non-conflicting write operations;
  • the NVM controller stores data corresponding to the second atomic write request and a to-be-written address corresponding to the second atomic write request to the write request memory; wherein the second atomic write request corresponds to The write address is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes an address to be written corresponding to each write operation in the second atomic write request;
  • the NVM controller maps a to-be-written address corresponding to each write operation in the second atomic write request to the Bloom filter bitmap, and pairs the second according to the Bloom filter bitmap
  • Each of the write operations in the atomic write request performs address conflict detection to obtain a second write operation concurrently in the second atom write request; wherein the second write operation of the second atom write request concurrently writes each write in the group The address to be written corresponding to the operation does not conflict;
  • the NVM controller performs channel conflict detection on each write operation in the second write operation concurrent group of the second atomic write request, and determines at least one first write operation concurrent group in the second atom write request;
  • the first write operation of the second atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium;
  • the NVM controller respectively corresponds to the first atom and the first atomic write request
  • the address to be written, the second sequence, and the address to be written corresponding to the second atomic write request, and the data corresponding to each of the first write operations of the first atomic write request are concurrently combined with the second
  • the data corresponding to each of the first write operations of the atomic write request is written to the NVM medium.
  • the method further includes:
  • the flag bit corresponding to the first atomic write request in the Bloom filter bitmap is cleared.
  • the NVM controller performs the first atomic write request Collision detection, determining at least one first write operation concurrent group in the first atomic write request, and determining to write data corresponding to each first write operation concurrent set in the first atomic write request to the NVM medium After the first sequence, the method further includes:
  • the NVM controller sends an atomic write success message to the central processor
  • the NVM controller receives an atomic write end command sent by the central processor.
  • an embodiment of the present invention provides a data writing apparatus, including:
  • a receiving module configured to receive a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations;
  • a storage module configured to store data corresponding to the first atomic write request and a to-be-written address corresponding to the first atomic write request to a write request memory; wherein the first atomic write request corresponds to a write request
  • the address is an address in the NVM medium, and the to-be-written address corresponding to the first atomic write request includes a to-be-written address corresponding to each write operation in the first atomic write request;
  • a conflict detection module configured to perform collision detection on the first atomic write request, determine at least one first write operation concurrent group in the first atomic write request, and determine each of the first atomic write requests Writing a first sequence of concurrent write data to the first sequence of the NVM media; wherein the first write operation concurrent set of the first atomic write request includes writing data to at least one of the NVM media in parallel Write operation
  • a data writing module configured to: according to the first sequence and the address to be written corresponding to the first atomic write request, data corresponding to each first write operation concurrent group in the first atomic write request from the A write request memory is written to the NVM medium.
  • the conflict detection module includes:
  • An address conflict detecting unit configured to perform address conflict detection on each write operation in the first atomic write request, to obtain a second write operation concurrent group in the first atomic write request; wherein the first atom write The second write operation of the request does not conflict with the address to be written corresponding to each write operation in the concurrent group;
  • a channel conflict detecting unit configured to perform channel conflict detection on each write operation in the second write operation concurrent group of the first atomic write request, and determine at least one first write operation concurrent group in the first atomic write request Wherein the first write operation of the first atomic write request and the data corresponding to each write operation in the concurrent write group are written to the channel of the NVM medium without conflict;
  • a determining unit configured to determine a first sequence of writing data corresponding to each of the first write operations in the first atomic write request to the NVM medium.
  • the address conflict detection unit is specifically configured to: perform each write operation in the first atomic write request Corresponding to-be-written address is mapped to the Bloom filter bitmap, and address conflict detection is performed on each write operation in the first atomic write request according to the Bloom filter bitmap to obtain the first atomic write
  • the second write operation in the request is concurrently grouped.
  • the receiving module is further configured to receive a second atomic write request sent by the central processing unit;
  • the second atomic write request includes at least two non-conflicting write operations;
  • the storage module is further configured to store data corresponding to the second atomic write request and a to-be-written address corresponding to the second atomic write request to the write request memory; wherein the second atomic write request
  • the corresponding address to be written is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes an address to be written corresponding to each write operation in the second atomic write request;
  • the address conflict detecting unit is further configured to map the to-be-written address corresponding to each write operation in the second atomic write request to the Bloom filter bitmap, and according to the Bloom filter bitmap Performing address conflict detection on each write operation in the second atomic write request to obtain a second write operation concurrently in the second atom write request; wherein the second write operation of the second atom write request is concurrent The address to be written corresponding to each write operation in the group does not conflict; and, The Bloom filter bitmap determines that an address conflict occurs between the to-be-written address corresponding to each write operation in the first atomic write request and the to-be-written address corresponding to each write operation in the second atomic write request;
  • the channel detecting unit is further configured to perform channel conflict detection on each write operation in the second write operation concurrent group of the second atom write request, and determine at least one first write operation in the second atom write request a concurrent group; wherein, the second write operation of the second atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium;
  • the determining unit is further configured to determine a second sequence of writing data corresponding to each of the first write operations in the second atomic write request to the NVM medium;
  • the data writing module is further configured to: according to the first sequence and the to-be-written address corresponding to the first atomic write request, the second sequence, and the to-be-written address corresponding to the second atomic write request And data corresponding to each first write operation concurrent group of the first atomic write request and data corresponding to each first write operation concurrent group of the second atomic write request are written in parallel to the NVM medium.
  • the device further includes:
  • a clearing module configured to: after the data writing module writes data corresponding to all write operations of the first atomic write request to the NVM medium, clear a Bloom filter bitmap corresponding to the first atomic write request Sign bit.
  • the device further includes:
  • a sending module configured to perform collision detection on the first atomic write request by the conflict detection module, determine at least one first write operation concurrent group in the first atomic write request, and determine to use the first atom After the first sequence of the first write operation concurrently in the write request is written into the first sequence of the NVM medium, an atomic write success message is sent to the central processor;
  • the receiving module is further configured to receive an atomic write end command sent by the central processing unit.
  • an embodiment of the present invention provides a storage system, including: a central processing unit, a write request memory, a non-volatile storage device NVM medium, and the NVM controller according to any one of claims 1 to 6.
  • the method, device, device and storage system for data writing store the data corresponding to the received first atomic write request and the address to be written to the write request by the NVM controller. And performing, in the storage, the conflict detection of the first atomic write request, obtaining at least one first write operation concurrent group in the first atomic write request, and determining to concurrently execute each first write operation in the first atomic write request.
  • the corresponding data of the group is written into the first sequence of the NVM medium, so that the data corresponding to each first write operation in the first atomic write request is concurrently grouped according to the first sequence and the address to be written corresponding to the first atomic write request.
  • Write NVM media from the write request memory The method provided by the embodiment of the invention not only improves the efficiency of data writing, but also saves the cost of ensuring the consistency of the file system, and avoids unnecessary conflicts between the writing operations, thereby ensuring the reliability of the file system.
  • FIG. 1 is a schematic diagram of a single client network architecture provided by the present invention.
  • FIG. 2 is a schematic diagram of a multi-client network architecture provided by the present invention.
  • FIG. 3 is a schematic flowchart diagram of Embodiment 1 of a method for writing data according to the present invention
  • Embodiment 4 is a schematic flowchart of Embodiment 2 of a method for writing data according to the present invention
  • FIG. 5 is a schematic flowchart diagram of Embodiment 3 of a method for writing data according to the present invention.
  • FIG. 6 is a schematic flowchart diagram of Embodiment 4 of a method for writing data according to the present invention.
  • FIG. 7 is a schematic structural diagram of Embodiment 1 of a data writing apparatus according to the present invention.
  • FIG. 8 is a schematic structural diagram of Embodiment 2 of a data writing apparatus according to the present invention.
  • FIG. 9 is a schematic structural diagram of Embodiment 3 of a data writing apparatus according to the present invention.
  • FIG. 10 is a schematic structural diagram of Embodiment 4 of a data writing apparatus according to the present invention.
  • Embodiment 5 of a data writing device according to the present invention.
  • Embodiment 6 is a schematic structural diagram of Embodiment 6 of a data writing device according to the present invention.
  • FIG. 13 is a schematic structural diagram of an embodiment of a storage system according to the present invention.
  • the embodiment of the present invention can be applied to a scenario of a single client.
  • the network architecture involved in the scenario specifically includes a client and at least one server, and the client can initiate a request for data atomic writing to multiple servers at the same time, or can be a single client.
  • the terminal initiates a plurality of atomic write requests to the same server in a preset time period.
  • FIG. 1 specifically shows that a single client initiates to multiple servers.
  • a request written by an atom the embodiment of the present invention is applicable to a multi-client scenario, where the network architecture involved in the scenario includes multiple clients and at least one server, and multiple clients may initiate to the same server within a preset time period.
  • the atomic write request can also initiate an atomic write request to multiple servers.
  • multiple clients send to the same server.
  • a request written by an atom may be a user-oriented communication device, and a plurality of servers shown in FIG. 1 or FIG. 2, each of which receives a request for atomic write of the client.
  • the operations performed are the same. Therefore, the embodiments of the present invention are described in the specific implementation process of a server.
  • the other servers are similar to the execution process of the server, and are not described in detail in the embodiments of the present invention.
  • the embodiments of the present invention are directed to the technical problem that the prior art has high cost and low data writing efficiency when ensuring file system consistency.
  • FIG. 3 is a schematic flowchart diagram of Embodiment 1 of a method for writing data according to the present invention.
  • This embodiment relates to a non-volatile storage (NonVolatile Memory, hereinafter referred to as NVM) controller, a central processing unit, and a write request memory, which can be integrated into a server.
  • NVM non-volatile storage
  • the method includes:
  • the NVM controller receives a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations.
  • the client sends a first atomic write request to the server.
  • the central processor in the server first sends an atomic write request start command to the NVM controller; after receiving the atomic write request start command, the NVM controller pulls up the atomic write request signal.
  • the level will be pulled up to identify to the central processor that the current atomic write request process begins, ie to the center
  • the processor indicates that the current atomic write request process of the NVM controller is available.
  • the NVM controller pulls up the atomic write request signal level by pulling the atomic write request signal level by means of a pulse.
  • the central processor determines that the current atomic write request of the NVM controller is available according to the level of the atomic write request signal, and sends the received first atomic write request to the NVM controller.
  • the first atomic write request includes at least two non-conflicting write operations. It should be noted that the write operation in the first atomic write request sent by the central processing unit is sent in a certain order. Therefore, the first atomic write request mentioned herein includes at least two non-conflicting write operations, which means The two adjacent write operations do not conflict, and the conflict here may be that the corresponding write addresses of the two adjacent write operations do not conflict and the data corresponding to the two adjacent write operations are written to the NVM medium. There is no conflict in the channel.
  • the NVM controller stores the data corresponding to the first atomic write request and the to-be-written address corresponding to the first atomic write request to a write request memory, where the first atomic write request corresponds to be written.
  • the address is an address in the NVM medium, and the to-be-written address corresponding to the first atomic write request includes a to-be-written address corresponding to each write operation in the first atomic write request.
  • the NVM controller After receiving the first atomic write request sent by the central processing unit, the NVM controller stores the data corresponding to the first atomic write request and the to-be-written address corresponding to the first atomic write request to the write request memory. That is, the first received write operation, the corresponding data and the address to be written are first stored in the write request memory, and the subsequent write operation, the corresponding data and the address to be written are stored in the write request memory. It should be noted that the address to be written corresponding to the first atomic write request is actually an address in the NVM medium, and the address to be written corresponding to the first atomic write request includes the first atomic write request.
  • the data to be written corresponding to each write operation includes data corresponding to each write operation in the first atomic write request. That is to say, the NVM controller finally writes the data corresponding to the first atomic write request into the NVM medium according to the address to be written corresponding to the first atomic write request.
  • the write request memory has the characteristics of non-volatileness and small read delay, and may be a magnetic random access memory (MRAM) or a resistive random access memory (Resistive Random Access Memory). , hereinafter referred to as RRAM), may also be Ferromagnetic Random Access Memory (FRAM), or a new type of non-volatile memory such as Phase Change Random Access Memory (PCRAM). quality.
  • the NVM controller performs collision detection on the first atomic write request, determines at least one first write operation concurrent group in the first atomic write request, and determines each of the first atomic write requests.
  • the NVM controller performs collision detection on the received first atomic write request, and determines at least one first write operation concurrent group in the first atomic write request, and each write operation included in each first write operation concurrent group Is a write operation in which the corresponding data can be written to the NVM medium in parallel or simultaneously, and the addresses to be written corresponding to the respective write operations do not conflict with each other, and the channels corresponding to the data written by the respective write operations are not written into the NVM medium. A conflict has occurred. It should be noted that the addresses to be written corresponding to the respective write operations in the first write operation concurrent group do not conflict with each other, and may be on the Bloom filter bitmap of the NVM controller.
  • the corresponding address to be written corresponds to the bit position on the Bloom filter bitmap does not overlap, and the detection result calculated by the computer according to a certain collision detection algorithm is different for the address to be written corresponding to each write operation by the computer;
  • the channel used for writing the data corresponding to each write operation in the first write operation concurrent group does not conflict with the channel used for writing the NVM medium.
  • the channel used for each write operation is different when the data is written to the NVM medium. of. That is to say, the data corresponding to each write operation in the first write operation concurrent group in the first atomic write request can be simultaneously written to the NVM medium through different channels.
  • the NVM controller may also determine a first order between the concurrent sets of the first write operations in the first atomic write request when the first atomic write request is detected for conflict. That is, the first atomic write request may include at least one first write operation concurrent group, and the data of the different first write operation concurrent groups written to the NVM medium is written in the first order, and each write The data corresponding to each write operation in the operation concurrent group can be written to the NVM medium in parallel.
  • the NVM controller receives the first atomic write request within a preset time period, and the first atomic write request includes three write operations, which are a, b, and c, respectively.
  • the NVM controller performs collision detection on the first atomic write request after storing the data corresponding to the first atomic write request and the address to be written into the write request memory.
  • the NVM controller is paired After the first atomic write request performs collision detection, it is known that a and b in the first atomic write request do not collide, but c and b collide, so the NVM controller determines that a and b constitute the first write operation and concurrently groups A, c constitutes the first write operation concurrent group B.
  • the first sequence of the first write operation in the first atomic write request determined by the NVM controller is the first write operation, and the data corresponding to the group A is written to the NVM medium before the first write operation concurrent group B.
  • S104 The NVM controller, according to the first sequence and the to-be-written address corresponding to the first atomic write request, data corresponding to each first write operation concurrent group in the first atomic write request from the write The memory is requested to be written to the NVM medium.
  • the NVM controller first extracts data corresponding to a and b in the first write operation concurrent A in the first atomic write request from the write request memory, and writes the NVM in parallel. In the medium, the data corresponding to c is then taken out of the write request memory and written into the NVM medium.
  • the NVM controller when the NVM controller receives the atomic write request, only the data corresponding to the write operation in the atom is written to the disk one by one in sequence, the data writing efficiency is very low, and the file system is consistent in the guarantee.
  • the NVM controller when the NVM controller writes data to the NVM medium, the data corresponding to the write operation in the first atomic write request is concurrently executed. Recombination, the data corresponding to the write operation of the NVM medium can be concurrently written into the NVM medium, and the efficiency of data writing is improved.
  • the embodiment of the present invention uses the write request memory to cache the data corresponding to the first atomic write request and
  • the address to be written the non-volatile nature of the write request memory guarantees the consistency of the file system (that is, the process of writing data from the write request memory to the NVM medium, even if there is a failure, the data stored in the write request memory will not Lost, when the fault disappears, the data can continue to be written to the NVM media until it is successfully written to the NVM media), saving existing Log surgery cost disk, reducing the costs to ensure the consistency of the file system.
  • a disk is used in the data writing process, and the storage write space on the disk is in units of memory blocks, that is, one memory block may include addresses corresponding to multiple write operations. Then, when a write operation wants to write data to its corresponding address (that is, write to the disk), it needs to occupy all the storage blocks. If the address corresponding to other write operations also belongs to the storage block, then other write operations are performed. A conflict occurs when data is written.
  • the invention adopts With NVM media, the granularity of its storage space is in bits. It is also the scenario of writing data described above. Since each write operation is for different bits, there is no overlap between the two, so it will not cause conflict. Therefore, the NVM medium is used in the embodiment of the present invention to avoid unnecessary conflicts and ensure the reliability of the file system.
  • the data writing method provided by the embodiment of the present invention stores the data corresponding to the received first atomic write request and the address to be written into the write request memory through the NVM controller, and conflicts with the first atomic write request. Obtaining at least one first write operation concurrently in the first atomic write request, and determining a first sequence of writing data corresponding to each first write operation concurrent set in the first atomic write request to the NVM medium, thereby And according to the first sequence and the address to be written corresponding to the first atomic write request, the data corresponding to each of the first write operations in the first atomic write request is written from the write request memory to the NVM medium.
  • the method provided by the embodiment of the invention not only improves the efficiency of data writing, but also saves the cost of ensuring the consistency of the file system, and avoids unnecessary conflicts between the writing operations, thereby ensuring the reliability of the file system.
  • FIG. 4 is a schematic flowchart diagram of Embodiment 2 of a method for writing data according to the present invention.
  • the embodiment relates to the NVM controller performing collision detection on the received first atomic write request, and determining the first write operation concurrently in the first atomic write request.
  • the method includes:
  • S201 The NVM controller performs address conflict detection on each write operation in the first atomic write request, and obtains a second write operation concurrent group in the first atomic write request; wherein, the first atomic write request The second write operation does not conflict with the address to be written corresponding to each write operation in the concurrent group.
  • the NVM controller after receiving the first atomic write request, performs address conflict detection on the address corresponding to each write operation in the first atomic write request.
  • the NVM controller may be detected by using a preset detection algorithm, or may be detected by matching degrees between addresses, and may also be detected. It is mapped to a certain bit bitmap according to the address corresponding to each write operation, and is detected by checking whether the bit bitmap has overlap.
  • the NVM controller writes each write operation in the first atomic write request.
  • the method includes:
  • S301 The NVM controller maps the to-be-written address corresponding to each write operation in the first atomic write request to the Bloom filter bitmap.
  • the NVM controller divides the storage space of the NVM medium into a linear space according to a certain granularity, and establishes a bloom filter, and the address to be written corresponding to the write operation of the first atomic write request can be mapped.
  • the bit on the bitmap of the Bloom filter that is, the address to be written corresponding to a write operation corresponds to one or more bits of the Bloom filter, so that a first mapping relationship can be optionally established, the first The mapping relationship includes the mapping relationship between the address to be written corresponding to the write operation in the first atomic write request and the bit on the Bloom filter bitmap.
  • S302 The NVM controller performs address conflict detection on each write operation in the first atomic write request according to the Bloom filter bitmap, and obtains a second write operation concurrent group in the first atomic write request.
  • the NVM controller may detect, according to the first mapping relationship in the Bloom filter, the to-be-written address corresponding to each write operation in the received first atomic write request, that is, the NVM controller is configured according to the first mapping.
  • the relationship detecting whether the address to be written corresponding to each write operation in the first atomic write request corresponds to whether the bits on the Bloom filter bitmap overlap, and whether the address of each write operation in the first atomic write request occurs is known. Collision, thereby dividing the write operation in which the address conflict does not occur in the first atomic write request into the second write operation concurrent group.
  • the first atomic write request includes five write operations of a, b, c, d, and e
  • a corresponds to 1-on the Bloom filter bitmap.
  • 10 bits corresponds to 11-20 bits on the Bloom filter bitmap
  • c corresponds to 21-30 bits on the Bloom filter bitmap
  • d corresponds to 30-40 bits on the Bloom filter bitmap
  • e corresponds 41-50 bits on the Bloom filter bitmap.
  • the NVM controller determines, according to the first mapping relationship, that the addresses to be written corresponding to a and b do not conflict, and the addresses to be written corresponding to c and b do not conflict, and the addresses to be written corresponding to d and c conflict, d
  • the address to be written corresponding to e does not conflict. Therefore, the NVM controller determines that a, b, and c constitute a second write operation concurrently with group A, and d and e constitute a second write operation concurrently with group B. That is to say, the addresses to be written corresponding to the respective write operations included in the second write operation concurrent group do not conflict.
  • S202 The NVM controller performs channel conflict detection on each write operation in the second write operation concurrent group of the first atomic write request, and determines at least one first write operation in the first atom write request.
  • a concurrent group wherein, the first write operation of the first atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium.
  • the NVM controller determines a first sequence of writing data corresponding to each of the first write operations in the first atomic write request to the NVM medium.
  • the first write operation of the first atomic write request does not conflict with the write address of the write operation included in the concurrent group and the data written to the NVM medium.
  • the NVM controller performs channel collision detection on the second write operation concurrent group A in the first atomic write request and the second write operation concurrent group B in the first atomic write request, respectively. Determining the second write operation in the first atomic write request.
  • the data corresponding to a and b in the group A is written to the channel of the NVM medium without conflict, but the data corresponding to c is written into the channel of the NVM medium and the data corresponding to b.
  • the channel written to the NVM medium conflicts, and the NVM controller determines that the second write operation in the first atomic write request includes two first write operations concurrent group A' and a first write operation concurrent group B'.
  • the first write operation concurrent group A' includes a and b
  • the first write operation concurrent group B' includes c (since the first write operation concurrent group B' includes only one c, so c performs channel writing when data is written
  • the write operation of the first write operation concurrent group B' that does not exist does not of course conflict.
  • the NVM controller also determines that the second write operation concurrently the data corresponding to d and e in the group B is written to the NVM medium, and the NVM controller determines that the second write operation includes a first A write operation concurrently groups C', the first write operation concurrent group C' including d and e.
  • the NVM controller maps to a position on the Bloom filter bitmap and the first mapping relationship according to each write operation in the first atomic write request, and the NVM controller determines each of the first atomic write requests.
  • the first sequence of data written to the NVM medium by a write operation concurrent group is: the data corresponding to the first write operation concurrent group A' is written to the NVM medium before the data corresponding to the first write operation concurrent group B' is written to the NVM medium.
  • the data corresponding to the first write operation concurrent group B' is written to the NVM medium before the data corresponding to the first write operation concurrent group C' is written to the NVM medium.
  • the NVM controller writes data corresponding to each first write operation to the NVM medium according to the first sequence determined above. That is, the NVM controller first writes the data corresponding to a and b in the first write operation concurrent group A' to the NVM medium in parallel, and then writes the data corresponding to c in the first write operation concurrent group B' to the NVM medium, and finally The data corresponding to d and e in the first write operation concurrent group C' is written into the NVM medium in parallel.
  • the NVM controller determines the first write operation in the first atomic write request and the first sequence of the first write operation concurrent data is written into the first sequence of the NVM medium
  • the NVM controller sends the NVM controller to the central processor.
  • the NVM controller sends an atomic write request end command, which implicitly informs the NVM controller that the data cached in the write request memory can be written to the NVM medium.
  • the NVM controller sends an atomic write request success message to the central processor on the premise that the central processor does not continue to send an atomic write request to the NVM controller in a short time, then the NVM controller determines the first order. After that, an atomic write request success message is sent to the central processor.
  • the NVM controller writes the data corresponding to all the write operations of the first atomic write request to the NVM medium, the flag corresponding to the first atomic write request in the Bloom filter bitmap is cleared, and the write request is performed.
  • the memory cache space is reclaimed to improve the storage space utilization of the write request memory.
  • the data writing method provided by the embodiment of the present invention stores the data corresponding to the received first atomic write request and the address to be written into the MRAM through the NVM controller, and compares the first atom according to the Bloom filter bitmap. And obtaining, by the write request, the at least one first write operation concurrent group in the first atomic write request, and determining to write the data corresponding to each first write operation concurrent group in the first atomic write request to the first of the NVM medium And sequentially, according to the first sequence and the address to be written corresponding to the first atomic write request, the data corresponding to each first write operation concurrent group in the first atomic write request is written from the write request memory to the NVM medium.
  • the method provided by the embodiment of the invention not only improves the efficiency of data writing, but also saves the cost of ensuring the consistency of the file system, and avoids unnecessary conflicts between the writing operations, thereby ensuring the reliability of the file system.
  • FIG. 6 is a schematic flowchart diagram of Embodiment 4 of a method for writing data according to the present invention.
  • the embodiment relates to data corresponding to the data of the first atomic write request and the second atomic write request after the NVM controller receives the second atomic write request sent by the central processor.
  • the specific process of writing to NVM media As shown in FIG. 6, the method includes:
  • the NVM controller receives a second atomic write request sent by the central processing unit; wherein the second atomic write request includes at least two non-conflicting write operations.
  • the client after sending the first atomic write request to the server, the client still sends a second atomic write request to the server. Therefore, after transmitting the first atomic write request to the NVM controller, the central processor continues to send the second atomic write request to the NVM controller.
  • the process by which the NVM controller processes the first atomic write request can be performed in synchronization with the process in which the NVM controller receives the second atomic write request.
  • the write operation in the second atomic write request sent by the central processing unit is also sent in a certain order. Therefore, the second atomic write request mentioned herein includes at least two non-conflicting write operations, which refer to adjacent ones. The two write operations do not conflict, and the conflict here may be that the adjacent write addresses of the two adjacent write operations do not conflict, and the data corresponding to the two adjacent write operations are written into the NVM medium. No conflicts occur.
  • the NVM controller stores the data corresponding to the second atomic write request and the to-be-written address corresponding to the second atomic write request to the write request memory; wherein the second atomic write request corresponds to The write address is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes a to-be-written address corresponding to each write operation in the second atomic write request.
  • the NVM controller stores the data corresponding to the second atomic write request and the to-be-written address corresponding to the second atomic write request to the write request memory, and the NVM controller writes the first atom in the first embodiment.
  • the process of requesting the corresponding data and the address to be written corresponding to the first atomic write request is stored in the write request memory, and details are not described herein again.
  • the data corresponding to the second atomic write request includes data corresponding to each write operation in the second atomic write request.
  • the NVM controller maps the to-be-written address corresponding to each write operation in the second atomic write request to the Bloom filter bitmap, and pairs the second according to the Bloom filter bitmap.
  • Each of the write operations in the atomic write request performs address conflict detection to obtain a second write operation concurrently in the second atom write request; wherein the second write operation of the second atom write request concurrently writes each write in the group The corresponding address to be written to the operation does not conflict.
  • the NVM controller not only maps the to-be-written address corresponding to the write operation of the first atomic write request to the Bloom filter bitmap, but also writes the second atomic write request.
  • the corresponding to-be-written address of the operation is mapped to the Bron filter bitmap, and the specific mapping process may be performed by referring to the process of mapping the to-be-written address corresponding to the first atomic write request in the foregoing implementation to the Bloom filter. This will not be repeated here.
  • the NVM controller detects, according to the mapping relationship between the address to be written and the bit in the Bron filter bitmap, that the address to be written corresponding to each write operation in the second atomic write request corresponds to Whether the bits on the Bloom filter bitmap overlap, it is possible to know whether an address conflict occurs in each write operation in the second atomic write request, thereby dividing the write operation in the second atomic write request without an address conflict into the first
  • the second write operation in the two-atom write request is concurrently grouped.
  • the NVM controller performs channel conflict detection on each write operation in the second write operation concurrent group of the second atomic write request, and determines at least one first write operation concurrent group in the second atomic write request; The first write operation of the second atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium.
  • S405 The NVM controller determines a second sequence of writing data corresponding to each of the first write operations in the second atomic write request to the NVM medium.
  • the specific process of the first write operation of the second atomic write request is obtained by the NVM controller, and the specific operation of the first write operation in the first atomic write request is obtained by referring to the NVM controller in the third embodiment. The process is performed, and details are not described herein again.
  • the first write operation of the second atomic write request does not conflict with the write address and the data written to the NVM medium between the write operations included in the concurrent set.
  • the NVM controller determines a process of writing data corresponding to each of the first write operations in the second atomic write request to the second sequence of the NVM medium, and determining the first atom by referring to the NVM controller in the third embodiment above.
  • the process of writing the first sequence of the first write operation in the write request to the first sequence of the NVM medium is performed, and details are not described herein again.
  • the NVM controller determines, according to the Bloom filter bitmap, a to-be-written address corresponding to each write operation in the first atomic write request and a write operation corresponding to each write operation in the second atomic write request.
  • the address does not have an address conflict.
  • the NVN controller determines, respectively, the first sequence of the first write operation in the first atomic write request and the first write operation in the first atomic write request
  • the first sequence of the concurrent write data is written into the NVM medium
  • the NVM controller continues to combine the Bloom filter.
  • the mapping relationship between the address to be written and the bit corresponding to the write operation of the first atomic write request in the bitmap, and the mapping relationship between the address to be written and the bit corresponding to the write operation of the second atomic write request determine the first atomic write
  • the address to be written corresponding to each write operation in the request does not have an address conflict with the to-be-written address corresponding to each write operation in the second atomic write request, that is, the first atomic write request and the second atomic write request may constitute One atom writes a concurrency group, and the atom writes a concurrency group
  • the first atomic write request and the second atomic write request are executed by the data write process.
  • the NVM controller performs parallel according to the first sequence and the to-be-written address corresponding to the first atomic write request, the second sequence, and the address to be written corresponding to the second atomic write request.
  • the data corresponding to each of the first write operations of the first atomic write request and the data of the first write operation of the second atomic write request are written to the NVM medium.
  • the “parallel” herein refers to the parallelism of the data writing process of the two atomic write requests. Executed, and the data corresponding to the atomic write request is still written to the NVM medium in the order of the respective first write operation concurrent groups. That is, the parallel execution of the data write process refers to the first atom write request.
  • the second atom write request can also perform data writing, but the order of the data corresponding to the two atom write requests is written to the NVM medium. independent.
  • the NVM controller when the NVM controller writes the data corresponding to the first atomic write request and the data corresponding to the second atomic write request into the NVM medium in parallel, it is assumed that the central processor does not continue to the NVM controller in a short time. After the atomic write request is sent, the NVM controller sends an atomic write request success message to the central processor after determining the first order and the second order.
  • the NVM controller determines the data write of the first write operation concurrent group and each first write operation concurrent group in each atomic write request. After the first sequence of NVM media, address conflict detection is still performed on two adjacent atomic write requests in all atomic write requests (the atomic write requests received by the NVM controller are themselves sequential, because the central processor Is an atomic write request sent sequentially to determine the atomic write concurrency group, the atomic write concurrency group includes at least one atomic write request executed in parallel by the data write process (if an atomic write concurrency group includes an atomic write request, then Think of yourself as being in parallel with yourself).
  • the NVM controller writes the atom to each atom in the concurrent group according to the first order of the first write operation concurrent data in each atomic write request and the first sequence of the NVM medium and the address to be written corresponding to the atomic write request.
  • the data corresponding to each of the first write operations of the write request is written from the write request memory to the NVM medium.
  • 1# atomic write request includes 3 write operations, which are a, b, c; 2# atomic write request includes 3 write operations, respectively d, e, f; 3# atomic write request includes 2 write operations , respectively, m, n.
  • the NVM controller After the NVM controller performs collision detection on the 1# atomic write request, the NVM controller determines that a and b in the 1# atomic write request constitute the first write operation concurrent group A, and c constitutes the first write operation concurrent group B. After the NVM controller performs collision detection on the 2# atomic write request, it is determined that d constitutes the first write operation and the group C is formed, and e and f constitute the first write operation concurrent group D. Similarly, after the NVM controller performs collision detection on the 3# atomic write request, it is determined that m and n constitute the first write operation concurrent group E.
  • the first sequence of the first write operation of the 1# atomic write request determined by the NVM controller is the first write operation, and the data corresponding to the send group A is written to the NVM medium before the first write operation concurrent group B; NVM The first write operation of the 2# atomic write request determined by the controller is the second write operation. The second write operation is performed by the first write operation. The data corresponding to the send group C is written to the NVM medium before the first write operation concurrent group D; the NVM controller determines The first write operation in the 3# atomic write request The second order of the concurrent write group is to directly write the data corresponding to the first write operation concurrent group E to the NVM medium.
  • the NVM controller determines, according to the mapping relationship between the address to be written and the bit in the Bloom filter bitmap, that the 1# atomic write request, the 2# atomic write request, and the 3# atomic write request correspond to each other. Whether the bits of the bitmap of the filter overlap or not to determine the atomic write request concurrent group. Assuming that the bits of the Bloom filter bitmap do not overlap corresponding to the 1# atomic write request, the 2# atomic write request, and the 3# atomic write request, then the 1# atomic write request, the 2# atomic write request, and the 3 are determined.
  • the # atomic write request can constitute an atomic write request concurrent group, that is, the 1# atomic write request, the 2# atomic write request, and the 3# atomic write request can simultaneously perform the data write process, and the three atomic write requests are used for data writing.
  • the order is independent of each other. That is, when the NVM controller writes the data corresponding to the 1# atomic write request to the NVM medium, the NVM controller can also write the data corresponding to the 2# atomic write request and the 3# atomic write request to the NVM medium, respectively. However, the order in which the NVM controller writes the data corresponding to the 1# atomic write request, the 2# atomic write request, and the 3# atomic write request to the NVM medium is also performed in the order of the respective first write operations concurrently.
  • the data writing method provided by the embodiment of the present invention determines, by the NVM controller, each of the to-be-written address and the second atomic write request corresponding to each write operation in the first atomic write request according to the Bloom filter bitmap.
  • the address to be written corresponding to the write operation does not cause an address conflict, so that the address to be written, the second sequence, and the second atomic write request corresponding to the first atomic write request according to the first order and the second atomic write request, respectively
  • the data corresponding to each first write operation of the first atomic write request and the data corresponding to the first write operation of the second atomic write request are written into the NVM medium in parallel, thereby further improving The efficiency of data writing.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
  • FIG. 7 is a schematic structural diagram of Embodiment 1 of a data writing apparatus according to the present invention.
  • the device can be integrated into the NVM controller or it can be an NVM controller.
  • the apparatus includes: a receiving module 10, a storage module 11, a conflict detecting module 12, and a data writing module 13.
  • the receiving module 10 is configured to receive a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations; and the storage module 11 is configured to write the first atom And the address to be written corresponding to the first atomic write request is stored in the write request memory; wherein the address to be written corresponding to the first atomic write request is an address in the NVM medium, the first The address to be written corresponding to the atomic write request includes the address to be written corresponding to each write operation in the first atomic write request; the conflict detection module 12 is configured to perform collision detection on the first atomic write request, and determine Determining at least one first write operation concurrently in the first atomic write request, and determining a first sequence of writing data corresponding to each first write operation concurrent set in the first atomic write request to the NVM medium; The first write operation concurrent group in the first atomic write request includes at least one write operation of writing data to the NVM medium in parallel; the data write module 13 is configured to perform according to the first order The first
  • the data writing device provided in the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
  • FIG. 8 is a schematic structural diagram of Embodiment 2 of a data writing apparatus according to the present invention.
  • the conflict detection module 12 further includes: an address conflict detecting unit 121, configured to perform address conflict detection on each write operation in the first atomic write request, Obtaining a second write operation in the first atomic write request and concurrently generating the group; wherein the first original The second write operation of the sub-write request does not conflict with the address to be written corresponding to each write operation in the concurrent group; the channel conflict detecting unit 122 is configured to perform the second write operation of the first atomic write request in the concurrent group Performing channel conflict detection for each write operation, determining at least one first write operation concurrent group in the first atomic write request; wherein, the first write operation of the first atomic write request corresponds to each write operation in the concurrent write group The channel in which the data is written to the NVM medium does not conflict; the determining unit 123 is configured to determine a first sequence of writing data corresponding to each of the first
  • the address conflict detecting unit 121 is specifically configured to map the to-be-written address corresponding to each write operation in the first atomic write request to a Bloom filter bitmap, and according to the Bloom filter bit. The figure performs address conflict detection on each write operation in the first atomic write request, and obtains a second write operation in the first atomic write request to be concurrently grouped.
  • the data writing device provided in the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
  • the receiving module 10 is further configured to receive a second atomic write request sent by the central processing unit, where the second atomic write request includes at least two non-conflicting write operations;
  • the storage module 11 is further configured to store the data corresponding to the second atomic write request and the to-be-written address corresponding to the second atomic write request to the write request memory; wherein the second atomic write request
  • the corresponding address to be written is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes an address to be written corresponding to each write operation in the second atomic write request;
  • the address conflict detecting unit 121 is further configured to map the to-be-written address corresponding to each write operation in the second atomic write request to the Bloom filter bitmap, and according to the Bloom filter bitmap Performing address conflict detection on each write operation in the second atomic write request to obtain a second write operation concurrently in the second atom write request; wherein the second write operation of the second atom write request is concurrent
  • the address to be written corresponding to each write operation in the group does not conflict; and is further configured to determine, according to the Bloom filter bitmap, a to-be-written address corresponding to each write operation in the first atomic write request An address conflict does not occur in the address to be written corresponding to each write operation in the second atomic write request;
  • the channel detecting unit 122 is further configured to perform a second write operation on the second atom write request and Each of the write operations in the issue group performs channel conflict detection to determine at least one first write operation concurrent set in the second atom write request; wherein the second write operation of the second atom write request is in each of the concurrent write groups The channel corresponding to the write operation is written to the channel of the NVM medium without conflict;
  • the determining unit 123 is further configured to determine a second sequence of writing data corresponding to each of the first write operations in the second atomic write request to the NVM medium;
  • the data writing module 13 is further configured to: according to the first sequence and the to-be-written address corresponding to the first atomic write request, the second sequence, and the to-be-written address corresponding to the second atomic write request And data corresponding to each first write operation concurrent group of the first atomic write request and data corresponding to each first write operation concurrent group of the second atomic write request are written in parallel to the NVM medium.
  • the data writing device provided in the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
  • FIG. 9 is a schematic structural diagram of Embodiment 3 of a data writing apparatus according to the present invention.
  • the apparatus further includes: a clearing module 14 for writing, in the data writing module 13, data corresponding to all write operations of the first atomic write request to the NVM medium. Thereafter, the flag bit corresponding to the first atomic write request in the Bloom filter bitmap is cleared.
  • FIG. 10 is a schematic structural diagram of Embodiment 4 of a data writing apparatus according to the present invention. Based on the embodiment shown in FIG. 8 above, as shown in FIG. 10, the device further includes: a sending module 14.
  • the sending module 14 is configured to perform collision detection on the first atomic write request by the conflict detection module 12, determine at least one first write operation concurrent group in the first atomic write request, and determine After writing the data corresponding to each of the first write operations in the first atomic write request to the first sequence of the NVM medium, sending an atomic write success message to the central processor; then the receiving module 10, Also used to receive an atomic write end command sent by the central processor.
  • the data writing device provided in the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
  • FIG. 11 is a schematic structural diagram of Embodiment 5 of a data writing device according to the present invention. As shown in FIG. 11, the device includes a receiver 20 and a processor 21.
  • the receiver 20 is configured to receive a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations; and the processor 21 is configured to write the first atom
  • the requesting corresponding data and the to-be-written address corresponding to the first atomic write request are stored in the write request memory; wherein the address to be written corresponding to the first atomic write request is a place in the NVM medium
  • the address to be written corresponding to the first atomic write request includes a to-be-written address corresponding to each write operation in the first atomic write request; and is used to perform collision detection on the first atomic write request, and determine At least one of the first atomic write requests concurrently groups and determines a first order in which data corresponding to each of the first write operations in the first atomic write request is written to the NVM medium
  • the first write operation concurrent set in the first atomic write request includes at least one write operation of writing data to the NVM medium in parallel; and is further configured to write according to the first sequence and
  • the data writing device provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
  • the processor 21 is specifically configured to perform address conflict detection on each write operation in the first atomic write request, obtain a second write operation concurrently in the first atomic write request, and perform the The second write operation of the first atomic write request performs a channel conflict detection for each write operation in the concurrent set, determines at least one first write operation concurrent set in the first atomic write request, and determines to write the first atom
  • the first sequence of concurrent write operations in the request is written to the first sequence of the NVM media.
  • the channel in which the data corresponding to each write operation in the first write operation of the first atomic write request is written to the NVM medium does not conflict; the second write operation of the first atom write request is concurrent
  • the addresses to be written corresponding to the individual write operations in the group do not conflict.
  • the processor 21 is specifically configured to map a to-be-written address corresponding to each write operation in the first atomic write request to a Bloom filter bitmap, and according to the Bloom filter bitmap Address conflict detection is performed on each write operation in the first atomic write request, and a second write operation in the first atomic write request is obtained and concurrently grouped.
  • the processor 21 is further configured to: after writing data corresponding to all write operations of the first atomic write request to the NVM medium, clear the first atomic write in the Bloom filter bitmap Request the corresponding flag bit.
  • the data writing device provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
  • the receiver 20 is further configured to receive a second atomic write request sent by the central processing unit, where the second atomic write request includes at least two Conflicting write operation;
  • the processor 21 is further configured to store the data corresponding to the second atomic write request and the to-be-written address corresponding to the second atomic write request to the write request memory, and write the second atom Addresses to be written corresponding to respective write operations in the request are mapped to the Bloom filter bitmap, and address conflict detection is performed on each write operation in the second atomic write request according to the Bloom filter bitmap Obtaining a second write operation in the second atomic write request concurrently, and determining, according to the Bloom filter bitmap, a to-be-written address corresponding to each write operation in the first atomic write request and the An address conflict does not occur in the address to be written corresponding to each write operation in the second atomic write request; and the channel conflict detection is performed on each write operation in the second write operation of the second atomic write request to determine the location At least one first write operation of the second atomic write request concurrently groups and determines a second sequence of writing data corresponding to each of the first write operations in the second atomic write request to the NVM medium, and Determin
  • the address to be written corresponding to the second atomic write request is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes each write operation in the second atomic write request.
  • Corresponding write address to be written; the second write operation request of the second atomic write request does not conflict with the address to be written corresponding to each write operation in the concurrent write group; the second write operation concurrent set of the second atomic write request.
  • the data writing device provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
  • FIG. 12 is a schematic structural diagram of Embodiment 6 of a data writing device according to the present invention.
  • the device includes: a transmitter 22, configured to perform collision detection on the first atomic write request by the processor 21, Determining at least one first write operation concurrent set in the first atomic write request, and determining to write data corresponding to each first write operation concurrent set in the first atomic write request to the first of the NVM medium After the sequence, an atomic write success message is sent to the central processor; the receiver 10 is further configured to receive an atomic write end command sent by the central processor.
  • FIG. 13 is a schematic structural diagram of an embodiment of a storage system according to the present invention. As shown in Figure 13, this The storage system includes a central processing unit 30, a write request memory 31, an NVM medium 32, and an NVM controller 33 in the above embodiment. Further, the central processing unit 30, the write request memory 31, the NVM medium 32, and the NVM controller 33 are connected to one another via a bus 34.
  • the storage system provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.

Abstract

Provided are a data write-in method, apparatus and device, and a storage system. The method comprises: an NVM controller receiving a first atomic write request sent by a central processing unit; the NVM controller storing data corresponding to the first atomic write request and an address which is to be written and corresponds to the first atomic write request into a write request memory; the NVM controller performing conflict detection on the first atomic write request, so as to determine at least one first write operation concurrence group in the first atomic write request and determine a first sequence for writing data corresponding to various first write operation concurrence groups in the first atomic write request into an NVM medium; and according to the first sequence and the address which is to be written and corresponds to the first atomic write request, the NVM controller writing the data corresponding to various first write operation concurrence groups in the first atomic write request from the write request memory into the NVM medium. By means of the method provided in the present invention, the data writing efficiency is improved, and the costs for ensuring the uniformity of a file system are saved.

Description

数据写入的方法、装置、设备和存储系统Method, device, device and storage system for data writing 技术领域Technical field
本发明涉及计算机技术,尤其涉及一种数据写入的方法、装置、设备和存储系统。The present invention relates to computer technology, and in particular, to a data writing method, apparatus, device and storage system.
背景技术Background technique
在计算机技术中,经常需要对磁盘的物理地址上所保存的数据进行修改,而对物理地址上的数据进行修改的过程,实际上就是将新的数据写入该物理地址的过程。常用的方法是服务器将数据写入存储器进行缓存,然后将该数据从存储器取出写入磁盘;并且,在将该数据写入磁盘的同时,存储器还会更新描述该数据属性的元数据。若在将数据从存储器写入磁盘的过程中出现故障,则就会导致更新后的元数据与实际写入磁盘的数据不一致,从而使得文件系统不一致。In computer technology, it is often necessary to modify the data stored on the physical address of the disk, and the process of modifying the data on the physical address is actually the process of writing new data to the physical address. A common method is that the server writes data to the memory for caching, and then fetches the data from the memory to the disk; and, while the data is written to the disk, the memory also updates the metadata describing the data attributes. If a failure occurs during the process of writing data from the disk to the disk, the updated metadata will be inconsistent with the data actually written to the disk, making the file system inconsistent.
为了保证数据写入磁盘的过程中文件系统的一致性,现有技术采用了多种方式,例如fsck方式、预写式日志(Write-ahead log或Journal)方式、写时拷贝(Copy-on-write)方式等。以预写式日志方式为例,具体为:服务器在实际写入数据之前,先把该数据以日志的形式存储至磁盘中,然后服务器再将数据写到存储器中。当服务器将该数据从存储器写入磁盘中出错时,服务器可以将磁盘所存储的日志重新加载至存储器中,然后根据该日志找到之前对应的原始数据,即根据该日志将数据重新写入磁盘,直至数据成功写入磁盘为止,这样就可以确保更新后的元数据与磁盘上保存的数据一致。In order to ensure the consistency of the file system in the process of writing data to the disk, the prior art adopts various methods, such as fsck mode, write-ahead log or Journal mode, and copy-on-write (Copy-on- Write) and so on. Take the pre-write log mode as an example. Specifically, the server stores the data in the form of a log to the disk before actually writing the data, and then the server writes the data to the memory. When the server writes the data from the memory to the disk, the server can reload the log stored by the disk into the memory, and then find the original corresponding data according to the log, that is, rewrite the data to the disk according to the log. Until the data is successfully written to disk, this ensures that the updated metadata is consistent with the data stored on the disk.
但是,无论是fsck方式、预写式日志方式还是写时拷贝方式,虽然均可在数据写入磁盘过程中保证文件系统的一致性,但是其成本很高,并且数据写入磁盘的效率低。However, whether it is the fsck mode, the pre-write log mode or the copy-on-write mode, although the file system consistency can be ensured during data writing to the disk, the cost is high, and the data is inefficiently written to the disk.
发明内容Summary of the invention
本发明提供一种数据写入的方法、装置、设备和存储系统,用以解决现有技术保证文件系统的一致性成本高且数据写入磁盘的效率低的技术问题。 The invention provides a method, a device, a device and a storage system for data writing, which are used to solve the technical problem that the prior art guarantees high consistency of the file system and low efficiency of writing data to the disk.
第一方面,本发明提供一种数据写入的方法,包括:In a first aspect, the present invention provides a data writing method, including:
非易失性存储设备NVM控制器接收中央处理器发送的第一原子写请求;所述第一原子写请求包括至少两个不冲突的写操作;The non-volatile storage device NVM controller receives a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations;
所述NVM控制器将所述第一原子写请求对应的数据和所述第一原子写请求对应的待写入地址存储至写请求存储器;其中,所述第一原子写请求对应的待写入地址为NVM介质中的地址,所述第一原子写请求对应的待写入地址包括所述第一原子写请求中的各个写操作对应的待写入地址;The NVM controller stores the data corresponding to the first atomic write request and the to-be-written address corresponding to the first atomic write request to a write request memory; wherein the first atomic write request corresponds to be written The address is an address in the NVM medium, and the to-be-written address corresponding to the first atomic write request includes a to-be-written address corresponding to each write operation in the first atomic write request;
所述NVM控制器对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序;其中,所述第一原子写请求中的第一写操作并发组包括并行将数据写入所述NVM介质的至少一个写操作;The NVM controller performs collision detection on the first atomic write request, determines at least one first write operation concurrent group in the first atomic write request, and determines to each of the first atomic write requests Writing a data to a first sequence of data of the concurrent set of writes to the NVM medium; wherein the first write operation concurrent set of the first atomic write request includes writing at least one write of data to the NVM medium in parallel operating;
所述NVM控制器根据所述第一顺序和所述第一原子写请求对应的待写入地址,将所述第一原子写请求中的各个第一写操作并发组对应的数据从所述写请求存储器写入所述NVM介质。And the NVM controller, according to the first sequence and the to-be-written address corresponding to the first atomic write request, data corresponding to each first write operation concurrent group in the first atomic write request from the write The memory is requested to be written to the NVM medium.
结合第一方面,在第一方面的第一种可能的实施方式中,所述NVM控制器对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序,包括:In conjunction with the first aspect, in a first possible implementation of the first aspect, the NVM controller performs collision detection on the first atomic write request, and determines at least one of the first atomic write requests. The write operation concurrently groups and determines a first sequence of writing data corresponding to each of the first write operations in the first atomic write request to the NVM medium, including:
所述NVM控制器对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组;其中,所述第一原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突;The NVM controller performs address conflict detection on each write operation in the first atomic write request to obtain a second write operation concurrent group in the first atomic write request; wherein, the first atomic write request The write-to-write address corresponding to each write operation in the second write operation concurrent group does not conflict;
所述NVM控制器对所述第一原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组;其中,所述第一原子写请求的第一写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突;The NVM controller performs channel conflict detection on each write operation in the second write operation concurrent group of the first atomic write request, and determines at least one first write operation concurrent group in the first atomic write request; The first write operation of the first atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium;
所述NVM控制器确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序。The NVM controller determines a first order in which data corresponding to each of the first write operations in the first atomic write request is written to the NVM medium.
结合第一方面的第一种可能的实施方式,在第一方面的第二种可能的实 施方式中,所述NVM控制器对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组,具体包括:In conjunction with the first possible implementation of the first aspect, the second possible implementation in the first aspect The NVM controller performs an address conflict detection on each of the first atomic write requests, and obtains a second write operation in the first atomic write request.
所述NVM控制器将所述第一原子写请求中的各个写操作对应的待写入地址映射至布隆过滤器位图;The NVM controller maps a to-be-written address corresponding to each write operation in the first atomic write request to a Bloom filter bitmap;
所述NVM控制器根据所述布隆过滤器位图对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组。The NVM controller performs address conflict detection on each write operation in the first atomic write request according to the Bloom filter bitmap to obtain a second write operation concurrent group in the first atomic write request.
结合第一方面的第二种可能的实施方式,在第一方面的第三种可能的实施方式中,所述方法还包括:In conjunction with the second possible implementation of the first aspect, in a third possible implementation of the first aspect, the method further includes:
所述NVM控制器接收中央处理器发送的第二原子写请求;其中,所述第二原子写请求包括至少两个不冲突的写操作;The NVM controller receives a second atomic write request sent by the central processor; wherein the second atomic write request includes at least two non-conflicting write operations;
所述NVM控制器将所述第二原子写请求对应的数据和所述第二原子写请求对应的待写入地址存储至所述写请求存储器;其中,所述第二原子写请求对应的待写入地址为所述NVM介质中的地址,所述第二原子写请求对应的待写入地址包括所述第二原子写请求中的各个写操作对应的待写入地址;The NVM controller stores data corresponding to the second atomic write request and a to-be-written address corresponding to the second atomic write request to the write request memory; wherein the second atomic write request corresponds to The write address is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes an address to be written corresponding to each write operation in the second atomic write request;
所述NVM控制器将所述第二原子写请求中的各个写操作对应的待写入地址映射至所述布隆过滤器位图,并根据所述布隆过滤器位图对所述第二原子写请求中的各个写操作进行地址冲突检测,获得所述第二原子写请求中的第二写操作并发组;其中,所述第二原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突;The NVM controller maps a to-be-written address corresponding to each write operation in the second atomic write request to the Bloom filter bitmap, and pairs the second according to the Bloom filter bitmap Each of the write operations in the atomic write request performs address conflict detection to obtain a second write operation concurrently in the second atom write request; wherein the second write operation of the second atom write request concurrently writes each write in the group The address to be written corresponding to the operation does not conflict;
所述NVM控制器对所述第二原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第二原子写请求中的至少一个第一写操作并发组;其中,所述第二原子写请求的第一写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突;The NVM controller performs channel conflict detection on each write operation in the second write operation concurrent group of the second atomic write request, and determines at least one first write operation concurrent group in the second atom write request; The first write operation of the second atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium;
所述NVM控制器确定将所述第二原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第二顺序;Determining, by the NVM controller, a second sequence of writing data corresponding to each of the first write operations in the second atomic write request to the NVM medium;
所述NVM控制器根据所述布隆过滤器位图确定所述第一原子写请求中的各个写操作对应的待写入地址与所述第二原子写请求中的各个写操作对应的待写入地址不发生地址冲突;Determining, by the NVM controller, the to-be-written address corresponding to each write operation in the first atomic write request and the write operation corresponding to each write operation in the second atomic write request according to the Bloom filter bitmap The address does not have an address conflict;
所述NVM控制器分别根据所述第一顺序和所述第一原子写请求对应的 待写入地址、所述第二顺序和所述第二原子写请求对应的待写入地址,并行将所述第一原子写请求的各个第一写操作并发组对应的数据、所述第二原子写请求的各个第一写操作并发组对应的数据写入所述NVM介质。The NVM controller respectively corresponds to the first atom and the first atomic write request The address to be written, the second sequence, and the address to be written corresponding to the second atomic write request, and the data corresponding to each of the first write operations of the first atomic write request are concurrently combined with the second The data corresponding to each of the first write operations of the atomic write request is written to the NVM medium.
结合第一方面至第一方面的第三种可能的实施方式中的任一项,在第一方面的第四种可能的实施方式中,所述方法还包括:In conjunction with the first aspect to any one of the third possible implementation manners of the first aspect, in a fourth possible implementation manner of the first aspect, the method further includes:
所述NVM控制器在将第一原子写请求的所有写操作对应的数据均写入所述NVM介质后,清除布隆过滤器位图中与所述第一原子写请求对应的标志位。After the NVM controller writes data corresponding to all write operations of the first atomic write request to the NVM medium, the flag bit corresponding to the first atomic write request in the Bloom filter bitmap is cleared.
结合第一方面至第一方面的第二种可能的实施方式中的任一项,在第一方面的第五种可能的实施方式中,所述NVM控制器对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序之后,所述方法还包括:In conjunction with the first aspect to any one of the second possible implementation of the first aspect, in a fifth possible implementation of the first aspect, the NVM controller performs the first atomic write request Collision detection, determining at least one first write operation concurrent group in the first atomic write request, and determining to write data corresponding to each first write operation concurrent set in the first atomic write request to the NVM medium After the first sequence, the method further includes:
所述NVM控制器向所述中央处理器发送原子写成功消息;The NVM controller sends an atomic write success message to the central processor;
所述NVM控制器接收所述中央处理器发送的原子写结束命令。The NVM controller receives an atomic write end command sent by the central processor.
第二方面,本发明实施例提供一种数据写入装置,包括:In a second aspect, an embodiment of the present invention provides a data writing apparatus, including:
接收模块,用于接收中央处理器发送的第一原子写请求;所述第一原子写请求包括至少两个不冲突的写操作;a receiving module, configured to receive a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations;
存储模块,用于将所述第一原子写请求对应的数据和所述第一原子写请求对应的待写入地址存储至写请求存储器;其中,所述第一原子写请求对应的待写入地址为NVM介质中的地址,所述第一原子写请求对应的待写入地址包括所述第一原子写请求中的各个写操作对应的待写入地址;a storage module, configured to store data corresponding to the first atomic write request and a to-be-written address corresponding to the first atomic write request to a write request memory; wherein the first atomic write request corresponds to a write request The address is an address in the NVM medium, and the to-be-written address corresponding to the first atomic write request includes a to-be-written address corresponding to each write operation in the first atomic write request;
冲突检测模块,用于对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序;其中,所述第一原子写请求中的第一写操作并发组包括并行将数据写入所述NVM介质的至少一个写操作;a conflict detection module, configured to perform collision detection on the first atomic write request, determine at least one first write operation concurrent group in the first atomic write request, and determine each of the first atomic write requests Writing a first sequence of concurrent write data to the first sequence of the NVM media; wherein the first write operation concurrent set of the first atomic write request includes writing data to at least one of the NVM media in parallel Write operation
数据写模块,用于根据所述第一顺序和所述第一原子写请求对应的待写入地址,将所述第一原子写请求中的各个第一写操作并发组对应的数据从所述写请求存储器写入所述NVM介质。 a data writing module, configured to: according to the first sequence and the address to be written corresponding to the first atomic write request, data corresponding to each first write operation concurrent group in the first atomic write request from the A write request memory is written to the NVM medium.
结合第二方面,在第二方面的第一种可能的实施方式中,所述冲突检测模块,具体包括:With reference to the second aspect, in a first possible implementation manner of the second aspect, the conflict detection module includes:
地址冲突检测单元,用于对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组;其中,所述第一原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突;An address conflict detecting unit, configured to perform address conflict detection on each write operation in the first atomic write request, to obtain a second write operation concurrent group in the first atomic write request; wherein the first atom write The second write operation of the request does not conflict with the address to be written corresponding to each write operation in the concurrent group;
通道冲突检测单元,用于对所述第一原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组;其中,所述第一原子写请求的第一写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突;a channel conflict detecting unit, configured to perform channel conflict detection on each write operation in the second write operation concurrent group of the first atomic write request, and determine at least one first write operation concurrent group in the first atomic write request Wherein the first write operation of the first atomic write request and the data corresponding to each write operation in the concurrent write group are written to the channel of the NVM medium without conflict;
确定单元,用于确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序。And a determining unit, configured to determine a first sequence of writing data corresponding to each of the first write operations in the first atomic write request to the NVM medium.
结合第二方面的第一种可能的实施方式,在第二方面的第二种可能的实施方式中,所述地址冲突检测单元,具体用于将所述第一原子写请求中的各个写操作对应的待写入地址映射至布隆过滤器位图,并根据所述布隆过滤器位图对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组。With reference to the first possible implementation of the second aspect, in a second possible implementation manner of the second aspect, the address conflict detection unit is specifically configured to: perform each write operation in the first atomic write request Corresponding to-be-written address is mapped to the Bloom filter bitmap, and address conflict detection is performed on each write operation in the first atomic write request according to the Bloom filter bitmap to obtain the first atomic write The second write operation in the request is concurrently grouped.
结合第二方面的第二种可能的实施方式,在第二方面的第三种可能的实施方式中,所述接收模块,还用于接收中央处理器发送的第二原子写请求;其中,所述第二原子写请求包括至少两个不冲突的写操作;In conjunction with the second possible implementation of the second aspect, in a third possible implementation of the second aspect, the receiving module is further configured to receive a second atomic write request sent by the central processing unit; The second atomic write request includes at least two non-conflicting write operations;
所述存储模块,还用于将所述第二原子写请求对应的数据和所述第二原子写请求对应的待写入地址存储至所述写请求存储器;其中,所述第二原子写请求对应的待写入地址为所述NVM介质中的地址,所述第二原子写请求对应的待写入地址包括所述第二原子写请求中的各个写操作对应的待写入地址;The storage module is further configured to store data corresponding to the second atomic write request and a to-be-written address corresponding to the second atomic write request to the write request memory; wherein the second atomic write request The corresponding address to be written is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes an address to be written corresponding to each write operation in the second atomic write request;
所述地址冲突检测单元,还用于将所述第二原子写请求中的各个写操作对应的待写入地址映射至所述布隆过滤器位图,并根据所述布隆过滤器位图对所述第二原子写请求中的各个写操作进行地址冲突检测,获得所述第二原子写请求中的第二写操作并发组;其中,所述第二原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突;并且,还用于根据所 述布隆过滤器位图确定所述第一原子写请求中的各个写操作对应的待写入地址与所述第二原子写请求中的各个写操作对应的待写入地址不发生地址冲突;The address conflict detecting unit is further configured to map the to-be-written address corresponding to each write operation in the second atomic write request to the Bloom filter bitmap, and according to the Bloom filter bitmap Performing address conflict detection on each write operation in the second atomic write request to obtain a second write operation concurrently in the second atom write request; wherein the second write operation of the second atom write request is concurrent The address to be written corresponding to each write operation in the group does not conflict; and, The Bloom filter bitmap determines that an address conflict occurs between the to-be-written address corresponding to each write operation in the first atomic write request and the to-be-written address corresponding to each write operation in the second atomic write request;
所述通道检测单元,还用于对所述第二原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第二原子写请求中的至少一个第一写操作并发组;其中,所述第二原子写请求的第二写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突;The channel detecting unit is further configured to perform channel conflict detection on each write operation in the second write operation concurrent group of the second atom write request, and determine at least one first write operation in the second atom write request a concurrent group; wherein, the second write operation of the second atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium;
所述确定单元,还用于确定将所述第二原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第二顺序;The determining unit is further configured to determine a second sequence of writing data corresponding to each of the first write operations in the second atomic write request to the NVM medium;
所述数据写模块,还用于分别根据所述第一顺序和所述第一原子写请求对应的待写入地址、所述第二顺序和所述第二原子写请求对应的待写入地址,并行将所述第一原子写请求的各个第一写操作并发组对应的数据、所述第二原子写请求的各个第一写操作并发组对应的数据写入所述NVM介质。The data writing module is further configured to: according to the first sequence and the to-be-written address corresponding to the first atomic write request, the second sequence, and the to-be-written address corresponding to the second atomic write request And data corresponding to each first write operation concurrent group of the first atomic write request and data corresponding to each first write operation concurrent group of the second atomic write request are written in parallel to the NVM medium.
结合第二方面至第二方面的第三种可能的实施方式中的任一项,在第二方面的第四种可能的实施方式中,所述装置还包括:In conjunction with the second aspect, the third possible implementation of the second aspect, in the fourth possible implementation of the second aspect, the device further includes:
清除模块,用于在所述数据写模块将第一原子写请求的所有写操作对应的数据均写入所述NVM介质后,清除布隆过滤器位图中与所述第一原子写请求对应的标志位。a clearing module, configured to: after the data writing module writes data corresponding to all write operations of the first atomic write request to the NVM medium, clear a Bloom filter bitmap corresponding to the first atomic write request Sign bit.
结合第二方面至第二方面的第二种可能的实施方式中的任一项,在第二方面的第五种可能的实施方式中,所述装置还包括:In conjunction with the second aspect, the second possible implementation of the second aspect, in the fifth possible implementation of the second aspect, the device further includes:
发送模块,用于在所述冲突检测模块对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序之后,向所述中央处理器发送原子写成功消息;a sending module, configured to perform collision detection on the first atomic write request by the conflict detection module, determine at least one first write operation concurrent group in the first atomic write request, and determine to use the first atom After the first sequence of the first write operation concurrently in the write request is written into the first sequence of the NVM medium, an atomic write success message is sent to the central processor;
所述接收模块,还用于接收所述中央处理器发送的原子写结束命令。The receiving module is further configured to receive an atomic write end command sent by the central processing unit.
第三方面,本发明实施例提供一种存储系统,包括:中央处理器、写请求存储器、非易失性存储设备NVM介质以及权利要求1至权利要求6任一项所述的NVM控制器。In a third aspect, an embodiment of the present invention provides a storage system, including: a central processing unit, a write request memory, a non-volatile storage device NVM medium, and the NVM controller according to any one of claims 1 to 6.
本发明实施例提供的数据写入的方法、装置、设备和存储系统,通过NVM控制器将接收到的第一原子写请求对应的数据和待写入地址存储至写请求存 储器中,并对该第一原子写请求进行冲突检测后获得第一原子写请求中的至少一个第一写操作并发组,并确定出将第一原子写请求中的各个第一写操作并发组对应的数据写入NVM介质的第一顺序,从而根据该第一顺序和第一原子写请求对应的待写入地址,将第一原子写请求中的各个第一写操作并发组对应的数据从写请求存储器写入NVM介质。本发明实施例提供的方法,不仅提高了数据写的效率,也节省了保证文件系统一致性的成本,并避免了写操作之间不必要的冲突,从而保证了文件系统的可靠性。The method, device, device and storage system for data writing provided by the embodiment of the present invention store the data corresponding to the received first atomic write request and the address to be written to the write request by the NVM controller. And performing, in the storage, the conflict detection of the first atomic write request, obtaining at least one first write operation concurrent group in the first atomic write request, and determining to concurrently execute each first write operation in the first atomic write request The corresponding data of the group is written into the first sequence of the NVM medium, so that the data corresponding to each first write operation in the first atomic write request is concurrently grouped according to the first sequence and the address to be written corresponding to the first atomic write request. Write NVM media from the write request memory. The method provided by the embodiment of the invention not only improves the efficiency of data writing, but also saves the cost of ensuring the consistency of the file system, and avoids unnecessary conflicts between the writing operations, thereby ensuring the reliability of the file system.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图1为本发明提供的单客户端网络架构示意图;1 is a schematic diagram of a single client network architecture provided by the present invention;
图2为本发明提供的多客户端网络架构示意图;2 is a schematic diagram of a multi-client network architecture provided by the present invention;
图3为本发明提供的数据写入的方法实施例一的流程示意图;FIG. 3 is a schematic flowchart diagram of Embodiment 1 of a method for writing data according to the present invention;
图4为本发明提供的数据写入的方法实施例二的流程示意图;4 is a schematic flowchart of Embodiment 2 of a method for writing data according to the present invention;
图5为本发明提供的数据写入的方法实施例三的流程示意图;FIG. 5 is a schematic flowchart diagram of Embodiment 3 of a method for writing data according to the present invention;
图6为本发明提供的数据写入的方法实施例四的流程示意图;FIG. 6 is a schematic flowchart diagram of Embodiment 4 of a method for writing data according to the present invention;
图7为本发明提供的数据写入装置实施例一的结构示意图;FIG. 7 is a schematic structural diagram of Embodiment 1 of a data writing apparatus according to the present invention; FIG.
图8为本发明提供的数据写入装置实施例二的结构示意图;FIG. 8 is a schematic structural diagram of Embodiment 2 of a data writing apparatus according to the present invention; FIG.
图9为本发明提供的数据写入装置实施例三的结构示意图;FIG. 9 is a schematic structural diagram of Embodiment 3 of a data writing apparatus according to the present invention; FIG.
图10为本发明提供的数据写入装置实施例四的结构示意图;FIG. 10 is a schematic structural diagram of Embodiment 4 of a data writing apparatus according to the present invention; FIG.
图11为本发明提供的数据写入设备实施例五的结构示意图;11 is a schematic structural diagram of Embodiment 5 of a data writing device according to the present invention;
图12为本发明提供的数据写入设备实施例六的结构示意图;12 is a schematic structural diagram of Embodiment 6 of a data writing device according to the present invention;
图13为本发明提供的存储系统实施例的结构示意图。FIG. 13 is a schematic structural diagram of an embodiment of a storage system according to the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本 发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objects, technical solutions and advantages of the embodiments of the present invention more clear, the following will be combined The technical solutions in the embodiments of the present invention are clearly and completely described in the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例可以适用于单客户端的场景,该场景中涉及的网络架构具体包括一个客户端与至少一个服务器,该客户端可以同时向多个服务器发起数据原子写的请求,也可以是单个客户端在预设时间段内向同一个服务器依次发起多个原子写的请求,具体可以参见图1所示的单客户端网络架构示意图,且图1具体示出的是单个客户端向多个服务器发起原子写的请求。可选的,本发明实施例还可以适用于多客户端的场景,该场景中涉及的网络架构具体包括多个客户端与至少一个服务器,多个客户端可以在预设时间段内向同一个服务器发起原子写的请求,也可以向多个服务器发起原子写的请求,具体可以参见图2所示的多客户端网络架构示意图,且图2中具体示出的是多个客户端向同一个服务器发送原子写的请求。需要说明的是,图1和图2所示的客户端,可以为面向用户的通信设备,并且,图1或图2所示的多个服务器,每一个服务器接收到客户端的原子写的请求后,所执行的操作是相同的,因此,本发明实施例均以一个服务器的具体执行过程来说明,其他的服务器与该服务器的执行过程类似,本发明实施例不再赘述。The embodiment of the present invention can be applied to a scenario of a single client. The network architecture involved in the scenario specifically includes a client and at least one server, and the client can initiate a request for data atomic writing to multiple servers at the same time, or can be a single client. The terminal initiates a plurality of atomic write requests to the same server in a preset time period. For details, refer to the single client network architecture diagram shown in FIG. 1, and FIG. 1 specifically shows that a single client initiates to multiple servers. A request written by an atom. Optionally, the embodiment of the present invention is applicable to a multi-client scenario, where the network architecture involved in the scenario includes multiple clients and at least one server, and multiple clients may initiate to the same server within a preset time period. The atomic write request can also initiate an atomic write request to multiple servers. For details, refer to the multi-client network architecture diagram shown in FIG. 2, and specifically shown in FIG. 2, multiple clients send to the same server. A request written by an atom. It should be noted that the client shown in FIG. 1 and FIG. 2 may be a user-oriented communication device, and a plurality of servers shown in FIG. 1 or FIG. 2, each of which receives a request for atomic write of the client. The operations performed are the same. Therefore, the embodiments of the present invention are described in the specific implementation process of a server. The other servers are similar to the execution process of the server, and are not described in detail in the embodiments of the present invention.
本发明实施例针对的是现有技术在保证文件系统一致性时成本较高且数据写入磁盘效率低的技术问题。The embodiments of the present invention are directed to the technical problem that the prior art has high cost and low data writing efficiency when ensuring file system consistency.
图3为本发明提供的数据写入的方法实施例一的流程示意图。本实施例涉及的是非易失性存储(NonVolatile Memory,以下简称NVM)控制器、中央处理器和写请求存储器均可以集成在服务器中。如图3所示,该方法包括:FIG. 3 is a schematic flowchart diagram of Embodiment 1 of a method for writing data according to the present invention. This embodiment relates to a non-volatile storage (NonVolatile Memory, hereinafter referred to as NVM) controller, a central processing unit, and a write request memory, which can be integrated into a server. As shown in FIG. 3, the method includes:
S101:NVM控制器接收中央处理器发送的第一原子写请求;所述第一原子写请求包括至少两个不冲突的写操作。S101: The NVM controller receives a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations.
具体的,客户端向服务器发送第一原子写请求。服务器中的中央处理器在收到客户端发送第一原子写请求之后,首先向NVM控制器发送原子写请求开始命令;NVM控制器在接收到原子写请求开始命令后,拉起原子写请求信号电平将拉起,向中央处理器标识当前原子写请求过程开始,即向中央处 理器表明NVM控制器当前的原子写请求过程是可用的。可选的,NVM控制器拉起原子写请求信号电平可以是通过脉冲的方式来拉起原子写请求信号电平。Specifically, the client sends a first atomic write request to the server. After receiving the first atomic write request from the client, the central processor in the server first sends an atomic write request start command to the NVM controller; after receiving the atomic write request start command, the NVM controller pulls up the atomic write request signal. The level will be pulled up to identify to the central processor that the current atomic write request process begins, ie to the center The processor indicates that the current atomic write request process of the NVM controller is available. Optionally, the NVM controller pulls up the atomic write request signal level by pulling the atomic write request signal level by means of a pulse.
中央处理器根据上述原子写请求信号的电平判断NVM控制器当前的原子写请求可用,则将接收到的第一原子写请求发送给NVM控制器。其中,第一原子写请求包括至少两个不冲突的写操作。需要说明的是,中央处理器发送第一原子写请求中的写操作是按照一定的顺序发送的,因此,这里所说的第一原子写请求包括至少两个不冲突的写操作,指的是相邻的两个写操作不发生冲突,且这里的冲突可以是相邻的两个写操作各自对应的待写入地址不发生冲突以及相邻的两个写操作各自对应的数据写入NVM介质的通道也不发生冲突。The central processor determines that the current atomic write request of the NVM controller is available according to the level of the atomic write request signal, and sends the received first atomic write request to the NVM controller. The first atomic write request includes at least two non-conflicting write operations. It should be noted that the write operation in the first atomic write request sent by the central processing unit is sent in a certain order. Therefore, the first atomic write request mentioned herein includes at least two non-conflicting write operations, which means The two adjacent write operations do not conflict, and the conflict here may be that the corresponding write addresses of the two adjacent write operations do not conflict and the data corresponding to the two adjacent write operations are written to the NVM medium. There is no conflict in the channel.
S102:NVM控制器将所述第一原子写请求对应的数据和所述第一原子写请求对应的待写入地址存储至写请求存储器;其中,所述第一原子写请求对应的待写入地址为NVM介质中的地址,所述第一原子写请求对应的待写入地址包括所述第一原子写请求中的各个写操作对应的待写入地址。S102: The NVM controller stores the data corresponding to the first atomic write request and the to-be-written address corresponding to the first atomic write request to a write request memory, where the first atomic write request corresponds to be written. The address is an address in the NVM medium, and the to-be-written address corresponding to the first atomic write request includes a to-be-written address corresponding to each write operation in the first atomic write request.
具体的,当NVM控制器接收到中央处理器发送的第一原子写请求之后,将第一原子写请求对应的数据和第一原子写请求对应的待写入地址存储至写请求存储器。即,先接收到的写操作,其对应的数据和待写入地址先存储至写请求存储器中,后到的写操作,其对应的数据和待写入地址后存储至写请求存储器中。需要说明的是,上述所述的第一原子写请求对应的待写入地址实际上为NVM介质中的地址,且上述第一原子写请求对应的待写入地址包括该第一原子写请求中的各个写操作对应的待写入地址,上述第一原子写请求对应的数据包括该第一原子写请求中的各个写操作对应的数据。也就是说,NVM控制器最终是要根据第一原子写请求对应的待写入地址将第一原子写请求对应的数据写入NVM介质中。另外,上述写请求存储器具有非易失性以及读取延时小的特点,其可以为磁性随机存储器(Magnetic Random Access Memory,以下简称MRAM),还可以为阻变式随机存储器(Resistive Random Access Memory,以下简称RRAM),还可以为铁电随机存储器(Ferromagnetic Random Access Memory,以下简称FRAM),还可以为相变随机存储器(Phase Change Random Access Memory,以下简称PCRAM)等新型非易失性存储介 质。Specifically, after receiving the first atomic write request sent by the central processing unit, the NVM controller stores the data corresponding to the first atomic write request and the to-be-written address corresponding to the first atomic write request to the write request memory. That is, the first received write operation, the corresponding data and the address to be written are first stored in the write request memory, and the subsequent write operation, the corresponding data and the address to be written are stored in the write request memory. It should be noted that the address to be written corresponding to the first atomic write request is actually an address in the NVM medium, and the address to be written corresponding to the first atomic write request includes the first atomic write request. The data to be written corresponding to each write operation, the data corresponding to the first atomic write request includes data corresponding to each write operation in the first atomic write request. That is to say, the NVM controller finally writes the data corresponding to the first atomic write request into the NVM medium according to the address to be written corresponding to the first atomic write request. In addition, the write request memory has the characteristics of non-volatileness and small read delay, and may be a magnetic random access memory (MRAM) or a resistive random access memory (Resistive Random Access Memory). , hereinafter referred to as RRAM), may also be Ferromagnetic Random Access Memory (FRAM), or a new type of non-volatile memory such as Phase Change Random Access Memory (PCRAM). quality.
S103:NVM控制器对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序;其中,所述第一原子写请求中的第一写操作并发组包括并行将数据写入所述NVM介质的至少一个写操作。S103: The NVM controller performs collision detection on the first atomic write request, determines at least one first write operation concurrent group in the first atomic write request, and determines each of the first atomic write requests. Writing a data to a first sequence of data of the concurrent set of writes to the NVM medium; wherein the first write operation concurrent set of the first atomic write request includes writing at least one write of data to the NVM medium in parallel operating.
具体的,NVM控制器对接收到的第一原子写请求进行冲突检测,确定第一原子写请求中的至少一个第一写操作并发组,每个第一写操作并发组中包括的各个写操作是可以并行或同时将其对应的数据写入NVM介质的写操作,各个写操作对应的待写入地址彼此之间不发生冲突,且各个写操作对应的数据写入NVM介质所用的通道也不发生冲突。需要说明的是,这里所说的第一写操作并发组中的各个写操作对应的待写入地址彼此之间不发生冲突可以是在NVM控制器的布隆过滤器位图上,这些写操作对应的待写入地址对应在布隆过滤器位图上的比特位不发生重叠,还可以是计算机对各个写操作对应的待写入地址根据某种冲突检测算法计算的检测结果不同;并且,上述所说的第一写操作并发组中的各个写操作对应的数据写入NVM介质所用的通道不发生冲突指的是每个写操作对应的数据写入NVM介质时所用的通道是互不相同的。也就是说,上述第一原子写请求中的第一写操作并发组中的各个写操作对应的数据是可以同时通过不同的通道写入NVM介质的。Specifically, the NVM controller performs collision detection on the received first atomic write request, and determines at least one first write operation concurrent group in the first atomic write request, and each write operation included in each first write operation concurrent group Is a write operation in which the corresponding data can be written to the NVM medium in parallel or simultaneously, and the addresses to be written corresponding to the respective write operations do not conflict with each other, and the channels corresponding to the data written by the respective write operations are not written into the NVM medium. A conflict has occurred. It should be noted that the addresses to be written corresponding to the respective write operations in the first write operation concurrent group do not conflict with each other, and may be on the Bloom filter bitmap of the NVM controller. The corresponding address to be written corresponds to the bit position on the Bloom filter bitmap does not overlap, and the detection result calculated by the computer according to a certain collision detection algorithm is different for the address to be written corresponding to each write operation by the computer; The channel used for writing the data corresponding to each write operation in the first write operation concurrent group does not conflict with the channel used for writing the NVM medium. The channel used for each write operation is different when the data is written to the NVM medium. of. That is to say, the data corresponding to each write operation in the first write operation concurrent group in the first atomic write request can be simultaneously written to the NVM medium through different channels.
进一步地,NVM控制器在对第一原子写请求进行冲突检测时,还可以确定第一原子写请求中的各个第一写操作并发组之间的第一顺序。也就是说,第一原子写请求中可以包括至少一个第一写操作并发组,且不同的第一写操作并发组对应的数据写入NVM介质是按照第一顺序写入的,而每个写操作并发组中的各个写操作对应的数据是可以并行写入NVM介质的。Further, the NVM controller may also determine a first order between the concurrent sets of the first write operations in the first atomic write request when the first atomic write request is detected for conflict. That is, the first atomic write request may include at least one first write operation concurrent group, and the data of the different first write operation concurrent groups written to the NVM medium is written in the first order, and each write The data corresponding to each write operation in the operation concurrent group can be written to the NVM medium in parallel.
为了更好的理解本发明,此处可以举一个简单的例子来说明本发明实施例的技术方案。具体为:For a better understanding of the present invention, a simple example is given herein to illustrate the technical solutions of the embodiments of the present invention. Specifically:
假设NVM控制器在预设时间段内接收到了第一原子写请求,该第一原子写请求包括3个写操作,分别是a、b、c。It is assumed that the NVM controller receives the first atomic write request within a preset time period, and the first atomic write request includes three write operations, which are a, b, and c, respectively.
其中,NVM控制器在将第一原子写请求对应的数据和待写入地址存储至写请求存储器中后,对该第一原子写请求进行冲突检测。当NVM控制器对 第一原子写请求进行冲突检测后,获知第一原子写请求中的a和b不发生冲突,但c与b发生冲突,因此NVM控制器确定a和b构成了第一写操作并发组A,c构成了第一写操作并发组B。The NVM controller performs collision detection on the first atomic write request after storing the data corresponding to the first atomic write request and the address to be written into the write request memory. When the NVM controller is paired After the first atomic write request performs collision detection, it is known that a and b in the first atomic write request do not collide, but c and b collide, so the NVM controller determines that a and b constitute the first write operation and concurrently groups A, c constitutes the first write operation concurrent group B.
因此,NVM控制器确定的第一原子写请求中的第一写操作并发组的第一顺序为第一写操作并发组A对应的数据写入NVM介质在第一写操作并发组B之前Therefore, the first sequence of the first write operation in the first atomic write request determined by the NVM controller is the first write operation, and the data corresponding to the group A is written to the NVM medium before the first write operation concurrent group B.
S104:NVM控制器根据所述第一顺序和所述第一原子写请求对应的待写入地址,将所述第一原子写请求中的各个第一写操作并发组对应的数据从所述写请求存储器写入所述NVM介质。S104: The NVM controller, according to the first sequence and the to-be-written address corresponding to the first atomic write request, data corresponding to each first write operation concurrent group in the first atomic write request from the write The memory is requested to be written to the NVM medium.
具体的,参照上述S103中所举的例子,NVM控制器先将第一原子写请求中的第一写操作并发组A中的a和b对应的数据从写请求存储器中取出,并行写入NVM介质中,然后再将c对应的数据从写请求存储器中取出,写入NVM介质中。Specifically, referring to the example mentioned in the above S103, the NVM controller first extracts data corresponding to a and b in the first write operation concurrent A in the first atomic write request from the write request memory, and writes the NVM in parallel. In the medium, the data corresponding to c is then taken out of the write request memory and written into the NVM medium.
现有技术中,当NVM控制器接收到原子写请求之后,只是将该原子中的写操作对应的数据按顺序一个一个写入磁盘,其数据写的效率非常低,并且,在保证文件系统一致性时,还需要磁盘额外的日志开销,成本较高;但是,在本发明实施例中,NVM控制器将数据写入NVM介质时对第一原子写请求中的写操作对应的数据进行了并发重组,将可以并行写入NVM介质的写操作对应的数据并发写入NVM介质中,提高了数据写的效率;并且,本发明实施例采用了写请求存储器缓存第一原子写请求对应的数据和待写入地址,通过写请求存储器的非易失性保证了文件系统的一致性(即将数据从写请求存储器写到NVM介质的过程中,即使出现故障,写请求存储器中存储的数据也不会丢失,当故障消失时,仍可以将数据继续写入NVM介质中,直至成功写入NVM介质中为止),节省了现有技术中磁盘的日志开销,降低了保证文件系统一致性的成本。In the prior art, when the NVM controller receives the atomic write request, only the data corresponding to the write operation in the atom is written to the disk one by one in sequence, the data writing efficiency is very low, and the file system is consistent in the guarantee. In addition, in the embodiment of the present invention, when the NVM controller writes data to the NVM medium, the data corresponding to the write operation in the first atomic write request is concurrently executed. Recombination, the data corresponding to the write operation of the NVM medium can be concurrently written into the NVM medium, and the efficiency of data writing is improved. Moreover, the embodiment of the present invention uses the write request memory to cache the data corresponding to the first atomic write request and The address to be written, the non-volatile nature of the write request memory guarantees the consistency of the file system (that is, the process of writing data from the write request memory to the NVM medium, even if there is a failure, the data stored in the write request memory will not Lost, when the fault disappears, the data can continue to be written to the NVM media until it is successfully written to the NVM media), saving existing Log surgery cost disk, reducing the costs to ensure the consistency of the file system.
进一步地,现有技术中在数据写入过程中采用的是磁盘,磁盘上的存储写入空间是以存储块为单位的,也就是说一个存储块可以包括多个写操作对应的地址。那么,当一个写操作要将数据写入其所对应的地址上(即写入磁盘)时就需要占据全部的存储块,若其他写操作对应的地址也属于该存储块,那么在其他写操作写入数据时就会发生冲突。但是,本发明采 用NVM介质,其存储空间的粒度是以比特为单位的,同样是上述写入数据的场景,由于每个写操作针对的是不同的比特,两两之间没有重叠的部分,因此不会引起冲突。故,本发明实施例中采用NVM介质,避免了不必要的冲突,保证了文件系统的可靠性。Further, in the prior art, a disk is used in the data writing process, and the storage write space on the disk is in units of memory blocks, that is, one memory block may include addresses corresponding to multiple write operations. Then, when a write operation wants to write data to its corresponding address (that is, write to the disk), it needs to occupy all the storage blocks. If the address corresponding to other write operations also belongs to the storage block, then other write operations are performed. A conflict occurs when data is written. However, the invention adopts With NVM media, the granularity of its storage space is in bits. It is also the scenario of writing data described above. Since each write operation is for different bits, there is no overlap between the two, so it will not cause conflict. Therefore, the NVM medium is used in the embodiment of the present invention to avoid unnecessary conflicts and ensure the reliability of the file system.
本发明实施例提供的数据写入的方法,通过NVM控制器将接收到的第一原子写请求对应的数据和待写入地址存储至写请求存储器中,并对该第一原子写请求进行冲突检测后获得第一原子写请求中的至少一个第一写操作并发组,并确定出将第一原子写请求中的各个第一写操作并发组对应的数据写入NVM介质的第一顺序,从而根据该第一顺序和第一原子写请求对应的待写入地址,将第一原子写请求中的各个第一写操作并发组对应的数据从写请求存储器写入NVM介质。本发明实施例提供的方法,不仅提高了数据写的效率,也节省了保证文件系统一致性的成本,并避免了写操作之间不必要的冲突,从而保证了文件系统的可靠性。The data writing method provided by the embodiment of the present invention stores the data corresponding to the received first atomic write request and the address to be written into the write request memory through the NVM controller, and conflicts with the first atomic write request. Obtaining at least one first write operation concurrently in the first atomic write request, and determining a first sequence of writing data corresponding to each first write operation concurrent set in the first atomic write request to the NVM medium, thereby And according to the first sequence and the address to be written corresponding to the first atomic write request, the data corresponding to each of the first write operations in the first atomic write request is written from the write request memory to the NVM medium. The method provided by the embodiment of the invention not only improves the efficiency of data writing, but also saves the cost of ensuring the consistency of the file system, and avoids unnecessary conflicts between the writing operations, thereby ensuring the reliability of the file system.
图4为本发明提供的数据写入的方法实施例二的流程示意图。在上述图3所示实施例的基础上,本实施例涉及的是NVM控制器对所接收到的第一原子写请求进行冲突检测,确定第一原子写请求中的第一写操作并发组和将第一原子写请求中的各个第一写操作并发组对应的数据写入NVM介质的第一顺序的具体过程。进一步地,如图4所示,该方法包括:FIG. 4 is a schematic flowchart diagram of Embodiment 2 of a method for writing data according to the present invention. On the basis of the foregoing embodiment shown in FIG. 3, the embodiment relates to the NVM controller performing collision detection on the received first atomic write request, and determining the first write operation concurrently in the first atomic write request. A specific process of writing the data corresponding to each of the first write operations in the first atomic write request to the first sequence of the NVM medium. Further, as shown in FIG. 4, the method includes:
S201:NVM控制器对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组;其中,所述第一原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突。S201: The NVM controller performs address conflict detection on each write operation in the first atomic write request, and obtains a second write operation concurrent group in the first atomic write request; wherein, the first atomic write request The second write operation does not conflict with the address to be written corresponding to each write operation in the concurrent group.
具体的,NVM控制器在接收到第一原子写请求之后,对该第一原子写请求中的各个写操作对应的地址进行地址冲突检测。可选的,NVM控制器在对第一原子写请求中的各个写操作进行地址冲突检测时,可以是通过预设的检测算法来检测,还可以是通过地址间的匹配度来检测,还可以是根据各个写操作对应的地址映射至某一比特位图上,通过查看比特位图是否有重叠的方式来检测。Specifically, after receiving the first atomic write request, the NVM controller performs address conflict detection on the address corresponding to each write operation in the first atomic write request. Optionally, when the address conflict detection is performed on each write operation in the first atomic write request, the NVM controller may be detected by using a preset detection algorithm, or may be detected by matching degrees between addresses, and may also be detected. It is mapped to a certain bit bitmap according to the address corresponding to each write operation, and is detected by checking whether the bit bitmap has overlap.
更具体的,上述S201中NVM控制器对第一原子写请求中的各个写操作 进行地址冲突检测,获得第二写操作并发组的具体过程可以参见图3所示的实施例三。如图5所示,该方法包括:More specifically, in the above S201, the NVM controller writes each write operation in the first atomic write request. For the specific process of performing the address conflict detection and obtaining the second write operation concurrent group, refer to the third embodiment shown in FIG. As shown in FIG. 5, the method includes:
S301:NVM控制器将所述第一原子写请求中的各个写操作对应的待写入地址映射至布隆过滤器位图。S301: The NVM controller maps the to-be-written address corresponding to each write operation in the first atomic write request to the Bloom filter bitmap.
具体的,NVM控制器按照一定的粒度,将NVM介质的存储空间划分成一个线性空间,建立布隆过滤器(bloom filter),第一原子写请求的写操作对应的待写入地址均可以映射到布隆过滤器的位图上的比特位,即一个写操作对应的待写入地址对应布隆过滤器的一位或几位,从而可选的可以建立出第一映射关系,该第一映射关系即包括第一原子写请求中的写操作对应的待写入地址与布隆过滤器位图上的比特位的映射关系。Specifically, the NVM controller divides the storage space of the NVM medium into a linear space according to a certain granularity, and establishes a bloom filter, and the address to be written corresponding to the write operation of the first atomic write request can be mapped. The bit on the bitmap of the Bloom filter, that is, the address to be written corresponding to a write operation corresponds to one or more bits of the Bloom filter, so that a first mapping relationship can be optionally established, the first The mapping relationship includes the mapping relationship between the address to be written corresponding to the write operation in the first atomic write request and the bit on the Bloom filter bitmap.
S302:NVM控制器根据所述布隆过滤器位图对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组。S302: The NVM controller performs address conflict detection on each write operation in the first atomic write request according to the Bloom filter bitmap, and obtains a second write operation concurrent group in the first atomic write request.
具体的,NVM控制器可以根据布隆过滤器中的第一映射关系对接收到的第一原子写请求中的各个写操作对应的待写入地址进行检测,即NVM控制器根据上述第一映射关系检测第一原子写请求中的各个写操作对应的待写入地址对应在布隆过滤器位图上的比特位是否有重叠,就可以获知第一原子写请求中的各个写操作是否发生地址冲突,从而将第一原子写请求中没有发生地址冲突的写操作划分为第二写操作并发组。Specifically, the NVM controller may detect, according to the first mapping relationship in the Bloom filter, the to-be-written address corresponding to each write operation in the received first atomic write request, that is, the NVM controller is configured according to the first mapping. The relationship detecting whether the address to be written corresponding to each write operation in the first atomic write request corresponds to whether the bits on the Bloom filter bitmap overlap, and whether the address of each write operation in the first atomic write request occurs is known. Collision, thereby dividing the write operation in which the address conflict does not occur in the first atomic write request into the second write operation concurrent group.
例如,假设该第一原子写请求中包括a、b、c、d、e 5个写操作,且在布隆过滤器的第一映射关系中,a对应布隆过滤器位图上的1-10位,b对应布隆过滤器位图上的11-20位,c对应布隆过滤器位图上的21-30位,d对应布隆过滤器位图上的30-40位,e对应布隆过滤器位图上的41-50位。For example, suppose that the first atomic write request includes five write operations of a, b, c, d, and e, and in the first mapping relationship of the Bloom filter, a corresponds to 1-on the Bloom filter bitmap. 10 bits, b corresponds to 11-20 bits on the Bloom filter bitmap, c corresponds to 21-30 bits on the Bloom filter bitmap, d corresponds to 30-40 bits on the Bloom filter bitmap, e corresponds 41-50 bits on the Bloom filter bitmap.
NVM控制器根据该第一映射关系,确定a与b对应的待写入地址不冲突,c与b对应的待写入地址也不发生冲突,d与c对应的待写入地址发生冲突,d与e对应的待写入地址不发生冲突。故,NVM控制器确定a、b和c构成了一个第二写操作并发组A,d与e构成了一个第二写操作并发组B。也就是说,第二写操作并发组中所包括的各个写操作对应的待写入地址均不发生冲突。The NVM controller determines, according to the first mapping relationship, that the addresses to be written corresponding to a and b do not conflict, and the addresses to be written corresponding to c and b do not conflict, and the addresses to be written corresponding to d and c conflict, d The address to be written corresponding to e does not conflict. Therefore, the NVM controller determines that a, b, and c constitute a second write operation concurrently with group A, and d and e constitute a second write operation concurrently with group B. That is to say, the addresses to be written corresponding to the respective write operations included in the second write operation concurrent group do not conflict.
S202:NVM控制器对所述第一原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第一原子写请求中的至少一个第一写操 作并发组;其中,所述第一原子写请求的第一写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突。S202: The NVM controller performs channel conflict detection on each write operation in the second write operation concurrent group of the first atomic write request, and determines at least one first write operation in the first atom write request. A concurrent group; wherein, the first write operation of the first atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium.
S203:NVM控制器确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序。S203: The NVM controller determines a first sequence of writing data corresponding to each of the first write operations in the first atomic write request to the NVM medium.
具体的,第一原子写请求的第一写操作并发组中包括的写操作之间待写入地址和数据写入NVM介质的通道均不发生冲突。Specifically, the first write operation of the first atomic write request does not conflict with the write address of the write operation included in the concurrent group and the data written to the NVM medium.
继续以上述S302中所举的例子来说明,NVM控制器分别对第一原子写请求中的第二写操作并发组A和第一原子写请求中的第二写操作并发组B进行通道冲突检测,确定第一原子写请求中的第二写操作并发组A中的a和b对应的数据写入NVM介质的通道不发生冲突,但c对应的数据写入NVM介质的通道与b对应的数据写入NVM介质的通道发生冲突,则NVM控制器确定第一原子写请求中的第二写操作并发组A中包括两个第一写操作并发组A’和第一写操作并发组B’,其中,第一写操作并发组A’包括a和b,第一写操作并发组B’包括c(由于第一写操作并发组B’仅包括一个c,因此c进行数据写入时的通道与第一写操作并发组B’中的其他并不存在的写操作当然不发生冲突)。同理,NVM控制器还确定第二写操作并发组B中的d和e对应的数据写入NVM介质的通道均不发生冲突,则NVM控制器确定第二写操作并发组A中包括一个第一写操作并发组C’,该第一写操作并发组C’包括d和e。Continuing with the example given in S302 above, the NVM controller performs channel collision detection on the second write operation concurrent group A in the first atomic write request and the second write operation concurrent group B in the first atomic write request, respectively. Determining the second write operation in the first atomic write request. The data corresponding to a and b in the group A is written to the channel of the NVM medium without conflict, but the data corresponding to c is written into the channel of the NVM medium and the data corresponding to b. The channel written to the NVM medium conflicts, and the NVM controller determines that the second write operation in the first atomic write request includes two first write operations concurrent group A' and a first write operation concurrent group B'. Wherein, the first write operation concurrent group A' includes a and b, and the first write operation concurrent group B' includes c (since the first write operation concurrent group B' includes only one c, so c performs channel writing when data is written The write operation of the first write operation concurrent group B' that does not exist does not of course conflict. Similarly, the NVM controller also determines that the second write operation concurrently the data corresponding to d and e in the group B is written to the NVM medium, and the NVM controller determines that the second write operation includes a first A write operation concurrently groups C', the first write operation concurrent group C' including d and e.
进一步地,NVM控制器根据上述第一原子写请求中的各个写操作映射至布隆过滤器位图上的位置和上述第一映射关系,NVM控制器确定上述第一原子写请求中的各个第一写操作并发组对应的数据写入NVM介质的第一顺序为:第一写操作并发组A’对应的数据写入NVM介质在第一写操作并发组B’对应的数据写入NVM介质之前,第一写操作并发组B’对应的数据写入NVM介质在第一写操作并发组C’对应的数据写入NVM介质之前。Further, the NVM controller maps to a position on the Bloom filter bitmap and the first mapping relationship according to each write operation in the first atomic write request, and the NVM controller determines each of the first atomic write requests. The first sequence of data written to the NVM medium by a write operation concurrent group is: the data corresponding to the first write operation concurrent group A' is written to the NVM medium before the data corresponding to the first write operation concurrent group B' is written to the NVM medium. The data corresponding to the first write operation concurrent group B' is written to the NVM medium before the data corresponding to the first write operation concurrent group C' is written to the NVM medium.
最后,NVM控制器根据上述所确定的第一顺序,将各个第一写操作对应的数据写入NVM介质。即,NVM控制器首先将第一写操作并发组A’中a和b对应的数据并行写入NVM介质,然后再将第一写操作并发组B’中c对应的数据写入NVM介质,最后将第一写操作并发组C’中d和e对应的数据并行写入NVM介质中。 Finally, the NVM controller writes data corresponding to each first write operation to the NVM medium according to the first sequence determined above. That is, the NVM controller first writes the data corresponding to a and b in the first write operation concurrent group A' to the NVM medium in parallel, and then writes the data corresponding to c in the first write operation concurrent group B' to the NVM medium, and finally The data corresponding to d and e in the first write operation concurrent group C' is written into the NVM medium in parallel.
另外,当NVM控制器在确定第一原子写请求中的第一写操作并发组和各个第一写操作并发组对应的数据写入NVM介质的第一顺序后,NVM控制器会向中央处理器发送原子写请求成功消息,以向中央处理器告知自己将第一原子写请求对应的数据成功缓存至写请求存储器中;中央处理器在接收到NVM控制器发送的原子写请求成功消息后,向NVM控制器发送原子写请求结束命令,即隐式的告知NVM控制器可以将写请求存储器中缓存的数据写入NVM介质中。需要说明的是,NVM控制器向中央处理器发送原子写请求成功消息的前提是中央处理器在短时间内没有继续向NVM控制器发送原子写请求,则NVM控制器才会在确定第一顺序后,向中央处理器发送原子写请求成功消息。In addition, when the NVM controller determines the first write operation in the first atomic write request and the first sequence of the first write operation concurrent data is written into the first sequence of the NVM medium, the NVM controller sends the NVM controller to the central processor. Sending an atomic write request success message to inform the central processor that the data corresponding to the first atomic write request is successfully cached into the write request memory; after receiving the atomic write request success message sent by the NVM controller, the central processor The NVM controller sends an atomic write request end command, which implicitly informs the NVM controller that the data cached in the write request memory can be written to the NVM medium. It should be noted that the NVM controller sends an atomic write request success message to the central processor on the premise that the central processor does not continue to send an atomic write request to the NVM controller in a short time, then the NVM controller determines the first order. After that, an atomic write request success message is sent to the central processor.
进一步地,在NVM控制器在将第一原子写请求的所有写操作对应的数据均写入NVM介质后,清除布隆过滤器位图中与第一原子写请求对应的标志位,对写请求存储器的缓存空间进行回收,提高写请求存储器的存储空间利用率。Further, after the NVM controller writes the data corresponding to all the write operations of the first atomic write request to the NVM medium, the flag corresponding to the first atomic write request in the Bloom filter bitmap is cleared, and the write request is performed. The memory cache space is reclaimed to improve the storage space utilization of the write request memory.
本发明实施例提供的数据写入的方法,通过NVM控制器将接收到的第一原子写请求对应的数据和待写入地址存储至MRAM中,并根据布隆过滤器位图对第一原子写请求进行冲突检测后获得第一原子写请求中的至少一个第一写操作并发组,并确定将第一原子写请求中的各个第一写操作并发组对应的数据写入NVM介质的第一顺序,从而根据该第一顺序和第一原子写请求对应的待写入地址,将第一原子写请求中的各个第一写操作并发组对应的数据从写请求存储器写入NVM介质。本发明实施例提供的方法,不仅提高了数据写的效率,也节省了保证文件系统一致性的成本,并避免了写操作之间不必要的冲突,从而保证了文件系统的可靠性。The data writing method provided by the embodiment of the present invention stores the data corresponding to the received first atomic write request and the address to be written into the MRAM through the NVM controller, and compares the first atom according to the Bloom filter bitmap. And obtaining, by the write request, the at least one first write operation concurrent group in the first atomic write request, and determining to write the data corresponding to each first write operation concurrent group in the first atomic write request to the first of the NVM medium And sequentially, according to the first sequence and the address to be written corresponding to the first atomic write request, the data corresponding to each first write operation concurrent group in the first atomic write request is written from the write request memory to the NVM medium. The method provided by the embodiment of the invention not only improves the efficiency of data writing, but also saves the cost of ensuring the consistency of the file system, and avoids unnecessary conflicts between the writing operations, thereby ensuring the reliability of the file system.
图6为本发明提供的数据写入的方法实施例四的流程示意图。在上述实施例的基础上,本实施例涉及的是当NVM控制器接收到中央处理器发送的第二原子写请求后,将第一原子写请求对应的数据与第二原子写请求对应的数据写入NVM介质的具体过程。如图6所示,该方法包括:FIG. 6 is a schematic flowchart diagram of Embodiment 4 of a method for writing data according to the present invention. On the basis of the foregoing embodiment, the embodiment relates to data corresponding to the data of the first atomic write request and the second atomic write request after the NVM controller receives the second atomic write request sent by the central processor. The specific process of writing to NVM media. As shown in FIG. 6, the method includes:
S401:NVM控制器接收中央处理器发送的第二原子写请求;其中,所述第二原子写请求包括至少两个不冲突的写操作。 S401: The NVM controller receives a second atomic write request sent by the central processing unit; wherein the second atomic write request includes at least two non-conflicting write operations.
具体的,客户端在向服务器发送第一原子写请求后,仍然向服务器发送第二原子写请求。因此,中央处理器在将第一原子写请求发送给NVM控制器后,继续将第二原子写请求发送给NVM控制器。当然,NVM控制器处理第一原子写请求的过程可以与NVM控制器接收第二原子写请求的过程同步执行。另外,中央处理器发送第二原子写请求中的写操作也是按照一定的顺序发送的,因此,这里所说的第二原子写请求包括至少两个不冲突的写操作,指的是相邻的两个写操作不发生冲突,且这里的冲突可以是相邻的两个写操作各自对应的待写入地址不发生冲突以及相邻的两个写操作各自对应的数据写入NVM介质的通道也不发生冲突。Specifically, after sending the first atomic write request to the server, the client still sends a second atomic write request to the server. Therefore, after transmitting the first atomic write request to the NVM controller, the central processor continues to send the second atomic write request to the NVM controller. Of course, the process by which the NVM controller processes the first atomic write request can be performed in synchronization with the process in which the NVM controller receives the second atomic write request. In addition, the write operation in the second atomic write request sent by the central processing unit is also sent in a certain order. Therefore, the second atomic write request mentioned herein includes at least two non-conflicting write operations, which refer to adjacent ones. The two write operations do not conflict, and the conflict here may be that the adjacent write addresses of the two adjacent write operations do not conflict, and the data corresponding to the two adjacent write operations are written into the NVM medium. No conflicts occur.
S402:NVM控制器将所述第二原子写请求对应的数据和所述第二原子写请求对应的待写入地址存储至所述写请求存储器;其中,所述第二原子写请求对应的待写入地址为所述NVM介质中的地址,所述第二原子写请求对应的待写入地址包括所述第二原子写请求中的各个写操作对应的待写入地址。S402: The NVM controller stores the data corresponding to the second atomic write request and the to-be-written address corresponding to the second atomic write request to the write request memory; wherein the second atomic write request corresponds to The write address is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes a to-be-written address corresponding to each write operation in the second atomic write request.
具体的,NVM控制器将第二原子写请求对应的数据和第二原子写请求对应的待写入地址存储至写请求存储器的过程,可以参见上述实施例一中NVM控制器将第一原子写请求对应的数据和第一原子写请求对应的待写入地址存储至写请求存储器的过程,在此不再赘述。需要说明的是,第二原子写请求对应的数据包括第二原子写请求中的各个写操作对应的数据。Specifically, the NVM controller stores the data corresponding to the second atomic write request and the to-be-written address corresponding to the second atomic write request to the write request memory, and the NVM controller writes the first atom in the first embodiment. The process of requesting the corresponding data and the address to be written corresponding to the first atomic write request is stored in the write request memory, and details are not described herein again. It should be noted that the data corresponding to the second atomic write request includes data corresponding to each write operation in the second atomic write request.
S403:NVM控制器将所述第二原子写请求中的各个写操作对应的待写入地址映射至所述布隆过滤器位图,并根据所述布隆过滤器位图对所述第二原子写请求中的各个写操作进行地址冲突检测,获得所述第二原子写请求中的第二写操作并发组;其中,所述第二原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突。S403: The NVM controller maps the to-be-written address corresponding to each write operation in the second atomic write request to the Bloom filter bitmap, and pairs the second according to the Bloom filter bitmap. Each of the write operations in the atomic write request performs address conflict detection to obtain a second write operation concurrently in the second atom write request; wherein the second write operation of the second atom write request concurrently writes each write in the group The corresponding address to be written to the operation does not conflict.
具体的,NVM控制器在建立布隆过滤器之后,不仅将第一原子写请求的写操作对应的待写入地址映射至布隆过滤器位图上,还将第二原子写请求对应的写操作对应的待写入地址映射至布隆过滤器位图上,其具体的映射过程可以参照上述实施三中第一原子写请求对应的待写入地址映射至布隆过滤器的过程执行,在此不再赘述。Specifically, after the Blom filter is established, the NVM controller not only maps the to-be-written address corresponding to the write operation of the first atomic write request to the Bloom filter bitmap, but also writes the second atomic write request. The corresponding to-be-written address of the operation is mapped to the Bron filter bitmap, and the specific mapping process may be performed by referring to the process of mapping the to-be-written address corresponding to the first atomic write request in the foregoing implementation to the Bloom filter. This will not be repeated here.
进一步地,NVM控制器根据上述布隆过滤器位图中的待写入地址与比特位的映射关系检测第二原子写请求中的各个写操作对应的待写入地址对应在 布隆过滤器位图上的比特位是否有重叠,就可以获知第二原子写请求中的各个写操作是否发生地址冲突,从而将第二原子写请求中没有发生地址冲突的写操作划分为第二原子写请求中的第二写操作并发组。Further, the NVM controller detects, according to the mapping relationship between the address to be written and the bit in the Bron filter bitmap, that the address to be written corresponding to each write operation in the second atomic write request corresponds to Whether the bits on the Bloom filter bitmap overlap, it is possible to know whether an address conflict occurs in each write operation in the second atomic write request, thereby dividing the write operation in the second atomic write request without an address conflict into the first The second write operation in the two-atom write request is concurrently grouped.
S404:NVM控制器对所述第二原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第二原子写请求中的至少一个第一写操作并发组;其中,所述第二原子写请求的第一写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突。S404: The NVM controller performs channel conflict detection on each write operation in the second write operation concurrent group of the second atomic write request, and determines at least one first write operation concurrent group in the second atomic write request; The first write operation of the second atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium.
S405:NVM控制器确定将所述第二原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第二顺序。S405: The NVM controller determines a second sequence of writing data corresponding to each of the first write operations in the second atomic write request to the NVM medium.
具体的,NVM控制器获得第二原子写请求中的第一写操作并发组的具体过程,可以参照上述实施例三中NVM控制器获得第一原子写请求中的第一写操作并发组的具体过程执行,本发明实施例在此不再赘述。第二原子写请求的第一写操作并发组包括的写操作之间待写入地址和数据写入NVM介质的通道均不发生冲突。Specifically, the specific process of the first write operation of the second atomic write request is obtained by the NVM controller, and the specific operation of the first write operation in the first atomic write request is obtained by referring to the NVM controller in the third embodiment. The process is performed, and details are not described herein again. The first write operation of the second atomic write request does not conflict with the write address and the data written to the NVM medium between the write operations included in the concurrent set.
另外,NVM控制器确定将第二原子写请求中的各个第一写操作并发组对应的数据写入NVM介质的第二顺序的过程,可以参照上述实施例三中NVM控制器确定将第一原子写请求中的各个第一写操作并发组对应的数据写入NVM介质的第一顺序的过程执行,在此不再赘述。In addition, the NVM controller determines a process of writing data corresponding to each of the first write operations in the second atomic write request to the second sequence of the NVM medium, and determining the first atom by referring to the NVM controller in the third embodiment above. The process of writing the first sequence of the first write operation in the write request to the first sequence of the NVM medium is performed, and details are not described herein again.
S406:NVM控制器根据所述布隆过滤器位图确定所述第一原子写请求中的各个写操作对应的待写入地址与所述第二原子写请求中的各个写操作对应的待写入地址不发生地址冲突。S406: The NVM controller determines, according to the Bloom filter bitmap, a to-be-written address corresponding to each write operation in the first atomic write request and a write operation corresponding to each write operation in the second atomic write request. The address does not have an address conflict.
具体的,当NVN控制器分别确定了第一原子写请求中的第一写操作并发组和第一原子写请求中的各个第一写操作并发组对应的数据写入NVM介质的第一顺序、第二原子写请求中的第一写操作并发组和第二原子写请求中的各个第一写操作并发组对应的数据写入NVM介质的第二顺序之后,NVM控制器继续结合布隆过滤器位图中第一原子写请求的写操作对应的待写入地址与比特位的映射关系,以及第二原子写请求的写操作对应的待写入地址与比特位的映射关系确定第一原子写请求中的各个写操作对应的待写入地址与所述第二原子写请求中的各个写操作对应的待写入地址不发生地址冲突,即第一原子写请求和第二原子写请求可以构成一原子写并发组,该原子写并发组 包括数据写进程进行执行的第一原子写请求和第二原子写请求。Specifically, when the NVN controller determines, respectively, the first sequence of the first write operation in the first atomic write request and the first write operation in the first atomic write request, the first sequence of the concurrent write data is written into the NVM medium, After the second sequence of the first write operation concurrency group and the second atom write request in the second atom write request are written to the second sequence of the NVM medium, the NVM controller continues to combine the Bloom filter. The mapping relationship between the address to be written and the bit corresponding to the write operation of the first atomic write request in the bitmap, and the mapping relationship between the address to be written and the bit corresponding to the write operation of the second atomic write request determine the first atomic write The address to be written corresponding to each write operation in the request does not have an address conflict with the to-be-written address corresponding to each write operation in the second atomic write request, that is, the first atomic write request and the second atomic write request may constitute One atom writes a concurrency group, and the atom writes a concurrency group The first atomic write request and the second atomic write request are executed by the data write process.
S407:NVM控制器分别根据所述第一顺序和所述第一原子写请求对应的待写入地址、所述第二顺序和所述第二原子写请求对应的待写入地址,并行将所述第一原子写请求的各个第一写操作并发组对应的数据、所述第二原子写请求的各个第一写操作并发组对应的数据写入所述NVM介质。S407: The NVM controller performs parallel according to the first sequence and the to-be-written address corresponding to the first atomic write request, the second sequence, and the address to be written corresponding to the second atomic write request. The data corresponding to each of the first write operations of the first atomic write request and the data of the first write operation of the second atomic write request are written to the NVM medium.
需要说明的是,虽然第一原子写请求对应的数据和第二原子写请求对应的数据可以并行写入NVM介质,但是这里的“并行”指的是两个原子写请求的数据写进程是并行执行的,而原子写请求对应的数据仍然分别按照各自的第一写操作并发组的顺序写入NVM介质。即数据写进程并行执行指的是第一原子写请求在进行数据写入时,第二原子写请求也可以进行数据写入,但这两个原子写请求对应的数据写入NVM介质的顺序是独立的。It should be noted that although the data corresponding to the first atomic write request and the data corresponding to the second atomic write request can be written into the NVM medium in parallel, the “parallel” herein refers to the parallelism of the data writing process of the two atomic write requests. Executed, and the data corresponding to the atomic write request is still written to the NVM medium in the order of the respective first write operation concurrent groups. That is, the parallel execution of the data write process refers to the first atom write request. When the data is written, the second atom write request can also perform data writing, but the order of the data corresponding to the two atom write requests is written to the NVM medium. independent.
因此,通过将第一原子写请求对应的数据和第二原子写请求对应的数据并行写入NVM介质,进一步提高了数据写的效率。Therefore, by writing the data corresponding to the first atomic write request and the data corresponding to the second atomic write request to the NVM medium in parallel, the efficiency of data writing is further improved.
需要说明的是,当NVM控制器在将第一原子写请求对应的数据和第二原子写请求对应的数据并行写入NVM介质后,假设中央处理器在短时间内并没有继续向NVM控制器发送原子写请求,则NVM控制器才会在确定第一顺序和第二顺序后,向中央处理器发送原子写请求成功消息。It should be noted that, when the NVM controller writes the data corresponding to the first atomic write request and the data corresponding to the second atomic write request into the NVM medium in parallel, it is assumed that the central processor does not continue to the NVM controller in a short time. After the atomic write request is sent, the NVM controller sends an atomic write request success message to the central processor after determining the first order and the second order.
进一步地,当NVM控制器接收到的原子写请求为两个以上时,NVM控制器在分别确定各个原子写请求中的第一写操作并发组和各个第一写操作并发组对应的数据写入NVM介质的第一顺序后,依然会对所有原子写请求中相邻的两个原子写请求进行地址冲突检测(NVM控制器接收到的原子写请求之间本身就是有顺序的,因为中央处理器是顺序发送的原子写请求),以确定出原子写并发组,该原子写并发组包括数据写进程并行执行的至少一个原子写请求(如果一个原子写并发组中包括一个原子写请求,那么也可以看成自己与自己并行)。Further, when the NVM controller receives more than two atomic write requests, the NVM controller determines the data write of the first write operation concurrent group and each first write operation concurrent group in each atomic write request. After the first sequence of NVM media, address conflict detection is still performed on two adjacent atomic write requests in all atomic write requests (the atomic write requests received by the NVM controller are themselves sequential, because the central processor Is an atomic write request sent sequentially to determine the atomic write concurrency group, the atomic write concurrency group includes at least one atomic write request executed in parallel by the data write process (if an atomic write concurrency group includes an atomic write request, then Think of yourself as being in parallel with yourself).
最后,NVM控制器根据每个原子写请求中第一写操作并发组对应的数据写入NVM介质的第一顺序和该原子写请求对应的待写入地址,将原子写并发组中每个原子写请求的各个第一写操作并发组对应的数据从写请求存储器写入NVM介质。Finally, the NVM controller writes the atom to each atom in the concurrent group according to the first order of the first write operation concurrent data in each atomic write request and the first sequence of the NVM medium and the address to be written corresponding to the atomic write request. The data corresponding to each of the first write operations of the write request is written from the write request memory to the NVM medium.
例如,假设NVM控制器接收到3个原子写请求,分别为1#原子写请求、 2#原子写请求和3#原子写请求。1#原子写请求中包括包括3个写操作,分别是a、b、c;2#原子写请求包括3个写操作,分别是d、e、f;3#原子写请求包括2个写操作,分别是m、n。For example, suppose the NVM controller receives 3 atomic write requests, respectively 1# atomic write request, 2# atomic write request and 3# atomic write request. 1# atomic write request includes 3 write operations, which are a, b, c; 2# atomic write request includes 3 write operations, respectively d, e, f; 3# atomic write request includes 2 write operations , respectively, m, n.
当NVM控制器对1#原子写请求进行冲突检测后,NVM控制器确定1#原子写请求中的a和b构成了第一写操作并发组A,c构成了第一写操作并发组B。当NVM控制器对2#原子写请求进行冲突检测后,确定d构成了第一写操作并发组C,e与f构成了第一写操作并发组D。同理,NVM控制器对3#原子写请求进行冲突检测后,确定m和n构成了第一写操作并发组E。After the NVM controller performs collision detection on the 1# atomic write request, the NVM controller determines that a and b in the 1# atomic write request constitute the first write operation concurrent group A, and c constitutes the first write operation concurrent group B. After the NVM controller performs collision detection on the 2# atomic write request, it is determined that d constitutes the first write operation and the group C is formed, and e and f constitute the first write operation concurrent group D. Similarly, after the NVM controller performs collision detection on the 3# atomic write request, it is determined that m and n constitute the first write operation concurrent group E.
另外,NVM控制器确定的1#原子写请求中的第一写操作并发组的第一顺序为第一写操作并发组A对应的数据写入NVM介质在第一写操作并发组B之前;NVM控制器确定的2#原子写请求中的第一写操作并发组的第二顺序为第一写操作并发组C对应的数据写入NVM介质在第一写操作并发组D之前;NVM控制器确定的3#原子写请求中的第一写操作并发组的第二顺序为直接将第一写操作并发组E对应的数据写入NVM介质。In addition, the first sequence of the first write operation of the 1# atomic write request determined by the NVM controller is the first write operation, and the data corresponding to the send group A is written to the NVM medium before the first write operation concurrent group B; NVM The first write operation of the 2# atomic write request determined by the controller is the second write operation. The second write operation is performed by the first write operation. The data corresponding to the send group C is written to the NVM medium before the first write operation concurrent group D; the NVM controller determines The first write operation in the 3# atomic write request The second order of the concurrent write group is to directly write the data corresponding to the first write operation concurrent group E to the NVM medium.
之后,NVM控制器根据布隆过滤器位图中的待写入地址与比特位之间的映射关系,判断1#原子写请求、2#原子写请求和3#原子写请求各自对应的在布隆过滤器位图的比特位是否重叠,以确定原子写请求并发组。假设1#原子写请求、2#原子写请求和3#原子写请求各自对应的在布隆过滤器位图的比特位均不重叠,则确定1#原子写请求、2#原子写请求和3#原子写请求可以构成一个原子写请求并发组,即1#原子写请求、2#原子写请求和3#原子写请求可以同时进行数据写进程,且这三个原子写请求进行数据写入时的顺序是相互独立的。也就是说,NVM控制器在将1#原子写请求对应的数据写入NVM介质时,NVM控制器还可以将2#原子写请求和3#原子写请求各自对应的数据分别写入NVM介质,但是NVM控制器将1#原子写请求、2#原子写请求和3#原子写请求对应的数据写入NVM介质的顺序还是按照上述各自的第一写操作并发组的顺序进行的。After that, the NVM controller determines, according to the mapping relationship between the address to be written and the bit in the Bloom filter bitmap, that the 1# atomic write request, the 2# atomic write request, and the 3# atomic write request correspond to each other. Whether the bits of the bitmap of the filter overlap or not to determine the atomic write request concurrent group. Assuming that the bits of the Bloom filter bitmap do not overlap corresponding to the 1# atomic write request, the 2# atomic write request, and the 3# atomic write request, then the 1# atomic write request, the 2# atomic write request, and the 3 are determined. The # atomic write request can constitute an atomic write request concurrent group, that is, the 1# atomic write request, the 2# atomic write request, and the 3# atomic write request can simultaneously perform the data write process, and the three atomic write requests are used for data writing. The order is independent of each other. That is, when the NVM controller writes the data corresponding to the 1# atomic write request to the NVM medium, the NVM controller can also write the data corresponding to the 2# atomic write request and the 3# atomic write request to the NVM medium, respectively. However, the order in which the NVM controller writes the data corresponding to the 1# atomic write request, the 2# atomic write request, and the 3# atomic write request to the NVM medium is also performed in the order of the respective first write operations concurrently.
本发明实施例提供的数据写入的方法,通过NVM控制器根据布隆过滤器位图分别确定第一原子写请求中的各个写操作对应的待写入地址与第二原子写请求中的各个写操作对应的待写入地址不发生地址冲突,从而分别根据第一顺序和第一原子写请求对应的待写入地址、第二顺序和第二原子写请求 对应的待写入地址,并行将第一原子写请求的各个第一写操作并发组对应的数据、第二原子写请求的各个第一写操作并发组对应的数据写入NVM介质,进一步提高了数据写的效率。The data writing method provided by the embodiment of the present invention determines, by the NVM controller, each of the to-be-written address and the second atomic write request corresponding to each write operation in the first atomic write request according to the Bloom filter bitmap. The address to be written corresponding to the write operation does not cause an address conflict, so that the address to be written, the second sequence, and the second atomic write request corresponding to the first atomic write request according to the first order and the second atomic write request, respectively Corresponding to the address to be written, the data corresponding to each first write operation of the first atomic write request and the data corresponding to the first write operation of the second atomic write request are written into the NVM medium in parallel, thereby further improving The efficiency of data writing.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to the program instructions. The foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
图7为本发明提供的数据写入装置实施例一的结构示意图。该装置可以集成在NVM控制器中,还可以为NVM控制器。如图7所示,该装置包括:接收模块10、存储模块11、冲突检测模块12和数据写模块13。FIG. 7 is a schematic structural diagram of Embodiment 1 of a data writing apparatus according to the present invention. The device can be integrated into the NVM controller or it can be an NVM controller. As shown in FIG. 7, the apparatus includes: a receiving module 10, a storage module 11, a conflict detecting module 12, and a data writing module 13.
其中,接收模块10,用于接收中央处理器发送的第一原子写请求;所述第一原子写请求包括至少两个不冲突的写操作;存储模块11,用于将所述第一原子写请求对应的数据和所述第一原子写请求对应的待写入地址存储至写请求存储器;其中,所述第一原子写请求对应的待写入地址为NVM介质中的地址,所述第一原子写请求对应的待写入地址包括所述第一原子写请求中的各个写操作对应的待写入地址;冲突检测模块12,用于对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序;其中,所述第一原子写请求中的第一写操作并发组包括并行将数据写入所述NVM介质的至少一个写操作;数据写模块13,用于根据所述第一顺序和所述第一原子写请求对应的待写入地址,将所述第一原子写请求中的各个第一写操作并发组对应的数据从所述写请求存储器写入所述NVM介质。The receiving module 10 is configured to receive a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations; and the storage module 11 is configured to write the first atom And the address to be written corresponding to the first atomic write request is stored in the write request memory; wherein the address to be written corresponding to the first atomic write request is an address in the NVM medium, the first The address to be written corresponding to the atomic write request includes the address to be written corresponding to each write operation in the first atomic write request; the conflict detection module 12 is configured to perform collision detection on the first atomic write request, and determine Determining at least one first write operation concurrently in the first atomic write request, and determining a first sequence of writing data corresponding to each first write operation concurrent set in the first atomic write request to the NVM medium; The first write operation concurrent group in the first atomic write request includes at least one write operation of writing data to the NVM medium in parallel; the data write module 13 is configured to perform according to the first order The first atomic write request to be written to the address corresponding to the write operation corresponding to each concurrent group of the first write request to the first data from the atomic write request to write the NVM memory medium.
本发明实施例提供的数据写入装置,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。The data writing device provided in the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
图8为本发明提供的数据写入装置实施例二的结构示意图。在上述图7所示实施例的基础上,进一步地,上述冲突检测模块12,具体包括:地址冲突检测单元121,用于对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组;其中,所述第一原 子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突;通道冲突检测单元122,用于对所述第一原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组;其中,所述第一原子写请求的第一写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突;确定单元123,用于确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序。FIG. 8 is a schematic structural diagram of Embodiment 2 of a data writing apparatus according to the present invention. On the basis of the foregoing embodiment shown in FIG. 7, the conflict detection module 12 further includes: an address conflict detecting unit 121, configured to perform address conflict detection on each write operation in the first atomic write request, Obtaining a second write operation in the first atomic write request and concurrently generating the group; wherein the first original The second write operation of the sub-write request does not conflict with the address to be written corresponding to each write operation in the concurrent group; the channel conflict detecting unit 122 is configured to perform the second write operation of the first atomic write request in the concurrent group Performing channel conflict detection for each write operation, determining at least one first write operation concurrent group in the first atomic write request; wherein, the first write operation of the first atomic write request corresponds to each write operation in the concurrent write group The channel in which the data is written to the NVM medium does not conflict; the determining unit 123 is configured to determine a first sequence of writing data corresponding to each of the first write operations in the first atomic write request to the NVM medium .
进一步地,上述地址冲突检测单元121,具体用于将所述第一原子写请求中的各个写操作对应的待写入地址映射至布隆过滤器位图,并根据所述布隆过滤器位图对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组。Further, the address conflict detecting unit 121 is specifically configured to map the to-be-written address corresponding to each write operation in the first atomic write request to a Bloom filter bitmap, and according to the Bloom filter bit. The figure performs address conflict detection on each write operation in the first atomic write request, and obtains a second write operation in the first atomic write request to be concurrently grouped.
本发明实施例提供的数据写入装置,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。The data writing device provided in the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
进一步地,继续参照图8,上述接收模块10,还用于接收中央处理器发送的第二原子写请求;其中,所述第二原子写请求包括至少两个不冲突的写操作;Further, with reference to FIG. 8, the receiving module 10 is further configured to receive a second atomic write request sent by the central processing unit, where the second atomic write request includes at least two non-conflicting write operations;
上述存储模块11,还用于将所述第二原子写请求对应的数据和所述第二原子写请求对应的待写入地址存储至所述写请求存储器;其中,所述第二原子写请求对应的待写入地址为所述NVM介质中的地址,所述第二原子写请求对应的待写入地址包括所述第二原子写请求中的各个写操作对应的待写入地址;The storage module 11 is further configured to store the data corresponding to the second atomic write request and the to-be-written address corresponding to the second atomic write request to the write request memory; wherein the second atomic write request The corresponding address to be written is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes an address to be written corresponding to each write operation in the second atomic write request;
上述地址冲突检测单元121,还用于将所述第二原子写请求中的各个写操作对应的待写入地址映射至所述布隆过滤器位图,并根据所述布隆过滤器位图对所述第二原子写请求中的各个写操作进行地址冲突检测,获得所述第二原子写请求中的第二写操作并发组;其中,所述第二原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突;并且,还用于根据所述布隆过滤器位图确定所述第一原子写请求中的各个写操作对应的待写入地址与所述第二原子写请求中的各个写操作对应的待写入地址不发生地址冲突;The address conflict detecting unit 121 is further configured to map the to-be-written address corresponding to each write operation in the second atomic write request to the Bloom filter bitmap, and according to the Bloom filter bitmap Performing address conflict detection on each write operation in the second atomic write request to obtain a second write operation concurrently in the second atom write request; wherein the second write operation of the second atom write request is concurrent The address to be written corresponding to each write operation in the group does not conflict; and is further configured to determine, according to the Bloom filter bitmap, a to-be-written address corresponding to each write operation in the first atomic write request An address conflict does not occur in the address to be written corresponding to each write operation in the second atomic write request;
上述通道检测单元122,还用于对所述第二原子写请求的第二写操作并 发组中的各个写操作进行通道冲突检测,确定所述第二原子写请求中的至少一个第一写操作并发组;其中,所述第二原子写请求的第二写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突;The channel detecting unit 122 is further configured to perform a second write operation on the second atom write request and Each of the write operations in the issue group performs channel conflict detection to determine at least one first write operation concurrent set in the second atom write request; wherein the second write operation of the second atom write request is in each of the concurrent write groups The channel corresponding to the write operation is written to the channel of the NVM medium without conflict;
上述确定单元123,还用于确定将所述第二原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第二顺序;The determining unit 123 is further configured to determine a second sequence of writing data corresponding to each of the first write operations in the second atomic write request to the NVM medium;
上述数据写模块13,还用于分别根据所述第一顺序和所述第一原子写请求对应的待写入地址、所述第二顺序和所述第二原子写请求对应的待写入地址,并行将所述第一原子写请求的各个第一写操作并发组对应的数据、所述第二原子写请求的各个第一写操作并发组对应的数据写入所述NVM介质。The data writing module 13 is further configured to: according to the first sequence and the to-be-written address corresponding to the first atomic write request, the second sequence, and the to-be-written address corresponding to the second atomic write request And data corresponding to each first write operation concurrent group of the first atomic write request and data corresponding to each first write operation concurrent group of the second atomic write request are written in parallel to the NVM medium.
本发明实施例提供的数据写入装置,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。The data writing device provided in the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
图9为本发明提供的数据写入装置实施例三的结构示意图。在上述图8所示实施例的基础上,该装置还包括:清除模块14,用于在所述数据写模块13将第一原子写请求的所有写操作对应的数据均写入所述NVM介质后,清除布隆过滤器位图中与所述第一原子写请求对应的标志位。FIG. 9 is a schematic structural diagram of Embodiment 3 of a data writing apparatus according to the present invention. On the basis of the foregoing embodiment shown in FIG. 8, the apparatus further includes: a clearing module 14 for writing, in the data writing module 13, data corresponding to all write operations of the first atomic write request to the NVM medium. Thereafter, the flag bit corresponding to the first atomic write request in the Bloom filter bitmap is cleared.
图10为本发明提供的数据写入装置实施例四的结构示意图。在上述图8所示实施例的基础上,如图10所示,该装置还包括:发送模块14。FIG. 10 is a schematic structural diagram of Embodiment 4 of a data writing apparatus according to the present invention. Based on the embodiment shown in FIG. 8 above, as shown in FIG. 10, the device further includes: a sending module 14.
具体的,该发送模块14,用于在所述冲突检测模块12对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序之后,向所述中央处理器发送原子写成功消息;则上述接收模块10,还用于接收所述中央处理器发送的原子写结束命令。Specifically, the sending module 14 is configured to perform collision detection on the first atomic write request by the conflict detection module 12, determine at least one first write operation concurrent group in the first atomic write request, and determine After writing the data corresponding to each of the first write operations in the first atomic write request to the first sequence of the NVM medium, sending an atomic write success message to the central processor; then the receiving module 10, Also used to receive an atomic write end command sent by the central processor.
本发明实施例提供的数据写入装置,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。The data writing device provided in the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
图11为本发明提供的数据写入设备实施例五的结构示意图。如图11所示,该设备包括:接收器20、处理器21。FIG. 11 is a schematic structural diagram of Embodiment 5 of a data writing device according to the present invention. As shown in FIG. 11, the device includes a receiver 20 and a processor 21.
其中,接收器20,用于接收中央处理器发送的第一原子写请求;所述第一原子写请求包括至少两个不冲突的写操作;处理器21,用于将所述第一原子写请求对应的数据和所述第一原子写请求对应的待写入地址存储至写请求存储器;其中,所述第一原子写请求对应的待写入地址为NVM介质中的地 址,所述第一原子写请求对应的待写入地址包括所述第一原子写请求中的各个写操作对应的待写入地址;并用于对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序;其中,所述第一原子写请求中的第一写操作并发组包括并行将数据写入所述NVM介质的至少一个写操作;还用于根据所述第一顺序和所述第一原子写请求对应的待写入地址,将所述第一原子写请求中的各个第一写操作并发组对应的数据从所述写请求存储器写入所述NVM介质。The receiver 20 is configured to receive a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations; and the processor 21 is configured to write the first atom The requesting corresponding data and the to-be-written address corresponding to the first atomic write request are stored in the write request memory; wherein the address to be written corresponding to the first atomic write request is a place in the NVM medium The address to be written corresponding to the first atomic write request includes a to-be-written address corresponding to each write operation in the first atomic write request; and is used to perform collision detection on the first atomic write request, and determine At least one of the first atomic write requests concurrently groups and determines a first order in which data corresponding to each of the first write operations in the first atomic write request is written to the NVM medium And wherein the first write operation concurrent set in the first atomic write request includes at least one write operation of writing data to the NVM medium in parallel; and is further configured to write according to the first sequence and the first atom Requesting a corresponding to-be-written address, and writing data corresponding to each of the first write operations in the first atomic write request from the write request memory to the NVM medium.
本发明实施例提供的数据写入设备,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。The data writing device provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
进一步地,上述处理器21,具体用于对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组,并对所述第一原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序。其中,所述第一原子写请求的第一写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突其中;所述第一原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突。Further, the processor 21 is specifically configured to perform address conflict detection on each write operation in the first atomic write request, obtain a second write operation concurrently in the first atomic write request, and perform the The second write operation of the first atomic write request performs a channel conflict detection for each write operation in the concurrent set, determines at least one first write operation concurrent set in the first atomic write request, and determines to write the first atom The first sequence of concurrent write operations in the request is written to the first sequence of the NVM media. The channel in which the data corresponding to each write operation in the first write operation of the first atomic write request is written to the NVM medium does not conflict; the second write operation of the first atom write request is concurrent The addresses to be written corresponding to the individual write operations in the group do not conflict.
更进一步地,上述处理器21,具体用于将所述第一原子写请求中的各个写操作对应的待写入地址映射至布隆过滤器位图,并根据所述布隆过滤器位图对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组。Further, the processor 21 is specifically configured to map a to-be-written address corresponding to each write operation in the first atomic write request to a Bloom filter bitmap, and according to the Bloom filter bitmap Address conflict detection is performed on each write operation in the first atomic write request, and a second write operation in the first atomic write request is obtained and concurrently grouped.
更进一步地,上述处理器21,还用于在将第一原子写请求的所有写操作对应的数据均写入所述NVM介质后,清除布隆过滤器位图中与所述第一原子写请求对应的标志位。Further, the processor 21 is further configured to: after writing data corresponding to all write operations of the first atomic write request to the NVM medium, clear the first atomic write in the Bloom filter bitmap Request the corresponding flag bit.
本发明实施例提供的数据写入设备,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。The data writing device provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
在上述实施例的基础上,更进一步地,上述接收器20,还用于接收中央处理器发送的第二原子写请求;其中,所述第二原子写请求包括至少两个不 冲突的写操作;On the basis of the foregoing embodiment, the receiver 20 is further configured to receive a second atomic write request sent by the central processing unit, where the second atomic write request includes at least two Conflicting write operation;
则上述处理器21,还用于将所述第二原子写请求对应的数据和所述第二原子写请求对应的待写入地址存储至所述写请求存储器,并将所述第二原子写请求中的各个写操作对应的待写入地址映射至所述布隆过滤器位图,并根据所述布隆过滤器位图对所述第二原子写请求中的各个写操作进行地址冲突检测,获得所述第二原子写请求中的第二写操作并发组,并根据所述布隆过滤器位图确定所述第一原子写请求中的各个写操作对应的待写入地址与所述第二原子写请求中的各个写操作对应的待写入地址不发生地址冲突;以及,对所述第二原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第二原子写请求中的至少一个第一写操作并发组并确定将所述第二原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第二顺序,并且,分别根据所述第一顺序和所述第一原子写请求对应的待写入地址、所述第二顺序和所述第二原子写请求对应的待写入地址,并行将所述第一原子写请求的各个第一写操作并发组对应的数据、所述第二原子写请求的各个第一写操作并发组对应的数据写入所述NVM介质。其中,所述第二原子写请求对应的待写入地址为所述NVM介质中的地址,所述第二原子写请求对应的待写入地址包括所述第二原子写请求中的各个写操作对应的待写入地址;所述第二原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突;所述第二原子写请求的第二写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突。The processor 21 is further configured to store the data corresponding to the second atomic write request and the to-be-written address corresponding to the second atomic write request to the write request memory, and write the second atom Addresses to be written corresponding to respective write operations in the request are mapped to the Bloom filter bitmap, and address conflict detection is performed on each write operation in the second atomic write request according to the Bloom filter bitmap Obtaining a second write operation in the second atomic write request concurrently, and determining, according to the Bloom filter bitmap, a to-be-written address corresponding to each write operation in the first atomic write request and the An address conflict does not occur in the address to be written corresponding to each write operation in the second atomic write request; and the channel conflict detection is performed on each write operation in the second write operation of the second atomic write request to determine the location At least one first write operation of the second atomic write request concurrently groups and determines a second sequence of writing data corresponding to each of the first write operations in the second atomic write request to the NVM medium, and Determining the first atom in parallel according to the first sequence and the address to be written corresponding to the first atomic write request, the second sequence, and the address to be written corresponding to the second atomic write request The data corresponding to each first write operation concurrent group of the write request and the data corresponding to each first write operation concurrent set of the second atom write request are written into the NVM medium. The address to be written corresponding to the second atomic write request is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes each write operation in the second atomic write request. Corresponding write address to be written; the second write operation request of the second atomic write request does not conflict with the address to be written corresponding to each write operation in the concurrent write group; the second write operation concurrent set of the second atomic write request The data corresponding to each write operation in the write to the NVM medium does not conflict.
本发明实施例提供的数据写入设备,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。The data writing device provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
图12为本发明提供的数据写入设备实施例六的结构示意图。在上述图11所示实施例的基础上,进一步地,如图12所示,该设备该包括:发送器22,用于在所述处理器21对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序之后,向所述中央处理器发送原子写成功消息;所述接收器10,还用于接收所述中央处理器发送的原子写结束命令。FIG. 12 is a schematic structural diagram of Embodiment 6 of a data writing device according to the present invention. On the basis of the foregoing embodiment shown in FIG. 11, further, as shown in FIG. 12, the device includes: a transmitter 22, configured to perform collision detection on the first atomic write request by the processor 21, Determining at least one first write operation concurrent set in the first atomic write request, and determining to write data corresponding to each first write operation concurrent set in the first atomic write request to the first of the NVM medium After the sequence, an atomic write success message is sent to the central processor; the receiver 10 is further configured to receive an atomic write end command sent by the central processor.
图13为本发明提供的存储系统实施例的结构示意图。如图13所示,该 存储系统包括中央处理器30、写请求存储器31、NVM介质32以及上述实施例中的NVM控制器33。并且,该中央处理器30、写请求存储器31、NVM介质32以及NVM控制器33通过总线34相互连接。FIG. 13 is a schematic structural diagram of an embodiment of a storage system according to the present invention. As shown in Figure 13, this The storage system includes a central processing unit 30, a write request memory 31, an NVM medium 32, and an NVM controller 33 in the above embodiment. Further, the central processing unit 30, the write request memory 31, the NVM medium 32, and the NVM controller 33 are connected to one another via a bus 34.
本发明实施例提供的存储系统,可以执行上述方法实施例,其实现原理和技术效果类似,在此不再赘述。The storage system provided by the embodiment of the present invention may perform the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and details are not described herein again.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。 Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the foregoing embodiments may be modified, or some or all of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the technical solutions of the embodiments of the present invention. range.

Claims (13)

  1. 一种数据写入的方法,其特征在于,包括:A method for data writing, comprising:
    非易失性存储设备NVM控制器接收中央处理器发送的第一原子写请求;所述第一原子写请求包括至少两个不冲突的写操作;The non-volatile storage device NVM controller receives a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations;
    所述NVM控制器将所述第一原子写请求对应的数据和所述第一原子写请求对应的待写入地址存储至写请求存储器;其中,所述第一原子写请求对应的待写入地址为NVM介质中的地址,所述第一原子写请求对应的待写入地址包括所述第一原子写请求中的各个写操作对应的待写入地址;The NVM controller stores the data corresponding to the first atomic write request and the to-be-written address corresponding to the first atomic write request to a write request memory; wherein the first atomic write request corresponds to be written The address is an address in the NVM medium, and the to-be-written address corresponding to the first atomic write request includes a to-be-written address corresponding to each write operation in the first atomic write request;
    所述NVM控制器对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序;其中,所述第一原子写请求中的第一写操作并发组包括并行将数据写入所述NVM介质的至少一个写操作;The NVM controller performs collision detection on the first atomic write request, determines at least one first write operation concurrent group in the first atomic write request, and determines to each of the first atomic write requests Writing a data to a first sequence of data of the concurrent set of writes to the NVM medium; wherein the first write operation concurrent set of the first atomic write request includes writing at least one write of data to the NVM medium in parallel operating;
    所述NVM控制器根据所述第一顺序和所述第一原子写请求对应的待写入地址,将所述第一原子写请求中的各个第一写操作并发组对应的数据从所述写请求存储器写入所述NVM介质。And the NVM controller, according to the first sequence and the to-be-written address corresponding to the first atomic write request, data corresponding to each first write operation concurrent group in the first atomic write request from the write The memory is requested to be written to the NVM medium.
  2. 根据权利要求1所述的方法,其特征在于,所述NVM控制器对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序,包括:The method according to claim 1, wherein the NVM controller performs collision detection on the first atomic write request, determines at least one first write operation concurrent group in the first atomic write request, and Determining a first sequence of writing data corresponding to each of the first write operations in the first atomic write request to the NVM medium, comprising:
    所述NVM控制器对所述第一原子写请求中的各个写操作进行地址冲突检测,获得至少一个所述第一原子写请求中的第二写操作并发组;其中,所述第一原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突;The NVM controller performs address conflict detection on each write operation in the first atomic write request, and obtains a second write operation concurrent group in at least one of the first atomic write requests; wherein the first atom writes The second write operation of the request does not conflict with the address to be written corresponding to each write operation in the concurrent group;
    所述NVM控制器对所述第一原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组;其中,所述第一原子写请求的第一写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突;The NVM controller performs channel conflict detection on each write operation in the second write operation concurrent group of the first atomic write request, and determines at least one first write operation concurrent group in the first atomic write request; The first write operation of the first atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium;
    所述NVM控制器确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序。 The NVM controller determines a first order in which data corresponding to each of the first write operations in the first atomic write request is written to the NVM medium.
  3. 根据权利要求2所述的方法,其特征在于,所述NVM控制器对所述第一原子写请求中的各个写操作进行地址冲突检测,获得至少一个所述第一原子写请求中的第二写操作并发组,具体包括:The method according to claim 2, wherein said NVM controller performs address conflict detection on each of said first atomic write requests to obtain a second of said at least one of said first atomic write requests Write operations concurrent groups, including:
    所述NVM控制器将所述第一原子写请求中的各个写操作对应的待写入地址映射至布隆过滤器位图;The NVM controller maps a to-be-written address corresponding to each write operation in the first atomic write request to a Bloom filter bitmap;
    所述NVM控制器根据所述布隆过滤器位图对所述第一原子写请求中的各个写操作进行地址冲突检测,获得所述第一原子写请求中的第二写操作并发组。The NVM controller performs address conflict detection on each write operation in the first atomic write request according to the Bloom filter bitmap to obtain a second write operation concurrent group in the first atomic write request.
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method of claim 3, wherein the method further comprises:
    所述NVM控制器接收中央处理器发送的第二原子写请求;其中,所述第二原子写请求包括至少两个不冲突的写操作;The NVM controller receives a second atomic write request sent by the central processor; wherein the second atomic write request includes at least two non-conflicting write operations;
    所述NVM控制器将所述第二原子写请求对应的数据和所述第二原子写请求对应的待写入地址存储至所述写请求存储器;其中,所述第二原子写请求对应的待写入地址为所述NVM介质中的地址,所述第二原子写请求对应的待写入地址包括所述第二原子写请求中的各个写操作对应的待写入地址;The NVM controller stores data corresponding to the second atomic write request and a to-be-written address corresponding to the second atomic write request to the write request memory; wherein the second atomic write request corresponds to The write address is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes an address to be written corresponding to each write operation in the second atomic write request;
    所述NVM控制器将所述第二原子写请求中的各个写操作对应的待写入地址映射至所述布隆过滤器位图,并根据所述布隆过滤器位图对所述第二原子写请求中的各个写操作进行地址冲突检测,获得所述第二原子写请求中的第二写操作并发组;其中,所述第二原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突;The NVM controller maps a to-be-written address corresponding to each write operation in the second atomic write request to the Bloom filter bitmap, and pairs the second according to the Bloom filter bitmap Each of the write operations in the atomic write request performs address conflict detection to obtain a second write operation concurrently in the second atom write request; wherein the second write operation of the second atom write request concurrently writes each write in the group The address to be written corresponding to the operation does not conflict;
    所述NVM控制器对所述第二原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第二原子写请求中的至少一个第一写操作并发组;其中,所述第二原子写请求的第一写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突;The NVM controller performs channel conflict detection on each write operation in the second write operation concurrent group of the second atomic write request, and determines at least one first write operation concurrent group in the second atom write request; The first write operation of the second atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium;
    所述NVM控制器确定将所述第二原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第二顺序;Determining, by the NVM controller, a second sequence of writing data corresponding to each of the first write operations in the second atomic write request to the NVM medium;
    所述NVM控制器根据所述布隆过滤器位图确定所述第一原子写请求中的各个写操作对应的待写入地址与所述第二原子写请求中的各个写操作对应的待写入地址不发生地址冲突;Determining, by the NVM controller, the to-be-written address corresponding to each write operation in the first atomic write request and the write operation corresponding to each write operation in the second atomic write request according to the Bloom filter bitmap The address does not have an address conflict;
    所述NVM控制器分别根据所述第一顺序和所述第一原子写请求对应的 待写入地址、所述第二顺序和所述第二原子写请求对应的待写入地址,并行将所述第一原子写请求的各个第一写操作并发组对应的数据、所述第二原子写请求的各个第一写操作并发组对应的数据写入所述NVM介质。The NVM controller respectively corresponds to the first atom and the first atomic write request The address to be written, the second sequence, and the address to be written corresponding to the second atomic write request, and the data corresponding to each of the first write operations of the first atomic write request are concurrently combined with the second The data corresponding to each of the first write operations of the atomic write request is written to the NVM medium.
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, wherein the method further comprises:
    所述NVM控制器将第一原子写请求的所有写操作对应的数据均写入所述NVM介质后,清除布隆过滤器位图中与所述第一原子写请求对应的标志位。After the NVM controller writes data corresponding to all write operations of the first atomic write request to the NVM medium, the flag bit corresponding to the first atomic write request in the Bloom filter bitmap is cleared.
  6. 根据权利要求1-3任一项所述的方法,其特征在于,所述NVM控制器对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序之后,所述方法还包括:The method according to any one of claims 1 to 3, wherein the NVM controller performs collision detection on the first atomic write request, and determines at least one first write in the first atomic write request. After operating the concurrent group and determining to write the data corresponding to each of the first write operations in the first atomic write request to the NVM medium, the method further includes:
    所述NVM控制器向所述中央处理器发送原子写成功消息;The NVM controller sends an atomic write success message to the central processor;
    所述NVM控制器接收所述中央处理器发送的原子写结束命令。The NVM controller receives an atomic write end command sent by the central processor.
  7. 一种数据写入装置,其特征在于,包括:A data writing device, comprising:
    接收模块,用于接收中央处理器发送的第一原子写请求;所述第一原子写请求包括至少两个不冲突的写操作;a receiving module, configured to receive a first atomic write request sent by the central processor; the first atomic write request includes at least two non-conflicting write operations;
    存储模块,用于将所述第一原子写请求对应的数据和所述第一原子写请求对应的待写入地址存储至写请求存储器;其中,所述第一原子写请求对应的待写入地址为NVM介质中的地址,所述第一原子写请求对应的待写入地址包括所述第一原子写请求中的各个写操作对应的待写入地址;a storage module, configured to store data corresponding to the first atomic write request and a to-be-written address corresponding to the first atomic write request to a write request memory; wherein the first atomic write request corresponds to a write request The address is an address in the NVM medium, and the to-be-written address corresponding to the first atomic write request includes a to-be-written address corresponding to each write operation in the first atomic write request;
    冲突检测模块,用于对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序;其中,所述第一原子写请求中的第一写操作并发组包括并行将数据写入所述NVM介质的至少一个写操作;a conflict detection module, configured to perform collision detection on the first atomic write request, determine at least one first write operation concurrent group in the first atomic write request, and determine each of the first atomic write requests Writing a first sequence of concurrent write data to the first sequence of the NVM media; wherein the first write operation concurrent set of the first atomic write request includes writing data to at least one of the NVM media in parallel Write operation
    数据写模块,用于根据所述第一顺序和所述第一原子写请求对应的待写入地址,将所述第一原子写请求中的各个第一写操作并发组对应的数据从所述写请求存储器写入所述NVM介质。a data writing module, configured to: according to the first sequence and the address to be written corresponding to the first atomic write request, data corresponding to each first write operation concurrent group in the first atomic write request from the A write request memory is written to the NVM medium.
  8. 根据权利要求7所述的装置,其特征在于,所述冲突检测模块,具体包括: The apparatus according to claim 7, wherein the conflict detection module specifically includes:
    地址冲突检测单元,用于对所述第一原子写请求中的各个写操作进行地址冲突检测,获得至少一个所述第一原子写请求中的第二写操作并发组;其中,所述第一原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突;An address conflict detecting unit, configured to perform address conflict detection on each write operation in the first atomic write request, to obtain a second write operation concurrent group in at least one of the first atomic write requests; wherein, the first The second write operation of the atomic write request does not conflict with the address to be written corresponding to each write operation in the concurrent group;
    通道冲突检测单元,用于对所述第一原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组;其中,所述第一原子写请求的第一写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突;a channel conflict detecting unit, configured to perform channel conflict detection on each write operation in the second write operation concurrent group of the first atomic write request, and determine at least one first write operation concurrent group in the first atomic write request Wherein the first write operation of the first atomic write request and the data corresponding to each write operation in the concurrent write group are written to the channel of the NVM medium without conflict;
    确定单元,用于确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序。And a determining unit, configured to determine a first sequence of writing data corresponding to each of the first write operations in the first atomic write request to the NVM medium.
  9. 根据权利要求8所述的装置,其特征在于,所述地址冲突检测单元,具体用于将所述第一原子写请求中的各个写操作对应的待写入地址映射至布隆过滤器位图,并根据所述布隆过滤器位图对所述第一原子写请求中的各个写操作进行地址冲突检测,获得至少一个所述第一原子写请求中的第二写操作并发组。The device according to claim 8, wherein the address conflict detecting unit is configured to map a to-be-written address corresponding to each write operation in the first atomic write request to a Bloom filter bitmap. And performing address conflict detection on each write operation in the first atomic write request according to the Bloom filter bitmap to obtain a second write operation concurrent group in at least one of the first atomic write requests.
  10. 根据权利要求9所述的装置,其特征在于,所述接收模块,还用于接收中央处理器发送的第二原子写请求;其中,所述第二原子写请求包括至少两个不冲突的写操作;The apparatus according to claim 9, wherein the receiving module is further configured to receive a second atomic write request sent by the central processor; wherein the second atomic write request includes at least two non-conflicting writes operating;
    所述存储模块,还用于将所述第二原子写请求对应的数据和所述第二原子写请求对应的待写入地址存储至所述写请求存储器;其中,所述第二原子写请求对应的待写入地址为所述NVM介质中的地址,所述第二原子写请求对应的待写入地址包括所述第二原子写请求中的各个写操作对应的待写入地址;The storage module is further configured to store data corresponding to the second atomic write request and a to-be-written address corresponding to the second atomic write request to the write request memory; wherein the second atomic write request The corresponding address to be written is an address in the NVM medium, and the address to be written corresponding to the second atomic write request includes an address to be written corresponding to each write operation in the second atomic write request;
    所述地址冲突检测单元,还用于将所述第二原子写请求中的各个写操作对应的待写入地址映射至所述布隆过滤器位图,并根据所述布隆过滤器位图对所述第二原子写请求中的各个写操作进行地址冲突检测,获得所述第二原子写请求中的第二写操作并发组;其中,所述第二原子写请求的第二写操作并发组中的各个写操作对应的待写入地址不发生冲突;并且,还用于根据所述布隆过滤器位图确定所述第一原子写请求中的各个写操作对应的待写入地址与所述第二原子写请求中的各个写操作对应的待写入地址不发生地址冲 突;The address conflict detecting unit is further configured to map the to-be-written address corresponding to each write operation in the second atomic write request to the Bloom filter bitmap, and according to the Bloom filter bitmap Performing address conflict detection on each write operation in the second atomic write request to obtain a second write operation concurrently in the second atom write request; wherein the second write operation of the second atom write request is concurrent The address to be written corresponding to each write operation in the group does not conflict; and is further configured to determine, according to the Bloom filter bitmap, a to-be-written address corresponding to each write operation in the first atomic write request The address to be written corresponding to each write operation in the second atomic write request does not occur. Suddenly
    所述通道检测单元,还用于对所述第二原子写请求的第二写操作并发组中的各个写操作进行通道冲突检测,确定所述第二原子写请求中的至少一个第一写操作并发组;其中,所述第二原子写请求的第二写操作并发组中的各个写操作对应的数据写入所述NVM介质的通道不发生冲突;The channel detecting unit is further configured to perform channel conflict detection on each write operation in the second write operation concurrent group of the second atom write request, and determine at least one first write operation in the second atom write request a concurrent group; wherein, the second write operation of the second atomic write request does not conflict with the channel in which the data corresponding to each write operation in the concurrent set is written to the NVM medium;
    所述确定单元,还用于确定将所述第二原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第二顺序;The determining unit is further configured to determine a second sequence of writing data corresponding to each of the first write operations in the second atomic write request to the NVM medium;
    所述数据写模块,还用于分别根据所述第一顺序和所述第一原子写请求对应的待写入地址、所述第二顺序和所述第二原子写请求对应的待写入地址,并行将所述第一原子写请求的各个第一写操作并发组对应的数据、所述第二原子写请求的各个第一写操作并发组对应的数据写入所述NVM介质。The data writing module is further configured to: according to the first sequence and the to-be-written address corresponding to the first atomic write request, the second sequence, and the to-be-written address corresponding to the second atomic write request And data corresponding to each first write operation concurrent group of the first atomic write request and data corresponding to each first write operation concurrent group of the second atomic write request are written in parallel to the NVM medium.
  11. 根据权利要求7-10任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 7 to 10, wherein the device further comprises:
    清除模块,用于在所述数据写模块将第一原子写请求的所有写操作对应的数据均写入所述NVM介质后,清除布隆过滤器位图中与所述第一原子写请求对应的标志位。a clearing module, configured to: after the data writing module writes data corresponding to all write operations of the first atomic write request to the NVM medium, clear a Bloom filter bitmap corresponding to the first atomic write request Sign bit.
  12. 根据权利要求7-9任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 7-9, wherein the device further comprises:
    发送模块,用于在所述冲突检测模块对所述第一原子写请求进行冲突检测,确定所述第一原子写请求中的至少一个第一写操作并发组,并确定将所述第一原子写请求中的各个第一写操作并发组对应的数据写入所述NVM介质的第一顺序之后,向所述中央处理器发送原子写成功消息;a sending module, configured to perform collision detection on the first atomic write request by the conflict detection module, determine at least one first write operation concurrent group in the first atomic write request, and determine to use the first atom After the first sequence of the first write operation concurrently in the write request is written into the first sequence of the NVM medium, an atomic write success message is sent to the central processor;
    所述接收模块,还用于接收所述中央处理器发送的原子写结束命令。The receiving module is further configured to receive an atomic write end command sent by the central processing unit.
  13. 一种存储系统,其特征在于,包括:中央处理器、写请求存储器、非易失性存储设备NVM介质以及权利要求1至权利要求6任一项所述的NVM控制器。 A storage system, comprising: a central processing unit, a write request memory, a non-volatile storage device NVM medium, and the NVM controller of any one of claims 1 to 6.
PCT/CN2014/092702 2014-12-01 2014-12-01 Data write-in method, apparatus and device, and storage system WO2016086342A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2014/092702 WO2016086342A1 (en) 2014-12-01 2014-12-01 Data write-in method, apparatus and device, and storage system
CN201480038253.6A CN105849688B (en) 2014-12-01 2014-12-01 Method, apparatus, equipment and the storage system of data write-in

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/092702 WO2016086342A1 (en) 2014-12-01 2014-12-01 Data write-in method, apparatus and device, and storage system

Publications (1)

Publication Number Publication Date
WO2016086342A1 true WO2016086342A1 (en) 2016-06-09

Family

ID=56090796

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/092702 WO2016086342A1 (en) 2014-12-01 2014-12-01 Data write-in method, apparatus and device, and storage system

Country Status (2)

Country Link
CN (1) CN105849688B (en)
WO (1) WO2016086342A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110504002A (en) * 2019-08-01 2019-11-26 苏州浪潮智能科技有限公司 A kind of hard disc data conformance test method and device
WO2020119050A1 (en) * 2018-12-11 2020-06-18 Huawei Technologies Co., Ltd. Write-write conflict detection for multi-master shared storage database
CN112395245A (en) * 2019-08-16 2021-02-23 上海寒武纪信息科技有限公司 Processor access device and method and computer equipment
CN112395243A (en) * 2019-08-16 2021-02-23 上海寒武纪信息科技有限公司 Processor access method and device
CN112395244A (en) * 2019-08-16 2021-02-23 上海寒武纪信息科技有限公司 Processor access device and method

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228483B (en) * 2016-12-15 2021-09-14 北京忆恒创源科技股份有限公司 Method and apparatus for processing atomic write commands
CN113360081A (en) 2020-03-06 2021-09-07 华为技术有限公司 Data processing method and apparatus thereof
CN111858514A (en) * 2020-07-27 2020-10-30 博泰车联网(南京)有限公司 Data writing method and device and computer storage medium
CN112187561B (en) * 2020-08-19 2022-05-27 深圳市广和通无线股份有限公司 Communication module testing method, device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080288819A1 (en) * 2007-05-14 2008-11-20 International Business Machines Corporation Computing System with Transactional Memory Using Millicode Assists
CN102411491A (en) * 2011-12-31 2012-04-11 中国科学院自动化研究所 Data access method and device for parallel FFT (Fast Fourier Transform) computation
CN103530066A (en) * 2013-09-16 2014-01-22 华为技术有限公司 Data storage method, device and system

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7173863B2 (en) * 2004-03-08 2007-02-06 Sandisk Corporation Flash controller cache architecture
KR100881597B1 (en) * 2007-02-02 2009-02-03 지인정보기술 주식회사 System and method for processing read request
CN101038571A (en) * 2007-04-19 2007-09-19 北京理工大学 Multiport storage controller of block transmission
CN101464781A (en) * 2008-12-31 2009-06-24 成都市华为赛门铁克科技有限公司 Port control method and apparatus, and solid state disk
CN102306115B (en) * 2011-05-20 2014-01-08 华为数字技术(成都)有限公司 Asynchronous remote copying method, system and equipment
CN102279712A (en) * 2011-08-10 2011-12-14 北京百度网讯科技有限公司 Storage control method, system and device applied to network storage system
WO2013158817A1 (en) * 2012-04-20 2013-10-24 Violin Memory, Inc. Lun management with distributed raid controllers
KR101450157B1 (en) * 2013-08-19 2014-10-13 이화여자대학교 산학협력단 Apparatus and method for cooperative data management for non-volatile ubj buffer cache and non-volatile storage

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080288819A1 (en) * 2007-05-14 2008-11-20 International Business Machines Corporation Computing System with Transactional Memory Using Millicode Assists
CN102411491A (en) * 2011-12-31 2012-04-11 中国科学院自动化研究所 Data access method and device for parallel FFT (Fast Fourier Transform) computation
CN103530066A (en) * 2013-09-16 2014-01-22 华为技术有限公司 Data storage method, device and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020119050A1 (en) * 2018-12-11 2020-06-18 Huawei Technologies Co., Ltd. Write-write conflict detection for multi-master shared storage database
CN110504002A (en) * 2019-08-01 2019-11-26 苏州浪潮智能科技有限公司 A kind of hard disc data conformance test method and device
CN112395245A (en) * 2019-08-16 2021-02-23 上海寒武纪信息科技有限公司 Processor access device and method and computer equipment
CN112395243A (en) * 2019-08-16 2021-02-23 上海寒武纪信息科技有限公司 Processor access method and device
CN112395244A (en) * 2019-08-16 2021-02-23 上海寒武纪信息科技有限公司 Processor access device and method

Also Published As

Publication number Publication date
CN105849688A (en) 2016-08-10
CN105849688B (en) 2019-10-22

Similar Documents

Publication Publication Date Title
WO2016086342A1 (en) Data write-in method, apparatus and device, and storage system
US9787773B2 (en) Method and system for global namespace with consistent hashing
US20150248434A1 (en) Delayed asynchronous file replication in a distributed file system
US10154112B1 (en) Cloud-to-cloud data migration via cache
US20180349396A1 (en) Managing I/O Operations in a Storage Network
WO2019127916A1 (en) Data read/write method and device implemented on the basis of distributed consensus protocol
EP2711841A1 (en) Data processing method, device and system based on block storage
US20100191919A1 (en) Append-based shared persistent storage
US10116746B2 (en) Data storage method and network interface card
US20170242822A1 (en) Dram appliance for data persistence
WO2017157158A1 (en) Data writing method and apparatus, and computer storage medium
US20190220402A1 (en) Data recovery method, data recovery system, and computer program product
WO2023207492A1 (en) Data processing method and apparatus, device, and readable storage medium
US20140244936A1 (en) Maintaining cache coherency between storage controllers
CN110489388A (en) A kind of implementation method and equipment locked for SCSI in distributed network storage system
US9606910B2 (en) Method and apparatus for data reduction
US8595430B2 (en) Managing a virtual tape library domain and providing ownership of scratch erased volumes to VTL nodes
WO2016206070A1 (en) File updating method and storage device
US20200133807A1 (en) Concurrent remote io processing for synchronous replication
WO2019000423A1 (en) Data storage method and device
JP6378364B2 (en) File management method and file system
US20210311654A1 (en) Distributed Storage System and Computer Program Product
US20210278981A1 (en) Method and system for performing data deduplication in a data pipeline
US8108635B2 (en) System, method and computer program product for copying data
US9501290B1 (en) Techniques for generating unique identifiers

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14907232

Country of ref document: EP

Kind code of ref document: A1