WO2018018885A1 - Storage method and device - Google Patents
Storage method and device Download PDFInfo
- Publication number
- WO2018018885A1 WO2018018885A1 PCT/CN2017/074392 CN2017074392W WO2018018885A1 WO 2018018885 A1 WO2018018885 A1 WO 2018018885A1 CN 2017074392 W CN2017074392 W CN 2017074392W WO 2018018885 A1 WO2018018885 A1 WO 2018018885A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- label
- file
- data
- data storage
- storage channel
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0643—Management of files
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0674—Disk device
- G06F3/0676—Magnetic disk device
Definitions
- the present invention relates to the field of data storage technologies, and in particular, to a storage method and apparatus.
- SAS Serial Attached SCSI
- FC Fibre Channel
- SSA Serial Adapted SCSI
- IEEE1394 Serial Attached SCSI
- the protocol infrastructure which uses the SCS1-3 extended instruction set and is compatible with SATA devices, is a multi-layer storage device connection protocol stack. Because SAS has outstanding advantages in interface bandwidth, performance, scalability, networking applications, and reliability, it has been widely used in the field of server storage devices.
- the receiving end when receiving multiple data frames of the same data file, the receiving end needs to store the multiple data frames in the order in which they are received. However, sometimes when the data frame received in the previous order is completed, its corresponding data storage channel is being occupied, causing the data frame to be temporarily back pressured. At this time, if the data frames in the subsequent sequence are also received, the corresponding data storage is completed. The channel is unoccupied, and the subsequent data frames are stored first. As a result, the receiving order and storage order of multiple data frames of the same data file are inconsistent, and the data file is stored incorrectly. Therefore, how to ensure that the receiving order of multiple data frames of the same data file is consistent with the storage order, and ensuring the consistency between the data file stored by the receiving end and the data file sent by the transmitting end is a technical problem that must be solved at present.
- the embodiment of the invention provides a storage method and device to ensure that the receiving order of multiple data frames of the same data file is consistent with the storage order, and the receiving end stores the data file and the transmitting end sends the data file. Consistency.
- an embodiment of the present invention provides a storage method, where an execution body of the storage method is a receiving end in a SAS wide port scenario.
- the receiving end may include: at least two data storage channels, a sequence protection module and a storage module.
- the order-preserving module is provided with a receiving list and a cache list corresponding to each data storage channel. Each data storage channel and the order-preserving module can perform data interaction, and each data storage channel and the storage module can also perform data interaction.
- the storage method is specifically controlled by the order-preserving module in the receiving end.
- the storing method may include: when the data storage channel is idle, extracting the received information from the cache list corresponding to the data storage channel according to a first-in first-out rule, the receiving information includes receiving a label and address information, and the receiving The label is used to indicate the order of the data frames corresponding to the received label in the data file to which the received label belongs, and the address information is used to indicate the position of the first file label corresponding to the received label in the receiving list, the first The file label is used to indicate a data file to which the data frame corresponding to the receiving label belongs; to find the first file label in the receiving list according to the address information; and obtain a desired label corresponding to the first file label, Determining, by the label, a storage sequence of the data frame corresponding to the data file of the first file label, when the storage of a data frame of the data file corresponding to the first file label is completed, the storing order is in accordance with the first file
- the label is updated in accordance with the data frame arrangement order of the data file; when the receiving
- the received information when the data storage channel is idle, the received information is extracted from the cache list corresponding to the data storage channel according to a first-in first-out rule, and the received information includes a receiving label and address information, where the receiving label is used for And indicating an arrangement order of the data frames corresponding to the receiving label in the data file to which the receiving label belongs, the address information is used to indicate a position of the first file label corresponding to the receiving label in the receiving list, and the first file label is used by the first file label And indicating a data file to which the data frame corresponding to the receiving label belongs; searching for the first file label in the receiving list according to the address information; acquiring a desired label corresponding to the first file label, where the desired label is used And in the storage order of the data frame indicating the data file corresponding to the first file label, when the storage of a data frame of the data file corresponding to the first file label is completed, the storage sequence is in accordance with the data corresponding to the first file label.
- the data frame arrangement order of the file is updated; when the receiving tag matches the expected tag, the control Said channel data storage storing the received data frame corresponding to the tag.
- the received label for indicating the order of arrangement of the data frames corresponding to the received label in the data file to which the received label belongs is matched with the desired label for indicating the storage order of the data frame of the data file corresponding to the first file label, Controlling the data storage channel to store the data frame corresponding to the receiving label, so the technical solution of the present invention can ensure that the receiving order of the multiple data frames of the same data file is consistent with the storage order, and the receiving end stores the data file and the sending end to send The consistency of the data files.
- the method further includes: acquiring the data storage channel Corresponding thread information, the thread information includes a second file label and thread validity information, and the second file label is used to indicate a data file to which the last data frame stored in the data storage channel belongs; The storing, by the data storage channel, the data frame corresponding to the receiving label, when the receiving label and the expected label match and the first file label and the second file label are the same, according to the data storage channel.
- the thread validity information in the thread information determines whether the current thread of the data storage channel is valid; when the current thread of the data storage channel is valid, sends a data frame storage instruction to the data storage channel to make the data
- the storage channel stores a data frame corresponding to the received label.
- the controlling the data storage channel to store the data frame corresponding to the receiving label further includes: when the current thread of the data storage channel is invalid, Transmitting, by the data storage channel, a breakpoint read instruction, so that the data storage channel reads breakpoint information of the data file corresponding to the first file label, and stores the receiving from a breakpoint location indicated by the breakpoint information The data frame corresponding to the label.
- the implementation when the current thread of the data storage channel is valid, sending a data frame storage instruction to the data storage channel, so that the data storage channel stores the data frame corresponding to the receiving label;
- sending a breakpoint read instruction to the data storage channel so that the data storage channel reads the breakpoint information of the data file corresponding to the first file label, and from the breakpoint The breakpoint location indicated by the information stores the data frame corresponding to the received tag. Therefore, the implementation can ensure that data frames belonging to the same data file are continuously stored.
- the controlling the data storage channel to store the data frame corresponding to the receiving label further includes: when the current thread of the data storage channel is invalid, determining Whether the file label in the thread information corresponding to the other data storage channel and the first file label are the same; when the file label in the thread information corresponding to the other data storage channel is the same as the first file label, according to other data storage channels
- the thread validity information in the corresponding thread information determines whether the thread corresponding to the other data storage channel is valid; when the thread corresponding to the other data storage channel is valid, sends a breakpoint processing instruction to the other data storage channel, so that other data storage channels are generated.
- the first file label corresponds to the breakpoint information of the data file and is stored; when the other data storage channel completes the corresponding breakpoint information storage, sending a breakpoint read instruction to the data storage channel, so that the data storage
- the channel reads the breakpoint information of the data file corresponding to the first file label, and Storing breakpoint location corresponding to said received tag information indicates the breakpoint of the data frame.
- the controlling the data storage channel to store the data frame corresponding to the receiving label further comprising: when the receiving label and the expected label match When the first file label and the second file label are different, sending a breakpoint read instruction to the data storage channel, so that the data storage channel reads a breakpoint of the data file corresponding to the first file label Information, and storing a data frame corresponding to the received tag from a breakpoint location indicated by the breakpoint information.
- a breakpoint reading instruction is sent to the data storage channel, so that The data storage channel reads the breakpoint information of the data file corresponding to the first file label, and stores the data frame corresponding to the received label from the breakpoint position indicated by the breakpoint information, thereby ensuring the data frame belonging to the same data file. Storage continuity.
- the controlling the data storage channel to store the data frame corresponding to the receiving label further comprising: when the receiving label and the expected label match When the first file label and the second file label are different, determining whether the file label and the first file label in the thread information corresponding to the other data storage channels are the same; when the thread information corresponding to the other data storage channel is When the file label and the first file label are the same, determining whether the thread corresponding to the other data storage channel is valid according to the thread validity information in the thread information corresponding to the other data storage channel; when the thread corresponding to the other data storage channel is valid,
- the other data storage channel sends a breakpoint processing instruction, so that other data storage channels generate breakpoint information of the data file corresponding to the first file label and store it; when other data storage channels complete the corresponding breakpoint information storage,
- the data storage channel sends a breakpoint read command to read the data storage channel Breakpoint information corresponding to said first tag file data file, and receives the tag data corresponding to the frames from the
- the controlling the data storage channel to store a data frame corresponding to the receiving label further comprising: a file label in thread information corresponding to another data storage channel And when the first file label is different from the first file label, sending a breakpoint read instruction to the data storage channel, so that the data storage channel reads the breakpoint information of the data file corresponding to the first file label, and The breakpoint position indicated by the breakpoint information stores the data frame corresponding to the received label.
- the controlling the data storage channel to store the data frame corresponding to the receiving label further includes: when the thread corresponding to the other data storage channel is invalid, The data storage channel sends a breakpoint read command to cause the data storage channel to read the first text
- the piece label corresponds to the breakpoint information of the data file, and stores the data frame corresponding to the received label from the breakpoint position indicated by the breakpoint information.
- the method further includes: determining whether the data frame storage completion indication sent by the data storage channel is received; and receiving the data frame transmission sent by the data storage channel is completed.
- the indication is set, the file label in the thread information corresponding to the data storage channel is set as the first file label, and the corresponding thread validity information is set to be valid.
- the method further includes: acquiring frame receiving information that is sent by any data storage channel after receiving the data frame, where the frame receiving information includes: a third file label, The third file label is used to indicate the data file to which the received data frame belongs; the sequential maintenance label corresponding to the third file label in the receiving list is obtained; and the sequential maintenance label is determined to correspond to the frame receiving information.
- the sequential maintenance label corresponding to the third file label is updated to a receiving label of the next data frame corresponding to the third file label. Therefore, the sequence maintenance label corresponding to the third file label can allocate a receiving label to the data frame corresponding to the third file label according to the receiving order, and the data frame corresponding to the third file label can be stored in the receiving order according to the allocated receiving label. .
- the method further includes: determining whether the third file label exists in the receiving list; and when the third file label exists in the receiving list, performing Obtaining, in the receiving list, a sequence maintenance label corresponding to the third file label; when the third file label does not exist in the receiving list, adding the third file label to the receiving list And allocating an initial receiving label and an initial expected label to the data frame corresponding to the frame receiving information.
- the third file label when the third file label does not exist in the receiving list, the third file label is added to the receiving list, and an initial receiving label is allocated for the data frame corresponding to the frame receiving information. And the initial expected label.
- the newly received data frames in the data file corresponding to the third file label can be stored in the order of reception.
- the method further includes: determining, when the data storage channel is idle, whether the cache list corresponding to the data storage channel is not empty; and when the data storage channel is When the corresponding cache list is not empty, a set of received information is extracted from the cache list corresponding to the data storage channel according to the first-in first-out rule.
- the method further includes: when the receiving label and the expected label do not match, sending a breakpoint processing instruction to the data storage channel, so that the data is The storage channel generates and stores the breakpoint information of the data file corresponding to the previous data frame stored therein.
- an embodiment of the present invention provides a storage device, where the storage device includes: at least two data storage channels, a storage module, and a preservation module; the protection module is provided with a receiving list, and each data storage The cache list corresponding to the channel.
- Each data storage channel and the order-preserving module can perform data interaction, and each data storage channel and the storage module can also perform data interaction.
- the order-preserving module also includes means or sub-units for performing the method steps of the first aspect and the implementations of the first aspect.
- FIG. 1 is a schematic diagram of an application scenario according to an embodiment of the present disclosure
- FIG. 2 is a flowchart of a storage method according to an embodiment of the present invention.
- FIG. 3 is a schematic diagram of a save order module according to an embodiment of the present invention.
- FIG. 4 is a schematic diagram of a breakpoint information according to an embodiment of the present invention.
- FIG. 5 is a flowchart of a specific embodiment of a storage method according to an embodiment of the present invention.
- FIG. 6 is a schematic structural diagram of a storage device according to an embodiment of the present invention.
- the application scenario is a SAS wide port scenario, including a transmitting end 100 and a receiving end 200, and N+1 data storage channels (Chnl 0, Chnl 1, ..., Chnl N) and a transmitting end of the receiving end 200.
- N+1 data transmission channels for data transmission are established between N+1 domains (Domain0, Domain 1, ..., Domain N) of 100.
- the executor of the embodiment of the present invention is the receiving end 200 in the SAS wide port scenario.
- each data storage channel and the storage module can perform data interaction, and each data storage channel and the Frame Order Manager can also perform data interaction.
- Each data storage channel includes a transport layer (such as Trans Layer 0, Trans Layer 1, ..., Trans Layer N, etc.) and a Direct Memory Access Controller (DMAC, such as DMAC 0, DMAC 1, ..., DMAC). N, etc., each DMAC is internally provided with a buffer area (not shown).
- the transport layer of each data storage channel is used to receive data frames sent by the corresponding domain; the DMAC of each data storage channel is used to buffer the data frames received by the corresponding transport layer in its internal buffer according to the first-in first-out rule.
- the storage module provides storage space for the data frame received by the receiving end 200 and the breakpoint information of each data file received by the receiving end 200 (corresponding to the IO Break Point in FIG. 1).
- the breakpoint information of each data file is used to indicate a storage location of the data frame of the data file to be stored.
- the breakpoint information may be generated by using a file label, a stored data file length, a stored data file address, thread validity information, and the like.
- the file label in the breakpoint information is used to indicate a data file corresponding to the breakpoint information
- the stored data file length is used to indicate the stored data amount of the data file corresponding to the breakpoint information
- the stored data file address is used to indicate the broken data.
- the point information corresponds to a storage address corresponding to the next frame of the data file, and the thread validity information is used to indicate whether the thread corresponding to the data file of the breakpoint information is valid.
- the breakpoint information may further include frame offset information indicating an offset of a data frame in the entire data file to verify whether the received data frame has data loss.
- the breakpoint information may further include a data file command address for indicating a storage location of the related data frame storage command during the data file interaction.
- the preserving module is configured to control the data frames of each data file received by the receiving end 200 to be stored in the order of receiving, so as to ensure the consistency between the data file stored by the receiving end and the data file sent by the transmitting end.
- the application scenario shown in FIG. 1 is only a specific application scenario of the embodiment of the present invention.
- the application scenario of the embodiment of the present invention is not limited thereto.
- the storage module may only provide storage space for data frames received by the receiving end 200.
- two storage modules may be included, where one storage module provides storage space for the data frame received by the receiving end 200, and another storage module is received by the receiving end 200.
- the breakpoint information for each data file provides storage space.
- FIG. 2 is a flowchart of a storage method according to an embodiment of the present invention.
- the storage method is controlled by a guarantee module in the receiving end 200.
- the embodiment may include the following steps:
- step S210 when the data storage channel is idle, the received information is extracted from the cache list corresponding to the data storage channel according to the first-in first-out rule.
- the received information extracted here includes a receiving tag and address information.
- the receiving label is used to indicate the order of the data frames corresponding to the received label in the data file to which the label belongs.
- the address information is used to indicate the position of the first file label corresponding to the received label in the receiving list, and the first file label is used to indicate the data file.
- the data file indicated by the first file label includes multiple data frames, and the data frame corresponding to the receiving label belongs to the data file indicated by the first file label.
- the sending end 100 sends a data frame to the receiving end 200 according to the order of the data frames in the data file.
- the transport layer of any data storage channel of the receiving end 200 receives a data frame sent by the transmitting end 100, the data storage channel is saved.
- the module sends frame reception information including the file tag.
- the file label here is used to indicate the data file to which the data frame received by the data storage channel belongs.
- the sequence maintaining module When receiving the frame receiving information, acquires a sequential maintenance label corresponding to the file label in the frame receiving information in the receiving list. When the sequential maintenance label is acquired, the sequential maintenance label is determined as the reception label of the data frame corresponding to the frame reception information. Further, after determining the receiving label, the sequential maintenance label corresponding to the file label in the frame receiving information is updated, and the updated sequential maintenance label is used as the receiving label of the next corresponding data frame.
- the order-preserving module before obtaining the sequential maintenance label, it may be determined whether the file label in the frame receiving information exists in the receiving list.
- the order-preserving module performs the step of acquiring the sequential maintenance label corresponding to the file label in the frame receiving information in the receiving list, and the file in the frame receiving information does not exist in the receiving list.
- the order-preserving module creates a correspondence between the file label and the sequential maintenance label in the frame receiving information in the receiving list, and the sequential maintenance label is updated according to the receiving order of the data frame corresponding to the file label in the frame receiving information.
- the order-preserving module receives the first frame receiving information corresponding to a file label
- the sequential maintenance label is recorded as 0, and 0 is determined as the receiving label of the first data frame corresponding to the file label (corresponding to the initial When the label is received, the sequence maintenance label is updated to 1.
- the sequence module receives the second frame receiving information corresponding to the file label
- 1 is determined as the receiving label of the second data frame corresponding to the file label. Updating the sequential maintenance label to 2, and so on, ensures that the receiving label can be used to indicate the order in which it is placed in the data file to which it belongs.
- the received information in each cache list is arranged in the order in which the received information is generated, so that the order-preserving module can extract the received information in the cache list according to the first-in first-out rule.
- the received information is extracted from the cache list corresponding to the data storage channel in the idle state according to the first-in first-out rule.
- whether a data storage channel is in an idle state is determined by whether the DMAC corresponding to the data storage channel is storing data frames to the storage module.
- the storage completion instruction may be sent to the sequence-preserving module, and the sequence-preserving module may confirm that the corresponding data storage channel is idle after receiving the storage completion instruction;
- the preserving module can also monitor in real time whether the buffer list corresponding to each data storage channel has received information. When there is no receiving information in the cache list corresponding to a data storage channel, it is determined that the data storage channel is in an idle state.
- the data storage channel in the idle state it is first ensured that the received information exists in the cache list corresponding to the data storage channel in the idle state. Therefore, in a specific implementation manner of the present invention, when the data storage channel is idle, it may further determine whether the cache list corresponding to the idle data storage channel is non-empty, only when the cache list corresponding to the idle data storage channel is not empty.
- the received information is extracted from the cache list corresponding to the idle data storage channel according to the first-in first-out rule.
- the receiving information may be directly extracted from the cache list corresponding to the idle data storage channel without determining whether the cache list corresponding to the idle data storage channel is non-empty. At this time, when the received information is extracted, the subsequent steps are performed. When the received information is not extracted, the received information is continuously extracted from the cache list corresponding to the idle data storage channel according to the first-in first-out rule until the received information is extracted.
- step S220 the first file tag is looked up in the receiving list according to the address information included in the received information.
- step S230 the desired label corresponding to the first file label is obtained, and the desired label is used to indicate the storage order of the data frame corresponding to the data file of the first file label, when the storage of a data frame of the data file corresponding to the first file label is completed.
- the storage order is updated in accordance with the data frame arrangement order of the data file corresponding to the first file label.
- the first file label, the sequential maintenance label corresponding to the first file label, and the correspondence between the expected labels corresponding to the first file label may be established in the receiving list to facilitate the protection.
- the sequence module acquires a desired label corresponding to the first file label. It can be understood that the correspondence between the first file label and the sequential maintenance label corresponding to the first file label and the expected label corresponding to the first file label and the first file label may be respectively established in the receiving list. Correspondence relationship.
- the storage order is updated according to the order of the data frames of the data file corresponding to the first file label in the data file to which the first file label belongs.
- the preserving module of the receiving end 200 learns that any data storage channel completes the storage of a data frame corresponding to the first file label, the expected label corresponding to the first file label is updated, and the updated expected label is updated. And matching the next receiving label corresponding to the first file label.
- the data may be sent to the order-preserving module to enable the order-preserving module to learn that the matching may be equal or one-to-one.
- Correspondence relationship (such as 0, 1, 2 and A, B, C one-to-one correspondence).
- the preserving module learns that any data storage channel receives the first data frame corresponding to the first file label
- the expected label corresponding to the first file label is recorded as (corresponding to the initial expected label) 0, when the first file is used.
- the expected label corresponding to the first file label is updated to 1, and so on, so that the desired label corresponding to the first file label can be used to indicate the data corresponding to the first file label.
- the storage order of the data frames of the file, and the storage order is updated in the order in which the data frames of the data files corresponding to the first file label are arranged in the data file to which they belong.
- step S240 when the receiving tag matches the expected tag, the control data storage channel stores the data frame corresponding to the receiving tag.
- the matching here may be equal or a one-to-one correspondence (for example, 0, 1, and 2 respectively correspond to A, B, and C).
- the sequence-preserving module may directly send a data frame storage instruction to the corresponding idle data storage channel when the receiving tag matches the expected tag, so that the corresponding data storage channel stores the data frame corresponding to the receiving tag.
- the order-preserving module may further determine whether it is necessary to read the breakpoint information corresponding to the first file label when the receiving label matches the expected label, and send data to the corresponding idle data storage channel when the breakpoint information is not required to be read.
- the frame stores instructions such that the corresponding free data storage channel stores the data frame corresponding to the received tag.
- the thread information corresponding to each data storage channel may be pre-established, so that the order-preserving module acquires the thread information corresponding to the idle data storage channel, where
- specific symbols or numbers may be used to indicate that they are valid or invalid. For example, the number 0 indicates invalid, the number 1 indicates valid, and the file label of the thread information is used to indicate the data file to which the previous data frame stored in the corresponding data storage channel belongs.
- the data frame storage completion indication may be sent to the order-preserving module, and the order-preserving module receives
- the file label in the thread information corresponding to the data storage channel may be set to
- the data storage channel completes the file label corresponding to the stored data frame, and sets the corresponding thread validity information to be valid.
- the corresponding thread validity information is set to be invalid.
- the file label in the thread information corresponding to the free data storage channel is subsequently recorded as the second file label.
- the order-preserving module may determine whether the first file label and the second file label are the same. When the first file label and the second file label are the same, further It is determined whether the current thread of the idle data storage channel is valid according to the corresponding thread validity information, and when the current thread of the idle data storage channel is valid, it is determined that the breakpoint information is not required to be read. The sequencer module then sends a data frame storage instruction to the idle data storage channel to cause the free data storage channel to store the corresponding data frame.
- the sequencer module determines that the breakpoint information needs to be read. .
- the order-preserving module determines that the breakpoint information needs to be read, if the breakpoint information is sent to the data storage channel whenever the receiving module finds that the receiving label of the data storage channel does not match the expected label,
- the data storage channel is configured to generate and store the breakpoint information of the data file corresponding to the previous data frame stored therein, where the previous data frame refers to the data frame that the data storage channel has just completed storage.
- the order-preserving module directly sends a breakpoint read instruction to the idle data storage channel, so that the idle data storage channel reads the breakpoint information of the data file corresponding to the first file label, and stores the breakpoint position indicated by the breakpoint information. Receive the data frame corresponding to the label.
- the breakpoint read command includes a first file label, so that the idle data storage channel can find the corresponding breakpoint information according to the breakpoint read command.
- the breakpoint information may be generated by using a file label, a stored data file length, a stored data file address, thread validity information, and the like. Specifically, the file label in the breakpoint information is used to indicate a data file corresponding to the breakpoint information, and the stored data file length is used to indicate the stored data amount of the data file corresponding to the breakpoint information, and the stored data file address is used to indicate the broken data.
- the point information corresponds to a storage address corresponding to the next frame of the data file, and the thread validity information is used to indicate whether the thread corresponding to the data file of the breakpoint information is valid.
- other information may be included in the breakpoint information.
- the breakpoint information may further include frame offset information indicating an offset of a data frame in the entire data file to verify whether the received data frame has data loss.
- the breakpoint information may further include a data file command address for indicating a storage location of the related data frame storage command during the data file interaction.
- the newly generated breakpoint information may be used to overwrite the previously generated breakpoint. Tap the information to save storage space. Similarly, if you find that the data storage channel reads the breakpoint information, you can delete the corresponding breakpoint information after reading to save storage space.
- the order-preserving module can control the generation of the breakpoint information and read the generated breakpoint information.
- the order-preserving module may first determine whether the file label and the first file label in the thread information corresponding to the other data storage channels are the same. When the file label in the thread information corresponding to the other data storage channel is the same as the first file label, the order-preserving module further determines whether the thread corresponding to the other data storage channel is valid according to the thread validity information in the thread information corresponding to the other data storage channel. .
- the order-preserving module sends a breakpoint processing instruction to the other data storage channel, so that the other data storage channel generates the breakpoint information of the data file corresponding to the first file label and stores it (for example, in the storage).
- the sequencer module sends a breakpoint read instruction to the idle data storage channel, so that the idle data storage channel reads the breakpoint information of the data file corresponding to the first file label, and A data frame corresponding to the received tag is stored from the breakpoint position indicated by the breakpoint information.
- the order-preserving module can monitor in real time whether other data storage channels complete the storage of the breakpoint information and know whether other data storage channels complete the breakpoint information storage.
- Other data storage channels may also send a breakpoint storage completion instruction to the order-preserving module when the breakpoint information storage is completed, so that the order-preserving module knows that the other data storage channels have completed the breakpoint information storage.
- the number of other data storage channels here is one or more.
- the order-preserving module may respectively determine the file label and the first file label in the thread information corresponding to each data storage channel in the other data storage channels. Whether they are the same or not, and determining the thread validity information in the thread information corresponding to the data storage channel to determine whether the thread corresponding to the data storage channel is valid. After the order-preserving module determines that the file label and the first file label in the thread information corresponding to another data storage channel are different, or determines that the thread corresponding to another data storage channel is invalid, the file label and the first file label are indicated.
- the same and thread-efficient other data storage channels are additional data storage channels. At this point, another data storage channel may have completed the preservation of the breakpoint information.
- the order-preserving module can send a breakpoint read instruction to the idle data storage channel, so that the idle data storage channel reads the breakpoint information of the data file corresponding to the first file label, and stores the breakpoint location indicated by the breakpoint information.
- the received information is extracted from the cache list corresponding to the data storage channel according to a first-in first-out rule, and the received information includes a receiving label and address information, where the receiving label is used for And indicating an arrangement order of the data frames corresponding to the receiving label in the data file to which the receiving label belongs, the address information is used to indicate a position of the first file label corresponding to the receiving label in the receiving list, and the first file label is used by the first file label And indicating a data file to which the data frame corresponding to the receiving label belongs; searching for the first file label in the receiving list according to the address information; acquiring a desired label corresponding to the first file label, where the desired label is used And storing the data frame of the data file corresponding to the first file label in the storage sequence of the data frame corresponding to the data file corresponding to the first file label And the storing sequence is updated according to the data frame arrangement order of the data file corresponding to the first file label; when the receiving label matches the
- FIG. 3 a schematic diagram of the order-preserving module is shown below using FIG. 3, and FIG. 4 is a schematic diagram showing breakpoint information. Based on the specific embodiment shown in FIG. 5, a storage method of the embodiment of the present invention is further illustrated.
- the number of data storage channels corresponding to the sequencer module is N+1, and the buffer area of each data buffer channel can cache up to M+1 data frames.
- the OrderTable represents a receiving list, and the receiving list includes a plurality of file information, each file information includes a file label IO Tag, a sequential maintenance label Rcv_Tag', and a desired label Exp_Tag, and each group of file information corresponds to an address information Order Table addr.
- Chnl 0pending fifo, Chnl 1pending fifo, ..., Chnl N pending fifo are cache lists corresponding to data storage channels Chnl 0, Chnl 1, ..., Chnl N, respectively, and each cache list includes a DMAC internal buffer cache corresponding to the data storage channel.
- Receive information of the data frame, each received information includes a corresponding address information Order Table addr and a receiving label Rcv_Tag (ie, address information of the corresponding file label), and Chnl 0brk reg, Chnl 1brk reg, ..., Chnl N brk reg are respectively data
- the thread information corresponding to the storage channels Chnl 0, Chnl 1, ..., Chnl N is stored.
- the RR indicates a scheduling module, configured to use the frame receiving information when receiving the frame receiving information including the IO tag (such as Chnl 0_rx newd_req, ..., Chnl N_rx newd_req, etc.) sent by Chnl 0, Chnl 1, ..., Chnl N
- the IO Tag searches for the corresponding Rcv_Tag' in the receiving list, determines the current Rcv_Tag' as the receiving tag of the corresponding data frame, and updates the found Rcv_Tag'. Further, the generated replacement address information and the received information of the received label are stored in the corresponding cache list according to the first-in first-out rule.
- each file information in the receiving list in FIG. 3 corresponds to one data file, and each file information is different; each received information in the cache list in FIG. 3 corresponds to one data frame, and each received information is different. .
- the content in the corresponding thread information in FIG. 3 is updated every time a data frame is stored.
- breakpoint information corresponding to multiple IO tags is stored, and each breakpoint information includes a file label IO Tag, a frame offset information Data_offset, and stored data.
- the sequence-preserving module learns that the Chnl 0 of the receiving end 200 is in an idle state (ie, the DMAC 0 is idle)
- the process in FIG. 5 is executed, and the process may be performed by using the RR module in the order-preserving module in FIG. 3, or may be in the orderly manner. Add other execution modules to the module to execute the process.
- the order-preserving module in FIG. 3 first determines whether Chnl 0pending fifo is non-empty. When Chnl0pending fifo is non-empty, the order-preserving module extracts an address table including Order Table addr and receives from the Chnl 0pending fifo according to the first-in-first-out rule. The receiving information of the tag Rcv_Tag. When Chnl 0pending fifo is empty, the order-preserving module again determines whether Chnl 0pending fifo is non-empty until it is determined that Chnl 0pending fifo is non-empty, and then performs the subsequent steps.
- the order-preserving module After extracting the address information Order Table addr and the receiving label Rcv_Tag, the order-preserving module searches the Order Table for the IO Tag corresponding to the extracted Order Table addr, and then compares whether the extracted Rcv_Tag is equal to the Exp_Tag corresponding to the found IO Tag. When equal, the order-preserving module obtains the Last IO Tag in Chnl 0brkreg (ie, the IO Tag of the data frame that Chnl 0 just stored) and brk_vld (ie, thread validity information).
- the sequence-preserving module sends a data frame storage instruction that does not need to read a breakpoint to the DMAC 0, so that the DMAC 0 storage corresponds to the extracted Rcv_Tag. Data frame.
- the Last IO Tag and brk_vld in the other brk reg are obtained.
- the found IO Tag is the same as the Last IO Tag in other brk reg and the other brk_vld in brk reg is valid, send a breakpoint processing instruction to other data storage channels, and monitor in real time whether the other channel DMAC completes the breakpoint information storage. .
- a breakpoint read instruction is sent to DMAC0.
- a breakpoint read command is also sent to DMAC 0, so that DMAC 0 reads other channels.
- the breakpoint information stored by the DMAC, and stores the data frame corresponding to the extracted Rcv_Tag.
- the breakpoint read command includes an IO Tag corresponding to the extracted Order Table addr, so that the DMACO can find the corresponding breakpoint information according to the breakpoint read command.
- the order-preserving module monitors in real time whether the DMAC 0 completes the storage of the corresponding data frame.
- the order-preserving module updates the Last IO Tag in Chnl 0brk reg.
- the updated Last IO Tag is the IO Tag of the stored data frame for DMAC 0 and the brk_vld in Chnl 0brk reg is updated to be valid.
- the order-preserving module updates the Exp_Tag corresponding to the IO Tag found in the Order Table, and the updated Exp_Tag is the same as the next data frame of the found IO Tag.
- the next data frame here is the next data frame of the data frame in which the received data order is located in the IO Tag corresponding data file.
- the embodiment of the present invention further provides a storage device.
- FIG. 6 is a schematic structural diagram of a storage device according to an embodiment of the present invention.
- the storage device is for performing the storage method as shown in FIG. 2.
- the storage device includes at least two data storage channels, a storage module, and a preserving module; the preserving module is provided with a receiving list, and a cache list corresponding to each data storage channel.
- Each data storage channel and the order-preserving module can perform data interaction, and each data storage channel and the storage module can also perform data interaction.
- the preserving module in the storage device may further include: an extracting unit 610, a searching unit 620, a desired label maintaining unit 630, and a control unit 640.
- the extracting unit 610 is configured to: when the data storage channel is idle, extract the received information from the cache list corresponding to the data storage channel according to a first-in first-out rule, where the received information includes a receiving label and address information, and the receiving label is used by the receiving label. Instructing the order of the data frames corresponding to the received label in the data file to which the received label belongs, the address information is used to indicate the location of the first file label corresponding to the received label in the receiving list, the first file label a data file for indicating a data frame corresponding to the receiving label;
- the searching unit 620 is configured to search for the first file label in the receiving list according to the address information
- the desired label maintenance unit 630 is configured to maintain a desired label according to a data frame arrangement order of the first file label corresponding data file when the storage of one data frame of the first file label corresponding data file is completed, so that the desired label is maintained.
- the expected label is used to indicate a storage order of the data frame corresponding to the data file of the first file label;
- the control unit 640 is configured to control, when the receiving tag and the expected tag match, the data storage channel to store the data frame corresponding to the receiving tag in the storage module.
- the received information when the data storage channel is idle, the received information is extracted from the cache list corresponding to the data storage channel according to a first-in first-out rule, and the received information includes a receiving label and address information, where the receiving label is used for And indicating an arrangement order of the data frames corresponding to the receiving label in the data file to which the receiving label belongs, the address information is used to indicate a position of the first file label corresponding to the receiving label in the receiving list, and the first file label is used by the first file label And indicating a data file to which the data frame corresponding to the receiving label belongs; searching for the first file label in the receiving list according to the address information; acquiring a desired label corresponding to the first file label, where the desired label is used And in the storage order of the data frame indicating the data file corresponding to the first file label, when the storage of a data frame of the data file corresponding to the first file label is completed, the storage sequence is in accordance with the data corresponding to the first file label.
- the data frame arrangement order of the file is updated; when the receiving tag matches the expected tag, the control Said channel data storage storing the received data frame corresponding to the tag.
- the received label for indicating the order of arrangement of the data frames corresponding to the received label in the data file to which the received label belongs is matched with the desired label for indicating the storage order of the data frame of the data file corresponding to the first file label, Controlling the data storage channel to store the receiving tag pair
- the data frame of the present invention can ensure that the receiving order of the multiple data frames of the same data file is consistent with the storage order, and the consistency between the data file stored by the receiving end and the data file sent by the transmitting end is ensured.
- the order-preserving module is further configured with thread information corresponding to each data storage channel, and the sequence-preserving module may further include: a first acquiring unit.
- the first acquiring unit is configured to acquire thread information corresponding to the data storage channel, where the thread information includes a second file label and thread validity information, and the second file label is used to indicate the data storage channel is stored.
- the control unit 640 may include: a first determining subunit and a first transmitting subunit.
- the first determining subunit is configured to: according to the thread in the thread information corresponding to the data storage channel, when the receiving label and the expected label match and the first file label and the second file label are the same
- the validity information determines whether the current thread of the data storage channel is valid
- the first sending subunit is configured to send a data frame storage instruction to the data storage channel when the current thread of the data storage channel is valid, so that the data storage channel stores the receiving in the storage module The data frame corresponding to the label.
- the first sending subunit is further configured to: when the current thread of the data storage channel is invalid, send a breakpoint read instruction to the data storage channel,
- the data storage channel reads the breakpoint information of the first file label corresponding data file in the storage module, and stores the data frame corresponding to the received label from the breakpoint position indicated by the breakpoint information.
- control unit 640 may further include: a second determining subunit, a third determining subunit, and a second sending subunit.
- the second determining subunit is configured to determine, when the current thread of the data storage channel is invalid, whether the file label and the first file label in the thread information corresponding to the other data storage channels are the same;
- the third determining subunit is configured to determine other data according to the thread validity information in the thread information corresponding to the other data storage channels when the file label in the thread information corresponding to the other data storage channel is the same as the first file label Whether the thread corresponding to the storage channel is valid;
- the second sending subunit is configured to send a breakpoint processing instruction to another data storage channel when the thread corresponding to the other data storage channel is valid, so that the other data storage channel generates a breakpoint of the data file corresponding to the first file label.
- the first sending subunit is further configured to send a breakpoint read instruction to the data storage channel when the other data storage channel completes the corresponding breakpoint information storage, so that the data storage channel is in the storage
- the module reads the breakpoint information of the data file corresponding to the first file label, and stores the data frame corresponding to the received label from the breakpoint position indicated by the breakpoint information.
- the first sending subunit is further configured to: when the receiving label and the expected label match, the first file label and the second file label When not the same, sending a breakpoint read instruction to the data storage channel, so that the data storage channel reads the breakpoint information of the data file corresponding to the first file label in the storage module, and The breakpoint position indicated by the point information stores the data frame corresponding to the received label.
- control unit 640 may further include: a fourth determining subunit and a fifth determining subunit.
- the fourth determining subunit is configured to determine, in the thread information corresponding to the other data storage channel, when the receiving label and the expected label match and the first file label and the second file label are not the same Whether the label and the first file label are the same;
- the fifth determining subunit is configured to determine other data according to the thread validity information in the thread information corresponding to the other data storage channels when the file label in the thread information corresponding to the other data storage channel is the same as the first file label Whether the thread corresponding to the storage channel is valid;
- the second sending subunit is further configured to: when the thread corresponding to the other data storage channel is valid, send a breakpoint processing instruction to the other data storage channel, so that the other data storage channel generates the data file corresponding to the first file label. Point information and store it;
- the first sending subunit is further configured to send a breakpoint read instruction to the data storage channel when the other data storage channel completes the corresponding breakpoint information storage, so that the data storage channel is in the storage module. And reading the breakpoint information of the data file corresponding to the first file label, and storing the data frame corresponding to the received label from the breakpoint location indicated by the breakpoint information.
- the first sending subunit is further configured to: when a file label in the thread information corresponding to another data storage channel is different from the first file label, The data storage channel sends a breakpoint read command, so that the data storage channel reads the breakpoint information of the data file corresponding to the first file label in the storage module, and indicates the breakpoint from the breakpoint information
- the point location stores a data frame corresponding to the received tag.
- the first sending subunit is further configured to: when a thread corresponding to another data storage channel is invalid, send a breakpoint reading instruction to the data storage channel, to And causing the data storage channel to read the breakpoint information of the first file label corresponding data file, and storing the data frame corresponding to the receiving label from the breakpoint location indicated by the breakpoint information.
- the order-preserving module may further include: Judging unit and setting unit.
- the first determining unit is configured to determine whether a data frame storage completion indication sent by the data storage channel is received
- the setting unit is configured to: when receiving the data frame storage completion indication sent by the data storage channel, set a file label in the thread information corresponding to the data storage channel as the first file label, and the corresponding thread The validity information is set to be valid.
- the order-preserving module may further include: a second acquiring unit, a third acquiring unit, a determining unit, and an updating unit.
- the second acquiring unit is configured to acquire frame receiving information that is sent by any data storage channel after receiving the data frame, where the frame receiving information includes: a third file label, where the third file label is used to indicate the received The data file to which the data frame belongs;
- the third obtaining unit is configured to acquire a sequential maintenance label corresponding to the third file label in the receiving list
- the determining unit is configured to determine the sequence maintenance label as a receiving label of a data frame corresponding to the frame receiving information
- the updating unit is configured to update a sequential maintenance label corresponding to the third file label, and the updated sequential maintenance label is used as a receiving label of the next corresponding data frame.
- the order-preserving module may further include: a second determining unit.
- the second determining unit is configured to determine whether the third file label exists in the receiving list
- the third obtaining unit is further configured to: when the third file label exists in the receiving list, perform a step of acquiring a sequential maintenance label corresponding to the third file label in the receiving list; when the receiving When the third file label does not exist in the list, the third file label is added to the receiving list, and an initial receiving label and an initial expected label are allocated for the data frame corresponding to the frame receiving information.
- the order-preserving module may further include: a third determining unit.
- the third determining unit is configured to determine, when the data storage channel is idle, whether the cache list corresponding to the data storage channel is not empty;
- the extracting unit is further configured to: when the cache list corresponding to the data storage channel is not empty, extract a group of received information from the cache list corresponding to the data storage channel according to a first-in first-out rule.
- the order-preserving module may further include: a sending unit.
- the sending unit is configured to send a breakpoint processing instruction to the data storage channel when the receiving label and the expected label do not match, so that the data storage channel generates data corresponding to the stored previous data frame.
- the breakpoint information of the file is stored.
- the techniques in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution in the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM. , a disk, an optical disk, etc., including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention or portions of the embodiments.
- a computer device which may be a personal computer, server, or network device, etc.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
本申请要求于2016年07月28日提交中国专利局、申请号为201610608388.2、申请名称为“一种存储方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. Serial No. No. No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No
本发明涉及数据存储技术领域,尤其涉及一种存储方法及装置。The present invention relates to the field of data storage technologies, and in particular, to a storage method and apparatus.
SAS(Serial Attached SCSI)即串行SCSI技术,是一种磁盘连接技术,它综合现有的并行SCSI技术和串行连接技术(如FC、SSA、IEEE1394等)的优势,以串行通讯协议为协议基础架构,采用SCS1-3扩展指令集并兼容SATA设备,是多层次的存储设备连接协议栈。由于SAS在接口带宽、工作性能、可扩展性、组网应用、可靠性等方面,有着突出的优势,目前已在服务器存储设备领域得到了广泛的应用。Serial Attached SCSI (SAS) is a disk connection technology that combines the advantages of existing parallel SCSI technology and serial connection technologies (such as FC, SSA, IEEE1394, etc.) with serial communication protocols. The protocol infrastructure, which uses the SCS1-3 extended instruction set and is compatible with SATA devices, is a multi-layer storage device connection protocol stack. Because SAS has outstanding advantages in interface bandwidth, performance, scalability, networking applications, and reliability, it has been widely used in the field of server storage devices.
在SAS协议里面有窄端口(narrow port)和宽端口(wide port),在宽端口背景下,发送端和接收端之间存在多条数据传输通道,在发送端和接收端之间进行数据传输时,发送端可通过这多条数据传输通道将同一数据文件的多个数据帧按顺序发送给接收端。In the SAS protocol, there are narrow ports and wide ports. In the wide port background, there are multiple data transmission channels between the sender and the receiver, and data transmission between the sender and the receiver is performed. When the transmitting end can send multiple data frames of the same data file to the receiving end sequentially through the multiple data transmission channels.
在数据文件存储过程中,接收端在接收到同一数据文件的多个数据帧时,需要按照多个数据帧的接收顺序对其进行存储。然而,有时顺序位于前面的数据帧接收完成时,其对应的数据存储通道正在被占用,导致该数据帧被暂时反压,此时若顺序位于后面的数据帧也接收完成且其对应的数据存储通道未被占用,顺序位于后面的数据帧就会先行存储,最终导致同一数据文件的多个数据帧的接收顺序和存储顺序不一致,数据文件存储错误。因此,如何确保同一数据文件的多个数据帧的接收顺序与存储顺序一致,保证接收端存储数据文件与发送端发送数据文件的一致性,是目前必须解决的技术难题。In the data file storage process, when receiving multiple data frames of the same data file, the receiving end needs to store the multiple data frames in the order in which they are received. However, sometimes when the data frame received in the previous order is completed, its corresponding data storage channel is being occupied, causing the data frame to be temporarily back pressured. At this time, if the data frames in the subsequent sequence are also received, the corresponding data storage is completed. The channel is unoccupied, and the subsequent data frames are stored first. As a result, the receiving order and storage order of multiple data frames of the same data file are inconsistent, and the data file is stored incorrectly. Therefore, how to ensure that the receiving order of multiple data frames of the same data file is consistent with the storage order, and ensuring the consistency between the data file stored by the receiving end and the data file sent by the transmitting end is a technical problem that must be solved at present.
发明内容Summary of the invention
本发明实施例提供了一种存储方法及装置,以确保同一数据文件的多个数据帧的接收顺序与存储顺序一致,保证接收端存储数据文件与发送端发送数据文件 的一致性。The embodiment of the invention provides a storage method and device to ensure that the receiving order of multiple data frames of the same data file is consistent with the storage order, and the receiving end stores the data file and the transmitting end sends the data file. Consistency.
第一方面,本发明实施例提供了一种存储方法,该存储方法的执行主体为SAS宽端口场景下的接收端。该接收端可以包括:至少两个数据存储通道,保序模块和存储模块。保序模块中设置有接收列表,以及每个数据存储通道对应的缓存列表,每个数据存储通道和保序模块可进行数据交互,每个数据存储通道和存储模块也可进行数据交互。该存储方法具体由接收端中的保序模块控制执行。具体地,该存储方法可以包括:当数据存储通道空闲时,按照先入先出规则从所述数据存储通道对应的缓存列表中提取接收信息,所述接收信息包括接收标签和地址信息,所述接收标签用于指示所述接收标签对应的数据帧在其所属数据文件中的排列顺序,所述地址信息用于指示所述接收标签对应的第一文件标签在接收列表中的位置,所述第一文件标签用于指示所述接收标签对应的数据帧所属数据文件;根据所述地址信息在所述接收列表中查找所述第一文件标签;获取所述第一文件标签对应的期望标签,所述期望标签用于指示所述第一文件标签对应数据文件的数据帧的存储顺序,在完成所述第一文件标签对应数据文件的一个数据帧的存储时,所述存储顺序按照所述第一文件标签对应数据文件的数据帧排列顺序进行更新;当所述接收标签和所述期望标签匹配时,控制所述数据存储通道存储所述接收标签对应的数据帧。In a first aspect, an embodiment of the present invention provides a storage method, where an execution body of the storage method is a receiving end in a SAS wide port scenario. The receiving end may include: at least two data storage channels, a sequence protection module and a storage module. The order-preserving module is provided with a receiving list and a cache list corresponding to each data storage channel. Each data storage channel and the order-preserving module can perform data interaction, and each data storage channel and the storage module can also perform data interaction. The storage method is specifically controlled by the order-preserving module in the receiving end. Specifically, the storing method may include: when the data storage channel is idle, extracting the received information from the cache list corresponding to the data storage channel according to a first-in first-out rule, the receiving information includes receiving a label and address information, and the receiving The label is used to indicate the order of the data frames corresponding to the received label in the data file to which the received label belongs, and the address information is used to indicate the position of the first file label corresponding to the received label in the receiving list, the first The file label is used to indicate a data file to which the data frame corresponding to the receiving label belongs; to find the first file label in the receiving list according to the address information; and obtain a desired label corresponding to the first file label, Determining, by the label, a storage sequence of the data frame corresponding to the data file of the first file label, when the storage of a data frame of the data file corresponding to the first file label is completed, the storing order is in accordance with the first file The label is updated in accordance with the data frame arrangement order of the data file; when the receiving label and the expected label are Match, the data storage control channel corresponding to the tag stores the received data frame.
本发明实施例中,当数据存储通道空闲时,按照先入先出规则从所述数据存储通道对应的缓存列表中提取接收信息,所述接收信息包括接收标签和地址信息,所述接收标签用于指示所述接收标签对应的数据帧在其所属数据文件中的排列顺序,所述地址信息用于指示所述接收标签对应的第一文件标签在接收列表中的位置,所述第一文件标签用于指示所述接收标签对应的数据帧所属数据文件;根据所述地址信息在所述接收列表中查找所述第一文件标签;获取所述第一文件标签对应的期望标签,所述期望标签用于指示所述第一文件标签对应数据文件的数据帧的存储顺序,在完成所述第一文件标签对应数据文件的一个数据帧的存储时,所述存储顺序按照所述第一文件标签对应数据文件的数据帧排列顺序进行更新;当所述接收标签和所述期望标签匹配时,控制所述数据存储通道存储所述接收标签对应的数据帧。由于当用于指示所述接收标签对应的数据帧在其所属数据文件中的排列顺序的接收标签和用于指示所述第一文件标签对应数据文件的数据帧的存储顺序的期望标签匹配时,控制所述数据存储通道存储所述接收标签对应的数据帧,所以本发明的技术方案能够确保同一数据文件的多个数据帧的接收顺序与存储顺序一致,保证接收端存储数据文件与发送端发送数据文件的一致性。In the embodiment of the present invention, when the data storage channel is idle, the received information is extracted from the cache list corresponding to the data storage channel according to a first-in first-out rule, and the received information includes a receiving label and address information, where the receiving label is used for And indicating an arrangement order of the data frames corresponding to the receiving label in the data file to which the receiving label belongs, the address information is used to indicate a position of the first file label corresponding to the receiving label in the receiving list, and the first file label is used by the first file label And indicating a data file to which the data frame corresponding to the receiving label belongs; searching for the first file label in the receiving list according to the address information; acquiring a desired label corresponding to the first file label, where the desired label is used And in the storage order of the data frame indicating the data file corresponding to the first file label, when the storage of a data frame of the data file corresponding to the first file label is completed, the storage sequence is in accordance with the data corresponding to the first file label. The data frame arrangement order of the file is updated; when the receiving tag matches the expected tag, the control Said channel data storage storing the received data frame corresponding to the tag. When the received label for indicating the order of arrangement of the data frames corresponding to the received label in the data file to which the received label belongs is matched with the desired label for indicating the storage order of the data frame of the data file corresponding to the first file label, Controlling the data storage channel to store the data frame corresponding to the receiving label, so the technical solution of the present invention can ensure that the receiving order of the multiple data frames of the same data file is consistent with the storage order, and the receiving end stores the data file and the sending end to send The consistency of the data files.
可选地,在本发明的一种具体实现方式中,还包括:获取所述数据存储通道 对应的线程信息,所述线程信息中包括第二文件标签和线程有效性信息,所述第二文件标签用于指示所述数据存储通道存储的上一数据帧所属数据文件;所述控制所述数据存储通道存储所述接收标签对应的数据帧,包括:当所述接收标签和所述期望标签匹配且所述第一文件标签和所述第二文件标签相同时,根据所述数据存储通道对应的线程信息中的线程有效性信息判断所述数据存储通道的当前线程是否有效;当所述数据存储通道的当前线程有效时,向所述数据存储通道发送数据帧存储指令,以使所述数据存储通道存储所述接收标签对应的数据帧。Optionally, in a specific implementation manner of the present invention, the method further includes: acquiring the data storage channel Corresponding thread information, the thread information includes a second file label and thread validity information, and the second file label is used to indicate a data file to which the last data frame stored in the data storage channel belongs; The storing, by the data storage channel, the data frame corresponding to the receiving label, when the receiving label and the expected label match and the first file label and the second file label are the same, according to the data storage channel The thread validity information in the thread information determines whether the current thread of the data storage channel is valid; when the current thread of the data storage channel is valid, sends a data frame storage instruction to the data storage channel to make the data The storage channel stores a data frame corresponding to the received label.
可选地,在本发明的另一种具体实现方式中,所述控制所述数据存储通道存储所述接收标签对应的数据帧,还包括:当所述数据存储通道的当前线程无效时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。Optionally, in another specific implementation manner of the present disclosure, the controlling the data storage channel to store the data frame corresponding to the receiving label further includes: when the current thread of the data storage channel is invalid, Transmitting, by the data storage channel, a breakpoint read instruction, so that the data storage channel reads breakpoint information of the data file corresponding to the first file label, and stores the receiving from a breakpoint location indicated by the breakpoint information The data frame corresponding to the label.
该实现方式中,由于当所述数据存储通道的当前线程有效时,向所述数据存储通道发送数据帧存储指令,以使所述数据存储通道存储所述接收标签对应的数据帧;当所述数据存储通道的当前线程无效时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。所以该实现方式能够保证属于同一数据文件的数据帧连续存储。In this implementation, when the current thread of the data storage channel is valid, sending a data frame storage instruction to the data storage channel, so that the data storage channel stores the data frame corresponding to the receiving label; When the current thread of the data storage channel is invalid, sending a breakpoint read instruction to the data storage channel, so that the data storage channel reads the breakpoint information of the data file corresponding to the first file label, and from the breakpoint The breakpoint location indicated by the information stores the data frame corresponding to the received tag. Therefore, the implementation can ensure that data frames belonging to the same data file are continuously stored.
可选地,在本发明的另一种具体实现方式中,所述控制所述数据存储通道存储所述接收标签对应的数据帧,还包括:当所述数据存储通道的当前线程无效时,判断其他数据存储通道对应的线程信息中的文件标签和所述第一文件标签是否相同;当其他数据存储通道对应的线程信息中的文件标签和所述第一文件标签相同时,根据其他数据存储通道对应的线程信息中的线程有效性信息判断其他数据存储通道对应的线程是否有效;当其他数据存储通道对应的线程有效时,向其他数据存储通道发送断点处理指令,以使其他数据存储通道生成所述第一文件标签对应数据文件的断点信息并进行存储;当其他数据存储通道完成相应的断点信息存储时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。Optionally, in another specific implementation manner of the present invention, the controlling the data storage channel to store the data frame corresponding to the receiving label further includes: when the current thread of the data storage channel is invalid, determining Whether the file label in the thread information corresponding to the other data storage channel and the first file label are the same; when the file label in the thread information corresponding to the other data storage channel is the same as the first file label, according to other data storage channels The thread validity information in the corresponding thread information determines whether the thread corresponding to the other data storage channel is valid; when the thread corresponding to the other data storage channel is valid, sends a breakpoint processing instruction to the other data storage channel, so that other data storage channels are generated. The first file label corresponds to the breakpoint information of the data file and is stored; when the other data storage channel completes the corresponding breakpoint information storage, sending a breakpoint read instruction to the data storage channel, so that the data storage The channel reads the breakpoint information of the data file corresponding to the first file label, and Storing breakpoint location corresponding to said received tag information indicates the breakpoint of the data frame.
该实现方式中,当其他数据存储通道完成相应的断点信息存储时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧,保证了属于同一数据文件的数据帧存储的连续性。 In this implementation manner, when another data storage channel completes the corresponding breakpoint information storage, sending a breakpoint read instruction to the data storage channel, so that the data storage channel reads the first file label corresponding data file. The breakpoint information, and storing the data frame corresponding to the received label from the breakpoint position indicated by the breakpoint information, ensures continuity of data frame storage belonging to the same data file.
可选地,在本发明的另一种具体实现方式中,所述控制所述数据存储通道存储所述接收标签对应的数据帧,还包括:当所述接收标签和所述期望标签匹配且所述第一文件标签和所述第二文件标签不相同时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。Optionally, in another specific implementation manner of the present invention, the controlling the data storage channel to store the data frame corresponding to the receiving label, further comprising: when the receiving label and the expected label match When the first file label and the second file label are different, sending a breakpoint read instruction to the data storage channel, so that the data storage channel reads a breakpoint of the data file corresponding to the first file label Information, and storing a data frame corresponding to the received tag from a breakpoint location indicated by the breakpoint information.
该实现方式中,当所述接收标签和所述期望标签匹配且所述第一文件标签和所述第二文件标签不相同时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧,保证了属于同一数据文件的数据帧存储的连续性。In this implementation manner, when the receiving label and the expected label match and the first file label and the second file label are different, a breakpoint reading instruction is sent to the data storage channel, so that The data storage channel reads the breakpoint information of the data file corresponding to the first file label, and stores the data frame corresponding to the received label from the breakpoint position indicated by the breakpoint information, thereby ensuring the data frame belonging to the same data file. Storage continuity.
可选地,在本发明的另一种具体实现方式中,所述控制所述数据存储通道存储所述接收标签对应的数据帧,还包括:当所述接收标签和所述期望标签匹配且所述第一文件标签和所述第二文件标签不相同时,判断其他数据存储通道对应的线程信息中的文件标签和所述第一文件标签是否相同;当其他数据存储通道对应的线程信息中的文件标签和所述第一文件标签相同时,根据其他数据存储通道对应的线程信息中的线程有效性信息判断其他数据存储通道对应的线程是否有效;当其他数据存储通道对应的线程有效时,向其他数据存储通道发送断点处理指令,以使其他数据存储通道生成所述第一文件标签对应数据文件的断点信息并进行存储;当其他数据存储通道完成相应的断点信息存储时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。Optionally, in another specific implementation manner of the present invention, the controlling the data storage channel to store the data frame corresponding to the receiving label, further comprising: when the receiving label and the expected label match When the first file label and the second file label are different, determining whether the file label and the first file label in the thread information corresponding to the other data storage channels are the same; when the thread information corresponding to the other data storage channel is When the file label and the first file label are the same, determining whether the thread corresponding to the other data storage channel is valid according to the thread validity information in the thread information corresponding to the other data storage channel; when the thread corresponding to the other data storage channel is valid, The other data storage channel sends a breakpoint processing instruction, so that other data storage channels generate breakpoint information of the data file corresponding to the first file label and store it; when other data storage channels complete the corresponding breakpoint information storage, The data storage channel sends a breakpoint read command to read the data storage channel Breakpoint information corresponding to said first tag file data file, and receives the tag data corresponding to the frames from the storage location of the breakpoint instruction breakpoint information.
该实现方式中,当其他数据存储通道完成相应的断点信息存储时,向所述数据存储通道发送数据帧存储指令,以使所述数据存储通道读取所述第一文件标签对应数据文件的断点信息息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧,保证了属于同一数据文件的数据帧存储的连续性。In this implementation manner, when the other data storage channels complete the corresponding breakpoint information storage, send a data frame storage instruction to the data storage channel, so that the data storage channel reads the data file corresponding to the first file label. The information information of the breakpoint is stored, and the data frame corresponding to the received label is stored from the breakpoint position indicated by the breakpoint information, thereby ensuring continuity of data frame storage belonging to the same data file.
可选地,在本发明的另一种具体实现方式中,所述控制所述数据存储通道存储所述接收标签对应的数据帧,还包括:当其他数据存储通道对应的线程信息中的文件标签和所述第一文件标签不相同时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。Optionally, in another specific implementation manner of the present invention, the controlling the data storage channel to store a data frame corresponding to the receiving label, further comprising: a file label in thread information corresponding to another data storage channel And when the first file label is different from the first file label, sending a breakpoint read instruction to the data storage channel, so that the data storage channel reads the breakpoint information of the data file corresponding to the first file label, and The breakpoint position indicated by the breakpoint information stores the data frame corresponding to the received label.
可选地,在本发明的另一种具体实现方式中,所述控制所述数据存储通道存储所述接收标签对应的数据帧,还包括:当其他数据存储通道对应的线程无效时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道读取所述第一文 件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。Optionally, in another specific implementation manner of the present invention, the controlling the data storage channel to store the data frame corresponding to the receiving label further includes: when the thread corresponding to the other data storage channel is invalid, The data storage channel sends a breakpoint read command to cause the data storage channel to read the first text The piece label corresponds to the breakpoint information of the data file, and stores the data frame corresponding to the received label from the breakpoint position indicated by the breakpoint information.
可选地,在本发明的另一种具体实现方式中,还包括:判断是否接收到所述数据存储通道发送的数据帧存储完成指示;当接收到所述数据存储通道发送的数据帧存储完成指示时,将所述数据存储通道对应的线程信息中的文件标签设置为所述第一文件标签,将对应的线程有效性信息设置为有效。Optionally, in another specific implementation manner of the present invention, the method further includes: determining whether the data frame storage completion indication sent by the data storage channel is received; and receiving the data frame transmission sent by the data storage channel is completed. When the indication is set, the file label in the thread information corresponding to the data storage channel is set as the first file label, and the corresponding thread validity information is set to be valid.
该实现方式中,当接收到所述数据存储通道发送的数据帧存储完成指示时,将所述数据存储通道对应的线程信息中的文件标签设置为所述第一文件标签,将对应的线程有效性信息设置为有效。通过设置线程信息方便判断所述数据存储通道所接收的后续数据帧是否需要读取断点信息,也方便所述数据存储通道生成断点信息,为后续数据帧的保序存储提供保证。In this implementation manner, when receiving the data frame storage completion indication sent by the data storage channel, setting a file label in the thread information corresponding to the data storage channel as the first file label, and validating the corresponding thread The sexual information is set to be valid. By setting the thread information, it is convenient to determine whether the subsequent data frames received by the data storage channel need to read the breakpoint information, and the data storage channel is also convenient to generate breakpoint information, which provides guarantee for the orderly storage of the subsequent data frames.
可选地,在本发明的另一种具体实现方式中,还包括:获取任一数据存储通道在接收到数据帧后发送的帧接收信息,所述帧接收信息包括:第三文件标签,所述第三文件标签用于指示所接收的数据帧所属数据文件;获取所述接收列表中与所述第三文件标签对应的顺序维护标签;将所述顺序维护标签确定为所述帧接收信息对应的数据帧的接收标签;更新所述第三文件标签对应的顺序维护标签,更新后的顺序维护标签作为下一对应数据帧的接收标签。Optionally, in another specific implementation manner of the present invention, the method further includes: acquiring frame receiving information that is sent by any data storage channel after receiving the data frame, where the frame receiving information includes: a third file label, The third file label is used to indicate the data file to which the received data frame belongs; the sequential maintenance label corresponding to the third file label in the receiving list is obtained; and the sequential maintenance label is determined to correspond to the frame receiving information. The receiving label of the data frame; updating the sequential maintenance label corresponding to the third file label, and the updated sequential maintenance label as the receiving label of the next corresponding data frame.
该实现方式中,每确定一个与第三文件标签对应的数据帧的接收标签,就将与第三文件标签对应的顺序维护标签更新为与第三文件标签对应的下一数据帧的接收标签,所以与第三文件标签对应的顺序维护标签能够按照接收顺序为第三文件标签对应的数据帧分配接收标签,后续第三文件标签对应的数据帧就可以根据所分配的接收标签按接收顺序进行存储。In this implementation manner, each time a receiving label of a data frame corresponding to the third file label is determined, the sequential maintenance label corresponding to the third file label is updated to a receiving label of the next data frame corresponding to the third file label. Therefore, the sequence maintenance label corresponding to the third file label can allocate a receiving label to the data frame corresponding to the third file label according to the receiving order, and the data frame corresponding to the third file label can be stored in the receiving order according to the allocated receiving label. .
可选地,在本发明的另一种具体实现方式中,还包括:判断所述接收列表中是否存在所述第三文件标签;当所述接收列表中存在所述第三文件标签时,执行获取所述接收列表中与所述第三文件标签对应的顺序维护标签的步骤;当所述接收列表中不存在所述第三文件标签时,在所述接收列表中添加所述第三文件标签,并为所述帧接收信息对应的数据帧分配初始接收标签和初始期望标签。Optionally, in another specific implementation manner of the present invention, the method further includes: determining whether the third file label exists in the receiving list; and when the third file label exists in the receiving list, performing Obtaining, in the receiving list, a sequence maintenance label corresponding to the third file label; when the third file label does not exist in the receiving list, adding the third file label to the receiving list And allocating an initial receiving label and an initial expected label to the data frame corresponding to the frame receiving information.
该实现方式中,当所述接收列表中不存在所述第三文件标签时,在所述接收列表中添加所述第三文件标签,并为所述帧接收信息对应的数据帧分配初始接收标签和初始期望标签。使新接收的、与所述第三文件标签对应的数据文件中的数据帧能够按照接收顺序进行存储。In this implementation, when the third file label does not exist in the receiving list, the third file label is added to the receiving list, and an initial receiving label is allocated for the data frame corresponding to the frame receiving information. And the initial expected label. The newly received data frames in the data file corresponding to the third file label can be stored in the order of reception.
可选地,在本发明的另一种具体实现方式中,还包括:当所述数据存储通道空闲时,判断所述数据存储通道对应的缓存列表是否非空;当所述数据存储通道 对应的缓存列表非空时,按照先入先出规则从所述数据存储通道对应的缓存列表中提取一组接收信息。Optionally, in another specific implementation manner of the present invention, the method further includes: determining, when the data storage channel is idle, whether the cache list corresponding to the data storage channel is not empty; and when the data storage channel is When the corresponding cache list is not empty, a set of received information is extracted from the cache list corresponding to the data storage channel according to the first-in first-out rule.
可选地,在本发明的另一种具体实现方式中,还包括:当所述接收标签和所述期望标签不匹配时,向所述数据存储通道发送断点处理指令,以使所述数据存储通道生成其存储的前一数据帧对应的数据文件的断点信息并进行存储。Optionally, in another specific implementation manner of the present invention, the method further includes: when the receiving label and the expected label do not match, sending a breakpoint processing instruction to the data storage channel, so that the data is The storage channel generates and stores the breakpoint information of the data file corresponding to the previous data frame stored therein.
该实现方式,当所述接收标签和所述期望标签不匹配时,向所述数据存储通道发送断点处理指令,以使所述数据存储通道生成其存储的前一数据帧对应的数据文件的断点信息并进行存储。方便其他数据存储通道读取相应的断点信息,并在该断点信息指示的断点位置存储相应的数据帧。In this implementation manner, when the receiving tag and the expected tag do not match, sending a breakpoint processing instruction to the data storage channel, so that the data storage channel generates a data file corresponding to the stored previous data frame thereof. Breakpoint information and store it. It is convenient for other data storage channels to read corresponding breakpoint information, and store corresponding data frames at the breakpoint position indicated by the breakpoint information.
第二方面,本发明实施例提供了一种存储装置,该存储装置包括:至少两个数据存储通道、存储模块和保序模块;所述保序模块中设置有接收列表,以及每个数据存储通道对应的缓存列表。其中,每个数据存储通道和所述保序模块可进行数据交互,每个数据存储通道和所述存储模块也可进行数据交互。所述保序模块还包括用于执行第一方面及第一方面各实现方式的中方法步骤的单元或子单元。In a second aspect, an embodiment of the present invention provides a storage device, where the storage device includes: at least two data storage channels, a storage module, and a preservation module; the protection module is provided with a receiving list, and each data storage The cache list corresponding to the channel. Each data storage channel and the order-preserving module can perform data interaction, and each data storage channel and the storage module can also perform data interaction. The order-preserving module also includes means or sub-units for performing the method steps of the first aspect and the implementations of the first aspect.
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it will be apparent to those skilled in the art that In other words, other drawings can be obtained based on these drawings without paying for creative labor.
图1为本发明实施例提供的一种应用场景的示意图;FIG. 1 is a schematic diagram of an application scenario according to an embodiment of the present disclosure;
图2为本发明实施例提供的一种存储方法的流程图;2 is a flowchart of a storage method according to an embodiment of the present invention;
图3为本发明实施例提供的一种保序模块的示意图;3 is a schematic diagram of a save order module according to an embodiment of the present invention;
图4为本发明实施例提供的一种断点信息的示意图;4 is a schematic diagram of a breakpoint information according to an embodiment of the present invention;
图5为本发明实施例提供的一种存储方法具体实施例的流程图;FIG. 5 is a flowchart of a specific embodiment of a storage method according to an embodiment of the present invention;
图6为本发明实施例的一种存储装置的结构示意图。FIG. 6 is a schematic structural diagram of a storage device according to an embodiment of the present invention.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整的描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳 动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, those skilled in the art are not creative All other embodiments obtained under the premise of the invention are within the scope of the invention.
为方便理解,首先对本发明实施例的一种应用场景进行介绍。如图1所示,该应用场景为SAS宽端口场景,包括发送端100和接收端200,接收端200的N+1个数据存储通道(Chnl 0、Chnl 1、…、Chnl N)与发送端100的N+1个域(Domain0、Domain 1、…、Domain N)之间建立有N+1个用于数据传输的数据传输通道。其中,本发明实施例的执行主体为SAS宽端口场景下的接收端200。For ease of understanding, an application scenario of an embodiment of the present invention is first introduced. As shown in FIG. 1 , the application scenario is a SAS wide port scenario, including a transmitting
其中,在接收端200中,每个数据存储通道和存储模块(Host/Target Memory)能够进行数据交互,且每个数据存储通道和保序模块(Frame Order Manager)也能够进行数据交互。每个数据存储通道包括传输层(如Trans Layer 0、Trans Layer 1、…、Trans Layer N等)和直接存储访问控制器(Direct Memory Access Controller,简称DMAC,如DMAC 0、DMAC 1、…、DMAC N等),每个DMAC内部设置有缓存区(图中未画出)。每个数据存储通道的传输层用于接收对应域发送的数据帧;每个数据存储通道的DMAC用于按照先入先出规则在其内部的缓存区缓存对应传输层接收的数据帧。存储模块为接收端200接收到的数据帧和接收端200所接收的每个数据文件的断点信息(对应图1中IO Break Point)提供存储空间。其中,每个数据文件的断点信息用于指示该数据文件的待存储数据帧的存储位置。在本发明具体实施的过程中,可利用文件标签、已存储数据文件长度、已存储数据文件地址、线程有效性信息等生成断点信息。具体地,断点信息中的文件标签用于指示断点信息对应的数据文件,已存储数据文件长度用于指示断点信息对应数据文件的已存储数据量,已存储数据文件地址用于指示断点信息对应数据文件的下一帧对应的存储地址,线程有效性信息用于指示断点信息对应数据文件的线程是否有效。另外,在本发明具体实施的过程中,断点信息中还可以包括其他信息。例如,断点信息中还可以包括用于指示一个数据帧在整个数据文件中偏移量的帧偏移量信息,以检验接收的数据帧是否有数据丢失。又例如,断点信息中还可以包括用于指示数据文件交互过程中相关数据帧存储命令的存储位置的数据文件命令地址。保序模块用于控制接收端200所接收的每个数据文件的数据帧按照接收顺序存储,保证接收端存储数据文件与发送端发送数据文件的一致性。In the receiving end 200, each data storage channel and the storage module (Host/Target Memory) can perform data interaction, and each data storage channel and the Frame Order Manager can also perform data interaction. Each data storage channel includes a transport layer (such as
需要说明的是,图1所示的应用场景仅仅是本发明实施例的一种具体应用场景。本发明实施例的应用场景并不限于此。例如,在本发明的另一中应用场景中,存储模块可仅为接收端200接收到的数据帧提供存储空间。又例如,在本发明实施例的又一种应用场景中,可以包括两个存储模块,其中一个存储模块为接收端200接收到的数据帧提供存储空间,另一个存储模块为接收端200所接收的每个数据文件的断点信息提供存储空间。 It should be noted that the application scenario shown in FIG. 1 is only a specific application scenario of the embodiment of the present invention. The application scenario of the embodiment of the present invention is not limited thereto. For example, in another application scenario of the present invention, the storage module may only provide storage space for data frames received by the receiving end 200. For another example, in another application scenario of the embodiment of the present invention, two storage modules may be included, where one storage module provides storage space for the data frame received by the receiving end 200, and another storage module is received by the receiving end 200. The breakpoint information for each data file provides storage space.
进一步地,下面结合本发明实施例对接收端200存储数据帧的流程进行说明。参见图2,为本发明实施例提供的一种存储方法的流程图,该存储方法由接收端200中的保序模块控制执行。具体地,本实施例可以包括以下步骤:Further, the flow of storing the data frame by the receiving end 200 will be described below in conjunction with the embodiment of the present invention. FIG. 2 is a flowchart of a storage method according to an embodiment of the present invention. The storage method is controlled by a guarantee module in the receiving end 200. Specifically, the embodiment may include the following steps:
在步骤S210中,当数据存储通道空闲时,按照先入先出规则从数据存储通道对应的缓存列表中提取接收信息。In step S210, when the data storage channel is idle, the received information is extracted from the cache list corresponding to the data storage channel according to the first-in first-out rule.
具体地,这里所提取的接收信息包括接收标签和地址信息。接收标签用于指示接收标签对应的数据帧在其所属数据文件中的排列顺序,地址信息用于指示接收标签对应的第一文件标签在接收列表中的位置,第一文件标签用于指示数据文件。其中,第一文件标签指示的数据文件包括多个数据帧,接收标签对应的数据帧属于第一文件标签指示的数据文件。Specifically, the received information extracted here includes a receiving tag and address information. The receiving label is used to indicate the order of the data frames corresponding to the received label in the data file to which the label belongs. The address information is used to indicate the position of the first file label corresponding to the received label in the receiving list, and the first file label is used to indicate the data file. . The data file indicated by the first file label includes multiple data frames, and the data frame corresponding to the receiving label belongs to the data file indicated by the first file label.
需要说明的是,为保证保证步骤S210所提取的接收信息中的接收标签能够用于指示接收标签对应的数据帧在其所属数据文件中的排列顺序,在本发明具体实施的过程中,发送端100按照数据文件中数据帧的排列顺序向接收端200发送数据帧,当接收端200的任一数据存储通道的传输层接收到发送端100发送的一个数据帧时,该数据存储通道向保序模块发送包括文件标签的帧接收信息。这里的文件标签用于指示该数据存储通道所接收的数据帧所属的数据文件。保序模块在接收到帧接收信息时,获取接收列表中与帧接收信息中的文件标签对应的顺序维护标签。当获取到顺序维护标签时,将顺序维护标签确定为帧接收信息对应的数据帧的接收标签。进一步地,在确定接收标签后,更新帧接收信息中的文件标签对应的顺序维护标签,更新后的顺序维护标签作为下一对应数据帧的接收标签。It should be noted that, in order to ensure that the receiving label in the received information extracted in step S210 can be used to indicate the order of the data frames corresponding to the receiving label in the data file to which the receiving label belongs, in the process of implementing the present invention, the sending
另外,在本发明具体实施的过程中,这里在获取顺序维护标签之前,可先判断接收列表中是否存在帧接收信息中的文件标签。当接收列表中存在帧接收信息中的文件标签时,保序模块执行获取接收列表中与帧接收信息中的文件标签对应的顺序维护标签的步骤,当接收列表中不存在帧接收信息中的文件标签时,保序模块在接收列表中创建帧接收信息中的文件标签与顺序维护标签的对应关系,顺序维护标签按照与帧接收信息中的文件标签对应的数据帧的接收顺序进行更新。例如,在保序模块接收到某一文件标签对应的第一个帧接收信息时,将顺序维护标签记为0,将0确定为该文件标签对应的第一个数据帧的接收标签(对应初始接收标签)时,将顺序维护标签更新为1,当保序模块接收到该文件标签对应的第二个帧接收信息时,将1确定为该文件标签对应的第二个数据帧的接收标签,并将顺序维护标签更新为2,以此类推,就能保证接收标签能够用于指示在其所属数据文件中的排列顺序。在每确定一个数据帧的接收标签时,生成一个包括该接收标签对应文件标签在接收列表中的地址信息和该接收标签的接收信息,并存 储在对应的缓存列表中。其中,如图1所示,数据存储通道与缓存列表存在一一对应关系。每个缓存列表中的接收信息按照接收信息的生成顺序进行排列,以使保序模块可按照先入先出规则提取缓存列表中的接收信息。In addition, in the process of the specific implementation of the present invention, before obtaining the sequential maintenance label, it may be determined whether the file label in the frame receiving information exists in the receiving list. When the file label in the frame receiving information exists in the receiving list, the order-preserving module performs the step of acquiring the sequential maintenance label corresponding to the file label in the frame receiving information in the receiving list, and the file in the frame receiving information does not exist in the receiving list. When the label is used, the order-preserving module creates a correspondence between the file label and the sequential maintenance label in the frame receiving information in the receiving list, and the sequential maintenance label is updated according to the receiving order of the data frame corresponding to the file label in the frame receiving information. For example, when the order-preserving module receives the first frame receiving information corresponding to a file label, the sequential maintenance label is recorded as 0, and 0 is determined as the receiving label of the first data frame corresponding to the file label (corresponding to the initial When the label is received, the sequence maintenance label is updated to 1. When the sequence module receives the second frame receiving information corresponding to the file label, 1 is determined as the receiving label of the second data frame corresponding to the file label. Updating the sequential maintenance label to 2, and so on, ensures that the receiving label can be used to indicate the order in which it is placed in the data file to which it belongs. Each time a receiving label of a data frame is determined, an address information including a file label corresponding to the receiving label in the receiving list and receiving information of the receiving label are generated, and the information is stored. Stored in the corresponding cache list. As shown in FIG. 1 , there is a one-to-one correspondence between the data storage channel and the cache list. The received information in each cache list is arranged in the order in which the received information is generated, so that the order-preserving module can extract the received information in the cache list according to the first-in first-out rule.
进一步地,当接收端200的数据通存储道处于空闲状态时,按照先入先出规则从处于空闲状态的数据存储通道对应的缓存列表中提取接收信息。通常情况下,一个数据存储通道是否处于空闲状态是由该数据存储通道对应的DMAC是否正在向存储模块存储数据帧所确定。在本发明具体实施的过程中,一个数据存储通道的DMAC完成一个数据帧存储时可向保序模块发送包括存储完成指令,保序模块在接收到存储完成指令可确认对应的数据存储通道空闲;保序模块也可实时监控每个数据存储通道缓对应的缓存列表是否有接收信息,当一个数据存储通道对应的缓存列表中没有接收信息时,确定该数据存储通道处于空闲状态。Further, when the data pass storage path of the receiving end 200 is in an idle state, the received information is extracted from the cache list corresponding to the data storage channel in the idle state according to the first-in first-out rule. Normally, whether a data storage channel is in an idle state is determined by whether the DMAC corresponding to the data storage channel is storing data frames to the storage module. In the process of the specific implementation of the present invention, when the DMAC of a data storage channel completes a data frame storage, the storage completion instruction may be sent to the sequence-preserving module, and the sequence-preserving module may confirm that the corresponding data storage channel is idle after receiving the storage completion instruction; The preserving module can also monitor in real time whether the buffer list corresponding to each data storage channel has received information. When there is no receiving information in the cache list corresponding to a data storage channel, it is determined that the data storage channel is in an idle state.
可以理解的是,为使处于空闲状态的数据存储通道能够提取到接收信息,,首先要保证处于空闲状态的数据存储通道对应的缓存列表中存在接收信息。为此,在本发明的一种具体实施方式中,当数据存储通道空闲时,还可以进一步判断空闲数据存储通道对应的缓存列表是否非空,仅当空闲数据存储通道对应的缓存列表非空时,按照先入先出规则从空闲数据存储通道对应的缓存列表中提取接收信息。当然,也可以不进行空闲数据存储通道对应的缓存列表是否非空的判断,直接从空闲数据存储通道对应的缓存列表中提取接收信息。此时,当提取到接收信息时进行后续步骤,当没有提取到接收信息时,继续按照先入先出规则从空闲数据存储通道对应的缓存列表中提取接收信息,直到提取到接收信息。It can be understood that in order to enable the data storage channel in the idle state to extract the received information, it is first ensured that the received information exists in the cache list corresponding to the data storage channel in the idle state. Therefore, in a specific implementation manner of the present invention, when the data storage channel is idle, it may further determine whether the cache list corresponding to the idle data storage channel is non-empty, only when the cache list corresponding to the idle data storage channel is not empty. The received information is extracted from the cache list corresponding to the idle data storage channel according to the first-in first-out rule. Certainly, the receiving information may be directly extracted from the cache list corresponding to the idle data storage channel without determining whether the cache list corresponding to the idle data storage channel is non-empty. At this time, when the received information is extracted, the subsequent steps are performed. When the received information is not extracted, the received information is continuously extracted from the cache list corresponding to the idle data storage channel according to the first-in first-out rule until the received information is extracted.
在步骤S220中,根据接收信息中包括的地址信息在接收列表中查找第一文件标签。In step S220, the first file tag is looked up in the receiving list according to the address information included in the received information.
在步骤S230中,获取第一文件标签对应的期望标签,期望标签用于指示第一文件标签对应数据文件的数据帧的存储顺序,在完成第一文件标签对应数据文件的一个数据帧的存储时,存储顺序按照第一文件标签对应数据文件的数据帧排列顺序进行更新。In step S230, the desired label corresponding to the first file label is obtained, and the desired label is used to indicate the storage order of the data frame corresponding to the data file of the first file label, when the storage of a data frame of the data file corresponding to the first file label is completed. The storage order is updated in accordance with the data frame arrangement order of the data file corresponding to the first file label.
其中,在本发明具体实施的过程中,可以在接收列表中建立第一文件标签,第一文件标签对应的顺序维护标签,以及第一文件标签对应的期望标签之间的对应关系,以方便保序模块获取第一文件标签对应的期望标签。可以理解的是,也可以在接收列表中分别建立第一文件标签和第一文件标签对应的顺序维护标签之间的对应关系,以及第一文件标签和第一文件标签对应的期望标签之间的对应关系。 In the process of the specific implementation of the present invention, the first file label, the sequential maintenance label corresponding to the first file label, and the correspondence between the expected labels corresponding to the first file label may be established in the receiving list to facilitate the protection. The sequence module acquires a desired label corresponding to the first file label. It can be understood that the correspondence between the first file label and the sequential maintenance label corresponding to the first file label and the expected label corresponding to the first file label and the first file label may be respectively established in the receiving list. Correspondence relationship.
为保证期望标签能够用于指示第一文件标签对应数据文件的数据帧的存储顺序,且存储顺序按照第一文件标签对应数据文件的数据帧在其所属数据文件中的排列顺序进行更新,在本发明具体实施的过程中,当接收端200的保序模块获知任一数据存储通道完成第一文件标签对应的一个数据帧的存储时,更新第一文件标签对应的期望标签,更新后的期望标签和所述第一文件标签对应的下一接收标签匹配。其中,任一数据存储通道在完成第一文件标签对应的一个数据帧的存储时,可向保序模块发送指令以使保序模块获知,这里的匹配可以是相等,也可以是一种一一对应关系(如0、1、2分别和A、B、C一一对应)。在保序模块获知任一数据存储通道接收到第一文件标签对应的第一个数据帧时,在接收列表中创建第一文件标签和第一文件标签对应的期望标签之间的对应关系,第一文件标签对应的期望标签按照与第一文件标签对应的数据帧的存储顺序进行更新。例如,在保序模块获知任一数据存储通道接收到第一文件标签对应的第一个数据帧时,将第一文件标签对应的期望标签记为(对应初始期望标签)0,当第一文件标签对应的第一个数据帧存储完成时,将第一文件标签对应的期望标签更新为1,以此类推,就能保证第一文件标签对应的期望标签能够用于指示第一文件标签对应数据文件的数据帧的存储顺序,且存储顺序按照第一文件标签对应数据文件的数据帧在其所属数据文件中的排列顺序进行更新。To ensure that the desired label can be used to indicate the storage order of the data frame corresponding to the data file of the first file label, and the storage order is updated according to the order of the data frames of the data file corresponding to the first file label in the data file to which the first file label belongs. In the process of the specific implementation of the invention, when the preserving module of the receiving end 200 learns that any data storage channel completes the storage of a data frame corresponding to the first file label, the expected label corresponding to the first file label is updated, and the updated expected label is updated. And matching the next receiving label corresponding to the first file label. When any data storage channel completes storage of a data frame corresponding to the first file label, the data may be sent to the order-preserving module to enable the order-preserving module to learn that the matching may be equal or one-to-one. Correspondence relationship (such as 0, 1, 2 and A, B, C one-to-one correspondence). When the preserving module learns that the first data frame corresponding to the first file label is received by any data storage channel, the correspondence between the first file label and the expected label corresponding to the first file label is created in the receiving list, The desired label corresponding to a file label is updated in the order in which the data frames corresponding to the first file label are stored. For example, when the preserving module learns that any data storage channel receives the first data frame corresponding to the first file label, the expected label corresponding to the first file label is recorded as (corresponding to the initial expected label) 0, when the first file is used. When the storage of the first data frame corresponding to the label is completed, the expected label corresponding to the first file label is updated to 1, and so on, so that the desired label corresponding to the first file label can be used to indicate the data corresponding to the first file label. The storage order of the data frames of the file, and the storage order is updated in the order in which the data frames of the data files corresponding to the first file label are arranged in the data file to which they belong.
在步骤S240中,当接收标签和期望标签匹配时,控制数据存储通道存储接收标签对应的数据帧。In step S240, when the receiving tag matches the expected tag, the control data storage channel stores the data frame corresponding to the receiving tag.
其中,这里的匹配可以是相等,也可以是一种一一对应关系(如0、1、2分别和A、B、C一一对应)。在本发明具体实施的过程中,保序模块可以在接收标签和期望标签匹配时,直接向对应的空闲数据存储通道发送数据帧存储指令,使对应的数据存储通道存储与接收标签对应的数据帧。保序模块也可以在接收标签和期望标签匹配时,继续判断是否需要读取与第一文件标签对应的断点信息,当不需读取断点信息时,向对应的空闲数据存储通道发送数据帧存储指令,以使对应的空闲数据存储通道存储与接收标签对应的数据帧。Wherein, the matching here may be equal or a one-to-one correspondence (for example, 0, 1, and 2 respectively correspond to A, B, and C). In the process of the specific implementation of the present invention, the sequence-preserving module may directly send a data frame storage instruction to the corresponding idle data storage channel when the receiving tag matches the expected tag, so that the corresponding data storage channel stores the data frame corresponding to the receiving tag. . The order-preserving module may further determine whether it is necessary to read the breakpoint information corresponding to the first file label when the receiving label matches the expected label, and send data to the corresponding idle data storage channel when the breakpoint information is not required to be read. The frame stores instructions such that the corresponding free data storage channel stores the data frame corresponding to the received tag.
在本发明具体实施的过程中,可预先建立与每一数据存储通道对应的、包括文件标签和线程有效性信息的线程信息,以使保序模块获取空闲数据存储通道对应的线程信息,其中,在本发明具体实施的过程中,可利用特定的符号或数字表示有效或无效。例如,利用数字0表示无效,数字1表示有效,线程信息的文件标签用于指示对应数据存储通道存储的上一数据帧所属数据文件。具体地,接收端200中的一个数据存储通道完成一个数据帧(即该数据存储通道存储的上一数据帧)的存储时,可向保序模块发送数据帧存储完成指示,保序模块在接收到数据帧存储完成指示时,可将该数据存储通道对应的线程信息中的文件标签设置为
该数据存储通道完成存储的数据帧对应的文件标签,同时将对应的线程有效性信息设置为有效。相应地,当该数据存储通道生成或读取断点信息时,将对应的线程有效性信息设置为无效。为描述方便,后续将与空闲数据通存储道对应的线程信息中的文件标签记为第二文件标签。在获取空闲数据存储通道中的第二文件标签和线程有效性信息之后,保序模块可判断第一文件标签和第二文件标签是否相同,当第一文件标签和第二文件标签相同时,进一步根据对应的线程有效性信息判断空闲数据存储通道的当前线程是否有效,当空闲数据存储通道的当前线程有效时,确定不需要读取断点信息。然后保序模块向空闲数据存储通道发送数据帧存储指令,以使空闲数据存储通道存储对应的数据帧。In the process of the specific implementation of the present invention, the thread information corresponding to each data storage channel, including the file label and the thread validity information, may be pre-established, so that the order-preserving module acquires the thread information corresponding to the idle data storage channel, where In the course of the specific implementation of the present invention, specific symbols or numbers may be used to indicate that they are valid or invalid. For example, the
相应地,当第一文件标签和第二文件标签不相同时,或者,第一文件标签和第二文件标签相同但空闲数据存储通道的当前线程无效时,保序模块确定需要读取断点信息。Correspondingly, when the first file label and the second file label are different, or the first file label and the second file label are the same but the current thread of the idle data storage channel is invalid, the sequencer module determines that the breakpoint information needs to be read. .
在保序模块确定需要读取断点信息时,如果断点信息是在每当保序模块发现一个数据存储通道的接收标签和期望标签不匹配时,向该数据存储通道发送断点处理指令,以使该数据存储通道生成其存储的前一数据帧对应的数据文件的断点信息并进行存储,这里前一数据帧是指该数据存储通道刚刚完成存储的数据帧。则保序模块直接向空闲数据存储通道发送断点读取指令,以使空闲数据存储通道读取第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储与接收标签对应的数据帧。其中,在本发明具体实施的过程中,断点读取指令中包括有第一文件标签,以使空闲数据存储通道能够根据断点读取指令查找到对应的断点信息。另外,在本发明具体实施的过程中,可利用文件标签、已存储数据文件长度、已存储数据文件地址、线程有效性信息等生成断点信息。具体地,断点信息中的文件标签用于指示断点信息对应的数据文件,已存储数据文件长度用于指示断点信息对应数据文件的已存储数据量,已存储数据文件地址用于指示断点信息对应数据文件的下一帧对应的存储地址,线程有效性信息用于指示断点信息对应数据文件的线程是否有效。另外,在本发明具体实施的过程中,断点信息中还可以包括其他信息。例如,断点信息中还可以包括用于指示一个数据帧在整个数据文件中偏移量的帧偏移量信息,以检验接收的数据帧是否有数据丢失。又例如,断点信息中还可以包括用于指示数据文件交互过程中相关数据帧存储命令的存储位置的数据文件命令地址。其中,在本发明具体实施的过程中,在断点信息存储的过程中,如果发现存储模块中已存储有相应数据文件的断点信息,则可以用新生成的断点信息覆盖之前生成的断点信息,以节省存储空间。同样,如果发现有数据存储通道读取断点信息,可在读取后删除相应的断点信息,以节省存储空间。 When the order-preserving module determines that the breakpoint information needs to be read, if the breakpoint information is sent to the data storage channel whenever the receiving module finds that the receiving label of the data storage channel does not match the expected label, The data storage channel is configured to generate and store the breakpoint information of the data file corresponding to the previous data frame stored therein, where the previous data frame refers to the data frame that the data storage channel has just completed storage. The order-preserving module directly sends a breakpoint read instruction to the idle data storage channel, so that the idle data storage channel reads the breakpoint information of the data file corresponding to the first file label, and stores the breakpoint position indicated by the breakpoint information. Receive the data frame corresponding to the label. In the process of the specific implementation of the present invention, the breakpoint read command includes a first file label, so that the idle data storage channel can find the corresponding breakpoint information according to the breakpoint read command. In addition, in the process of the specific implementation of the present invention, the breakpoint information may be generated by using a file label, a stored data file length, a stored data file address, thread validity information, and the like. Specifically, the file label in the breakpoint information is used to indicate a data file corresponding to the breakpoint information, and the stored data file length is used to indicate the stored data amount of the data file corresponding to the breakpoint information, and the stored data file address is used to indicate the broken data. The point information corresponds to a storage address corresponding to the next frame of the data file, and the thread validity information is used to indicate whether the thread corresponding to the data file of the breakpoint information is valid. In addition, in the process of implementing the present invention, other information may be included in the breakpoint information. For example, the breakpoint information may further include frame offset information indicating an offset of a data frame in the entire data file to verify whether the received data frame has data loss. For another example, the breakpoint information may further include a data file command address for indicating a storage location of the related data frame storage command during the data file interaction. In the process of the specific implementation of the present invention, in the process of storing the breakpoint information, if the breakpoint information of the corresponding data file is already stored in the storage module, the newly generated breakpoint information may be used to overwrite the previously generated breakpoint. Tap the information to save storage space. Similarly, if you find that the data storage channel reads the breakpoint information, you can delete the corresponding breakpoint information after reading to save storage space.
另外,在保序模块确定需要读取断点信息时,保序模块可控制生成断点信息并读取所生成的断点信息。具体地,在本发明的一种具体实施方式中,保序模块可先判断其他数据存储通道对应的线程信息中的文件标签和第一文件标签是否相同。当其他数据存储通道对应的线程信息中的文件标签和第一文件标签相同时,保序模块进而根据其他数据存储通道对应的线程信息中的线程有效性信息判断其他数据存储通道对应的线程是否有效。当其他数据存储通道对应的线程有效时,保序模块向其他数据存储通道发送断点处理指令,以使其他数据存储通道生成第一文件标签对应数据文件的断点信息并进行存储(如存储在图1所示的存储模块中)。当其他数据存储通道完成相应的断点信息存储时,保序模块向空闲数据存储通道发送断点读取指令,以使空闲数据存储通道读取第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储与接收标签对应的数据帧。这里保序模块可实时监测其他数据存储通道是否完成断点信息的存储进而获知其他数据存储通道是否完成断点信息存储。也可以其他数据存储通道在完成断点信息存储时,向保序模块发送断点存储完成指令,以使保序模块获知其他数据存储通道已完成断点信息存储。这里其他数据存储通道的个数为一个或多个。In addition, when the order-preserving module determines that the breakpoint information needs to be read, the order-preserving module can control the generation of the breakpoint information and read the generated breakpoint information. Specifically, in a specific implementation manner of the present invention, the order-preserving module may first determine whether the file label and the first file label in the thread information corresponding to the other data storage channels are the same. When the file label in the thread information corresponding to the other data storage channel is the same as the first file label, the order-preserving module further determines whether the thread corresponding to the other data storage channel is valid according to the thread validity information in the thread information corresponding to the other data storage channel. . When the thread corresponding to the other data storage channel is valid, the order-preserving module sends a breakpoint processing instruction to the other data storage channel, so that the other data storage channel generates the breakpoint information of the data file corresponding to the first file label and stores it (for example, in the storage). In the memory module shown in Figure 1). When the other data storage channels complete the corresponding breakpoint information storage, the sequencer module sends a breakpoint read instruction to the idle data storage channel, so that the idle data storage channel reads the breakpoint information of the data file corresponding to the first file label, and A data frame corresponding to the received tag is stored from the breakpoint position indicated by the breakpoint information. Here, the order-preserving module can monitor in real time whether other data storage channels complete the storage of the breakpoint information and know whether other data storage channels complete the breakpoint information storage. Other data storage channels may also send a breakpoint storage completion instruction to the order-preserving module when the breakpoint information storage is completed, so that the order-preserving module knows that the other data storage channels have completed the breakpoint information storage. The number of other data storage channels here is one or more.
其中,前述具体实施方式中当其他数据存储通道的个数为两个以上时,保序模块可分别判断其他数据存储通道中每个数据存储通道对应的线程信息中的文件标签和第一文件标签是否相同,当相同时,进而判断该数据存储通道对应的线程信息中的线程有效性信息判断该数据存储通道对应的线程是否有效。一旦保序模块判断出一个其他数据存储通道对应的线程信息中的文件标签和第一文件标签不相同时,或者判断出一个其他数据存储通道对应的线程无效时,表明文件标签和第一文件标签相同且线程有效的其他数据存储通道为另外的其他数据存储通道。此时,另外的数据存储通道可能已完成断点信息的保存。所以保序模块可向空闲数据存储通道发送断点读取指令,以使空闲数据存储通道读取与第一文件标签对应数据文件的断点信息,以及从该断点信息指示的断点位置存储与接收标签对应的数据帧。In the foregoing embodiment, when the number of other data storage channels is two or more, the order-preserving module may respectively determine the file label and the first file label in the thread information corresponding to each data storage channel in the other data storage channels. Whether they are the same or not, and determining the thread validity information in the thread information corresponding to the data storage channel to determine whether the thread corresponding to the data storage channel is valid. After the order-preserving module determines that the file label and the first file label in the thread information corresponding to another data storage channel are different, or determines that the thread corresponding to another data storage channel is invalid, the file label and the first file label are indicated. The same and thread-efficient other data storage channels are additional data storage channels. At this point, another data storage channel may have completed the preservation of the breakpoint information. Therefore, the order-preserving module can send a breakpoint read instruction to the idle data storage channel, so that the idle data storage channel reads the breakpoint information of the data file corresponding to the first file label, and stores the breakpoint location indicated by the breakpoint information. A data frame corresponding to the received tag.
本发明实施例中,当数据存储通道空闲时,按照先入先出规则从所述数据存储通道对应的缓存列表中提取接收信息,所述接收信息包括接收标签和地址信息,所述接收标签用于指示所述接收标签对应的数据帧在其所属数据文件中的排列顺序,所述地址信息用于指示所述接收标签对应的第一文件标签在接收列表中的位置,所述第一文件标签用于指示所述接收标签对应的数据帧所属数据文件;根据所述地址信息在所述接收列表中查找所述第一文件标签;获取所述第一文件标签对应的期望标签,所述期望标签用于指示所述第一文件标签对应数据文件的数据帧的存储顺序,在完成所述第一文件标签对应数据文件的一个数据帧的存储 时,所述存储顺序按照所述第一文件标签对应数据文件的数据帧排列顺序进行更新;当所述接收标签和所述期望标签匹配时,控制所述数据存储通道存储所述接收标签对应的数据帧。由于当用于指示所述接收标签对应的数据帧在其所属数据文件中的排列顺序的接收标签和用于指示所述第一文件标签对应数据文件的数据帧的存储顺序的期望标签匹配时,控制所述数据存储通道存储所述接收标签对应的数据帧,所以本发明的技术方案能够确保同一数据文件的多个数据帧的接收顺序与存储顺序一致,保证接收端存储数据文件与发送端发送数据文件的一致性。In the embodiment of the present invention, when the data storage channel is idle, the received information is extracted from the cache list corresponding to the data storage channel according to a first-in first-out rule, and the received information includes a receiving label and address information, where the receiving label is used for And indicating an arrangement order of the data frames corresponding to the receiving label in the data file to which the receiving label belongs, the address information is used to indicate a position of the first file label corresponding to the receiving label in the receiving list, and the first file label is used by the first file label And indicating a data file to which the data frame corresponding to the receiving label belongs; searching for the first file label in the receiving list according to the address information; acquiring a desired label corresponding to the first file label, where the desired label is used And storing the data frame of the data file corresponding to the first file label in the storage sequence of the data frame corresponding to the data file corresponding to the first file label And the storing sequence is updated according to the data frame arrangement order of the data file corresponding to the first file label; when the receiving label matches the expected label, controlling the data storage channel to store the corresponding corresponding to the receiving label Data Frame. When the received label for indicating the order of arrangement of the data frames corresponding to the received label in the data file to which the received label belongs is matched with the desired label for indicating the storage order of the data frame of the data file corresponding to the first file label, Controlling the data storage channel to store the data frame corresponding to the receiving label, so the technical solution of the present invention can ensure that the receiving order of the multiple data frames of the same data file is consistent with the storage order, and the receiving end stores the data file and the sending end to send The consistency of the data files.
为方便理解,下面利用图3表示保序模块的示意图,图4表示断点信息的示意图。并在此基础上,利用图5所示具体实施例对本发明实施例的一种存储方法进行更加形象的说明。For ease of understanding, a schematic diagram of the order-preserving module is shown below using FIG. 3, and FIG. 4 is a schematic diagram showing breakpoint information. Based on the specific embodiment shown in FIG. 5, a storage method of the embodiment of the present invention is further illustrated.
如图3所示的保序模块,该保序模块对应的数据存储通道的数目为N+1,每个数据缓存通道的缓存区最多可缓存M+1个数据帧。在该保序模块中,OrderTable表示接收列表,接收列表中包含多个文件信息,每个文件信息包括文件标签IO Tag、顺序维护标签Rcv_Tag′和期望标签Exp_Tag,每组文件信息对应一个地址信息Order Table addr。Chnl 0pending fifo、Chnl 1pending fifo、…、Chnl N pending fifo分别为数据存储通道Chnl 0、Chnl 1、…、Chnl N对应的缓存列表,每个缓存列表中包括对应数据存储通道的DMAC内部缓存区缓存的数据帧的接收信息,每个接收信息包括对应的地址信息Order Table addr和接收标签Rcv_Tag(即对应文件标签的地址信息),Chnl 0brk reg、Chnl 1brk reg、…、Chnl N brk reg分别为数据存储通道Chnl 0、Chnl 1、…、Chnl N对应的线程信息。RR表示调度模块,用于在接收到Chnl 0、Chnl 1、…、Chnl N发送的包含IO Tag的帧接收信息(如Chnl 0_rx newd_req、…、Chnl N_rx newd_req等)时,利用帧接收信息中的IO Tag在接收列表中查找对应的Rcv_Tag′,将当前的Rcv_Tag′确定为对应数据帧的接收标签,同时更新查找到的Rcv_Tag′。进一步地,生成包换地址信息和接收标签的接收信息,按照先入先出规则存储到对应的缓存列表中。As shown in FIG. 3, the number of data storage channels corresponding to the sequencer module is N+1, and the buffer area of each data buffer channel can cache up to M+1 data frames. In the order-preserving module, the OrderTable represents a receiving list, and the receiving list includes a plurality of file information, each file information includes a file label IO Tag, a sequential maintenance label Rcv_Tag', and a desired label Exp_Tag, and each group of file information corresponds to an address information Order Table addr. Chnl 0pending fifo, Chnl 1pending fifo, ..., Chnl N pending fifo are cache lists corresponding to data storage channels Chnl 0,
需要说明的是,图3中接收列表中每个文件信息与一个数据文件对应,且每个文件信息不同;图3中缓存列表中的每个接收信息对应一个数据帧,且每个接收信息不同。在每完成一个数据帧的存储时更新图3中对应线程信息中的内容。It should be noted that each file information in the receiving list in FIG. 3 corresponds to one data file, and each file information is different; each received information in the cache list in FIG. 3 corresponds to one data frame, and each received information is different. . The content in the corresponding thread information in FIG. 3 is updated every time a data frame is stored.
如图4所示的端点信息,在该断点信息中,保存有多个IO Tag对应的断点信息,每个断点信息中包括文件标签IO Tag、帧偏移量信息Data_offset、已存储数据文件长度IO_data_length、已存储数据文件地址Frame addr_L、线程有效性信息valid、数据文件命令地址Frame addr_H等。 As shown in FIG. 4, in the breakpoint information, breakpoint information corresponding to multiple IO tags is stored, and each breakpoint information includes a file label IO Tag, a frame offset information Data_offset, and stored data. The file length IO_data_length, the stored data file address Frame addr_L, the thread validity information valid, the data file command address Frame addr_H, and the like.
在保序模块获知接收端200的Chnl 0处于空闲状态(即DMAC 0空闲)时,执行图5中的流程,该流程可以利用图3中保序模块中的RR模块执行,也可以在保序模块中添加其他的执行模块执行该流程。When the sequence-preserving module learns that the
具体地,图3中的保序模块首先判断Chnl 0pending fifo是否非空,当Chnl0pending fifo为非空时,保序模块从Chnl 0pending fifo中按照先入先出规则提取一个包括地址信息Order Table addr和接收标签Rcv_Tag的接收信息。当Chnl 0pending fifo为空时,保序模块再次判断Chnl 0pending fifo是否非空,直至判断出Chnl 0pending fifo是非空的,然后执行后续步骤。在提取到地址信息Order Table addr和接收标签Rcv_Tag后,保序模块从Order Table中查找与提取的Order Table addr对应的IO Tag,然后比较提取的Rcv_Tag与查找到的IO Tag对应的Exp_Tag是否相等。当相等时,保序模块获取Chnl 0brkreg中的Last IO Tag(即Chnl 0刚存储完成的数据帧的IO Tag)和brk_vld(即线程有效性信息)。进一步地,当查找到的IO Tag和获取的Last IO Tag相同且brk_vld为有效时,保序模块向DMAC 0发送无需读断点的数据帧存储指令,以使DMAC 0存储与所提取的Rcv_Tag对应的数据帧。Specifically, the order-preserving module in FIG. 3 first determines whether Chnl 0pending fifo is non-empty. When Chnl0pending fifo is non-empty, the order-preserving module extracts an address table including Order Table addr and receives from the Chnl 0pending fifo according to the first-in-first-out rule. The receiving information of the tag Rcv_Tag. When Chnl 0pending fifo is empty, the order-preserving module again determines whether Chnl 0pending fifo is non-empty until it is determined that Chnl 0pending fifo is non-empty, and then performs the subsequent steps. After extracting the address information Order Table addr and the receiving label Rcv_Tag, the order-preserving module searches the Order Table for the IO Tag corresponding to the extracted Order Table addr, and then compares whether the extracted Rcv_Tag is equal to the Exp_Tag corresponding to the found IO Tag. When equal, the order-preserving module obtains the Last IO Tag in Chnl 0brkreg (ie, the IO Tag of the data frame that
当查找到的IO Tag和获取的Last IO Tag不相同,或者brk_vld为无效时,获取其他(数据存储通道对应的)brk reg中的Last IO Tag和brk_vld。当查找到的IO Tag与其他brk reg中的Last IO Tag相同且其他brk reg中的brk_vld为有效时,向其他数据存储通道发送断点处理指令,并实时监测其他通道DMAC是否完成断点信息存储。当完成存储时,向DMAC 0发送断点读取指令。另外,当查找到的IO Tag与其他brk reg中的Last IO Tag不相同,或者其他brk reg中的brk_vld为无效时,也向DMAC 0发送断点读取指令,以使DMAC 0读取其他通道DMAC所存储的断点信息,并存储与所提取的Rcv_Tag对应的数据帧。其中,断点读取指令中包括提取的Order Table addr对应的IO Tag,以使DMACO能够根据断点读取指令查找到对应的断点信息。When the found IO Tag is different from the obtained Last IO Tag, or brk_vld is invalid, the Last IO Tag and brk_vld in the other brk reg (corresponding to the data storage channel) are obtained. When the found IO Tag is the same as the Last IO Tag in other brk reg and the other brk_vld in brk reg is valid, send a breakpoint processing instruction to other data storage channels, and monitor in real time whether the other channel DMAC completes the breakpoint information storage. . When the storage is completed, a breakpoint read instruction is sent to DMAC0. In addition, when the found IO Tag is different from the Last IO Tag in other brk reg, or the brk_vld in other brk reg is invalid, a breakpoint read command is also sent to
进一步地,在保序模块向DMAC 0发送数据帧存储指令或断点读取指令后,保序模块实时监测DMAC 0是否完成对应数据帧的存储。当完成时,保序模块更新Chnl 0brk reg中的Last IO Tag,更新后的Last IO Tag为DMAC 0完成存储的数据帧的IO Tag,并将Chnl 0brk reg中的brk_vld更新为有效。另外,保序模块更新Order Table中所查找到的IO Tag对应的Exp_Tag,更新后的Exp_Tag与所查找到IO Tag的下一数据帧相同。这里的下一数据帧为所查找到IO Tag对应数据文件中接收顺序位于完成存储的数据帧的下一个数据帧。Further, after the order-preserving module sends a data frame storage instruction or a breakpoint read instruction to the
相对于前述实施例中的存储方法,本发明实施例还提供了一种存储装置。 Compared with the storage method in the foregoing embodiment, the embodiment of the present invention further provides a storage device.
参见图6,为本发明实施例提供的一种存储装置的结构示意图。该存储装置用于执行如图2所示的存储方法。该存储装置包括至少两个数据存储通道、存储模块和保序模块;所述保序模块中设置有接收列表,以及每个数据存储通道对应的缓存列表。每个数据存储通道和所述保序模块可进行数据交互,每个数据存储通道和所述存储模块也可进行数据交互。其中,该存储装置中的保序模块还可以包括:提取单元610、查找单元620、期望标签维护单元630和控制单元640。FIG. 6 is a schematic structural diagram of a storage device according to an embodiment of the present invention. The storage device is for performing the storage method as shown in FIG. 2. The storage device includes at least two data storage channels, a storage module, and a preserving module; the preserving module is provided with a receiving list, and a cache list corresponding to each data storage channel. Each data storage channel and the order-preserving module can perform data interaction, and each data storage channel and the storage module can also perform data interaction. The preserving module in the storage device may further include: an extracting
所述提取单元610用于当数据存储通道空闲时,按照先入先出规则从所述数据存储通道对应的缓存列表中提取接收信息,所述接收信息包括接收标签和地址信息,所述接收标签用于指示所述接收标签对应的数据帧在其所属数据文件中的排列顺序,所述地址信息用于指示所述接收标签对应的第一文件标签在接收列表中的位置,所述第一文件标签用于指示所述接收标签对应的数据帧所属数据文件;The extracting
所述查找单元620用于根据所述地址信息在所述接收列表中查找所述第一文件标签;The searching
所述期望标签维护单元630用于在完成所述第一文件标签对应数据文件的一个数据帧的存储时,按照所述第一文件标签对应数据文件的数据帧排列顺序维护期望标签,以使所述期望标签用于指示所述第一文件标签对应数据文件的数据帧的存储顺序;The desired
所述控制单元640用于当所述接收标签和所述期望标签匹配时,控制所述数据存储通道向所述存储模块中存储所述接收标签对应的数据帧。The
本发明实施例中,当数据存储通道空闲时,按照先入先出规则从所述数据存储通道对应的缓存列表中提取接收信息,所述接收信息包括接收标签和地址信息,所述接收标签用于指示所述接收标签对应的数据帧在其所属数据文件中的排列顺序,所述地址信息用于指示所述接收标签对应的第一文件标签在接收列表中的位置,所述第一文件标签用于指示所述接收标签对应的数据帧所属数据文件;根据所述地址信息在所述接收列表中查找所述第一文件标签;获取所述第一文件标签对应的期望标签,所述期望标签用于指示所述第一文件标签对应数据文件的数据帧的存储顺序,在完成所述第一文件标签对应数据文件的一个数据帧的存储时,所述存储顺序按照所述第一文件标签对应数据文件的数据帧排列顺序进行更新;当所述接收标签和所述期望标签匹配时,控制所述数据存储通道存储所述接收标签对应的数据帧。由于当用于指示所述接收标签对应的数据帧在其所属数据文件中的排列顺序的接收标签和用于指示所述第一文件标签对应数据文件的数据帧的存储顺序的期望标签匹配时,控制所述数据存储通道存储所述接收标签对 应的数据帧,所以本发明的技术方案能够确保同一数据文件的多个数据帧的接收顺序与存储顺序一致,保证接收端存储数据文件与发送端发送数据文件的一致性。In the embodiment of the present invention, when the data storage channel is idle, the received information is extracted from the cache list corresponding to the data storage channel according to a first-in first-out rule, and the received information includes a receiving label and address information, where the receiving label is used for And indicating an arrangement order of the data frames corresponding to the receiving label in the data file to which the receiving label belongs, the address information is used to indicate a position of the first file label corresponding to the receiving label in the receiving list, and the first file label is used by the first file label And indicating a data file to which the data frame corresponding to the receiving label belongs; searching for the first file label in the receiving list according to the address information; acquiring a desired label corresponding to the first file label, where the desired label is used And in the storage order of the data frame indicating the data file corresponding to the first file label, when the storage of a data frame of the data file corresponding to the first file label is completed, the storage sequence is in accordance with the data corresponding to the first file label. The data frame arrangement order of the file is updated; when the receiving tag matches the expected tag, the control Said channel data storage storing the received data frame corresponding to the tag. When the received label for indicating the order of arrangement of the data frames corresponding to the received label in the data file to which the received label belongs is matched with the desired label for indicating the storage order of the data frame of the data file corresponding to the first file label, Controlling the data storage channel to store the receiving tag pair The data frame of the present invention can ensure that the receiving order of the multiple data frames of the same data file is consistent with the storage order, and the consistency between the data file stored by the receiving end and the data file sent by the transmitting end is ensured.
可选地,在本发明的一种具体实施方式中,所述保序模块中还设置有每个数据存储通道对应的线程信息,所述保序模块还可以包括:第一获取单元。Optionally, in a specific implementation manner of the present invention, the order-preserving module is further configured with thread information corresponding to each data storage channel, and the sequence-preserving module may further include: a first acquiring unit.
所述第一获取单元用于获取所述数据存储通道对应的线程信息,所述线程信息中包括第二文件标签和线程有效性信息,所述第二文件标签用于指示所述数据存储通道存储的上一数据帧所属数据文件;The first acquiring unit is configured to acquire thread information corresponding to the data storage channel, where the thread information includes a second file label and thread validity information, and the second file label is used to indicate the data storage channel is stored. The data file to which the previous data frame belongs;
所述控制单元640可以包括:第一判断子单元和第一发送子单元。The
所述第一判断子单元用于当所述接收标签和所述期望标签匹配且所述第一文件标签和所述第二文件标签相同时,根据所述数据存储通道对应的线程信息中的线程有效性信息判断所述数据存储通道的当前线程是否有效;The first determining subunit is configured to: according to the thread in the thread information corresponding to the data storage channel, when the receiving label and the expected label match and the first file label and the second file label are the same The validity information determines whether the current thread of the data storage channel is valid;
所述第一发送子单元用于当所述数据存储通道的当前线程有效时,向所述数据存储通道发送数据帧存储指令,以使所述数据存储通道向所述存储模块中存储所述接收标签对应的数据帧。The first sending subunit is configured to send a data frame storage instruction to the data storage channel when the current thread of the data storage channel is valid, so that the data storage channel stores the receiving in the storage module The data frame corresponding to the label.
可选地,在本发明的一种具体实施方式中,所述第一发送子单元还用于当所述数据存储通道的当前线程无效时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道在所述存储模块中读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。Optionally, in a specific implementation manner of the present invention, the first sending subunit is further configured to: when the current thread of the data storage channel is invalid, send a breakpoint read instruction to the data storage channel, The data storage channel reads the breakpoint information of the first file label corresponding data file in the storage module, and stores the data frame corresponding to the received label from the breakpoint position indicated by the breakpoint information.
可选地,在本发明的一种具体实施方式中,所述控制单元640还可以包括:第二判断子单元、第三判断子单元和第二发送子单元。Optionally, in a specific implementation manner of the present invention, the
所述第二判断子单元用于当所述数据存储通道的当前线程无效时,判断其他数据存储通道对应的线程信息中的文件标签和所述第一文件标签是否相同;The second determining subunit is configured to determine, when the current thread of the data storage channel is invalid, whether the file label and the first file label in the thread information corresponding to the other data storage channels are the same;
所述第三判断子单元用于当其他数据存储通道对应的线程信息中的文件标签和所述第一文件标签相同时,根据其他数据存储通道对应的线程信息中的线程有效性信息判断其他数据存储通道对应的线程是否有效;The third determining subunit is configured to determine other data according to the thread validity information in the thread information corresponding to the other data storage channels when the file label in the thread information corresponding to the other data storage channel is the same as the first file label Whether the thread corresponding to the storage channel is valid;
所述第二发送子单元用于当其他数据存储通道对应的线程有效时,向其他数据存储通道发送断点处理指令,以使其他数据存储通道生成所述第一文件标签对应数据文件的断点信息并进行存储;The second sending subunit is configured to send a breakpoint processing instruction to another data storage channel when the thread corresponding to the other data storage channel is valid, so that the other data storage channel generates a breakpoint of the data file corresponding to the first file label. Information and storage;
所述第一发送子单元还用于当其他数据存储通道完成相应的断点信息存储时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道在所述存储 模块中读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。The first sending subunit is further configured to send a breakpoint read instruction to the data storage channel when the other data storage channel completes the corresponding breakpoint information storage, so that the data storage channel is in the storage The module reads the breakpoint information of the data file corresponding to the first file label, and stores the data frame corresponding to the received label from the breakpoint position indicated by the breakpoint information.
可选地,在本发明的一种具体实施方式中,所述第一发送子单元还用于当所述接收标签和所述期望标签匹配且所述第一文件标签和所述第二文件标签不相同时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道在所述存储模块中读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。Optionally, in a specific implementation manner of the present invention, the first sending subunit is further configured to: when the receiving label and the expected label match, the first file label and the second file label When not the same, sending a breakpoint read instruction to the data storage channel, so that the data storage channel reads the breakpoint information of the data file corresponding to the first file label in the storage module, and The breakpoint position indicated by the point information stores the data frame corresponding to the received label.
可选地,在本发明的一种具体实施方式中,所述控制单元640还可以包括:第四判断子单元和第五判断子单元。Optionally, in a specific implementation manner of the present invention, the
所述第四判断子单元用于当所述接收标签和所述期望标签匹配且所述第一文件标签和所述第二文件标签不相同时,判断其他数据存储通道对应的线程信息中的文件标签和所述第一文件标签是否相同;The fourth determining subunit is configured to determine, in the thread information corresponding to the other data storage channel, when the receiving label and the expected label match and the first file label and the second file label are not the same Whether the label and the first file label are the same;
所述第五判断子单元用于当其他数据存储通道对应的线程信息中的文件标签和所述第一文件标签相同时,根据其他数据存储通道对应的线程信息中的线程有效性信息判断其他数据存储通道对应的线程是否有效;The fifth determining subunit is configured to determine other data according to the thread validity information in the thread information corresponding to the other data storage channels when the file label in the thread information corresponding to the other data storage channel is the same as the first file label Whether the thread corresponding to the storage channel is valid;
所述第二发送子单元还用于当其他数据存储通道对应的线程有效时,向其他数据存储通道发送断点处理指令,以使其他数据存储通道生成所述第一文件标签对应数据文件的断点信息并进行存储;The second sending subunit is further configured to: when the thread corresponding to the other data storage channel is valid, send a breakpoint processing instruction to the other data storage channel, so that the other data storage channel generates the data file corresponding to the first file label. Point information and store it;
所述第一发送子单元还用于当其他数据存储通道完成相应的断点信息存储时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道在所述存储模块中读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。The first sending subunit is further configured to send a breakpoint read instruction to the data storage channel when the other data storage channel completes the corresponding breakpoint information storage, so that the data storage channel is in the storage module. And reading the breakpoint information of the data file corresponding to the first file label, and storing the data frame corresponding to the received label from the breakpoint location indicated by the breakpoint information.
可选地,在本发明的一种具体实施方式中,所述第一发送子单元还用于当其他数据存储通道对应的线程信息中的文件标签和所述第一文件标签不相同时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道在所述存储模块中读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。Optionally, in a specific implementation manner of the present disclosure, the first sending subunit is further configured to: when a file label in the thread information corresponding to another data storage channel is different from the first file label, The data storage channel sends a breakpoint read command, so that the data storage channel reads the breakpoint information of the data file corresponding to the first file label in the storage module, and indicates the breakpoint from the breakpoint information The point location stores a data frame corresponding to the received tag.
可选地,在本发明的一种具体实施方式中,所述第一发送子单元还用于当其他数据存储通道对应的线程无效时,向所述数据存储通道发送断点读取指令,以使所述数据存储通道读取所述第一文件标签对应数据文件的断点信息,并从该断点信息指示的断点位置存储所述接收标签对应的数据帧。Optionally, in a specific implementation manner of the present invention, the first sending subunit is further configured to: when a thread corresponding to another data storage channel is invalid, send a breakpoint reading instruction to the data storage channel, to And causing the data storage channel to read the breakpoint information of the first file label corresponding data file, and storing the data frame corresponding to the receiving label from the breakpoint location indicated by the breakpoint information.
可选地,在本发明的一种具体实施方式中,所述保序模块还可以包括:第一 判断单元和设置单元。Optionally, in a specific implementation manner of the present invention, the order-preserving module may further include: Judging unit and setting unit.
所述第一判断单元用于判断是否接收到所述数据存储通道发送的数据帧存储完成指示;The first determining unit is configured to determine whether a data frame storage completion indication sent by the data storage channel is received;
所述设置单元用于当接收到所述数据存储通道发送的数据帧存储完成指示时,将所述数据存储通道对应的线程信息中的文件标签设置为所述第一文件标签,将对应的线程有效性信息设置为有效。The setting unit is configured to: when receiving the data frame storage completion indication sent by the data storage channel, set a file label in the thread information corresponding to the data storage channel as the first file label, and the corresponding thread The validity information is set to be valid.
可选地,在本发明的一种具体实施方式中,所述保序模块还可以包括:第二获取单元、第三获取单元、确定单元和更新单元。Optionally, in a specific implementation manner of the present invention, the order-preserving module may further include: a second acquiring unit, a third acquiring unit, a determining unit, and an updating unit.
所述第二获取单元用于获取任一数据存储通道在接收到数据帧后发送的帧接收信息,所述帧接收信息包括:第三文件标签,所述第三文件标签用于指示所接收的数据帧所属数据文件;The second acquiring unit is configured to acquire frame receiving information that is sent by any data storage channel after receiving the data frame, where the frame receiving information includes: a third file label, where the third file label is used to indicate the received The data file to which the data frame belongs;
所述第三获取单元用于获取所述接收列表中与所述第三文件标签对应的顺序维护标签;The third obtaining unit is configured to acquire a sequential maintenance label corresponding to the third file label in the receiving list;
所述确定单元用于将所述顺序维护标签确定为所述帧接收信息对应的数据帧的接收标签;The determining unit is configured to determine the sequence maintenance label as a receiving label of a data frame corresponding to the frame receiving information;
所述更新单元用于更新所述第三文件标签对应的顺序维护标签,更新后的顺序维护标签作为下一对应数据帧的接收标签。The updating unit is configured to update a sequential maintenance label corresponding to the third file label, and the updated sequential maintenance label is used as a receiving label of the next corresponding data frame.
可选地,在本发明的一种具体实施方式中,所述保序模块还可以包括:第二判断单元。Optionally, in a specific implementation manner of the present invention, the order-preserving module may further include: a second determining unit.
所述第二判断单元用于判断所述接收列表中是否存在所述第三文件标签;The second determining unit is configured to determine whether the third file label exists in the receiving list;
所述第三获取单元还用于当所述接收列表中存在所述第三文件标签时,执行获取所述接收列表中与所述第三文件标签对应的顺序维护标签的步骤;当所述接收列表中不存在所述第三文件标签时,在所述接收列表中添加所述第三文件标签,并为所述帧接收信息对应的数据帧分配初始接收标签和初始期望标签。The third obtaining unit is further configured to: when the third file label exists in the receiving list, perform a step of acquiring a sequential maintenance label corresponding to the third file label in the receiving list; when the receiving When the third file label does not exist in the list, the third file label is added to the receiving list, and an initial receiving label and an initial expected label are allocated for the data frame corresponding to the frame receiving information.
可选地,在本发明的一种具体实施方式中,所述保序模块还可以包括:第三判断单元。Optionally, in a specific implementation manner of the present invention, the order-preserving module may further include: a third determining unit.
所述第三判断单元用于当所述数据存储通道空闲时,判断所述数据存储通道对应的缓存列表是否非空;The third determining unit is configured to determine, when the data storage channel is idle, whether the cache list corresponding to the data storage channel is not empty;
所述提取单元还用于当所述数据存储通道对应的缓存列表非空时,按照先入先出规则从所述数据存储通道对应的缓存列表中提取一组接收信息。 The extracting unit is further configured to: when the cache list corresponding to the data storage channel is not empty, extract a group of received information from the cache list corresponding to the data storage channel according to a first-in first-out rule.
可选地,在本发明的一种具体实施方式中,所述保序模块还可以包括:发送单元。Optionally, in a specific implementation manner of the disclosure, the order-preserving module may further include: a sending unit.
所述发送单元用于当所述接收标签和所述期望标签不匹配时,向所述数据存储通道发送断点处理指令,以使所述数据存储通道生成其存储的前一数据帧对应的数据文件的断点信息并进行存储。The sending unit is configured to send a breakpoint processing instruction to the data storage channel when the receiving label and the expected label do not match, so that the data storage channel generates data corresponding to the stored previous data frame. The breakpoint information of the file is stored.
本领域的技术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明实施例中的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。It will be apparent to those skilled in the art that the techniques in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution in the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM. , a disk, an optical disk, etc., including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention or portions of the embodiments.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统及装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in the specification are described in a progressive manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system and the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
以上所述的本发明实施方式,并不构成对本发明保护范围的限定。任何在本发明的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明的保护范围之内。 The embodiments of the invention described above are not intended to limit the scope of the invention. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the invention are intended to be included within the scope of the invention.
Claims (26)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610608388.2A CN107665092B (en) | 2016-07-28 | 2016-07-28 | A storage method and device |
| CN201610608388.2 | 2016-07-28 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018018885A1 true WO2018018885A1 (en) | 2018-02-01 |
Family
ID=61015520
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/074392 Ceased WO2018018885A1 (en) | 2016-07-28 | 2017-02-22 | Storage method and device |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN107665092B (en) |
| WO (1) | WO2018018885A1 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108174136B (en) * | 2018-03-14 | 2021-03-02 | 成都创信特电子技术有限公司 | Cloud disk video coding storage method |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140032788A1 (en) * | 2012-07-30 | 2014-01-30 | HGST Netherlands B.V. | Method and structure enabling improved native command queueing in a data storage device |
| CN103793181A (en) * | 2012-11-05 | 2014-05-14 | 腾讯科技(深圳)有限公司 | Data synchronizing method and data synchronizing system of multilevel association storage architecture |
| CN104991737A (en) * | 2015-06-18 | 2015-10-21 | 杭州电子科技大学 | Storage card array architecture based hard disk implementation method |
| CN105204776A (en) * | 2015-08-18 | 2015-12-30 | 北京京东尚科信息技术有限公司 | Data processing method and device |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101453751A (en) * | 2007-12-05 | 2009-06-10 | 高德软件有限公司 | Method for large file transmission under narrow-band network environment |
| US9460178B2 (en) * | 2013-01-25 | 2016-10-04 | Dell Products L.P. | Synchronized storage system operation |
| CN104462563B (en) * | 2014-12-26 | 2019-04-30 | 浙江宇视科技有限公司 | A file storage method and system |
-
2016
- 2016-07-28 CN CN201610608388.2A patent/CN107665092B/en active Active
-
2017
- 2017-02-22 WO PCT/CN2017/074392 patent/WO2018018885A1/en not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140032788A1 (en) * | 2012-07-30 | 2014-01-30 | HGST Netherlands B.V. | Method and structure enabling improved native command queueing in a data storage device |
| CN103793181A (en) * | 2012-11-05 | 2014-05-14 | 腾讯科技(深圳)有限公司 | Data synchronizing method and data synchronizing system of multilevel association storage architecture |
| CN104991737A (en) * | 2015-06-18 | 2015-10-21 | 杭州电子科技大学 | Storage card array architecture based hard disk implementation method |
| CN105204776A (en) * | 2015-08-18 | 2015-12-30 | 北京京东尚科信息技术有限公司 | Data processing method and device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107665092A (en) | 2018-02-06 |
| CN107665092B (en) | 2019-11-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10592464B2 (en) | Methods for enabling direct memory access (DMA) capable devices for remote DMA (RDMA) usage and devices thereof | |
| WO2017041398A1 (en) | Data transmission method and device | |
| CN107786638B (en) | A data processing method, device and system | |
| KR102256890B1 (en) | Access method and device | |
| US10621124B2 (en) | Method, device and computer program product for enabling SR-IOV functions in endpoint device | |
| US9699276B2 (en) | Data distribution method and system and data receiving apparatus | |
| US10038752B2 (en) | Method and system for execution of client-initiated operations on file handles in a distributed server system | |
| US11163566B2 (en) | Handling an input/output store instruction | |
| TWI247215B (en) | Communication system for raising channel utilization rate and communication method thereof | |
| CN104811392A (en) | Method and system for processing resource access request in network | |
| US10884886B2 (en) | Copy-on-read process in disaster recovery | |
| US11579874B2 (en) | Handling an input/output store instruction | |
| CN110719215A (en) | Flow information acquisition method and device of virtual network | |
| US10178018B2 (en) | Transmission and reception devices | |
| CN103067129B (en) | network data transmission method and system | |
| CN114648820B (en) | Information synchronization method, device, electronic device and medium | |
| US8806159B2 (en) | Data storage resource management systems and methods | |
| WO2022156376A1 (en) | Method, system and device for prefetching target address, and medium | |
| US20130013755A1 (en) | Diskless pc network communication agent system | |
| WO2018018885A1 (en) | Storage method and device | |
| US20140310458A1 (en) | Data transferring method and apparatus and storage system | |
| US10042809B2 (en) | Method for communication using PCI express dedicated communication module and network device including the same | |
| CN117675720B (en) | Message transmission method and device, electronic equipment and storage medium | |
| CN112711572A (en) | Online capacity expansion method and device suitable for sub-warehouse and sub-meter | |
| CN105955916B (en) | A method, device and system for writing immediate data |
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: 17833199 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: 17833199 Country of ref document: EP Kind code of ref document: A1 |