WO2020006715A1 - Data storage method and apparatus, and related device - Google Patents

Data storage method and apparatus, and related device Download PDF

Info

Publication number
WO2020006715A1
WO2020006715A1 PCT/CN2018/094545 CN2018094545W WO2020006715A1 WO 2020006715 A1 WO2020006715 A1 WO 2020006715A1 CN 2018094545 W CN2018094545 W CN 2018094545W WO 2020006715 A1 WO2020006715 A1 WO 2020006715A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
write command
sub
target
storage device
Prior art date
Application number
PCT/CN2018/094545
Other languages
French (fr)
Chinese (zh)
Inventor
龚伟
王华强
李吉坤
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2018/094545 priority Critical patent/WO2020006715A1/en
Priority to CN201880044615.0A priority patent/CN110881277A/en
Publication of WO2020006715A1 publication Critical patent/WO2020006715A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files

Definitions

  • the present application relates to the field of computer technology, and in particular, to a data storage method, device, and related equipment.
  • OSD object-based storage device
  • the data sending device In the process of data storage, the data sending device usually sends the entire target data to be stored to the data storage device, so that it takes a long time for the target data to be transmitted to the data storage device through the network, especially when the network status is poor. , Resulting in lower data storage efficiency. Therefore, how to improve the efficiency of data storage is an urgent problem.
  • the present application provides a data storage method, device, and related equipment to improve data storage efficiency.
  • the present application provides a data storage method.
  • the method includes: a data storage device obtaining first indication information from a first storage area, wherein the first indication information is Generated after a piece of sub data, the first indication information includes an identifier of the target data and position information of the second sub data in the target data, and the first sub data and the second sub data for the target data include Two of the plurality of sub-data, and the second sub-data is a next sub-data adjacent to the first sub-data; and the data storage device obtains the first instruction information from the current
  • a target write command is obtained from the received at least one write command and the at least one write command stored in the second storage area, wherein the target write command carries an identifier of the target data, a third sub-data, and the first Location information of three sub-data in the target data, and the location information carried in the target write command matches the location information in the first instruction information
  • the data storage device stores a write command to be processed in the second storage area, where the write command to be processed is at least
  • the write command of the identifier of the target data the data storage device stores the third sub data carried in the obtained target write command into a storage area corresponding to the identifier of the target data, and updates the first instruction information
  • the position information in the first storage area, and the updated first indication information is stored in the first storage area;
  • the position information in the updated first indication information is the position of the fourth sub-data in the target data Information, among the plurality of sub data included in the target data, the fourth sub data is a next sub data adjacent to the third sub data.
  • the data storage device can receive one or more write commands sent by the data sending device each time, and determine the write command in the write command according to the position information of the sub data carried in the received write command in the target data. A position of the carried subdata in the target data, so that the write command sent by the data storage device in the data sending device does not follow the subdata carried in the write command sent by the data sending device in the target data. In the case where the order of the data arrives at the data storage device, it can also determine that the sub-data carried in the write command sent by the data sending device is in the target according to the location information carried in the write command sent by the data sending device.
  • Positioning the data correctly and completely storing the target data can reduce the time for the target data as a whole to be transmitted on the network, and improve the storage efficiency and accuracy of the target data.
  • the data storage device processes write commands at a rate much faster than the speed at which the write commands are transmitted over the network, the data storage device carries the pending write command, that is, at least one write command currently received, with the The write command that identifies the target data and carries positional information of the sub-data in the target data that does not match the positional information in the first indication information is stored in the second storage area, so that the write command
  • the data storage device processes the write command in time when the location information contained in the first instruction information matches the location information carried in the write command stored in the second storage area, and does not require the data sending device to resend
  • the write command can further improve the storage efficiency of the target data.
  • the data storage device may receive the at least one write command through a host connected to the data storage device, where the write command is sent to the host by a data sending device to store data, or the data storage device The device directly receives the at least one write command sent by the data sending device.
  • the data storage device may be a solid-state storage hard disk SSD.
  • the write command received by the data storage device and the position information of the sub-data carried in the write command stored in the second storage area in the target data may be through, but not limited to, the following two Any one of these ways:
  • the position information of the sub data carried in the write command in the target data may be relative to the target using the first byte of the sub data.
  • the offset of the first byte of data is represented, or it is expressed by the offset of the last byte of the sub-data relative to the first byte of the target data.
  • the position information of the sub data carried in the write command in the target data may be relative to the target by using the first byte of the sub data.
  • the offset of the first byte of data and the number of bytes occupied by the subdata that is, the length of the subdata
  • the offset of the section and the number of bytes occupied by the subdata is the offset of the section and the number of bytes occupied by the subdata.
  • the position information of the sub-data carried in the write command in the target data may be represented by the sort identifier of the sub-data in the target data , Wherein the sort identifier of the sub-data in the target data may be represented by numbers or characters.
  • the position information of the sub-data carried in the write command in the target data may be identified by the sorting of the sub-data in the target data and
  • the number of bytes occupied by the sub-data indicates that the sort identifier of the sub-data in the target data may be represented by numbers or characters.
  • a storage order of the write command in the second storage area is determined according to position information carried in the write command.
  • the position information carried in the write command is used to identify the position of the sub-data carried in the write command in the target data, so that the data storage device is in at least one write command stored from the second storage area,
  • the location information matches the location information contained in the first indication information, and it is not necessary to traverse all write commands stored in the second storage area, thereby reducing the data storage device's need to obtain the target write command Time to improve the efficiency of the data storage device storing the target data.
  • the data storage device may also send the data to the host through a host connected to the target data.
  • the data sending device of the write command sends the second instruction information, or the second instruction information is directly sent to the data sending device of the write command, and the second instruction information is used to indicate that the target write command carries the The child data has been stored.
  • the data sending device may determine, according to the second instruction information, the sub data corresponding to the second instruction information and the target data in the sub data. All previous sub-data are stored, and a subsequent write command is sent to the data storage device, or a subsequent write command is sent to the data storage device through the host, and a part or all of the remaining sub-data of the target data is sent. Sending to the data storage device can reduce the time required for the target data to be transmitted to the data storage device through the network, thereby improving the storage efficiency of the target data without being affected by the second instruction information reaching the The impact of the sequence of data transmission equipment.
  • the data storage device stores the pending write command in the currently received at least one write command into the second storage area, which may specifically include the following steps: the data storage device will obtain The identifier of the target data and the position information of the sub-data in the target data carried in the received pending write command are correspondingly stored in the second storage area.
  • the data storage device stores the identifier of the target data carried in the obtained write command to be processed and the position information of the target data's sub-data in the target data, it is correspondingly stored in the second storage area. , The sub-data of the target data carried in the obtained write command to be stored is not stored, and the command and data can be separated, reducing the storage space required to store the write command to be processed, and preventing the data from being stored The device cannot process the received write command because it has no free resources.
  • the present application provides another data storage method, which includes: the data sending device determines the number of write commands N that can be sent in parallel according to the current network state, and generates the N write commands, where N It is a positive integer, and each write command carries an identifier of the target data to be stored, subdata, and position information of the subdata in the target data, and the subdata is a plurality of subdata obtained by dividing the target data. And the sub data carried in each write command are different; the data sending device sends the generated N write commands in parallel to a host connected to the data storage device or directly to the data storage device.
  • the data sending device can send multiple write commands in parallel to the host or data storage device connected to the data storage device according to the current network status, where each write command carries an identifier of the target data to be stored, The sub data and the position information of the sub data in the target data, where the sub data is one of a plurality of sub data obtained by dividing the target data, so that the data storage device can carry the received data according to the received write command.
  • the position information of the subdata in the target data to determine the position of the subdata carried in the write command in the target data, even if the network status is poor, the writes sent by the data sending device are received out of order
  • the target data can also be stored correctly and completely, which can reduce the transmission time of the target data in the network, and improve the storage efficiency and storage accuracy of the target data.
  • the data sending device receives instruction information sent by the data storage device, where the instruction information is used to indicate that the sub data carried in the write command sent by the data sending device has been stored; The data sending device sends a subsequent write command to the data storage device according to the instruction information, or sends a subsequent write command to the data storage device through the host.
  • the data sending device may determine, according to the instruction information, subdata corresponding to the instruction information and the target data before the subdata. All the sub-data are stored, send a subsequent write command to the data storage device, or send a subsequent write command to the data storage device through the host, and send some or all of the remaining sub-data of the target data
  • the time required for the target data to be transmitted to the data storage device through the network can be reduced, thereby further improving the storage efficiency of the target data without being affected by the second instruction information reaching the data. The effect of the order of sending devices.
  • the present application provides a data storage device, which has a function of realizing the behavior of the data storage device in the method example of the first aspect.
  • the functions may be implemented by hardware, and may also be implemented by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the structure of the data storage device includes a communication unit, a processing unit, a data storage unit, and a command storage unit, and these units can execute the corresponding functions in the method example of the first aspect above.
  • a communication unit a processing unit, a data storage unit, and a command storage unit, and these units can execute the corresponding functions in the method example of the first aspect above.
  • a processing unit a data storage unit
  • a command storage unit a command storage unit
  • a structure of the data storage device includes a communication interface, a controller, and a memory, and the controller is configured to support the data storage device to perform a corresponding function in the method provided by the first aspect.
  • the memory is coupled to the controller and stores program instructions and data necessary for the data storage device.
  • the present application provides a data sending device, and the data sending device has a function of implementing the behavior of the data sending device in the method example of the second aspect.
  • the functions may be implemented by hardware, and may also be implemented by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the structure of the data sending device includes a processing unit and a communication unit, and these units can perform corresponding functions in the method example of the second aspect described above.
  • these units can perform corresponding functions in the method example of the second aspect described above.
  • the structure of the data sending device includes a processing unit and a communication unit, and these units can perform corresponding functions in the method example of the second aspect described above.
  • processing unit and a communication unit can perform corresponding functions in the method example of the second aspect described above.
  • a structure of the data sending device includes a transceiver, a processor, and a memory, and the processor is configured to support the data storage device to perform a corresponding function in the method provided in the second aspect above.
  • the memory is coupled to the controller and stores program instructions and data necessary for the data transmitting device.
  • the present application provides a communication system including the data storage device described in the third aspect and the data transmission device described in the fourth aspect.
  • the present application further provides a chip, where the chip is connected to a memory or the chip includes the memory, and is used to read and execute a software program stored in the memory to implement any of the foregoing aspects.
  • the present application further provides a computer-readable storage medium, where the computer storage medium stores computer-executable instructions, and when the instructions are run on a computer, the computer is caused to execute any of the foregoing aspects.
  • the present application also provides a computer program product containing instructions that, when the instructions are run on a computer, cause the computer to perform any of the methods in any of the above aspects.
  • FIG. 1 is a schematic diagram of a communication system architecture according to an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a data storage method according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a write command processing method according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a data storage method according to a specific embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a data storage device according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a data sending apparatus according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a data storage device according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a data storage device according to a specific embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a data sending device according to an embodiment of the present application.
  • the present application provides a data storage method, device, and related equipment to improve data storage efficiency.
  • the method and the device are based on the same inventive concept. Since the principle of the method and the device for solving the problem is similar, the implementation of the device and the method can be referred to each other, and duplicated details will not be repeated.
  • FIG. 1 shows a possible communication system architecture to which the data storage method provided by the embodiment of the present application is applicable.
  • the communication system includes: at least one of the data storage device 101 and at least one of the data sending device 102.
  • the data storage device 101 may be connected to the host 103.
  • the data storage device 101 is configured to receive a write command sent by the data sending device through a network, and store subdata in the target data to be stored carried in the write command to the data storage device 101 Medium; the data storage device 101 can simultaneously receive write commands sent by different data sending devices 102, and when the data storage device 101 can be connected to a host 103, the data storage device 101 receives the data through the host The write command sent by the data transmitting device 102 through the network.
  • the data sending device 102 may divide the target data to be stored into multiple sub-data, carry the divided sub-data in a corresponding write command, and send the write command to the data storage device through a network. 101.
  • the communication system further includes at least one data forwarding device 104, where the data forwarding device 104 is configured to forward a write command sent by the data sending device 102 to the corresponding data storage device 101 or Corresponds to the host 103 connected to the data storage device 101.
  • the data forwarding device 104 may be a router or a switch.
  • the data storage device 101 may be inserted into a corresponding card slot in the host 103 to achieve connection with the host 103.
  • the data storage device 101 may be a solid-state storage hard disk SSD.
  • an embodiment of the present application provides a data storage method, which is applied to a scenario in which target data to be stored is divided into multiple sub-data, and the obtained multiple sub-data are transmitted through a network and stored to a corresponding storage device, respectively.
  • Suitable for communication systems as shown in Figure 1. The method includes:
  • the data sending device determines the number of write commands N that can be sent in parallel according to the current network state, and generates the N write commands.
  • N is a positive integer
  • each write command carries an identifier of the target data to be stored, sub data, and position information of the sub data in the target data.
  • the sub data is obtained by dividing the target data.
  • One of the sub data, and the sub data carried in each write command is different; the data sending device sends the generated N write commands in parallel to a host or data storage device connected to the data storage device.
  • the embodiment of the present application does not limit the specific name of the write command sent by the data sending device.
  • the above write command may be an append command.
  • the data sending device sends the generated N write commands in parallel to a host or a data storage device connected to the data storage device.
  • the data storage device may receive at least one write command through a host connected to the data storage device, or directly receive at least one write command.
  • the at least one write command currently received by the data storage device is one or more of the N write commands sent by the data sending device.
  • the data storage device obtains first instruction information from a first storage area.
  • the first instruction information is generated after the data storage device stores the first sub data, and the first instruction information includes an identifier of the target data and position information of the second sub data in the target data,
  • the first sub data and the second sub data are two sub data of a plurality of sub data included in the target data, and the second sub data is a next sub data adjacent to the first sub data.
  • the data storage device obtains the target write command from at least one write command currently received and at least one write command stored in the second storage area according to the obtained first instruction information.
  • the target write command carries an identifier of the target data, a third subdata, and position information of the third subdata in the target data, and the position information carried in the target write command is related to all
  • the position information in the first indication information matches, and the third sub-data is one of a plurality of sub-data included in the target data.
  • the first storage area and the second storage area may be a storage space in the data storage device, or may be a storage space in another device with a storage function connected to the data storage device.
  • the data storage device stores the third sub data carried in the target write command into a storage area corresponding to an identifier of the target data, and updates the position information in the first instruction information, and updates the position information.
  • the subsequent first instruction information is stored in the first storage area.
  • the updated position information in the first instruction information is position information of a fourth sub-data in the target data, and among the plurality of sub-data included in the target data, the fourth sub-data is all The next sub-data adjacent to the third sub-data is described.
  • the data storage device stores a pending write command in at least one currently received write command into the second storage area.
  • the write command to be processed is a write command in addition to the target write command among the currently received at least one write command and carrying the identifier of the target data, that is, the at least one write command currently received is carried in A write command in which the identifier of the target data and the position information of the sub-data of the target data in the target data and the position information in the first indication information do not match.
  • the data sending device and the data storage device may execute the above steps S201-S206 through cycles to store all the sub-data of the target data in the data storage device. It should be noted that the data storage device may simultaneously store the sub-data of the data to be stored sent by different data sending devices. For a write command sent by any data sending device that carries the sub-data of the data to be stored, the data The storage devices can all adopt the above steps S201-S206 for processing.
  • the write command received by the data storage device and the position information of the sub-data carried in the write command stored in the second storage area in the target data may be through, but not limited to, the following two Any one of these ways:
  • the position information of the sub data carried in the write command in the target data may be relative to the target data by using the first byte of the sub data.
  • the offset of the first byte of, or the offset of the last byte of the sub-data relative to the first byte of the target data For example, the size of the target data is 100 megabytes, and each sub-data size of the target data is 10 MB.
  • the first sub-data of the target data carried in the write command is in the
  • the position information in the target data may be represented by an offset of 10MB of the last byte of the first sub-data relative to the first byte of the target data.
  • the position information of the second sub-data in the target data may be represented by an offset 20MB of the last byte of the second sub-data relative to the first byte of the target data ..., in the write command
  • the position information of the tenth sub-data of the target data carried in the target data may be represented by an offset of 100 MB of the last byte of the tenth sub-data relative to the first byte of the target data .
  • the position information of the sub data carried in the write command in the target data may be relative to the target data by using the first byte of the sub data.
  • the offset of the first byte of the and the number of bytes occupied by the subdata that is, the length of the subdata
  • the offset and the number of bytes occupied by the subdata The offset and the number of bytes occupied by the subdata.
  • the size of the target data is 100 megabytes
  • the first sub-data size of the target data is 10 MB
  • the first sub-data of the target data carried in the write command is For the position information in the target data, an offset 0 of the first byte of the first sub-data relative to the first byte of the target data and the bytes occupied by the first sub-data can be used.
  • the number 10MB indicates that the size of the second subdata of the target data is 30MB, and the position information of the second subdata of the target data carried in the write command in the target data can use the second subdata
  • the offset of the first byte from the first byte of the target data by 10MB and the number of bytes occupied by the second sub-data is 30MB, and so on.
  • the position information of the sub-data carried in the write command in the target data may be represented by the sort identifier of the sub-data in the target data
  • the sorting identifier of the sub-data in the target data may be represented by numbers or characters.
  • the size of the target data is 100MB
  • the size of each sub-data of the target data is 10MB.
  • the ordering identifier of each sub-data of the target data in the target data is represented by numbers 1-10, that is, all
  • the position information of the first sub-data of the target data carried in the write command in the target data may be represented by 1, and the second sub-data of the target data carried in the write command is at the target.
  • the position information in the data may be represented by 2 ..., and the position information of the tenth sub-data of the target data carried in the write command in the target data may be represented by 10.
  • the position information of the sub-data carried in the write command in the target data may be identified by the sorting of the sub-data in the target data and the The sub-data indicates the number of bytes occupied (that is, the length of the sub-data), and the sort identifier of the sub-data in the target data may be represented by numbers or characters.
  • the size of the target data is 100 megabytes
  • the first sub-data size of the target data is 10 MB
  • the first sub-data of the target data carried in the write command is
  • the position information in the target data may be represented by the sort identifier 1 of the first sub data in the target data and the number of bytes occupied by the first sub data is 10 MB.
  • each sub-data is 30MB
  • the position information of the second sub-data of the target data carried in the write command in the target data can be identified by the ordering of the second sub-data in the target data 2 and
  • the number of bytes occupied by the second sub-data is 30MB, and so on.
  • position information of the second sub-data included in the first indication information in the target data is in the target data.
  • the position information in the target data may be the same as that of the currently received at least one write command and at least one write command stored in the second storage area in the target data. different.
  • the location information in the first instruction information is different from the representation method of the location information carried in the write command
  • the data storage device and the data sending device agree on the location information in the first instruction information and
  • the correspondence between the position information in the write command enables the data storage device to receive at least one write command currently received or at least one write command stored in the second storage area according to the first instruction information.
  • the target write command is obtained, and the sub-data of the target data carried in the obtained target write command is stored.
  • the data storage device when the data storage device obtains, from the host, the first carrying the target data identifier, a subdata of the target data, and location information of the subdata in the target data.
  • the data storage device When the command is written, the data storage device generates the first instruction information, and the position information of the next sub-data of the target data to be stored included in the first instruction information may be set in the target data. Fixed initial value.
  • a storage order of the write command in the second storage area is determined according to position information carried in the write command.
  • the position information carried in the write command is used to identify the position of the sub-data carried in the write command in the target data, so that the data storage device is in at least one write command stored from the second storage area,
  • the location information matches the location information contained in the first indication information, and it is not necessary to traverse all write commands stored in the second storage area, thereby reducing the data storage device's need to obtain the target write command Time, further improving the efficiency of the data storage device storing the target data.
  • step 207 may be further performed: a host connected through itself Send the second instruction information to the data sending device that sends the target write command, or send the second instruction information directly to the data sending device that sends the target write command, where the second instruction information is used to indicate the The sub-data of the target data carried in the target write command is successfully stored.
  • the data sending device may send a subsequent write command to the data storage device according to the second instruction information, or send the subsequent write command to the data storage device through the host. Subsequent write commands.
  • the data sending device can determine that the sub data corresponding to the second instruction information and the sub data before the sub data in the target data are stored according to the second instruction information, the data The sending device can continue to send multiple write commands to the data storage device in parallel within the range allowed by the network bandwidth, and send some or all of the remaining sub-data of the target data to the data storage device, which can reduce The time required for the target data to be transmitted to the data storage device over the network can further improve the storage efficiency of the target data, and is not affected by the order in which the second instruction information reaches the data sending device.
  • the second indication information sent after the data storage device stores the subdata carried in the target write command each time may not be able to send the second indication according to the data storage device
  • the order of the information reaches the data sending device, but the data storage device stores only when the position information in the first instruction information matches the position information of the sub-data carried in the write command in the target data.
  • the sub data carried in the write command so when the data transmitting device receives the second indication information that a certain sub data of the target data is successfully stored, the data transmitting device can determine that the position in the target data is in a certain position. All the sub-data before each sub-data are stored, and continue to send at least one of the write commands to the data storage device.
  • the data sending device may send the three write commands to the data storage device in parallel, or may send the write command to the data storage device in parallel. Two of the write commands are sent in parallel, or one of the write commands may be sent to the data storage device.
  • the data storage device reserves a larger second storage area to store command information and data information that cannot be processed currently, but the data sending device may send the data storage device to the data storage device at the same time. Issue a large number of write commands, and the data storage device may receive multiple write commands corresponding to different target data issued by the data sending device at the same time, and these write commands are transmitted through the network to the data storage device in the order It is unpredictable that the data storage device may need a large number of write commands stored in the second storage area, which causes the second area to be completely occupied, thereby making the data storage device unable to process newly received data. The write command cannot release the resources of the second storage area, causing resource deadlock.
  • the data storage device includes a pending write command in at least one currently received write command (the pending write command carries an identifier of the target data, and the target data carried in the target data includes (The position information of the sub data in the target data does not match the position information in the first indication information), and when stored in the second storage area, the sub data carried in the write command to be stored is not stored Only the identifier of the target data and the position information of the sub-data in the target data are stored to reduce the resources occupied by storing write commands that cannot be processed immediately among the currently received at least one write command.
  • step S206 when the data storage device stores the pending write command in the second storage area, the identifier of the target data carried in the obtained pending write command may be specifically determined. And the position information of the sub-data in the target data is correspondingly stored in the second storage area.
  • the data storage device stores the identifier of the target data carried in the obtained write command to be processed and the position information of the target data's sub-data in the target data, it is correspondingly stored in the second storage area.
  • the sub-data of the target data carried in the obtained write command to be processed is not stored, and the command and data can be separated, reducing the storage of the write command to be processed, and the storage resources of the data storage device (for example, The double-rate synchronous dynamic random access memory (DDR, dynamic random access, memory, DDR, SDRAM (or DDR)) resources of the data storage device are occupied, so that the data storage device can maintain good performance and process the received data.
  • the write command prevents the data storage device from being unable to process the received write command due to lack of idle resources.
  • a host connected to the data storage device when it receives at least one write command sent by the data sending device, it may include the at least one write command sent by the data sending device.
  • the sub data of the target data is cached in the memory of the host, and the data storage device is notified of the storage location information of the sub data of the target data carried in at least one write command sent by the data sending device;
  • the host carries at least one write command sent by the data sending device. Replace the sub data in the target data with the storage location information of the sub data of the target data, and send the replaced write command to the data storage device.
  • the data storage device determines that the currently received at least one write command contains an identifier carrying the target data, and the position information of the sub-data of the target data carried in the target data and the first
  • the data storage device determines that at least one write command currently received by the host has the target data that the data storage device cannot process immediately.
  • the data storage device may further store the storage location information of the sub-data carried in the pending write command into the second storage area, so that subsequent storage in the second storage area is performed.
  • the location information carried in the write command matches the location information contained in the first instruction information, the data storage device obtains the corresponding sub data for storage according to the storage location information of the sub data carried in the write command. .
  • the first indication information stored in the SSD includes the identification ID0 of the target data and the position of the sub-data of the next target data to be stored in the target data.
  • Information, the position information contained in the first indication information is represented by an offset of the first byte of the next sub target data to be stored by the data storage device relative to the first byte of the target data
  • the position information contained in the first indication information is an offset curofffset0
  • the position information carried in a write command corresponding to the target data received by the SSD uses the target data carried in the write command
  • the offset of the first byte of the sub-data relative to the first byte of the target data indicates that the storage medium in the SSD is DDR, and the host connected to the SSD will
  • the sub-data carried in the write command is cached in its own memory. As shown in FIG. 3, the process of the SSD processing the received write command is as follows:
  • the SSD first obtains a write command 1 from a host connected to the SSD, wherein the write command 1 carries an identification ID0 of the target data, a subdata buff1 of the target data, and the subdata.
  • the offset of the first byte of buff1 from the first byte of the target data is offset1. Because the offset curofffset0 in the first instruction information does not match the offset offset1 in the write command 1, that is, the write command 1 is the pending write command, and the SSD is the write command 1 Allocate a storage space for storing command information in the DDR, and store the storage location information of the target data identifier ID0, the offset offset1, and the sub-data buff1 carried in the write command 1 to the allocation.
  • the SSD receives a write command 2, wherein the write command 2 carries the identification ID0 of the target data, the subdata buff2 of the target data, and the subdata buff2.
  • the offset of the first byte of the relative to the first byte of the target data is offset2. Because the offset curofffset0 in the first instruction information does not match the offset offset2 in the write command 2, that is, the write command 2 is the pending write command, and the SSD is the command 2 Allocate a storage space for storing command information in the DDR, and store the storage location information of the offset ID2, the offset 2 and the subdata buff2 of the target data in the write command 2 into the allocated storage space.
  • the SSD receives the write command 0, wherein the write command 0 carries all The identifier ID0 of the target data, the subdata buff0 of the target data, and the offset 0 of the first byte of the subdata buff0 relative to the first byte of the target data are offset0. Because the offset curofffset0 in the first instruction information matches the offset offset0 in the write command 0, that is, the write command 0 is the target write command, and the SSD is allocated in the DDR for storage.
  • Data storage space stores the sub-data buff0 carried in the write command 0 to the allocated storage space, and updates the offset in the first instruction information to curofffset1, where the curofffset1 identifies the target number of The position information of the second sub-data buff1 in the target data, and according to the updated offset in the first instruction information, is matched with the write command in the queue PendList0, and the write command is a successful match Allocate storage space for storing data, complete data storage, and so on, and finally update the offset in the first instruction information to curofffset3, where curofffset3 identifies the fourth sub-data buff3 of the target number in all locations
  • the position information in the target data is described.
  • the data storage device is a solid state storage (SSD), and the SSD has the advantages of fast data storage speed, low latency, and strong stability.
  • the SSD is usually connected to the host, and obtains the write command sent by the data sending device through the host connected to the SSD, and the second instruction information to the data sending device.
  • the data sending device can send multiple write commands in parallel to the host or data storage device connected to the data storage device according to the current network status, so that the data storage device can receive the data sent by the data sending device each time. Multiple write commands, and determining the position of the sub data carried in the write command in the target data according to the position information of the sub data carried in the received write command in the target data, so that the data is stored
  • the device can also The location information carried in the write command sent by the data sending device, determining the position of the sub data carried in the write command sent by the data sending device in the target data, and storing the target data correctly and completely can reduce the The time that the target data is transmitted on the network as a whole, and the storage efficiency of the target data is improved. Storage and accuracy.
  • the data storage device processes write commands at a rate much faster than the speed at which the write commands are transmitted over the network
  • the data storage device carries the pending write command, that is, at least one write command currently received, with the The write command that identifies the target data and carries positional information of the sub-data in the target data that does not match the positional information in the first indication information is stored in the second storage area, so that the write command
  • the data storage device can process the write command in time when the location information contained in the first instruction information matches the location information carried in the write command stored in the second storage area, without the data sending device needing to resend
  • the write command can further improve the storage efficiency of the target data.
  • the data storage device takes an SSD as an example
  • the data sending device takes a server as an example
  • the write command sent by the data sending device takes an additional write command as an example.
  • the target data to be stored sent by the server includes 7 sub-nodes.
  • the data is sequentially buff0, buff1, buff2, ..., buff6.
  • the position information of the subdata of the next target data to be stored included in the first instruction information stored in the data storage device is used in the target data.
  • the offset of the first byte of the sub-data of the next target data to be stored relative to the first byte of the target data indicates that the target data carried in the additional write command sent by the server
  • Position information of a sub data in the target data is represented by an offset of a first byte of the sub data with respect to a first byte of the target data.
  • the process in which the server stores target data to be stored in the SSD mainly includes the following steps:
  • S401 The server sends an additional write command 0, an additional write command 1, an additional write command 2 and an additional write command 3 to the host connected to the SSD in parallel according to the current network status.
  • the additional write command 0 carries the identification ID0 of the target data, the first sub-data buff0 of the target data, and the first byte of the first sub-data relative to the first of the target data Byte offset offset0;
  • the additional write command 1 carries the identification ID0 of the target data, the second sub-data buff1 of the target data, and the first byte of the second sub-data relative to the Offset1 of the first byte of the target data;
  • the additional write command 2 carries the identification ID0 of the target data, the third sub-data buff2 of the target data, and the first word of the third sub-data
  • the additional write command 3 carries the identification ID0 of the target data, the fourth sub-data buff3 of the target data, and the fourth sub-data
  • the offset of the first byte of data from the first byte of the target data is offset3.
  • the SSD obtains the additional write command 0, the additional write command 1, the additional write command 2 and the additional write command 3 sent by the server through the host.
  • the server divides the target data into multiple sub-data and sorts the multiple sub-data in the target data, Assign an offset to each subdata.
  • the SSD first receives the additional write command 2 and the additional write command 3, generates first instruction information, and stores the first instruction information in a first storage area.
  • the first indication information includes an identifier ID0 of the target data and an offset of a first byte of a first sub-data buff0 of the target data from the first byte of the target data to be stored. ⁇ curoffset0.
  • S403 The SSD determines that neither curoffset0 included in the first instruction information does not match offset2 carried in the additional write command 2 and offset3 carried in the additional write command 3, that is, the additional write command 2 and The additional write command 3 is the pending write command, and the additional write command 2 and the additional write command 3 are stored in a write command buffer queue pendlist0 corresponding to the target data in the second storage area.
  • the write commands in the write command buffer queue pendlist0 are arranged in ascending order from the offset carried in the write command, that is, the additional write command 2 is arranged before the additional write command 3.
  • the SSD receives the additional write command 0, and determines that curoffset0 included in the first instruction information matches the offset0 carried in the additional write command 0, that is, the additional write command 0 is the target write.
  • S405 The SSD sends to the server second instruction information indicating that the first sub-data buff0 of the target data has been stored.
  • the SSD updates the offset included in the first instruction information to curoffset1, stores the updated first instruction information to the first storage area, and determines the write command cache queue pendlist0.
  • the offset offset2 carried in the first write command (that is, the additional write command 2) does not match the offset curoffset1 included in the updated first instruction information, and is waiting to receive the next sent from the server. An append write command.
  • the offset curoffset1 included in the updated first indication information indicates position information of the second subdata buff1 of the target subdata in the target subdata.
  • the SSD receives the additional write command 1, and determines that curoffset1 included in the first instruction information matches the offset1 carried in the additional write command 1, that is, the additional write command 1 is the target write.
  • the SSD sends second indication information indicating that the second sub-data buff1 of the target data is stored to the server.
  • the SSD updates the offset included in the first instruction information to curoffset2, stores the updated first instruction information in the first storage area, and determines the write command cache queue pendlist0.
  • the offset offset2 carried in the first write command (that is, the additional write command 2) in the first write command matches the offset curoffset2 included in the updated first instruction information, that is, the additional write command 2 is
  • the target write command stores the third sub-data buff2 of the target data carried in the additional write command 2 to a storage area corresponding to the target data.
  • the offset curoffset2 included in the updated first indication information indicates position information of the third sub-data buff2 of the target sub-data in the target sub-data.
  • the additional write command 2 is removed from the target data.
  • the write command is deleted from the cache queue pendlist0.
  • S410 The SSD sends second indication information indicating that the third sub-data buff2 of the target data is stored to the server.
  • the SSD updates the offset included in the first instruction information to curoffset3, stores the updated first instruction information in the first storage area, and determines the write command cache queue pendlist0.
  • the offset offset3 carried in the first write command matches the offset curoffset3 included in the updated first instruction information, and the additional write command 3 is carried
  • the fourth sub-data buff3 of the target data is stored in a storage area corresponding to the target data, and the offset included in the first instruction information is updated to curoffset4.
  • the offset curoffset3 included in the updated first indication information represents position information of the fourth subdata buff3 of the target subdata in the target subdata.
  • S412 The SSD sends to the server second instruction information indicating that the fourth sub-data buff3 of the target data has been stored.
  • the server first receives the second instruction information indicating that the third sub-data buff2 of the target data is stored, and determines that when the first sub-data buff0-the third sub-data buff2 of the target data are all stored, , Continuously adding a write command 4, a write command 5 and a write command 6 to the SSD.
  • the additional write command 4 carries the identification ID0 of the target data, the fifth sub-data buff4 of the target data, and the first byte of the fifth sub-data relative to the first word of the target data Offset 4 of the section;
  • the additional write command 5 carries the identification ID0 of the target data, the sixth sub-data buff5 of the target data, and the first byte of the sixth sub-data relative to the target Offset 5 of the first byte of data;
  • the additional write command 6 carries the identification ID0 of the target data, the seventh sub-data buff6 of the target data, and the first byte of the seventh sub-data An offset of offset6 from the first byte of the target data.
  • the SSD After the SSD receives the additional write command 4, the additional write command 5 and the additional write command 6, the SSD processes the additional write command 4, any one of the additional write command 5 and the additional write command 6.
  • the method of one command is the same as the method of processing the additional write command 0-the additional write command 3, which will not be repeated here. For details about the steps S402-S411 described above.
  • an embodiment of the present application further provides a data storage device, where the data storage device is configured to implement the data storage method shown in FIG. 2 to FIG. 4.
  • the data storage device 500 includes: a communication unit 501, a processing unit 502, a command storage unit 503, and a data storage unit 504. among them,.
  • the communication unit 501 is configured to receive at least one write command
  • the processing unit 502 is configured to obtain first instruction information from a first storage area, where the first instruction information is generated after the data storage device stores the first sub-data, and the first instruction information includes The identification of the target data and the position information of the second sub-data in the target data, the first sub-data and the second sub-data are two sub-data among a plurality of sub-data included in the target data, and the first The two sub-data are the next sub-data adjacent to the first sub-data; and according to the obtained first instruction information, at least one write command currently received from the communication unit 501 and stored in the second storage area In at least one write command, a target write command is obtained; wherein the target write command carries an identifier of the target data, a third sub-data, and position information of the third sub-data in the target data, and all The location information carried in the target write command matches the location information in the first indication information; and at least one write command currently received from the communication unit 501 Obtaining a write command to be processed, wherein the write command to be processed
  • the command storage unit 503 is configured to store a write command to be processed obtained by the processing unit 502 in the second storage area;
  • the data storage unit 504 is configured to store the third sub-data carried in the target write command into a storage area corresponding to the identifier of the target data, and update the position information in the first instruction information, Storing the updated first instruction information in the first storage area; the updated position information in the first instruction information is position information of fourth subdata in the target data, and Among the plurality of sub data included in the target data, the fourth sub data is a next sub data adjacent to the third sub data;
  • a storage order of the write command in the second storage area is determined according to position information carried in the write command.
  • the position information carried in the write command is used to identify the position of the sub-data carried in the write command in the target data.
  • the communication unit 501 is further configured to: store, in the data storage unit 504, the third sub-data carried in the target write command obtained by the processing unit 502 to a corresponding one of the identifiers of the target data.
  • the host sending the second instruction information is sent to the data sending device through the host connected to the storage area, or the second instruction information is directly sent to the data sending device, and the second instruction information is used to indicate that the target write command carries the The sub data has been stored, and the data sending device is a device that sends the write command.
  • the command storage unit 503 is specifically configured to: identify the target data identifier and the sub-data of the target data carried in the to-be-processed write command obtained by the processing unit 502 The position information in the target data is correspondingly stored in the second storage area.
  • the data storage device is a solid-state storage hard disk SSD.
  • An embodiment of the present application provides a data storage device.
  • the data storage device can receive multiple write commands sent by a data sending device each time, and according to the sub-data carried in the received write command in the target data.
  • Location information to determine the position of the sub-data carried in the write command in the target data, so that the data storage device carries a write command sent by the data sending device that does not follow the write command sent by the data sending device.
  • the sub data of the target data arrives in the data storage device in the order, it can also be determined in the write command sent by the data sending device according to the location information carried in the write command sent by the data sending device.
  • the position of the carried sub-data in the target data to correctly and completely store the target data can reduce the time for transmitting the target data as a whole in the network, and improve the storage efficiency and storage accuracy of the target data.
  • the data storage device since the speed of processing the write command by the data storage device is much faster than the speed at which the write command is transmitted in the network, the data storage device carries the write command to be processed, that is, at least one write command currently received, with the The write command that identifies the target data and carries positional information of the sub-data in the target data that does not match the positional information in the first indication information is stored in the second storage area, so that the write command
  • the data storage device can process the write command in time, and does not require the data sending device to resend The write command can further improve the storage efficiency of the target data.
  • an embodiment of the present application further provides a data sending device, where the data sending device is configured to implement the data storage method shown in FIG. 2 to FIG. 4.
  • the data sending device 600 includes a processing unit 601 and a communication unit 602. among them,
  • the processing unit 601 is configured to determine the number of write commands N that can be sent in parallel according to the current network status, where N is a positive integer; and generate the N write commands; wherein each write command carries a target to be stored A data identifier, sub-data, and position information of the sub-data in the target data, the sub-data is one of a plurality of sub-data obtained by dividing the target data by the data sending device, and each of the writes The subdata carried in the command are different.
  • the communication unit 602 is configured to send the N write commands generated by the processing unit 601 to a host or a data storage device connected to the data storage device in parallel.
  • the communication unit 602 is further configured to: receive instruction information sent by the data storage device, where the instruction information is used to indicate that the sub data carried in the write command sent by the data sending device is stored Complete; and, send a subsequent write command to the data storage device according to the instruction information, or send a subsequent write command to the data storage device through the host.
  • An embodiment of the present application provides a data sending device capable of sending multiple write commands to a host or data storage device connected to a data storage device in parallel according to a current network status, where each write command carries The identifier of the target data to be stored, the sub data, and the position information of the sub data in the target data, where the sub data is one of a plurality of sub data obtained by dividing the target data, so that the data storage device can The position information of the sub-data carried in the received write command in the target data is used to determine the position of the sub-data carried in the write command in the target data.
  • the target data can also be stored correctly and completely, which can reduce the transmission time of the target data in the network, and improve the storage efficiency and storage accuracy of the target data. .
  • the division of the units in the embodiments of the present application is schematic, and is only a logical function division. In actual implementation, there may be another division manner.
  • the functional units in the embodiments of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially a part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium , Including a number of instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to perform all or part of the steps of the method described in each embodiment of the present application.
  • the foregoing storage media include: various types of media that can store program code, such as a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.
  • an embodiment of the present application further provides a data storage device.
  • the data storage device is configured to implement the data storage method shown in FIG. 2, and has the functions of the data storage device 500 shown in FIG. 5.
  • the data storage device includes: a communication interface 701, a controller 702, and a memory 703.
  • the communication interface 701, the controller 702, and the memory 703 are connected to each other. among them,
  • the communication interface 701 is configured to receive at least one write command.
  • the controller 702 is configured to obtain first instruction information from a first storage area, where the first instruction information is generated after the data storage device stores first sub-data, and the first instruction information includes The identification of the target data and the position information of the second sub-data in the target data, the first sub-data and the second sub-data are two sub-data among a plurality of sub-data included in the target data, and the first The two sub data are the next sub data adjacent to the first sub data;
  • the target write command Obtaining the target write command from at least one write command currently received and at least one write command stored in the second storage area according to the first instruction information obtained by the acquiring unit; wherein the target write command carries the The target data identifier, the third sub data, and the position information of the third sub data in the target data, and the position information carried in the target write command matches the position information in the first instruction information ;
  • the third sub-data carried in the target write command is stored in a storage area corresponding to the identifier of the target data in the memory 703, and the position information in the first instruction information is updated, and The updated first indication information is stored in the first storage area; the position information in the updated first indication information is position information of fourth subdata in the target data, and Among the plurality of sub-data included in the data, the fourth sub-data is a next sub-data adjacent to the third sub-data; and, a write command to be processed is stored in the second storage area, wherein the The pending write command is a write command other than the target write command and carrying an identifier of the target data among at least one write command currently received.
  • the memory 703 is used for the third sub-data carried in the target write command.
  • the memory 703 may include non-volatile memory (non-volatile memory), such as flash memory (also called flash memory), and hard disk (hard disk drive).
  • non-volatile memory such as flash memory (also called flash memory), and hard disk (hard disk drive).
  • the memory 703 may further include the foregoing.
  • the memory 703 may be a memory or a memory array composed of multiple memories. As shown in FIG. 8, the memory in the memory array is a flash memory as an example.
  • the controller 702 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.
  • the controller 702 may further include a hardware chip.
  • the above hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof.
  • the PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
  • a storage order of the write command in the second storage area is determined according to position information carried in the write command.
  • the position information carried in the write command is used to identify the position of the sub-data carried in the write command in the target data.
  • the communication interface 701 Also used for:
  • the data sending device is a device that sends the target write command.
  • the controller 702 is specifically configured to: obtain the pending write command from at least one currently received write command; and acquire the target data carried in the obtained pending write command.
  • the identifier and the position information of the sub-data in the target data are correspondingly stored in the second storage area.
  • the data storage device is a solid-state storage hard disk SSD.
  • An embodiment of the present application provides a data storage device.
  • the data storage device can receive multiple write commands sent by a data sending device each time, and according to the sub-data carried in the received write command in the target data.
  • Location information to determine the position of the sub-data carried in the write command in the target data, so that the data storage device does not carry the write command sent by the data sending device in accordance with the write command sent by the data sending device.
  • it can also be determined in the write command sent by the data sending device according to the location information carried in the write command sent by the data sending device.
  • the position of the carried sub-data in the target data to correctly and completely store the target data can reduce the time for transmitting the target data as a whole in the network, and improve the storage efficiency and storage accuracy of the target data.
  • the data storage device processes write commands at a rate much faster than the speed at which the write commands are transmitted over the network
  • the data storage device carries the pending write command, that is, at least one write command currently received, with the The write command that identifies the target data and carries positional information of the sub-data in the target data that does not match the positional information in the first indication information is stored in the second storage area, so that the write command
  • the data storage device can process the write command in time when the location information contained in the first instruction information matches the location information carried in the write command stored in the second storage area, without the data sending device needing to resend
  • the write command can further improve the storage efficiency of the target data.
  • an embodiment of the present application further provides a data sending device, which is used to implement the data storage method shown in FIG. 2 and has the functions of the data sending device 600 shown in FIG. 6.
  • the data storage device 900 includes: a memory 901, a processor 902, and a transceiver 903.
  • the memory 901, the processor 902, and the transceiver 903 are connected to each other. among them,
  • the memory 901 is configured to store a program instruction.
  • the processor 902 is configured to call a program instruction stored in the memory 901 and execute: determine the number of write commands N that can be sent in parallel according to the current network status, where N is a positive integer;
  • the data sending device generates the N write commands; wherein each write command carries an identifier of the target data to be stored, sub data, and position information of the sub data in the target data, and the sub data is
  • the data sending device divides the target data into one of a plurality of sub-data, and the sub-data carried in each write command is different.
  • the transceiver 903 is configured to send the N write commands generated by the processor 902 to the host or the data storage device connected to the data storage device in parallel.
  • the memory 901 may include volatile memory, such as RAM; the memory 901 may also include non-volatile memory, such as flash memory, HDD or SSD; the memory 901 may further include the above-mentioned types of Memory combination.
  • the processor 902 may be a CPU, an NP, or a combination of a CPU and an NP.
  • the processor 902 may further include a hardware chip.
  • the aforementioned hardware chip may be an ASIC, a PLD, or a combination thereof.
  • the PLD may be a CPLD, an FPGA, a GAL, or any combination thereof.
  • the transceiver 903 is further configured to: receive instruction information sent by the data storage device, where the instruction information is used to indicate that the sub data carried in the write command sent by the data sending device has been Storage completed
  • the processor 902 is further configured to control the transceiver 903 to send a subsequent write command to the data storage device or send a subsequent write command to the data storage device through the host according to the instruction information.
  • An embodiment of the present application provides a data sending device.
  • the data sending device can send multiple write commands to a host or data storage device connected to the data storage device in parallel according to the current network status, where each write command carries The identifier of the target data to be stored, sub-data, and position information of the sub-data in the target data, the sub-data is one of a plurality of sub-data obtained by dividing the target data, so that the data storage device can The position of the sub-data carried in the write command in the target data is determined according to the position information of the sub-data carried in the received write command in the target data. Even if the network status is poor, the data is received out of order.
  • the target data can also be stored correctly and completely, which can reduce the transmission time of the target data in the network, and improve the storage efficiency and storage accuracy of the target data. .
  • this application may be provided as a method, a system, or a computer program product. Therefore, this application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a specific manner such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, the instructions
  • the device implements the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided are a data storage method and apparatus, and a related device. The method comprises: a data storage device acquiring first instruction information from a first storage area, wherein the first instruction information is generated after the data storage device stores first sub-data, the first instruction information contains an identification of target data and position information of second sub-data in the target data, and the second sub-data is the next piece of sub-data, which is adjacent to the first sub-data in the target data; according to the first instruction information, obtaining a target write command from at least one write command received at present and at least one write command stored in a second storage area, wherein position information carried in the target write command is matched with the position information in the first instruction information; and storing a write command, which is to be processed, in the second storage area, storing third sub-data carried in the target write command in a storage area corresponding to the identification of the target data, and updating and saving the position information in the first instruction information.

Description

一种数据存储方法、装置及相关设备Data storage method, device and related equipment 技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种数据存储方法、装置及相关设备。The present application relates to the field of computer technology, and in particular, to a data storage method, device, and related equipment.
背景技术Background technique
随着数据规模的不断增加,存储设备需要具备艾比特(exabyte,EB)级别的无缝扩容能力,千万级别的并发访问能力以及在此之上的可靠性保障。由于受到存储设备的机头能力和机柜空间的限制,传统网络存储架构(如存储区域网络(storage area network,SAN)架构或网络附加存储(network attached storage,NAS)架构)的扩展能力弱,价格昂贵,且容灾无法保证,无法满足海量数据的存储需求。基于对象存储技术的对象存储设备(object-based storage device,OSD)架构应运而生,OSD架构采用标识(identification,ID)引用对象,使得存储设备具有可扩展性,以满足日益增长的数据存储需求。With the continuous increase of data scale, storage devices need to have exabyte (EB) -level seamless capacity expansion, tens of millions of concurrent access capabilities, and reliability guarantees on top of this. Due to the limitations of the storage device's head capacity and cabinet space, traditional network storage architectures (such as storage area network (SAN) architecture or network attached storage (NAS) architecture) have weak expansion capabilities and prices It is expensive, and disaster tolerance cannot be guaranteed, which cannot meet the storage requirements of massive data. An object-based storage device (OSD) architecture based on object storage technology came into being. The OSD architecture uses identification (ID) to refer to objects, making the storage device expandable to meet the growing data storage requirements. .
在数据存储的过程中,数据发送设备通常将待存储的目标数据整体发送给数据存储设备,使得目标数据需要较长的时间才能通过网络传输到数据存储设备,尤其在网络状态较差的情况下,导致数据存储的效率较低。因此,如何提高数据存储效率是急需解决的问题。In the process of data storage, the data sending device usually sends the entire target data to be stored to the data storage device, so that it takes a long time for the target data to be transmitted to the data storage device through the network, especially when the network status is poor. , Resulting in lower data storage efficiency. Therefore, how to improve the efficiency of data storage is an urgent problem.
发明内容Summary of the invention
本申请提供一种数据存储方法、装置及相关设备,以提高数据存储效率。The present application provides a data storage method, device, and related equipment to improve data storage efficiency.
第一方面,本申请提供了一种数据存储方法,所述方法包括:数据存储设备从第一存储区域获取第一指示信息,其中,所述第一指示信息为所述数据存储设备存储完成第一子数据后生成的,所述第一指示信息包含目标数据的标识以及第二子数据在所述目标数据中的位置信息,所述第一子数据和第二子数据为所述目标数据包括的多个子数据中的两个子数据、且所述第二子数据是所述第一子数据相邻的下一个子数据;所述数据存储设备根据获取到的所述第一指示信息,从当前接收到的至少一条写命令以及第二存储区域中存储的至少一条写命令中,获得目标写命令,其中,所述目标写命令中携带所述目标数据的标识、第三子数据以及所述第三子数据在所述目标数据中的位置信息,且所述目标写命令中携带的位置信息与所述第一指示信息中的位置信息匹配;所述数据存储设备将待处理写命令存储到所述第二存储区域中,其中,所述待处理写命令为当前接收到的至少一条写命令中除所述目标写命令之外、且携带所述目标数据的标识的写命令;所述数据存储设备将获取的目标写命令中携带的第三子数据,存储到所述目标数据的标识对应的存储区域中,并更新所述第一指示信息中的位置信息,将更新后的所述第一指示信息存储到所述第一存储区域;更新后的所述第一指示信息中的位置信息为第四子数据在所述目标数据中的位置信息,在所述目标数据包括的多个子数据中,所述第四子数据是所述第三子数据相邻的下一子数据。In a first aspect, the present application provides a data storage method. The method includes: a data storage device obtaining first indication information from a first storage area, wherein the first indication information is Generated after a piece of sub data, the first indication information includes an identifier of the target data and position information of the second sub data in the target data, and the first sub data and the second sub data for the target data include Two of the plurality of sub-data, and the second sub-data is a next sub-data adjacent to the first sub-data; and the data storage device obtains the first instruction information from the current A target write command is obtained from the received at least one write command and the at least one write command stored in the second storage area, wherein the target write command carries an identifier of the target data, a third sub-data, and the first Location information of three sub-data in the target data, and the location information carried in the target write command matches the location information in the first instruction information The data storage device stores a write command to be processed in the second storage area, where the write command to be processed is at least one write command currently received except for the target write command, and carries the target write command. The write command of the identifier of the target data; the data storage device stores the third sub data carried in the obtained target write command into a storage area corresponding to the identifier of the target data, and updates the first instruction information The position information in the first storage area, and the updated first indication information is stored in the first storage area; the position information in the updated first indication information is the position of the fourth sub-data in the target data Information, among the plurality of sub data included in the target data, the fourth sub data is a next sub data adjacent to the third sub data.
通过上述方法,数据存储设备每次能够接收数据发送设备发送的一条或多条写命令,并根据接收到的写命令中携带的子数据在所述目标数据中的位置信息,确定该写命令中携带的子数据在所述目标数据中的位置,使得所述数据存储设备在所述数据发送设备发送的写命令没有按照所述数据发送设备发送的写命令中携带的子数据在所述目标数据中的顺 序到达所述数据存储设备的情况下,也能够根据所述数据发送设备发送的写命令中携带的位置信息,确定所述数据发送设备发送的写命令中携带的子数据在所述目标数据中的位置,正确、完整地存储所述目标数据,可以减少所述目标数据整体在网络中传输的时间,提高所述目标数据的存储效率以及存储准确性。另外,由于所述数据存储设备处理写命令的速度远大于写命令在网络中传输的速度,因此所述数据存储设备将所述待处理写命令,即当前接收到的至少一条写命令中携带所述目标数据的标识、且携带的子数据在所述目标数据中的位置信息与所述第一指示信息中的位置信息不匹配的写命令,存储到所述第二存储区域中,使得所述数据存储设备在所述第一指示信息包含的位置信息与所述第二存储区域中存储的写命令中携带的位置信息匹配时,再及时处理该写命令,不需要所述数据发送设备重新发送该写命令,可以进一步提高所述目标数据的存储效率。With the above method, the data storage device can receive one or more write commands sent by the data sending device each time, and determine the write command in the write command according to the position information of the sub data carried in the received write command in the target data. A position of the carried subdata in the target data, so that the write command sent by the data storage device in the data sending device does not follow the subdata carried in the write command sent by the data sending device in the target data In the case where the order of the data arrives at the data storage device, it can also determine that the sub-data carried in the write command sent by the data sending device is in the target according to the location information carried in the write command sent by the data sending device. Positioning the data correctly and completely storing the target data can reduce the time for the target data as a whole to be transmitted on the network, and improve the storage efficiency and accuracy of the target data. In addition, because the data storage device processes write commands at a rate much faster than the speed at which the write commands are transmitted over the network, the data storage device carries the pending write command, that is, at least one write command currently received, with the The write command that identifies the target data and carries positional information of the sub-data in the target data that does not match the positional information in the first indication information is stored in the second storage area, so that the write command The data storage device processes the write command in time when the location information contained in the first instruction information matches the location information carried in the write command stored in the second storage area, and does not require the data sending device to resend The write command can further improve the storage efficiency of the target data.
一个可能的实施方式中,所述数据存储设备可以通过自身连接的主机接收所述至少一个写命令,所述写命令是要存储数据的数据发送设备发送给所述主机的,或者所述数据存储设备直接接收数据发送设备发送的所述至少一个写命令。In a possible implementation manner, the data storage device may receive the at least one write command through a host connected to the data storage device, where the write command is sent to the host by a data sending device to store data, or the data storage device The device directly receives the at least one write command sent by the data sending device.
一个可能的实施方式中,所述数据存储设备可以为固态存储硬盘SSD。In a possible implementation manner, the data storage device may be a solid-state storage hard disk SSD.
一个可能的实施方式中,所述数据存储设备接收到的写命令以及所述第二存储区域中存储的写命令中携带的子数据在所述目标数据中的位置信息可以通过但不限于以下两种方式种的任意一种表示:In a possible implementation manner, the write command received by the data storage device and the position information of the sub-data carried in the write command stored in the second storage area in the target data may be through, but not limited to, the following two Any one of these ways:
一、当所述目标数中的每个子数据的大小相同时,所述写命令中携带的子数据在所述目标数据中的位置信息可以用该子数据的首个字节相对于所述目标数据的首个字节的偏移量表示,或者用该子数据的最后一个字节相对于所述目标数据的首个字节的偏移量表示。1. When the size of each sub data in the target number is the same, the position information of the sub data carried in the write command in the target data may be relative to the target using the first byte of the sub data. The offset of the first byte of data is represented, or it is expressed by the offset of the last byte of the sub-data relative to the first byte of the target data.
二、当所述目标数中的每个子数据的大小不同时,所述写命令中携带的子数据在所述目标数据中的位置信息可以用该子数据的首个字节相对于所述目标数据的首个字节的偏移量以及该子数据所占用的字节数(即该子数据的长度)表示,或者用该子数据的最后一个字节相对于所述目标数据的首个字节的偏移量以及该子数据所占用的字节数表示。2. When the size of each sub data in the target number is different, the position information of the sub data carried in the write command in the target data may be relative to the target by using the first byte of the sub data. The offset of the first byte of data and the number of bytes occupied by the subdata (that is, the length of the subdata), or the last word of the subdata relative to the first word of the target data The offset of the section and the number of bytes occupied by the subdata.
三、当所述目标数中的每个子数据的大小相同时,所述写命令中携带的子数据在所述目标数据中的位置信息可以用该子数据在所述目标数据中的排序标识表示,其中,该子数据在所述目标数据中的排序标识可以用数字或字符表示。3. When the size of each sub-data in the target number is the same, the position information of the sub-data carried in the write command in the target data may be represented by the sort identifier of the sub-data in the target data , Wherein the sort identifier of the sub-data in the target data may be represented by numbers or characters.
四、当所述目标数中的每个子数据的大小不同时,所述写命令中携带的子数据在所述目标数据中的位置信息可以用该子数据在所述目标数据中的排序标识以及该子数据所占用的字节数(即该子数据的长度)表示,其中,该子数据在所述目标数据中的排序标识可以用数字或字符表示。4. When the size of each sub-data in the target number is different, the position information of the sub-data carried in the write command in the target data may be identified by the sorting of the sub-data in the target data and The number of bytes occupied by the sub-data (that is, the length of the sub-data) indicates that the sort identifier of the sub-data in the target data may be represented by numbers or characters.
一个可能的实施方式中,针对所述第二存储区域中存储的任意一条写命令,该写命令在所述第二存储区域中的存储顺序是根据该写命令中携带的位置信息确定的,该写命令中携带的位置信息用于标识该写命令中携带的子数据在所述目标数据中的位置,使得所述数据存储设备在从所述第二存储区域中存储的至少一条写命令中,获得目标写命令时,只需要判断所述第二存储区域中存储的首个未执行的写命令中携带的位置信息或者所述第二存储区域中存储的最后一个未执行的写命令中携带的位置信息,与所述第一指示信息中包含的位置信息是否匹配,不需要遍历所述第二存储区域中存储的所有写命令,进而可以减少所述数据存储设备获得所述目标写命令所需的时间,提高所述数据存储设备存储所述目 标数据的效率。In a possible implementation manner, for any one write command stored in the second storage area, a storage order of the write command in the second storage area is determined according to position information carried in the write command. The position information carried in the write command is used to identify the position of the sub-data carried in the write command in the target data, so that the data storage device is in at least one write command stored from the second storage area, When obtaining the target write command, it is only necessary to determine the position information carried in the first unexecuted write command stored in the second storage area or the last unexecuted write command stored in the second storage area. Whether the location information matches the location information contained in the first indication information, and it is not necessary to traverse all write commands stored in the second storage area, thereby reducing the data storage device's need to obtain the target write command Time to improve the efficiency of the data storage device storing the target data.
一个可能的实施方式中,所述数据存储设备将所述目标写命令中携带的第三子数据,存储到所述目标数据的标识对应的存储区域中之后,还可以通过自身连接的主机向发送所述写命令的数据发送设备发送第二指示信息,或者,直接向发送所述写命令的数据发送设备发送第二指示信息,所述第二指示信息用于指示所述目标写命令中携带的子数据已存储完成。In a possible implementation manner, after the data storage device stores the third sub data carried in the target write command into a storage area corresponding to an identifier of the target data, the data storage device may also send the data to the host through a host connected to the target data. The data sending device of the write command sends the second instruction information, or the second instruction information is directly sent to the data sending device of the write command, and the second instruction information is used to indicate that the target write command carries the The child data has been stored.
通过上述方法,所述数据发送设备接收到所述第二指示信息后,可以根据所述第二指示信息,确定所述第二指示信息对应的子数据以及所述目标数据中在所述子数据之前的子数据均存储完成,向所述数据存储设备发送后续写命令,或通过所述主机向所述数据存储设备发送后续写命令,将剩余的所述目标数据的子数据中的部分或全部发送给所述数据存储设备,可以减少所述目标数据通过网络传输到所述数据存储设备所需的时间,进而提高所述目标数据的存储效率,且不受所述第二指示信息到达所述数据发送设备的先后顺序的影响。According to the above method, after receiving the second instruction information, the data sending device may determine, according to the second instruction information, the sub data corresponding to the second instruction information and the target data in the sub data. All previous sub-data are stored, and a subsequent write command is sent to the data storage device, or a subsequent write command is sent to the data storage device through the host, and a part or all of the remaining sub-data of the target data is sent. Sending to the data storage device can reduce the time required for the target data to be transmitted to the data storage device through the network, thereby improving the storage efficiency of the target data without being affected by the second instruction information reaching the The impact of the sequence of data transmission equipment.
一个可能的实施方式中,所述数据存储设备将当前接收到的至少一条写命令中的待处理写命令存储到所述第二存储区域中,具体可以包括以下步骤:所述数据存储设备将获取到的待处理写命令中携带的所述目标数据的标识以及子数据在所述目标数据中的位置信息,对应存储到所述第二存储区域中。In a possible implementation manner, the data storage device stores the pending write command in the currently received at least one write command into the second storage area, which may specifically include the following steps: the data storage device will obtain The identifier of the target data and the position information of the sub-data in the target data carried in the received pending write command are correspondingly stored in the second storage area.
由于所述数据存储设备将获取到的待处理写命令中携带的所述目标数据的标识以及所述目标数据的子数据在所述目标数据中的位置信息,对应存储到所述第二存储区域中,没有存储获取到的待处理写命令中携带的所述目标数据的子数据,可以实现命令与数据的分离,减少存储所述待处理写命令所需占用的存储空间,防止所述数据存储设备由于没有空闲资源导致无法处理接收到的写命令的情况发生。Because the data storage device stores the identifier of the target data carried in the obtained write command to be processed and the position information of the target data's sub-data in the target data, it is correspondingly stored in the second storage area. , The sub-data of the target data carried in the obtained write command to be stored is not stored, and the command and data can be separated, reducing the storage space required to store the write command to be processed, and preventing the data from being stored The device cannot process the received write command because it has no free resources.
第二方面,本申请提供了还一种数据存储方法,所述方法包括:数据发送设备根据当前网络状态,确定能够并行发送的写命令数量N,并生成所述N个写命令,其中,N为正整数,每条写命令中携带待存储的目标数据的标识、子数据以及该子数据在所述目标数据中的位置信息,该子数据为将所述目标数据划分得到的多个子数据中的一个,且所述每条写命令中携带的子数据不同;所述数据发送设备将生成的N个写命令,并行发送给数据存储设备连接的主机或者直接发送给数据存储设备。In a second aspect, the present application provides another data storage method, which includes: the data sending device determines the number of write commands N that can be sent in parallel according to the current network state, and generates the N write commands, where N It is a positive integer, and each write command carries an identifier of the target data to be stored, subdata, and position information of the subdata in the target data, and the subdata is a plurality of subdata obtained by dividing the target data. And the sub data carried in each write command are different; the data sending device sends the generated N write commands in parallel to a host connected to the data storage device or directly to the data storage device.
通过上述方法,所述数据发送设备能够根据当前的网络状态,向数据存储设备连接的主机或者数据存储设备并行发送多条写命令,其中,每条写命令中携带待存储的目标数据的标识、子数据以及该子数据在所述目标数据中的位置信息,该子数据为将所述目标数据划分得到的多个子数据中的一个,使得所述数据存储设备能够根据接收到的写命令中携带的子数据在所述目标数据中的位置信息,确定该写命令中携带的子数据在所述目标数据中的位置,即使在网络状态较差,乱序接收到所述数据发送设备发送的写命令的情况下,也能正确、完整的存储所述目标数据,可以减少所述目标数据在网络中传输的时间,提高所述目标数据的存储效率以及存储准确性。According to the above method, the data sending device can send multiple write commands in parallel to the host or data storage device connected to the data storage device according to the current network status, where each write command carries an identifier of the target data to be stored, The sub data and the position information of the sub data in the target data, where the sub data is one of a plurality of sub data obtained by dividing the target data, so that the data storage device can carry the received data according to the received write command The position information of the subdata in the target data to determine the position of the subdata carried in the write command in the target data, even if the network status is poor, the writes sent by the data sending device are received out of order In the case of a command, the target data can also be stored correctly and completely, which can reduce the transmission time of the target data in the network, and improve the storage efficiency and storage accuracy of the target data.
一个可能的实施方式中,所述数据发送设备接收所述数据存储设备发送的指示信息,所述指示信息用于指示所述数据发送设备发送的写命令中携带的子数据已存储完成;所述数据发送设备根据所述指示信息,向所述数据存储设备发送后续写命令,或通过所述主机向所述数据存储设备发送后续写命令。In a possible implementation manner, the data sending device receives instruction information sent by the data storage device, where the instruction information is used to indicate that the sub data carried in the write command sent by the data sending device has been stored; The data sending device sends a subsequent write command to the data storage device according to the instruction information, or sends a subsequent write command to the data storage device through the host.
通过上述方法,所述数据发送设备接收到所述数据存储设备发送的指示信息后,可以根据所述指示信息,确定所述指示信息对应的子数据以及所述目标数据中在所述子数据之前的子数据均存储完成,向所述数据存储设备发送后续写命令,或通过所述主机向所述数据存储设备发送后续写命令,将剩余的所述目标数据的子数据中的部分或全部发送给所述数据存储设备,可以减少所述目标数据通过网络传输到所述数据存储设备所需的时间,进而提高所述目标数据的存储效率,且不受所述第二指示信息到达所述数据发送设备的先后顺序的影响。According to the above method, after receiving the instruction information sent by the data storage device, the data sending device may determine, according to the instruction information, subdata corresponding to the instruction information and the target data before the subdata. All the sub-data are stored, send a subsequent write command to the data storage device, or send a subsequent write command to the data storage device through the host, and send some or all of the remaining sub-data of the target data To the data storage device, the time required for the target data to be transmitted to the data storage device through the network can be reduced, thereby further improving the storage efficiency of the target data without being affected by the second instruction information reaching the data. The effect of the order of sending devices.
第三方面,本申请提供了一种数据存储设备,所述数据存储设备具有实现上述第一方面方法实例中数据存储设备行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In a third aspect, the present application provides a data storage device, which has a function of realizing the behavior of the data storage device in the method example of the first aspect. The functions may be implemented by hardware, and may also be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions described above.
一种可能的实施方式中,所述数据存储设备的结构中包括通信单元、处理单元、数据存储单元和命令存储单元,这些单元可以执行上述第一方面的方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。In a possible implementation manner, the structure of the data storage device includes a communication unit, a processing unit, a data storage unit, and a command storage unit, and these units can execute the corresponding functions in the method example of the first aspect above. For details, refer to the method. The detailed description in the example is not repeated here.
一种可能的实施方式中,所述数据存储设备的结构中包括通信接口、控制器和存储器,所述控制器被配置为支持所述数据存储设备执行上述第一方面提供的方法中相应的功能。所述存储器与所述控制器耦合,其保存所述数据存储设备必要的程序指令和数据。In a possible implementation manner, a structure of the data storage device includes a communication interface, a controller, and a memory, and the controller is configured to support the data storage device to perform a corresponding function in the method provided by the first aspect. . The memory is coupled to the controller and stores program instructions and data necessary for the data storage device.
第四方面,本申请提供了一种数据发送设备,所述数据发送设备具有实现上述第二方面方法实例中数据发送设备行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In a fourth aspect, the present application provides a data sending device, and the data sending device has a function of implementing the behavior of the data sending device in the method example of the second aspect. The functions may be implemented by hardware, and may also be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions described above.
一种可能的实施方式中,所述数据发送设备的结构中包括处理单元和通信单元,这些单元可以执行上述第二方面的方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。In a possible implementation manner, the structure of the data sending device includes a processing unit and a communication unit, and these units can perform corresponding functions in the method example of the second aspect described above. For details, refer to the detailed description in the method example. Do not go into details.
一种可能的实施方式中,所述数据发送设备的结构中包括收发器、处理器和存储器,所述处理器被配置为支持所述数据存储设备执行上述第二方面提供的方法中相应的功能。所述存储器与所述控制器耦合,其保存所述数据发送设备必要的程序指令和数据。In a possible implementation manner, a structure of the data sending device includes a transceiver, a processor, and a memory, and the processor is configured to support the data storage device to perform a corresponding function in the method provided in the second aspect above. . The memory is coupled to the controller and stores program instructions and data necessary for the data transmitting device.
第五方面,本申请提供了一种通信系统,所述通信系统包括上述第三方面所述的数据存储设备以及上述第四方面所述的数据发送设备。In a fifth aspect, the present application provides a communication system including the data storage device described in the third aspect and the data transmission device described in the fourth aspect.
第六方面,本申请还提供了一种芯片,所述芯片与存储器相连或者所述芯片包括所述存储器,用于读取并执行所述存储器中存储的软件程序,以实现上述任一方面的任意一种实施方式提供的方法。According to a sixth aspect, the present application further provides a chip, where the chip is connected to a memory or the chip includes the memory, and is used to read and execute a software program stored in the memory to implement any of the foregoing aspects. The method provided by any one of the embodiments.
第七方面,本申请还提供一种计算机可读存储介质,所述计算机存储介质上存储有计算机可执行指令,当所述指令在计算机上运行时,使得所述计算机执行上述任一方面的任意一种实施方式提供的方法。In a seventh aspect, the present application further provides a computer-readable storage medium, where the computer storage medium stores computer-executable instructions, and when the instructions are run on a computer, the computer is caused to execute any of the foregoing aspects. A method provided by an embodiment.
第八方面,本申请还提供了一种包含指令的计算机程序产品,当所述指令在计算机上运行时,使得计算机执行上述任一方面中的任一种方法。In an eighth aspect, the present application also provides a computer program product containing instructions that, when the instructions are run on a computer, cause the computer to perform any of the methods in any of the above aspects.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请实施例提供的一种通信系统架构示意图;FIG. 1 is a schematic diagram of a communication system architecture according to an embodiment of the present application; FIG.
图2为本申请实施例提供的一种数据存储方法的流程示意图;2 is a schematic flowchart of a data storage method according to an embodiment of the present application;
图3为本申请实施例提供的一种写命令处理方法的流程示意图;3 is a schematic flowchart of a write command processing method according to an embodiment of the present application;
图4为本申请具体实施例提供的一种数据存储方法的流程示意图;4 is a schematic flowchart of a data storage method according to a specific embodiment of the present application;
图5为本申请实施例提供的一种数据存储装置的结构示意图;5 is a schematic structural diagram of a data storage device according to an embodiment of the present application;
图6为本申请实施例提供的一种数据发送装置的结构示意图;6 is a schematic structural diagram of a data sending apparatus according to an embodiment of the present application;
图7为本申请实施例提供的一种数据存储设备的结构示意图;7 is a schematic structural diagram of a data storage device according to an embodiment of the present application;
图8为本申请具体实施例提供的一种数据存储设备的结构示意图;8 is a schematic structural diagram of a data storage device according to a specific embodiment of the present application;
图9为本申请实施例提供的一种数据发送设备的结构示意图。FIG. 9 is a schematic structural diagram of a data sending device according to an embodiment of the present application.
具体实施方式detailed description
本申请提供一种数据存储方法、装置及相关设备,以提高数据存储效率。其中,方法和装置是基于同一发明构思的,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。The present application provides a data storage method, device, and related equipment to improve data storage efficiency. Among them, the method and the device are based on the same inventive concept. Since the principle of the method and the device for solving the problem is similar, the implementation of the device and the method can be referred to each other, and duplicated details will not be repeated.
需要说明的是,在本申请的描述中,“多个”是指两个或两个以上;“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。It should be noted that in the description of this application, "multiple" means two or more; words such as "first" and "second" are used only for the purpose of distinguishing descriptions, and cannot be understood as instructions. Or imply relative importance, nor can it be understood as indicating or implying order.
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述。In order to make the purpose, technical solution, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings.
本申请实施例提供的数据存储方法应用于数据存储设备接收并存储数据发送设备通过网络发送的待存储的目标数据的场景。图1示出了本申请实施例提供的数据存储方法适用的一种可能的通信系统架构,所述通信系统包括:至少一个所述数据存储设备101和至少一个所述数据发送设备102,所述数据存储设备101可以与主机103连接。The data storage method provided in the embodiment of the present application is applied to a scenario in which a data storage device receives and stores target data to be stored sent by a data sending device through a network. FIG. 1 shows a possible communication system architecture to which the data storage method provided by the embodiment of the present application is applicable. The communication system includes: at least one of the data storage device 101 and at least one of the data sending device 102. The data storage device 101 may be connected to the host 103.
其中,所述数据存储设备101用于接收所述数据发送设备通过网络发送的写命令,并将所述写命令中携带的待存储的目标数据中的子数据,存储到所述数据存储设备101中;所述数据存储设备101可以同时接收不同数据发送设备102发送的写命令,当所述数据存储设备101可以与主机103连接时,所述所述数据存储设备101通过所述主机接收所述数据发送设备102通过网络发送的写命令。所述数据发送设备102可以将所述待存储的目标数据划分为多个子数据,并将划分得到的子数据携带在对应的写命令中,通过网络将所述写命令发送给所述数据存储设备101。The data storage device 101 is configured to receive a write command sent by the data sending device through a network, and store subdata in the target data to be stored carried in the write command to the data storage device 101 Medium; the data storage device 101 can simultaneously receive write commands sent by different data sending devices 102, and when the data storage device 101 can be connected to a host 103, the data storage device 101 receives the data through the host The write command sent by the data transmitting device 102 through the network. The data sending device 102 may divide the target data to be stored into multiple sub-data, carry the divided sub-data in a corresponding write command, and send the write command to the data storage device through a network. 101.
当网络环境较复杂时,所述通信系统还包括至少一个数据转发设备104,所述数据转发设备104用于将所述数据发送设备102发送的写命令转发到对应的所述数据存储设备101或对应所述数据存储设备101连接的主机103。具体地,所述数据转发设备104可以是路由器或者交换机。所述数据存储设备101可以插在所述主机103中相应的卡槽上,实现与所述主机103的连接,所述数据存储设备101可以是固态存储硬盘SSD。When the network environment is complicated, the communication system further includes at least one data forwarding device 104, where the data forwarding device 104 is configured to forward a write command sent by the data sending device 102 to the corresponding data storage device 101 or Corresponds to the host 103 connected to the data storage device 101. Specifically, the data forwarding device 104 may be a router or a switch. The data storage device 101 may be inserted into a corresponding card slot in the host 103 to achieve connection with the host 103. The data storage device 101 may be a solid-state storage hard disk SSD.
如图2所示,本申请实施例提供了一种数据存储方法,应用于待存储的目标数据被划分为多个子数据,划分得到的多个子数据分别通过网络传输并存储到对应存储设备的场景,适用于如图1所示的通信系统。所述方法包括:As shown in FIG. 2, an embodiment of the present application provides a data storage method, which is applied to a scenario in which target data to be stored is divided into multiple sub-data, and the obtained multiple sub-data are transmitted through a network and stored to a corresponding storage device, respectively. , Suitable for communication systems as shown in Figure 1. The method includes:
S201:数据发送设备根据当前网络状态,确定能够并行发送的写命令数量N,并生成所述N个写命令。S201: The data sending device determines the number of write commands N that can be sent in parallel according to the current network state, and generates the N write commands.
其中,N为正整数,每条写命令中携带待存储的目标数据的标识、子数据以及该子数据在所述目标数据中的位置信息,该子数据为将所述目标数据划分得到的多个子数据中的一个,且所述每条写命令中携带的子数据不同;所述数据发送设备将生成的N个写命令, 并行发送给数据存储设备连接的主机或者数据存储设备。Wherein, N is a positive integer, and each write command carries an identifier of the target data to be stored, sub data, and position information of the sub data in the target data. The sub data is obtained by dividing the target data. One of the sub data, and the sub data carried in each write command is different; the data sending device sends the generated N write commands in parallel to a host or data storage device connected to the data storage device.
需要说明的是,本申请实施例并不对所述数据发送设备发送的写命令的具体名称进行限定,例如,上述写命令可以为追加写(append)命令。It should be noted that the embodiment of the present application does not limit the specific name of the write command sent by the data sending device. For example, the above write command may be an append command.
S202:所述数据发送设备将生成的N个写命令,并行发送给数据存储设备连接的主机或者数据存储设备。S202: The data sending device sends the generated N write commands in parallel to a host or a data storage device connected to the data storage device.
相应地,所述数据存储设备可以通过自身连接的主机接收至少一个写命令,或者直接接收至少一个写命令。其中,所述数据存储设备当前接收到的至少一条写命令为所述数据发送设备发送的N个写命令中的一个或多个写命令。Correspondingly, the data storage device may receive at least one write command through a host connected to the data storage device, or directly receive at least one write command. The at least one write command currently received by the data storage device is one or more of the N write commands sent by the data sending device.
S203:所述数据存储设备从第一存储区域获取第一指示信息。S203: The data storage device obtains first instruction information from a first storage area.
其中,所述第一指示信息为所述数据存储设备存储完成第一子数据后生成的,所述第一指示信息包含目标数据的标识以及第二子数据在所述目标数据中的位置信息,所述第一子数据和第二子数据为所述目标数据包括的多个子数据中的两个子数据、且所述第二子数据是所述第一子数据相邻的下一个子数据。The first instruction information is generated after the data storage device stores the first sub data, and the first instruction information includes an identifier of the target data and position information of the second sub data in the target data, The first sub data and the second sub data are two sub data of a plurality of sub data included in the target data, and the second sub data is a next sub data adjacent to the first sub data.
S204:所述数据存储设备根据获得的第一指示信息,从当前接收到的至少一条写命令以及第二存储区域中存储的至少一条写命令中,获得目标写命令。S204: The data storage device obtains the target write command from at least one write command currently received and at least one write command stored in the second storage area according to the obtained first instruction information.
其中,所述目标写命令中携带所述目标数据的标识、第三子数据以及所述第三子数据在所述目标数据中的位置信息,且所述目标写命令中携带的位置信息与所述第一指示信息中的位置信息匹配,所述第三子数据是所述目标数据包括的多个子数据中的一个子数据。The target write command carries an identifier of the target data, a third subdata, and position information of the third subdata in the target data, and the position information carried in the target write command is related to all The position information in the first indication information matches, and the third sub-data is one of a plurality of sub-data included in the target data.
所述第一存储区域以及所述第二存储区域可以是所述数据存储设备中的存储空间,也可以是与所述数据存储设备连接的其他具有存储功能的设备中的存储空间。The first storage area and the second storage area may be a storage space in the data storage device, or may be a storage space in another device with a storage function connected to the data storage device.
S205:所述数据存储设备将所述目标写命令中携带的第三子数据,存储到所述目标数据的标识对应的存储区域中,并更新所述第一指示信息中的位置信息,将更新后的所述第一指示信息存储到所述第一存储区域。S205: The data storage device stores the third sub data carried in the target write command into a storage area corresponding to an identifier of the target data, and updates the position information in the first instruction information, and updates the position information. The subsequent first instruction information is stored in the first storage area.
其中,更新后的所述第一指示信息中的位置信息为第四子数据在所述目标数据中的位置信息,在所述目标数据包括的多个子数据中,所述第四子数据是所述第三子数据相邻的下一子数据。Wherein, the updated position information in the first instruction information is position information of a fourth sub-data in the target data, and among the plurality of sub-data included in the target data, the fourth sub-data is all The next sub-data adjacent to the third sub-data is described.
S206:所述数据存储设备将当前接收到的至少一条写命令中的待处理写命令,存储到所述第二存储区域中。S206: The data storage device stores a pending write command in at least one currently received write command into the second storage area.
其中,所述待处理写命令为当前接收到的至少一条写命令中除所述目标写命令之外、且携带所述目标数据的标识的写命令,即当前接收到的至少一条写命令中携带所述目标数据的标识、且携带的所述目标数据的子数据在所述目标数据中的位置信息与所述第一指示信息中的位置信息不匹配的写命令。The write command to be processed is a write command in addition to the target write command among the currently received at least one write command and carrying the identifier of the target data, that is, the at least one write command currently received is carried in A write command in which the identifier of the target data and the position information of the sub-data of the target data in the target data and the position information in the first indication information do not match.
所述数据发送设备以及所述数据存储设备可以通过循环执行上述步骤S201-S206,将所述目标数据的所有子数据存储到所述数据存储设备中。需要说明的是,所述数据存储设备可以同时存储不同数据发送设备发送的待存储数据的子数据,针对任意一个数据发送设备发送的任意一个携带待存储数据的子数据的写命令,所述数据存储设备均可以采用上述步骤S201-S206处理。The data sending device and the data storage device may execute the above steps S201-S206 through cycles to store all the sub-data of the target data in the data storage device. It should be noted that the data storage device may simultaneously store the sub-data of the data to be stored sent by different data sending devices. For a write command sent by any data sending device that carries the sub-data of the data to be stored, the data The storage devices can all adopt the above steps S201-S206 for processing.
一个可能的实施方式中,所述数据存储设备接收到的写命令以及所述第二存储区域中存储的写命令中携带的子数据在所述目标数据中的位置信息可以通过但不限于以下两种方式种的任意一种表示:In a possible implementation manner, the write command received by the data storage device and the position information of the sub-data carried in the write command stored in the second storage area in the target data may be through, but not limited to, the following two Any one of these ways:
一、当所述目标数的每个子数据的大小相同时,所述写命令中携带的子数据在所述目标数据中的位置信息可以用该子数据的首个字节相对于所述目标数据的首个字节的偏移量表示,或者用该子数据的最后一个字节相对于所述目标数据的首个字节的偏移量表示。例如,所述目标数据的大小为100兆字节(Megabytes),所述目标数据的每个子数据大小均为10MB,所述写命令中携带的所述目标数据的第一个子数据在所述目标数据中的位置信息可以用所述第一个子数据的最后一个字节相对于所述目标数据的首个字节的偏移量10MB表示,所述写命令中携带的所述目标数据的第二个子数据在所述目标数据中的位置信息可以用所述第二个子数据的最后一个字节相对于所述目标数据的首个字节的偏移量20MB表示…,所述写命令中携带的所述目标数据的第十个子数据在所述目标数据中的位置信息可以用所述第十个子数据的最后一个字节相对于所述目标数据的首个字节的偏移量100MB表示。1. When the size of each sub data of the target number is the same, the position information of the sub data carried in the write command in the target data may be relative to the target data by using the first byte of the sub data. The offset of the first byte of, or the offset of the last byte of the sub-data relative to the first byte of the target data. For example, the size of the target data is 100 megabytes, and each sub-data size of the target data is 10 MB. The first sub-data of the target data carried in the write command is in the The position information in the target data may be represented by an offset of 10MB of the last byte of the first sub-data relative to the first byte of the target data. The position information of the second sub-data in the target data may be represented by an offset 20MB of the last byte of the second sub-data relative to the first byte of the target data ..., in the write command The position information of the tenth sub-data of the target data carried in the target data may be represented by an offset of 100 MB of the last byte of the tenth sub-data relative to the first byte of the target data .
二、当所述目标数的每个子数据的大小不同时,所述写命令中携带的子数据在所述目标数据中的位置信息可以用该子数据的首个字节相对于所述目标数据的首个字节的偏移量以及该子数据所占用的字节数(即该子数据的长度)表示,或者用该子数据的最后一个字节相对于所述目标数据的首个字节的偏移量以及该子数据所占用的字节数表示。例如,所述目标数据的大小为100兆字节(Megabytes),所述目标数据的第一个子数据大小为10MB,所述写命令中携带的所述目标数据的第一个子数据在所述目标数据中的位置信息可以用所述第一个子数据的首个字节相对于所述目标数据的首个字节的偏移量0以及所述第一个子数据所占用的字节数10MB表示,所述目标数据的第二个子数据大小为30MB,所述写命令中携带的所述目标数据的第二个子数据在所述目标数据中的位置信息可以用所述第二个子数据的首个字节相对于所述目标数据的首个字节的偏移量10MB以及所述第二个子数据所占用的字节数30MB表示,…,以此类推。2. When the size of each sub data of the target number is different, the position information of the sub data carried in the write command in the target data may be relative to the target data by using the first byte of the sub data. The offset of the first byte of the and the number of bytes occupied by the subdata (that is, the length of the subdata), or the last byte of the subdata relative to the first byte of the target data The offset and the number of bytes occupied by the subdata. For example, the size of the target data is 100 megabytes, the first sub-data size of the target data is 10 MB, and the first sub-data of the target data carried in the write command is For the position information in the target data, an offset 0 of the first byte of the first sub-data relative to the first byte of the target data and the bytes occupied by the first sub-data can be used. The number 10MB indicates that the size of the second subdata of the target data is 30MB, and the position information of the second subdata of the target data carried in the write command in the target data can use the second subdata The offset of the first byte from the first byte of the target data by 10MB and the number of bytes occupied by the second sub-data is 30MB, and so on.
三、当所述目标数的每个子数据的大小相同时,所述写命令中携带的子数据在所述目标数据中的位置信息可以用该子数据在所述目标数据中的排序标识表示,其中,该子数据在所述目标数据中的排序标识可以用数字或字符表示。例如,所述目标数据的大小为100MB,所述目标数据的每个子数据大小为10MB,所述目标数据的每个子数据在所述目标数据中的排序标识分别用数字1-10表示,即所述写命令中携带的所述目标数据的第一个子数据在所述目标数据中的位置信息可以用1表示,所述写命令中携带的所述目标数据的第二个子数据在所述目标数据中的位置信息可以用2表示…,所述写命令中携带的所述目标数据的第十个子数据在所述目标数据中的位置信息可以用10表示。3. When the size of each sub-data of the target number is the same, the position information of the sub-data carried in the write command in the target data may be represented by the sort identifier of the sub-data in the target data, The sorting identifier of the sub-data in the target data may be represented by numbers or characters. For example, the size of the target data is 100MB, and the size of each sub-data of the target data is 10MB. The ordering identifier of each sub-data of the target data in the target data is represented by numbers 1-10, that is, all The position information of the first sub-data of the target data carried in the write command in the target data may be represented by 1, and the second sub-data of the target data carried in the write command is at the target. The position information in the data may be represented by 2 ..., and the position information of the tenth sub-data of the target data carried in the write command in the target data may be represented by 10.
四、当所述目标数的每个子数据的大小不同时,所述写命令中携带的子数据在所述目标数据中的位置信息可以用该子数据在所述目标数据中的排序标识以及该子数据表示所占用的字节数(即该子数据的长度)表示,其中,该子数据在所述目标数据中的排序标识可以用数字或字符表示。例如,所述目标数据的大小为100兆字节(Megabytes),所述目标数据的第一个子数据大小为10MB,所述写命令中携带的所述目标数据的第一个子数据在所述目标数据中的位置信息可以用所述第一个子数据在所述目标数据中的排序标识1以及所述第一个子数据所占用的字节数10MB表示,所述目标数据的第二个子数据大小为30MB,所述写命令中携带的所述目标数据的第二个子数据在所述目标数据中的位置信息可以用所述第二个子数据在所述目标数据中的排序标识2以及所述第二个子数据所占用的字节数30MB表示,…,以此类推。4. When the size of each sub-data of the target number is different, the position information of the sub-data carried in the write command in the target data may be identified by the sorting of the sub-data in the target data and the The sub-data indicates the number of bytes occupied (that is, the length of the sub-data), and the sort identifier of the sub-data in the target data may be represented by numbers or characters. For example, the size of the target data is 100 megabytes, the first sub-data size of the target data is 10 MB, and the first sub-data of the target data carried in the write command is The position information in the target data may be represented by the sort identifier 1 of the first sub data in the target data and the number of bytes occupied by the first sub data is 10 MB. The size of each sub-data is 30MB, and the position information of the second sub-data of the target data carried in the write command in the target data can be identified by the ordering of the second sub-data in the target data 2 and The number of bytes occupied by the second sub-data is 30MB, and so on.
一个可能的实施方式中,所述第一指示信息中包含的所述第二子数据在所述目标数据中的位置信息,即所述数据存储设备待存储的下一个子数据在所述目标数据中的位置信息,与当前接收到的至少一条写命令以及所述第二存储区域中存储的至少一条写命令中携带的子数据在所述目标数据中的位置信息的表示方式可以相同,也可以不同。当所述第一指示信息中的位置信息与所述写命令中携带的位置信息的表示方式不同时,所述数据存储设备与所述数据发送设备约定所述第一指示信息中的位置信息与所述写命令中的位置信息的对应关系,使得所述数据存储设备能够根据所述第一指示信息,从当前接收到的至少一条写命令或所述第二存储区域中存储的至少一条写命令中,获得所述目标写命令,存储获得的目标写命令中携带的所述目标数据的子数据。In a possible implementation manner, position information of the second sub-data included in the first indication information in the target data, that is, the next sub-data to be stored by the data storage device is in the target data. The position information in the target data may be the same as that of the currently received at least one write command and at least one write command stored in the second storage area in the target data. different. When the location information in the first instruction information is different from the representation method of the location information carried in the write command, the data storage device and the data sending device agree on the location information in the first instruction information and The correspondence between the position information in the write command enables the data storage device to receive at least one write command currently received or at least one write command stored in the second storage area according to the first instruction information. The target write command is obtained, and the sub-data of the target data carried in the obtained target write command is stored.
一个可能的实施方式中,当所述数据存储设备从所述主机获取到首个携带所述目标数据标识、所述目标数据的一个子数据以及该子数据在所述目标数据中的位置信息的写命令时,所述数据存储设备生成所述第一指示信息,所述第一指示信息中包含的待存储的所述目标数据的下一个子数据在所述目标数据中的位置信息可以为设定的初始值。In a possible implementation manner, when the data storage device obtains, from the host, the first carrying the target data identifier, a subdata of the target data, and location information of the subdata in the target data. When the command is written, the data storage device generates the first instruction information, and the position information of the next sub-data of the target data to be stored included in the first instruction information may be set in the target data. Fixed initial value.
一个可能的实施方式中,针对所述第二存储区域中存储的任意一条写命令,该写命令在所述第二存储区域中的存储顺序是根据该写命令中携带的位置信息确定的,该写命令中携带的位置信息用于标识该写命令中携带的子数据在所述目标数据中的位置,使得所述数据存储设备在从所述第二存储区域中存储的至少一条写命令中,获得目标写命令时,只需要判断所述第二存储区域中存储的首个未执行的写命令中携带的位置信息或者所述第二存储区域中存储的最后一个未执行的写命令中携带的位置信息,与所述第一指示信息中包含的位置信息是否匹配,不需要遍历所述第二存储区域中存储的所有写命令,进而可以减少所述数据存储设备获得所述目标写命令所需的时间,进一步提高所述数据存储设备存储所述目标数据的效率。In a possible implementation manner, for any one write command stored in the second storage area, a storage order of the write command in the second storage area is determined according to position information carried in the write command. The position information carried in the write command is used to identify the position of the sub-data carried in the write command in the target data, so that the data storage device is in at least one write command stored from the second storage area, When obtaining the target write command, it is only necessary to determine the position information carried in the first unexecuted write command stored in the second storage area or the last unexecuted write command stored in the second storage area. Whether the location information matches the location information contained in the first indication information, and it is not necessary to traverse all write commands stored in the second storage area, thereby reducing the data storage device's need to obtain the target write command Time, further improving the efficiency of the data storage device storing the target data.
一个可能的实施方式中,所述数据存储设备将所述目标写命令中携带的子数据,存储到所述目标数据的标识对应的存储区域中之后,还可以执行步骤207:通过自身连接的主机向发送所述目标写命令的数据发送设备发送第二指示信息,或者,直接向发送所述目标写命令的数据发送设备发送第二指示信息,其中,所述第二指示信息用于指示所述目标写命令中携带的所述目标数据的子数据存储成功。In a possible implementation manner, after the data storage device stores the sub data carried in the target write command into a storage area corresponding to an identifier of the target data, step 207 may be further performed: a host connected through itself Send the second instruction information to the data sending device that sends the target write command, or send the second instruction information directly to the data sending device that sends the target write command, where the second instruction information is used to indicate the The sub-data of the target data carried in the target write command is successfully stored.
相应地,所述数据发送设备接收到所述第二指示信息后,可以根据所述第二指示信息,向所述数据存储设备发送后续写命令,或通过所述主机向所述数据存储设备发送后续写命令。Accordingly, after receiving the second instruction information, the data sending device may send a subsequent write command to the data storage device according to the second instruction information, or send the subsequent write command to the data storage device through the host. Subsequent write commands.
由于所述数据发送设备可以根据所述第二指示信息,确定所述第二指示信息对应的子数据以及所述目标数据中在所述子数据之前的子数据均存储完成,因此,所述数据发送设备可以在网络带宽允许的范围内,继续向所述数据存储设备并行发送多个写命令,将剩余的所述目标数据的子数据中的部分或全部发送给所述数据存储设备,可以减少所述目标数据通过网络传输到所述数据存储设备所需的时间,进而可以提高所述目标数据的存储效率,且不受所述第二指示信息到达所述数据发送设备的先后顺序的影响。Since the data sending device can determine that the sub data corresponding to the second instruction information and the sub data before the sub data in the target data are stored according to the second instruction information, the data The sending device can continue to send multiple write commands to the data storage device in parallel within the range allowed by the network bandwidth, and send some or all of the remaining sub-data of the target data to the data storage device, which can reduce The time required for the target data to be transmitted to the data storage device over the network can further improve the storage efficiency of the target data, and is not affected by the order in which the second instruction information reaches the data sending device.
尽管受到网络状态的影响,所述数据存储设备每次存储完所述目标写命令中携带的子数据之后发送的所述第二指示信息,可能无法按照所述数据存储设备发送所述第二指示信息的顺序到达所述数据发送设备,但是所述数据存储设备仅在所述第一指示信息中的位置信息与写命令中携带的子数据在所述目标数据中的位置信息匹配时,才存储该写命令中携 带的子数据,因此当所述数据发送设备接收到所述目标数据的某个子数据存储成功的第二指示信息时,所述数据发送设备能够确定所述目标数据中位置在某个子数据之前的子数据均存储完成,并继续向所述数据存储设备发送至少一个所述写命令。例如,当所述数据发送设备接收到用于指示所述目标数据的第三个子数据存储完成的第二指示信息,且所述数据发送设备未接收到用于指示所述目标数据的第一个子数据或所述目标数据的第二个子数据存储完成的第二指示信息时,所述数据发送设备可以向所述数据存储设备并行发送三个所述写命令,或者可以向所述数据存储设备并行发送两个所述写命令,或者可以向所述数据存储设备发送一个所述写命令。Although affected by the network status, the second indication information sent after the data storage device stores the subdata carried in the target write command each time may not be able to send the second indication according to the data storage device The order of the information reaches the data sending device, but the data storage device stores only when the position information in the first instruction information matches the position information of the sub-data carried in the write command in the target data. The sub data carried in the write command, so when the data transmitting device receives the second indication information that a certain sub data of the target data is successfully stored, the data transmitting device can determine that the position in the target data is in a certain position. All the sub-data before each sub-data are stored, and continue to send at least one of the write commands to the data storage device. For example, when the data sending device receives the second instruction information indicating that the third sub-data storage of the target data is completed, and the data sending device does not receive the first one indicating the target data When the sub data or the second indication data of the target data is stored, the data sending device may send the three write commands to the data storage device in parallel, or may send the write command to the data storage device in parallel. Two of the write commands are sent in parallel, or one of the write commands may be sent to the data storage device.
通常情况下,所述数据存储设备会预留较大的所述第二存储区域,以存储当前不能处理的命令信息和数据信息,但是所述数据发送设备可能在同一时刻向所述数据存储设备下发大量的写命令,且所述数据存储设备可能同时接收多个所述数据发送设备下发的不同目标数据对应的写命令,这些写命令经过网络的传输,到达所述数据存储设备的顺序不可预知,使得所述数据存储设备可能需要在所述第二存储区域中存储的大量的写命令,导致所述第二区域全部被占用,进而使得所述数据存储设备既无法处理新接收到的写命令,又无法释放所述第二存储区域的资源,造成资源死锁。为了解决上述问题,所述数据存储设备将当前接收到的至少一条写命令中的待处理写命令(所述待处理写命令中携带所述目标数据的标识,且携带的所述目标数据中的子数据在所述目标数据中的位置信息与所述第一指示信息中的位置信息不匹配),存储到所述第二存储区域中时,不存储所述待存储写命令中携带的子数据,仅存储所述目标数据的标识,子数据在所述目标数据中的位置信息,以减少存储当前接收到的至少一条写命令中不能立即处理的写命令所占用的资源。为此在步骤S206中,所述数据存储设备将所述待处理写命令存储到所述第二存储区域中时,具体可以通过将获取到的待处理写命令中携带的所述目标数据的标识以及该子数据在所述目标数据中的位置信息,对应存储到所述第二存储区域中。Generally, the data storage device reserves a larger second storage area to store command information and data information that cannot be processed currently, but the data sending device may send the data storage device to the data storage device at the same time. Issue a large number of write commands, and the data storage device may receive multiple write commands corresponding to different target data issued by the data sending device at the same time, and these write commands are transmitted through the network to the data storage device in the order It is unpredictable that the data storage device may need a large number of write commands stored in the second storage area, which causes the second area to be completely occupied, thereby making the data storage device unable to process newly received data. The write command cannot release the resources of the second storage area, causing resource deadlock. In order to solve the foregoing problem, the data storage device includes a pending write command in at least one currently received write command (the pending write command carries an identifier of the target data, and the target data carried in the target data includes (The position information of the sub data in the target data does not match the position information in the first indication information), and when stored in the second storage area, the sub data carried in the write command to be stored is not stored Only the identifier of the target data and the position information of the sub-data in the target data are stored to reduce the resources occupied by storing write commands that cannot be processed immediately among the currently received at least one write command. To this end, in step S206, when the data storage device stores the pending write command in the second storage area, the identifier of the target data carried in the obtained pending write command may be specifically determined. And the position information of the sub-data in the target data is correspondingly stored in the second storage area.
由于所述数据存储设备将获取到的待处理写命令中携带的所述目标数据的标识以及所述目标数据的子数据在所述目标数据中的位置信息,对应存储到所述第二存储区域中,没有存储获取到的待处理写命令中携带的所述目标数据的子数据,可以实现命令与数据的分离,减少存储所述待处理写命令,对所述数据存储设备的存储资源(例如所述数据存储设备的双倍速率同步动态随机存储器(double data rate synchronous dynamic random access memory,DDR SDRAM(或DDR))资源)的占用,使得所述数据存储设备能够维持良好的性能,处理接收到的写命令,防止所述数据存储设备由于没有空闲资源导致无法处理接收到的写命令的情况发生。Because the data storage device stores the identifier of the target data carried in the obtained write command to be processed and the position information of the target data's sub-data in the target data, it is correspondingly stored in the second storage area. , The sub-data of the target data carried in the obtained write command to be processed is not stored, and the command and data can be separated, reducing the storage of the write command to be processed, and the storage resources of the data storage device (for example, The double-rate synchronous dynamic random access memory (DDR, dynamic random access, memory, DDR, SDRAM (or DDR)) resources of the data storage device are occupied, so that the data storage device can maintain good performance and process the received data. The write command prevents the data storage device from being unable to process the received write command due to lack of idle resources.
一个可能的实施方式中,与所述数据存储设备连接的主机在接收到所述数据发送设备发送的至少一条写命令时,可以将所述数据发送设备发送的至少一条写命令中携带的所述目标数据的子数据缓存到所述主机的内存中,并将所述数据发送设备发送的至少一条写命令中携带的所述目标数据的子数据的存储位置信息,通知给所述数据存储设备;或者,所述主机将所述数据发送设备发送的至少一条写命令中携带的所述目标数据的子数据缓存到所述主机的内存后,将所述数据发送设备发送的至少一条写命令中携带的所述目标数据中的子数据替换为所述目标数据的子数据的存储位置信息,将替换后的写命令发送给所述数据存储设备。In a possible implementation manner, when a host connected to the data storage device receives at least one write command sent by the data sending device, it may include the at least one write command sent by the data sending device. The sub data of the target data is cached in the memory of the host, and the data storage device is notified of the storage location information of the sub data of the target data carried in at least one write command sent by the data sending device; Alternatively, after the host buffers the sub-data of the target data carried in the at least one write command sent by the data sending device to the memory of the host, the host carries at least one write command sent by the data sending device. Replace the sub data in the target data with the storage location information of the sub data of the target data, and send the replaced write command to the data storage device.
因此,当所述数据存储设备确定当前接收到的至少一条写命令中存在携带所述目标数 据的标识、且携带的所述目标数据的子数据在所述目标数据中的位置信息与所述第一指示信息中的位置信息不匹配的待处理写命令时,即所述数据存储设备确定所述主机当前接收到的至少一条写命令中存在所述数据存储设备不能立即处理的、所述目标数据对应的写命令时,所述数据存储设备还可以将所述待处理写命令中携带的子数据的存储位置信息,存储到所述第二存储区域中,使得后续所述第二存储区域中存储的写命令中携带的位置信息与所述第一指示信息中包含的位置信息匹配时,所述数据存储设备再根据该写命令中携带的子数据的存储位置信息,获取对应的子数据进行存储。Therefore, when the data storage device determines that the currently received at least one write command contains an identifier carrying the target data, and the position information of the sub-data of the target data carried in the target data and the first When there is a pending write command whose location information in the indication information does not match, that is, the data storage device determines that at least one write command currently received by the host has the target data that the data storage device cannot process immediately. When the corresponding write command is issued, the data storage device may further store the storage location information of the sub-data carried in the pending write command into the second storage area, so that subsequent storage in the second storage area is performed. When the location information carried in the write command matches the location information contained in the first instruction information, the data storage device obtains the corresponding sub data for storage according to the storage location information of the sub data carried in the write command. .
以所述数据存储设备为SSD为例,所述SSD存储的第一指示信息中包含所述目标数据的标识ID0以及待存储的下一个所述目标数据的子数据在所述目标数据中的位置信息,所述第一指示信息中包含的位置信息用所述数据存储设备待存储的下一个子所述目标数据的首个字节相对于所述目标数据的首个字节的偏移量表示,且当前所述第一指示信息中包含的位置信息为偏移量curofffset0,所述SSD接收到的所述目标数据对应的写命令中携带的位置信息用该写命令中携带的所述目标数据的子数据的首个字节相对于所述目标数据的首个字节的偏移量表示,所述SSD中的存储介质为DDR,与所述SSD连接的主机在接收到写命令时会将该写命令中携带的子数据,缓存到自身的内存中。如图3所示,所述SSD处理接收到的写命令的流程如下:Taking the data storage device as an SSD, the first indication information stored in the SSD includes the identification ID0 of the target data and the position of the sub-data of the next target data to be stored in the target data. Information, the position information contained in the first indication information is represented by an offset of the first byte of the next sub target data to be stored by the data storage device relative to the first byte of the target data And the position information contained in the first indication information is an offset curofffset0, and the position information carried in a write command corresponding to the target data received by the SSD uses the target data carried in the write command The offset of the first byte of the sub-data relative to the first byte of the target data indicates that the storage medium in the SSD is DDR, and the host connected to the SSD will The sub-data carried in the write command is cached in its own memory. As shown in FIG. 3, the process of the SSD processing the received write command is as follows:
(1)所述SSD首先从所述SSD连接的主机获取到写命令1,其中,所述写命令1中携带所述目标数据的标识ID0、所述目标数据的子数据buff1以及所述子数据buff1的首个字节相对于所述目标数据的首个字节的偏移量offset1。由于所述第一指示信息中的偏移量curofffset0与所述写命令1中的偏移量offset1不匹配,即所述写命令1为所述待处理写命令,所述SSD为所述写命令1在DDR中分配用于存储命令信息的存储空间,将所述写命令1中携带的所述目标数据的标识ID0、所述偏移量offset1以及所述子数据buff1的存储位置信息存储到分配的存储空间中;(2)接着,所述SSD接收到写命令2,其中,所述写命令2中携带所述目标数据的标识ID0、所述目标数据的子数据buff2以及所述子数据buff2的首个字节相对于所述目标数据的首个字节的偏移量offset2。由于所述第一指示信息中的偏移量curofffset0与所述写命令2中的偏移量offset2不匹配,即所述写命令2为所述待处理写命令,所述SSD为所述命令2在DDR中分配用于存储命令信息的存储空间,将所述写命令2中所述目标数据的标识ID0所述偏移量offset2以及所述子数据buff2的存储位置信息存储到分配的存储空间中,与所述写命令1中携带的所述目标数据的标识ID0以及所述偏移量offset1组成队列PendList0;(3)所述SSD接收到写命令0,其中,所述写命令0中携带所述目标数据的标识ID0、所述目标数据的子数据buff0以及所述子数据buff0的首个字节相对于所述目标数据的首个字节的偏移量offset0。由于所述第一指示信息中的偏移量curofffset0与所述写命令0中的偏移量offset0匹配,即所述写命令0为所述目标写命令,所述SSD在DDR中分配用于存储数据的存储空间,并将所述写命令0中携带的子数据buff0存储到分配的存储空间,将所述第一指示信息中的偏移量更新为curofffset1,所述curofffset1标识所述目标数的第二个子数据buff1在所述目标数据中的位置信息,并根据更新后的所述第一指示信息中的偏移量,与所述队列PendList0中的写命令进行匹配,为匹配成功的写命令分配用于存储数据的存储空间,完成数据存储,以此类推,最终将所述第一指示信息中的偏移量更新为curofffset3,所述curofffset3标识所述目标数的第四个子数据buff3在所述目标数据中的位置信息。(1) The SSD first obtains a write command 1 from a host connected to the SSD, wherein the write command 1 carries an identification ID0 of the target data, a subdata buff1 of the target data, and the subdata. The offset of the first byte of buff1 from the first byte of the target data is offset1. Because the offset curofffset0 in the first instruction information does not match the offset offset1 in the write command 1, that is, the write command 1 is the pending write command, and the SSD is the write command 1 Allocate a storage space for storing command information in the DDR, and store the storage location information of the target data identifier ID0, the offset offset1, and the sub-data buff1 carried in the write command 1 to the allocation. (2) Next, the SSD receives a write command 2, wherein the write command 2 carries the identification ID0 of the target data, the subdata buff2 of the target data, and the subdata buff2. The offset of the first byte of the relative to the first byte of the target data is offset2. Because the offset curofffset0 in the first instruction information does not match the offset offset2 in the write command 2, that is, the write command 2 is the pending write command, and the SSD is the command 2 Allocate a storage space for storing command information in the DDR, and store the storage location information of the offset ID2, the offset 2 and the subdata buff2 of the target data in the write command 2 into the allocated storage space. , Forming a queue PendList0 with the identifier ID0 of the target data and the offset offset1 carried in the write command 1; (3) the SSD receives the write command 0, wherein the write command 0 carries all The identifier ID0 of the target data, the subdata buff0 of the target data, and the offset 0 of the first byte of the subdata buff0 relative to the first byte of the target data are offset0. Because the offset curofffset0 in the first instruction information matches the offset offset0 in the write command 0, that is, the write command 0 is the target write command, and the SSD is allocated in the DDR for storage. Data storage space, and stores the sub-data buff0 carried in the write command 0 to the allocated storage space, and updates the offset in the first instruction information to curofffset1, where the curofffset1 identifies the target number of The position information of the second sub-data buff1 in the target data, and according to the updated offset in the first instruction information, is matched with the write command in the queue PendList0, and the write command is a successful match Allocate storage space for storing data, complete data storage, and so on, and finally update the offset in the first instruction information to curofffset3, where curofffset3 identifies the fourth sub-data buff3 of the target number in all locations The position information in the target data is described.
一个可能的实施方式中,所述数据存储设备为固态存储硬盘(solid state drives,SSD),SSD具有数据存储速度快、延时低以及稳定性强等优点。SSD通常与主机连接,通过自身连接的主机获取数据发送设备发送的写命令,以及向所述数据发送设备所述第二指示信息。In a possible implementation manner, the data storage device is a solid state storage (SSD), and the SSD has the advantages of fast data storage speed, low latency, and strong stability. The SSD is usually connected to the host, and obtains the write command sent by the data sending device through the host connected to the SSD, and the second instruction information to the data sending device.
在本申请实施例中,所述数据发送装置能够根据当前的网络状态,向数据存储设备连接的主机或者数据存储设备并行发送多条写命令,使得数据存储设备每次能够接收数据发送设备发送的多条写命令,并根据接收到的写命令中携带的子数据在所述目标数据中的位置信息,确定该写命令中携带的子数据在所述目标数据中的位置,使得所述数据存储设备在所述数据发送设备发送的写命令没有按照所述数据发送设备发送的写命令中携带的子数据在所述目标数据中的顺序到达所述数据存储设备的情况下,也能够根据所述数据发送设备发送的写命令中携带的位置信息,确定所述数据发送设备发送的写命令中携带的子数据在所述目标数据中的位置,正确、完整地存储所述目标数据,可以减少所述目标数据整体在网络中传输的时间,提高所述目标数据的存储效率以及存储准确性。In the embodiment of the present application, the data sending device can send multiple write commands in parallel to the host or data storage device connected to the data storage device according to the current network status, so that the data storage device can receive the data sent by the data sending device each time. Multiple write commands, and determining the position of the sub data carried in the write command in the target data according to the position information of the sub data carried in the received write command in the target data, so that the data is stored In a case where the write command sent by the data sending device does not reach the data storage device in the order of the sub data carried in the write command sent by the data sending device in the target data, the device can also The location information carried in the write command sent by the data sending device, determining the position of the sub data carried in the write command sent by the data sending device in the target data, and storing the target data correctly and completely can reduce the The time that the target data is transmitted on the network as a whole, and the storage efficiency of the target data is improved. Storage and accuracy.
另外,由于所述数据存储设备处理写命令的速度远大于写命令在网络中传输的速度,因此所述数据存储设备将所述待处理写命令,即当前接收到的至少一条写命令中携带所述目标数据的标识、且携带的子数据在所述目标数据中的位置信息与所述第一指示信息中的位置信息不匹配的写命令,存储到所述第二存储区域中,使得所述数据存储设备在所述第一指示信息包含的位置信息与所述第二存储区域中存储的写命令中携带的位置信息匹配时,能够及时处理该写命令,不需要所述数据发送设备重新发送该写命令,可以进一步提高所述目标数据的存储效率。In addition, because the data storage device processes write commands at a rate much faster than the speed at which the write commands are transmitted over the network, the data storage device carries the pending write command, that is, at least one write command currently received, with the The write command that identifies the target data and carries positional information of the sub-data in the target data that does not match the positional information in the first indication information is stored in the second storage area, so that the write command The data storage device can process the write command in time when the location information contained in the first instruction information matches the location information carried in the write command stored in the second storage area, without the data sending device needing to resend The write command can further improve the storage efficiency of the target data.
下面通过一个具体实施例对本申请提供的数据存储方法进行详细的说明。其中,所述数据存储设备以SSD为例,所述数据发送设备以服务器为例,所述数据发送设备发送的写命令以追加写命令为例,所述服务器发送的待存储目标数据包括7个子数据,依次为buff0、buff1、buff2…,buff6,所述数据存储设备存储的第一指示信息中包含的待存储的下一个所述目标数据的子数据在所述目标数据中的位置信息,用待存储的下一个所述目标数据的子数据的首个字节相对于所述目标数据的首个字节的偏移量表示,所述服务器发送的追加写命令中携带的所述目标数据的一个子数据在所述目标数据中的位置信息,用该子数据的首个字节相对于所述目标数据的首个字节的偏移量表示。The following describes the data storage method provided in this application in detail through a specific embodiment. The data storage device takes an SSD as an example, the data sending device takes a server as an example, and the write command sent by the data sending device takes an additional write command as an example. The target data to be stored sent by the server includes 7 sub-nodes. The data is sequentially buff0, buff1, buff2, ..., buff6. The position information of the subdata of the next target data to be stored included in the first instruction information stored in the data storage device is used in the target data. The offset of the first byte of the sub-data of the next target data to be stored relative to the first byte of the target data indicates that the target data carried in the additional write command sent by the server Position information of a sub data in the target data is represented by an offset of a first byte of the sub data with respect to a first byte of the target data.
如图4所示,所述服务器将待存储的目标数据存储到所述SSD的过程主要包括以下步骤:As shown in FIG. 4, the process in which the server stores target data to be stored in the SSD mainly includes the following steps:
S401:所述服务器根据当前的网络状态,向所述SSD连接的主机并行发送追加写命令0,追加写命令1,追加写命令2以及追加写命令3。S401: The server sends an additional write command 0, an additional write command 1, an additional write command 2 and an additional write command 3 to the host connected to the SSD in parallel according to the current network status.
其中,所述追加写命令0中携带所述目标数据的标识ID0、所述目标数据的第一个子数据buff0以及所述第一子数据的首个字节相对于所述目标数据的首个字节的偏移量offset0;所述追加写命令1中携带所述目标数据的标识ID0、所述目标数据的第二个子数据buff1以及所述第二子数据的首个字节相对于所述目标数据的首个字节的偏移量offset1;所述追加写命令2中携带所述目标数据的标识ID0、所述目标数据的第三个子数据buff2以及所述第三子数据的首个字节相对于所述目标数据的首个字节的偏移量offset2;所述追加写命令3中携带所述目标数据的标识ID0、所述目标数据的第四个子数据buff3以及所述第四子数据的首个字节相对于所述目标数据的首个字节的偏移量offset3。Wherein, the additional write command 0 carries the identification ID0 of the target data, the first sub-data buff0 of the target data, and the first byte of the first sub-data relative to the first of the target data Byte offset offset0; the additional write command 1 carries the identification ID0 of the target data, the second sub-data buff1 of the target data, and the first byte of the second sub-data relative to the Offset1 of the first byte of the target data; the additional write command 2 carries the identification ID0 of the target data, the third sub-data buff2 of the target data, and the first word of the third sub-data The offset offset2 of the section from the first byte of the target data; the additional write command 3 carries the identification ID0 of the target data, the fourth sub-data buff3 of the target data, and the fourth sub-data The offset of the first byte of data from the first byte of the target data is offset3.
相应地,所述SSD通过所述主机获取所述服务器发送的追加写命令0,追加写命令1,追加写命令2以及追加写命令3。Correspondingly, the SSD obtains the additional write command 0, the additional write command 1, the additional write command 2 and the additional write command 3 sent by the server through the host.
具体地,所述服务器在向所述SSD连接的主机发送上述四个追加写命令之前,将所述目标数据划分为多个子数据,并按照所述多个子数据在所述目标数据中的排序,为每个子数据分配偏移量。Specifically, before sending the four additional write commands to the SSD-connected host, the server divides the target data into multiple sub-data and sorts the multiple sub-data in the target data, Assign an offset to each subdata.
S402:所述SSD首先接收到所述追加写命令2和所述追加写命令3,生成第一指示信息,并将所述第一指示信息存储到第一存储区域。其中,所述第一指示信息包含所述目标数据的标识ID0以及待存储的所述目标数据的第一个子数据buff0的首个字节相对于所述目标数据的首个字节的偏移量curoffset0。S402: The SSD first receives the additional write command 2 and the additional write command 3, generates first instruction information, and stores the first instruction information in a first storage area. The first indication information includes an identifier ID0 of the target data and an offset of a first byte of a first sub-data buff0 of the target data from the first byte of the target data to be stored.量 curoffset0.
S403:所述SSD确定所述第一指示信息中包含的curoffset0与所述追加写命令2中携带的offset2以及所述追加写命令3中携带的offset3均不匹配,即所述追加写命令2以及所述追加写命令3为所述待处理写命令,将所述追加写命令2和所述追加写命令3存储到第二存储区域中所述目标数据对应的写命令缓存队列pendlist0中。S403: The SSD determines that neither curoffset0 included in the first instruction information does not match offset2 carried in the additional write command 2 and offset3 carried in the additional write command 3, that is, the additional write command 2 and The additional write command 3 is the pending write command, and the additional write command 2 and the additional write command 3 are stored in a write command buffer queue pendlist0 corresponding to the target data in the second storage area.
其中,所述写命令缓存队列pendlist0中的写命令按照该写命令中携带的偏移量从小到大的顺序排列,即所述追加写命令2排在所述追加写命令3之前。The write commands in the write command buffer queue pendlist0 are arranged in ascending order from the offset carried in the write command, that is, the additional write command 2 is arranged before the additional write command 3.
S404:所述SSD接收到所述追加写命令0,确定所述第一指示信息中包含的curoffset0与所述追加写命令0中携带的offset0匹配,即所述追加写命令0为所述目标写命令,将所述追加写命令0中携带的所述目标数据的第一个子数据buff0,存储到所述目标数据对应的存储区域。S404: The SSD receives the additional write command 0, and determines that curoffset0 included in the first instruction information matches the offset0 carried in the additional write command 0, that is, the additional write command 0 is the target write. A command to store the first sub data buff0 of the target data carried in the append write command 0 to a storage area corresponding to the target data.
S405:所述SSD向所述服务器发送用于指示所述目标数据的第一子数据buff0存储完成的第二指示信息。S405: The SSD sends to the server second instruction information indicating that the first sub-data buff0 of the target data has been stored.
S406:所述SSD将所述第一指示信息中包含的偏移量更新为curoffset1,将更新后的所述第一指示信息存储到所述第一存储区域,并确定所述写命令缓存队列pendlist0中的首个写命令(即所述追加写命令2)中携带的偏移量offset2与更新后的所述第一指示信息中包含的偏移量curoffset1不匹配,等待接收所述服务器发送的下一个追加写命令。S406: The SSD updates the offset included in the first instruction information to curoffset1, stores the updated first instruction information to the first storage area, and determines the write command cache queue pendlist0. The offset offset2 carried in the first write command (that is, the additional write command 2) does not match the offset curoffset1 included in the updated first instruction information, and is waiting to receive the next sent from the server. An append write command.
其中,更新后的所述第一指示信息中包含的偏移量curoffset1,表示所述目标子数据的第二个子数据buff1在所述目标子数据中的位置信息。Wherein, the offset curoffset1 included in the updated first indication information indicates position information of the second subdata buff1 of the target subdata in the target subdata.
S407:所述SSD接收到所述追加写命令1,确定所述第一指示信息中包含的curoffset1与所述追加写命令1中携带的offset1匹配,即所述追加写命令1为所述目标写命令,将所述追加写命令1中携带的所述目标数据的第二个子数据buff1,存储到所述目标数据对应的存储区域。S407: The SSD receives the additional write command 1, and determines that curoffset1 included in the first instruction information matches the offset1 carried in the additional write command 1, that is, the additional write command 1 is the target write. A command to store the second sub-data buff1 of the target data carried in the additional write command 1 to a storage area corresponding to the target data.
S408:所述SSD向所述服务器发送用于指示所述目标数据的第二子数据buff1存储完成的第二指示信息。S408: The SSD sends second indication information indicating that the second sub-data buff1 of the target data is stored to the server.
S409:所述SSD将所述第一指示信息中包含的偏移量更新为curoffset2,将更新后的所述第一指示信息存储到所述第一存储区域,并确定所述写命令缓存队列pendlist0中的首个写命令(即所述追加写命令2)中携带的偏移量offset2与更新后的所述第一指示信息中包含的偏移量curoffset2匹配,即所述追加写命令2为所述目标写命令,将所述追加写命令2中携带的所述目标数据的第三个子数据buff2,存储到所述目标数据对应的存储区域。S409: The SSD updates the offset included in the first instruction information to curoffset2, stores the updated first instruction information in the first storage area, and determines the write command cache queue pendlist0. The offset offset2 carried in the first write command (that is, the additional write command 2) in the first write command matches the offset curoffset2 included in the updated first instruction information, that is, the additional write command 2 is The target write command stores the third sub-data buff2 of the target data carried in the additional write command 2 to a storage area corresponding to the target data.
其中,更新后的所述第一指示信息中包含的偏移量curoffset2,表示所述目标子数据的第三个子数据buff2在所述目标子数据中的位置信息。Wherein, the offset curoffset2 included in the updated first indication information indicates position information of the third sub-data buff2 of the target sub-data in the target sub-data.
可选地,所述SSD将所述追加写命令2中携带的所述目标数据的第三个子数据buff2,存储到所述目标数据对应的存储区域之后,将所述追加写命令2从所述写命令缓存队列pendlist0中删除。Optionally, after the SSD stores the third sub-data buff2 of the target data carried in the additional write command 2 to a storage area corresponding to the target data, the additional write command 2 is removed from the target data. The write command is deleted from the cache queue pendlist0.
S410:所述SSD向所述服务器发送用于指示所述目标数据的第三子数据buff2存储完成的第二指示信息。S410: The SSD sends second indication information indicating that the third sub-data buff2 of the target data is stored to the server.
S411:所述SSD将所述第一指示信息中包含的偏移量更新为curoffset3,将更新后的所述第一指示信息存储到所述第一存储区域,并确定所述写命令缓存队列pendlist0中的首个写命令(即所述追加写命令3)中携带的偏移量offset3与更新后的所述第一指示信息中包含的偏移量curoffset3匹配,将所述追加写命令3中携带的所述目标数据的第四个子数据buff3,存储到所述目标数据对应的存储区域,并将所述第一指示信息中包含的偏移量更新为curoffset4。S411: The SSD updates the offset included in the first instruction information to curoffset3, stores the updated first instruction information in the first storage area, and determines the write command cache queue pendlist0. The offset offset3 carried in the first write command (that is, the additional write command 3) matches the offset curoffset3 included in the updated first instruction information, and the additional write command 3 is carried The fourth sub-data buff3 of the target data is stored in a storage area corresponding to the target data, and the offset included in the first instruction information is updated to curoffset4.
其中,更新后的所述第一指示信息中包含的偏移量curoffset3,表示所述目标子数据的第四个子数据buff3在所述目标子数据中的位置信息。Wherein, the offset curoffset3 included in the updated first indication information represents position information of the fourth subdata buff3 of the target subdata in the target subdata.
S412:所述SSD向所述服务器发送用于指示所述目标数据的第四子数据buff3存储完成的第二指示信息。S412: The SSD sends to the server second instruction information indicating that the fourth sub-data buff3 of the target data has been stored.
S413:所述服务器首先接收到用于指示所述目标数据的第三子数据buff2存储完成的第二指示信息,确定所述目标数据的第一子数据buff0-第三子数据buff2均存储完成时,向所述SSD连续追加写命令4,追加写命令5以及追加写命令6。S413: The server first receives the second instruction information indicating that the third sub-data buff2 of the target data is stored, and determines that when the first sub-data buff0-the third sub-data buff2 of the target data are all stored, , Continuously adding a write command 4, a write command 5 and a write command 6 to the SSD.
其中,所述追加写命令4中携带所述目标数据的标识ID0、所述目标数据的第五个子数据buff4以及所述第五子数据的首个字节相对于所述目标数据的首个字节的偏移量offset4;所述追加写命令5中携带所述目标数据的标识ID0、所述目标数据的第六个子数据buff5以及所述第六子数据的首个字节相对于所述目标数据的首个字节的偏移量offset5;所述追加写命令6中携带所述目标数据的标识ID0、所述目标数据的第七个子数据buff6以及所述第七子数据的首个字节相对于所述目标数据的首个字节的偏移量offset6。Wherein, the additional write command 4 carries the identification ID0 of the target data, the fifth sub-data buff4 of the target data, and the first byte of the fifth sub-data relative to the first word of the target data Offset 4 of the section; the additional write command 5 carries the identification ID0 of the target data, the sixth sub-data buff5 of the target data, and the first byte of the sixth sub-data relative to the target Offset 5 of the first byte of data; the additional write command 6 carries the identification ID0 of the target data, the seventh sub-data buff6 of the target data, and the first byte of the seventh sub-data An offset of offset6 from the first byte of the target data.
所述SSD接收到所述追加写命令4,所述追加写命令5以及所述追加写命令6后,处理所述追加写命令4,所述追加写命令5以及所述追加写命令6中任意一个命令的方法,与处理所述追加写命令0-所述追加写命令3的方法相同,此处不再赘述,参见上述步骤哦S402-S411的相关描述。After the SSD receives the additional write command 4, the additional write command 5 and the additional write command 6, the SSD processes the additional write command 4, any one of the additional write command 5 and the additional write command 6. The method of one command is the same as the method of processing the additional write command 0-the additional write command 3, which will not be repeated here. For details about the steps S402-S411 described above.
基于以上实施例,本申请实施例还提供了一种数据存储装置,所述数据存储装置用于实现如图2至图4所示的数据存储方法。参阅图5所示,所述数据存储装置500中包括:通信单元501、处理单元502、命令存储单元503以及数据存储单元504。其中,.Based on the above embodiments, an embodiment of the present application further provides a data storage device, where the data storage device is configured to implement the data storage method shown in FIG. 2 to FIG. 4. Referring to FIG. 5, the data storage device 500 includes: a communication unit 501, a processing unit 502, a command storage unit 503, and a data storage unit 504. among them,.
所述通信单元501,用于接收至少一个写命令;The communication unit 501 is configured to receive at least one write command;
所述处理单元502,用于从第一存储区域获取第一指示信息,其中,所述第一指示信息为所述数据存储装置存储完成第一子数据后生成的,所述第一指示信息包含目标数据的标识以及第二子数据在所述目标数据中的位置信息,所述第一子数据和第二子数据为所述目标数据包括的多个子数据中的两个子数据、且所述第二子数据是所述第一子数据相邻的下一个子数据;根据获得的第一指示信息,从所述通信单元501当前接收到的至少一条写命令以及所述第二存储区域中存储的至少一条写命令中,获得目标写命令;其中,所述目标写命令中携带所述目标数据的标识、第三子数据以及所述第三子数据在所述目标数据中的位置信息,且所述目标写命令中携带的位置信息与所述第一指示信息中的位置信息匹 配;以及,从所述通信单元501当前接收到的至少一条写命令中获取待处理写命令,其中,所述待处理写命令为当前接收到的至少一条写命令中除所述目标写命令之外、且携带所述目标数据的标识的写命令;The processing unit 502 is configured to obtain first instruction information from a first storage area, where the first instruction information is generated after the data storage device stores the first sub-data, and the first instruction information includes The identification of the target data and the position information of the second sub-data in the target data, the first sub-data and the second sub-data are two sub-data among a plurality of sub-data included in the target data, and the first The two sub-data are the next sub-data adjacent to the first sub-data; and according to the obtained first instruction information, at least one write command currently received from the communication unit 501 and stored in the second storage area In at least one write command, a target write command is obtained; wherein the target write command carries an identifier of the target data, a third sub-data, and position information of the third sub-data in the target data, and all The location information carried in the target write command matches the location information in the first indication information; and at least one write command currently received from the communication unit 501 Obtaining a write command to be processed, wherein the write command to be processed is a write command other than the target write command and carrying an identifier of the target data among at least one write command currently received;
所述命令存储单元503,用于将处理单元502获取的待处理写命令存储到所述第二存储区域中;The command storage unit 503 is configured to store a write command to be processed obtained by the processing unit 502 in the second storage area;
所述数据存储单元504,用于将所述目标写命令中携带的第三子数据,存储到所述目标数据的标识对应的存储区域中,并更新所述第一指示信息中的位置信息,将更新后的所述第一指示信息存储到所述第一存储区域;更新后的所述第一指示信息中的位置信息为第四子数据在所述目标数据中的位置信息,在所述目标数据包括的多个子数据中,所述第四子数据是所述第三子数据相邻的下一子数据;The data storage unit 504 is configured to store the third sub-data carried in the target write command into a storage area corresponding to the identifier of the target data, and update the position information in the first instruction information, Storing the updated first instruction information in the first storage area; the updated position information in the first instruction information is position information of fourth subdata in the target data, and Among the plurality of sub data included in the target data, the fourth sub data is a next sub data adjacent to the third sub data;
一个可能的实施方式中,针对所述第二设存储区域中存储的任意一条写命令,该写命令在所述第二存储区域中的存储顺序是根据该写命令中携带的位置信息确定的,该写命令中携带的位置信息用于标识该写命令中携带的子数据在所述目标数据中的位置。In a possible implementation manner, for any one write command stored in the second storage area, a storage order of the write command in the second storage area is determined according to position information carried in the write command. The position information carried in the write command is used to identify the position of the sub-data carried in the write command in the target data.
一个可能的实施方式中,所述通信单元501还用于:在数据存储单元504将所述处理单元502获得的目标写命令中携带的第三子数据,存储到所述目标数据的标识对应的存储区域中之后,通过自身连接的主机向数据发送设备发送第二指示信息,或者,直接向数据发送设备发送第二指示信息,所述第二指示信息用于指示所述目标写命令中携带的子数据已存储完成,所述数据发送设备为发送所述写命令的设备。In a possible implementation manner, the communication unit 501 is further configured to: store, in the data storage unit 504, the third sub-data carried in the target write command obtained by the processing unit 502 to a corresponding one of the identifiers of the target data. After being stored in the storage area, the host sending the second instruction information is sent to the data sending device through the host connected to the storage area, or the second instruction information is directly sent to the data sending device, and the second instruction information is used to indicate that the target write command carries the The sub data has been stored, and the data sending device is a device that sends the write command.
一个可能的实施方式中,所述命令存储单元503具体用于:将所述处理单元502获取到的待处理写命令中携带的所述目标数据的标识以及所述目标数据的子数据在所述目标数据中的位置信息,对应存储到所述第二存储区域中。In a possible implementation manner, the command storage unit 503 is specifically configured to: identify the target data identifier and the sub-data of the target data carried in the to-be-processed write command obtained by the processing unit 502 The position information in the target data is correspondingly stored in the second storage area.
一个可能的实施方式中,所述数据存储装置为固态存储硬盘SSD。In a possible implementation manner, the data storage device is a solid-state storage hard disk SSD.
本申请实施例提供了一种数据存储装置,所述数据存储装置每次能够接收数据发送设备发送的多条写命令,并根据接收到的写命令中携带的子数据在所述目标数据中的位置信息,确定该写命令中携带的子数据在所述目标数据中的位置,使得所述数据存储装置在所述数据发送设备发送的写命令没有按照所述数据发送设备发送的写命令中携带的子数据在所述目标数据中的顺序到达所述数据存储设备的情况下,也能够根据所述数据发送设备发送的写命令中携带的位置信息,确定所述数据发送设备发送的写命令中携带的子数据在所述目标数据中的位置,正确、完整地存储所述目标数据,可以减少所述目标数据整体在网络中传输的时间,提高所述目标数据的存储效率以及存储准确性。An embodiment of the present application provides a data storage device. The data storage device can receive multiple write commands sent by a data sending device each time, and according to the sub-data carried in the received write command in the target data. Location information to determine the position of the sub-data carried in the write command in the target data, so that the data storage device carries a write command sent by the data sending device that does not follow the write command sent by the data sending device In the case where the sub data of the target data arrives in the data storage device in the order, it can also be determined in the write command sent by the data sending device according to the location information carried in the write command sent by the data sending device. The position of the carried sub-data in the target data to correctly and completely store the target data can reduce the time for transmitting the target data as a whole in the network, and improve the storage efficiency and storage accuracy of the target data.
另外,由于所述数据存储装置处理写命令的速度远大于写命令在网络中传输的速度,因此所述数据存储装置将所述待处理写命令,即当前接收到的至少一条写命令中携带所述目标数据的标识、且携带的子数据在所述目标数据中的位置信息与所述第一指示信息中的位置信息不匹配的写命令,存储到所述第二存储区域中,使得所述数据存储装置在所述第一指示信息包含的位置信息与所述第二存储区域中存储的写命令中携带的位置信息匹配时,能够及时处理该写命令,不需要所述数据发送设备重新发送该写命令,可以进一步提高所述目标数据的存储效率。In addition, since the speed of processing the write command by the data storage device is much faster than the speed at which the write command is transmitted in the network, the data storage device carries the write command to be processed, that is, at least one write command currently received, with the The write command that identifies the target data and carries positional information of the sub-data in the target data that does not match the positional information in the first indication information is stored in the second storage area, so that the write command When the location information contained in the first instruction information matches the location information carried in a write command stored in the second storage area, the data storage device can process the write command in time, and does not require the data sending device to resend The write command can further improve the storage efficiency of the target data.
基于以上实施例,本申请实施例还提供了一种数据发送装置,所述数据发送装置用于实现如图2至图4所示的数据存储方法。参阅图6所示,所述数据发送装置600中包括:处理单元601和通信单元602。其中,Based on the above embodiments, an embodiment of the present application further provides a data sending device, where the data sending device is configured to implement the data storage method shown in FIG. 2 to FIG. 4. As shown in FIG. 6, the data sending device 600 includes a processing unit 601 and a communication unit 602. among them,
所述处理单元601,用于根据当前网络状态,确定能够并行发送的写命令数量N,N为正整数;以及,生成所述N个写命令;其中,每条写命令中携带待存储的目标数据的标识、子数据以及该子数据在所述目标数据中的位置信息,该子数据为所述数据发送装置将所述目标数据划分得到的多个子数据中的一个,且所述每条写命令中携带的子数据不同。The processing unit 601 is configured to determine the number of write commands N that can be sent in parallel according to the current network status, where N is a positive integer; and generate the N write commands; wherein each write command carries a target to be stored A data identifier, sub-data, and position information of the sub-data in the target data, the sub-data is one of a plurality of sub-data obtained by dividing the target data by the data sending device, and each of the writes The subdata carried in the command are different.
所述通信单元602,用于将所述处理单元601生成的N个写命令,并行发送给数据存储设备连接的主机或者数据存储设备。The communication unit 602 is configured to send the N write commands generated by the processing unit 601 to a host or a data storage device connected to the data storage device in parallel.
一个可能的实施方式中,所述通信单元602还用于:接收所述数据存储设备发送的指示信息,所述指示信息用于指示所述数据发送设备发送的写命令中携带的子数据已存储完成;以及,根据所述指示信息,向所述数据存储设备发送后续写命令,或通过所述主机向所述数据存储设备发送后续写命令。In a possible implementation manner, the communication unit 602 is further configured to: receive instruction information sent by the data storage device, where the instruction information is used to indicate that the sub data carried in the write command sent by the data sending device is stored Complete; and, send a subsequent write command to the data storage device according to the instruction information, or send a subsequent write command to the data storage device through the host.
本申请实施例提供了一种数据发送装置,所述数据发送装置能够根据当前的网络状态,向数据存储设备连接的主机或者数据存储设备并行发送多条写命令,其中,每条写命令中携带待存储的目标数据的标识、子数据以及该子数据在所述目标数据中的位置信息,该子数据为所述目标数据划分得到的多个子数据中的一个,使得所述数据存储设备能够根据接收到的写命令中携带的子数据在所述目标数据中的位置信息,确定该写命令中携带的子数据在所述目标数据中的位置,即使在网络状态较差,乱序接收到所述数据发送设备发送的写命令的情况下,也能正确、完整的存储所述目标数据,可以减少所述目标数据在网络中传输的时间,提高所述目标数据的存储效率以及存储准确性。。An embodiment of the present application provides a data sending device capable of sending multiple write commands to a host or data storage device connected to a data storage device in parallel according to a current network status, where each write command carries The identifier of the target data to be stored, the sub data, and the position information of the sub data in the target data, where the sub data is one of a plurality of sub data obtained by dividing the target data, so that the data storage device can The position information of the sub-data carried in the received write command in the target data is used to determine the position of the sub-data carried in the write command in the target data. Even if the network status is poor, all the In the case of the write command sent by the data sending device, the target data can also be stored correctly and completely, which can reduce the transmission time of the target data in the network, and improve the storage efficiency and storage accuracy of the target data. .
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。It should be noted that the division of the units in the embodiments of the present application is schematic, and is only a logical function division. In actual implementation, there may be another division manner. The functional units in the embodiments of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially a part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium , Including a number of instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The foregoing storage media include: various types of media that can store program code, such as a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.
基于以上实施例,本申请实施例还提供了一种数据存储设备,所述数据存储设备用于实现如图2所示的数据存储方法,具有如图5所示的数据存储设备500的功能。参阅图7所示,所述数据存储设备包括:通信接口701、控制器702以及存储器703。其中,所述通信接口701、所述控制器702以及所述存储器703之间相互连接。其中,Based on the above embodiments, an embodiment of the present application further provides a data storage device. The data storage device is configured to implement the data storage method shown in FIG. 2, and has the functions of the data storage device 500 shown in FIG. 5. As shown in FIG. 7, the data storage device includes: a communication interface 701, a controller 702, and a memory 703. The communication interface 701, the controller 702, and the memory 703 are connected to each other. among them,
所述通信接口701,用于接收至少一条写命令。The communication interface 701 is configured to receive at least one write command.
所述控制器702,用于从第一存储区域获取第一指示信息,其中,所述第一指示信息为所述数据存储设备存储完成第一子数据后生成的,所述第一指示信息包含目标数据的标识以及第二子数据在所述目标数据中的位置信息,所述第一子数据和第二子数据为所述目标数据包括的多个子数据中的两个子数据、且所述第二子数据是所述第一子数据相邻的下一个子数据;The controller 702 is configured to obtain first instruction information from a first storage area, where the first instruction information is generated after the data storage device stores first sub-data, and the first instruction information includes The identification of the target data and the position information of the second sub-data in the target data, the first sub-data and the second sub-data are two sub-data among a plurality of sub-data included in the target data, and the first The two sub data are the next sub data adjacent to the first sub data;
根据所述获取单元获得的第一指示信息,从当前接收到的至少一条写命令以及第二存储区域中存储的至少一条写命令中,获得目标写命令;其中,所述目标写命令中携带所述目标数据的标识、第三子数据以及所述第三子数据在所述目标数据中的位置信息,且所述目标写命令中携带的位置信息与所述第一指示信息中的位置信息匹配;Obtaining the target write command from at least one write command currently received and at least one write command stored in the second storage area according to the first instruction information obtained by the acquiring unit; wherein the target write command carries the The target data identifier, the third sub data, and the position information of the third sub data in the target data, and the position information carried in the target write command matches the position information in the first instruction information ;
以及,将所述目标写命令中携带的第三子数据,存储到所述存储器703中的所述目标数据的标识对应的存储区域中,并更新所述第一指示信息中的位置信息,将更新后的所述第一指示信息存储到所述第一存储区域;更新后的所述第一指示信息中的位置信息为第四子数据在所述目标数据中的位置信息,在所述目标数据包括的多个子数据中,所述第四子数据是所述第三子数据相邻的下一子数据;以及,将待处理写命令存储到所述第二存储区域中,其中,所述待处理写命令为当前接收到的至少一条写命令中除所述目标写命令之外、且携带所述目标数据的标识的写命令。And, the third sub-data carried in the target write command is stored in a storage area corresponding to the identifier of the target data in the memory 703, and the position information in the first instruction information is updated, and The updated first indication information is stored in the first storage area; the position information in the updated first indication information is position information of fourth subdata in the target data, and Among the plurality of sub-data included in the data, the fourth sub-data is a next sub-data adjacent to the third sub-data; and, a write command to be processed is stored in the second storage area, wherein the The pending write command is a write command other than the target write command and carrying an identifier of the target data among at least one write command currently received.
所述存储器703,用于所述目标写命令中携带的第三子数据。The memory 703 is used for the third sub-data carried in the target write command.
其中,所述存储器703可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory,也称闪存),硬盘(hard disk drive,HDD);所述存储器703还可以包括上述种类的存储器的组合。所述存储器703可以是一个存储器,也可以是多个存储器组成的存储器阵列,如图8所示,图8中以所述存储器阵列中存储器为闪存为例。The memory 703 may include non-volatile memory (non-volatile memory), such as flash memory (also called flash memory), and hard disk (hard disk drive). The memory 703 may further include the foregoing. A combination of kinds of memories. The memory 703 may be a memory or a memory array composed of multiple memories. As shown in FIG. 8, the memory in the memory array is a flash memory as an example.
所述控制器702可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。所述控制器702还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。The controller 702 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. The controller 702 may further include a hardware chip. The above hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
一个可能的实施方式中,针对所述第二存储区域中存储的任意一条写命令,该写命令在所述第二存储区域中的存储顺序是根据该写命令中携带的位置信息确定的,该写命令中携带的位置信息用于标识该写命令中携带的子数据在所述目标数据中的位置。In a possible implementation manner, for any one write command stored in the second storage area, a storage order of the write command in the second storage area is determined according to position information carried in the write command. The position information carried in the write command is used to identify the position of the sub-data carried in the write command in the target data.
一个可能的实施方式中,所述控制器702将所述目标写命令中携带的第三子数据,存储到所述存储器703中所述目标数据的标识对应的存储区域之后,所述通信接口701还用于:In a possible implementation manner, after the controller 702 stores the third sub data carried in the target write command to a storage area corresponding to the identifier of the target data in the memory 703, the communication interface 701 Also used for:
通过自身连接主机向数据发送设备发送第二指示信息,或者,直接向数据发送设备发送第二指示信息,所述第二指示信息用于指示所述目标写命令中携带的子数据已存储完成,所述数据发送设备为发送所述目标写命令的设备。Sending the second instruction information to the data sending device through the host connected to itself, or directly sending the second instruction information to the data sending device, where the second instruction information is used to indicate that the sub-data carried in the target write command has been stored, The data sending device is a device that sends the target write command.
一个可能的实施方式中,所述控制器702具体用于:从当前接收到的至少一条写命令中,获取所述待处理写命令;将获取到的待处理写命令中携带的所述目标数据的标识以及子数据在所述目标数据中的位置信息,对应存储到所述第二存储区域中。In a possible implementation manner, the controller 702 is specifically configured to: obtain the pending write command from at least one currently received write command; and acquire the target data carried in the obtained pending write command. The identifier and the position information of the sub-data in the target data are correspondingly stored in the second storage area.
一个可能的实施方式中,所述数据存储设备为固态存储硬盘SSD。In a possible implementation manner, the data storage device is a solid-state storage hard disk SSD.
本申请实施例提供了一种数据存储设备,所述数据存储设备每次能够接收数据发送设备发送的多条写命令,并根据接收到的写命令中携带的子数据在所述目标数据中的位置信息,确定该写命令中携带的子数据在所述目标数据中的位置,使得所述数据存储设备在所述数据发送设备发送的写命令没有按照所述数据发送设备发送的写命令中携带的子数据在所述目标数据中的顺序到达所述数据存储设备的情况下,也能够根据所述数据发送设备 发送的写命令中携带的位置信息,确定所述数据发送设备发送的写命令中携带的子数据在所述目标数据中的位置,正确、完整地存储所述目标数据,可以减少所述目标数据整体在网络中传输的时间,提高所述目标数据的存储效率以及存储准确性。An embodiment of the present application provides a data storage device. The data storage device can receive multiple write commands sent by a data sending device each time, and according to the sub-data carried in the received write command in the target data. Location information to determine the position of the sub-data carried in the write command in the target data, so that the data storage device does not carry the write command sent by the data sending device in accordance with the write command sent by the data sending device In the case where the sub data of the target data arrives in the data storage device in the order, it can also be determined in the write command sent by the data sending device according to the location information carried in the write command sent by the data sending device. The position of the carried sub-data in the target data to correctly and completely store the target data can reduce the time for transmitting the target data as a whole in the network, and improve the storage efficiency and storage accuracy of the target data.
另外,由于所述数据存储设备处理写命令的速度远大于写命令在网络中传输的速度,因此所述数据存储设备将所述待处理写命令,即当前接收到的至少一条写命令中携带所述目标数据的标识、且携带的子数据在所述目标数据中的位置信息与所述第一指示信息中的位置信息不匹配的写命令,存储到所述第二存储区域中,使得所述数据存储设备在所述第一指示信息包含的位置信息与所述第二存储区域中存储的写命令中携带的位置信息匹配时,能够及时处理该写命令,不需要所述数据发送设备重新发送该写命令,可以进一步提高所述目标数据的存储效率。In addition, because the data storage device processes write commands at a rate much faster than the speed at which the write commands are transmitted over the network, the data storage device carries the pending write command, that is, at least one write command currently received, with the The write command that identifies the target data and carries positional information of the sub-data in the target data that does not match the positional information in the first indication information is stored in the second storage area, so that the write command The data storage device can process the write command in time when the location information contained in the first instruction information matches the location information carried in the write command stored in the second storage area, without the data sending device needing to resend The write command can further improve the storage efficiency of the target data.
基于以上实施例,本申请实施例还提供了一种数据发送设备,所述数据发送设备用于实现如图2所示的数据存储方法,具有如图6所示的数据发送设备600的功能。参阅图9所示,所述数据存储设备900包括:存储器901、处理器902以及收发器903。其中,所述存储器901、所述处理器902以及所述收发器903之间相互连接。其中,Based on the above embodiments, an embodiment of the present application further provides a data sending device, which is used to implement the data storage method shown in FIG. 2 and has the functions of the data sending device 600 shown in FIG. 6. Referring to FIG. 9, the data storage device 900 includes: a memory 901, a processor 902, and a transceiver 903. The memory 901, the processor 902, and the transceiver 903 are connected to each other. among them,
所述存储器901,用于存储程序指令。The memory 901 is configured to store a program instruction.
所述处理器902,用于调用所述存储器901中存储的程序指令,执行:根据当前网络状态,确定能够并行发送的写命令数量N,N为正整数;The processor 902 is configured to call a program instruction stored in the memory 901 and execute: determine the number of write commands N that can be sent in parallel according to the current network status, where N is a positive integer;
所述数据发送设备生成所述N个写命令;其中,每条写命令中携带待存储的目标数据的标识、子数据以及该子数据在所述目标数据中的位置信息,该子数据为所述数据发送设备将所述目标数据划分得到的多个子数据中的一个,且所述每条写命令中携带的子数据不同。The data sending device generates the N write commands; wherein each write command carries an identifier of the target data to be stored, sub data, and position information of the sub data in the target data, and the sub data is The data sending device divides the target data into one of a plurality of sub-data, and the sub-data carried in each write command is different.
所述收发器903,用于将所述处理器902生成的N个写命令,并行发送给数据存储设备连接的主机或者数据存储设备。The transceiver 903 is configured to send the N write commands generated by the processor 902 to the host or the data storage device connected to the data storage device in parallel.
其中,其中,所述存储器901可以包括易失性存储器,例如RAM;所述存储器901也可以包括非易失性存储器,例如快闪存储器,HDD或SSD;所述存储器901还可以包括上述种类的存储器的组合。Wherein, the memory 901 may include volatile memory, such as RAM; the memory 901 may also include non-volatile memory, such as flash memory, HDD or SSD; the memory 901 may further include the above-mentioned types of Memory combination.
所述处理器902可以是CPU,NP或者CPU和NP的组合。所述处理器902还可以进一步包括硬件芯片。上述硬件芯片可以是ASIC,PLD或其组合。上述PLD可以是CPLD,FPGA,GAL或其任意组合。The processor 902 may be a CPU, an NP, or a combination of a CPU and an NP. The processor 902 may further include a hardware chip. The aforementioned hardware chip may be an ASIC, a PLD, or a combination thereof. The PLD may be a CPLD, an FPGA, a GAL, or any combination thereof.
一种可能的实施方式中,所述收发器903还用于:接收所述数据存储设备发送的指示信息,所述指示信息用于指示所述数据发送设备发送的写命令中携带的子数据已存储完成;In a possible implementation manner, the transceiver 903 is further configured to: receive instruction information sent by the data storage device, where the instruction information is used to indicate that the sub data carried in the write command sent by the data sending device has been Storage completed
所述处理器902,还用于根据所述指示信息,控制所述收发器903向所述数据存储设备发送后续写命令,或通过所述主机向所述数据存储设备发送后续写命令。The processor 902 is further configured to control the transceiver 903 to send a subsequent write command to the data storage device or send a subsequent write command to the data storage device through the host according to the instruction information.
本申请实施例提供了一种数据发送设备,所述数据发送设备能够根据当前的网络状态,向数据存储设备连接的主机或者数据存储设备并行发送多条写命令,其中,每条写命令中携带待存储的目标数据的标识、子数据以及该子数据在所述目标数据中的位置信息,该子数据为将所述目标数据划分得到的多个子数据中的一个,使得所述数据存储设备能够根据接收到的写命令中携带的子数据在所述目标数据中的位置信息,确定该写命令中携带的子数据在所述目标数据中的位置,即使在网络状态较差,乱序接收到所述数据发送设备 发送的写命令的情况下,也能正确、完整的存储所述目标数据,可以减少所述目标数据在网络中传输的时间,提高所述目标数据的存储效率以及存储准确性。An embodiment of the present application provides a data sending device. The data sending device can send multiple write commands to a host or data storage device connected to the data storage device in parallel according to the current network status, where each write command carries The identifier of the target data to be stored, sub-data, and position information of the sub-data in the target data, the sub-data is one of a plurality of sub-data obtained by dividing the target data, so that the data storage device can The position of the sub-data carried in the write command in the target data is determined according to the position information of the sub-data carried in the received write command in the target data. Even if the network status is poor, the data is received out of order. In the case of the write command sent by the data sending device, the target data can also be stored correctly and completely, which can reduce the transmission time of the target data in the network, and improve the storage efficiency and storage accuracy of the target data. .
由于所述数据存储设备以及所述数据发送设备用于实现图2至图4所示的数据存储方法,并且所述数据存储设备以及所述数据发送设备涉及的相关技术特征已经在上文结合附图,进行了详细的描述,因此,此处不再赘述,可参见上述方法实施例部分的相关描述。Because the data storage device and the data sending device are used to implement the data storage method shown in FIG. 2 to FIG. 4, and the related technical features involved in the data storage device and the data sending device have been attached in combination with the foregoing. The figure is described in detail, so it will not be repeated here, please refer to the relevant description in the above method embodiment.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as a method, a system, or a computer program product. Therefore, this application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and combinations of processes and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, so that the instructions generated by the processor of the computer or other programmable data processing device are used to generate instructions Means for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a specific manner such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, the instructions The device implements the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various modifications and variations to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. In this way, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these changes and variations.

Claims (17)

  1. 一种数据存储方法,其特征在于,包括:A data storage method, comprising:
    数据存储设备从第一存储区域获取第一指示信息,其中,所述第一指示信息为所述数据存储设备存储完成第一子数据后生成的,所述第一指示信息包含目标数据的标识以及第二子数据在所述目标数据中的位置信息,所述第一子数据和第二子数据为所述目标数据包括的多个子数据中的两个子数据、且所述第二子数据是所述第一子数据相邻的下一个子数据;The data storage device obtains first instruction information from a first storage area, where the first instruction information is generated after the data storage device stores the first sub-data, and the first instruction information includes an identifier of the target data and Position information of a second sub-data in the target data, the first sub-data and the second sub-data are two sub-data among a plurality of sub-data included in the target data, and the second sub-data is all The next sub-data adjacent to the first sub-data;
    所述数据存储设备根据获得的第一指示信息,从当前接收到的至少一条写命令中以及第二存储区域中存储的至少一条写命令中,获得目标写命令;其中,所述目标写命令中携带所述目标数据的标识、第三子数据以及所述第三子数据在所述目标数据中的位置信息,且所述目标写命令中携带的位置信息与所述第一指示信息中的位置信息匹配,所述第三子数据是所述目标数据包括的多个子数据中的一个子数据;The data storage device obtains a target write command from at least one write command currently received and at least one write command stored in a second storage area according to the obtained first instruction information; wherein, in the target write command, Carry the identifier of the target data, the third sub-data, and position information of the third sub-data in the target data, and the position information carried in the target write command and the position in the first instruction information Information matching, the third sub-data is one of a plurality of sub-data included in the target data;
    所述数据存储设备将待处理写命令存储到所述第二存储区域中,其中,所述待处理写命令为当前接收到的至少一条写命令中除所述目标写命令之外、且携带所述目标数据的标识的写命令;The data storage device stores a write command to be processed in the second storage area, where the write command to be processed is at least one write command currently received except for the target write command, and carries the target write command. The write command of the identification of the target data;
    所述数据存储设备将所述目标写命令中携带的第三子数据,存储到所述目标数据的标识对应的存储区域中,并更新所述第一指示信息中的位置信息,将更新后的所述第一指示信息存储到所述第一存储区域;更新后的所述第一指示信息中的位置信息为第四子数据在所述目标数据中的位置信息,在所述目标数据包括的多个子数据中,所述第四子数据是所述第三子数据相邻的下一子数据。The data storage device stores the third sub-data carried in the target write command into a storage area corresponding to an identifier of the target data, and updates the position information in the first instruction information, and updates the updated information. The first indication information is stored in the first storage area; the updated position information in the first indication information is position information of the fourth subdata in the target data, and the information included in the target data Among the plurality of sub-data, the fourth sub-data is a next sub-data adjacent to the third sub-data.
  2. 如权利要求1所述的方法,其特征在于,针对所述第二存储区域中存储的任意一条写命令,该写命令在所述第二存储区域中的存储顺序是根据该写命令中携带的位置信息确定的,该写命令中携带的位置信息用于标识该写命令中携带的子数据在所述目标数据中的位置。The method according to claim 1, wherein, for any one write command stored in the second storage area, a storage order of the write command in the second storage area is according to the carry command carried in the write command. The location information is determined, and the location information carried in the write command is used to identify the position of the sub-data carried in the write command in the target data.
  3. 如权利要求1或2所述的方法,其特征在于,所述数据存储设备将所述第三子数据,存储到所述目标数据的标识对应的存储区域中之后,还包括:The method according to claim 1 or 2, wherein after the data storage device stores the third sub-data in a storage area corresponding to an identifier of the target data, the method further comprises:
    所述数据存储设备通过自身连接的主机,向数据发送设备发送第二指示信息,或者,所述数据存储设备直接向数据发送设备发送第二指示信息;The data storage device sends the second instruction information to the data sending device through the host connected to the data storage device, or the data storage device directly sends the second instruction information to the data sending device;
    其中,所述第二指示信息用于指示所述目标写命令中携带的子数据已存储完成,所述数据发送设备为发送所述目标写命令的设备。The second instruction information is used to indicate that the sub data carried in the target write command has been stored, and the data sending device is a device that sends the target write command.
  4. 如权利要求1-3任意一项所述的方法,其特征在于,所述数据存储设备将待处理写命令存储到所述第二存储区域中,包括:The method according to any one of claims 1-3, wherein the storing, by the data storage device, a write command to be processed into the second storage area comprises:
    所述数据存储设备从当前接收到的至少一条写命令中,获取所述待处理写命令;Obtaining, by the data storage device, the pending write command from at least one write command currently received;
    所述数据存储设备将所述待处理写命令中携带的所述目标数据的标识以及子数据在所述目标数据中的位置信息,对应存储到所述第二存储区域中。The data storage device stores the identifier of the target data and the position information of the sub data in the target data carried in the write command to be processed into the second storage area correspondingly.
  5. 如权利要求1-4任意一项所述的方法,其特征在于,所述数据存储设备为固态存储硬盘SSD。The method according to any one of claims 1-4, wherein the data storage device is a solid-state storage hard disk SSD.
  6. 一种数据存储方法,其特征在于,包括:A data storage method, comprising:
    数据发送设备根据当前网络状态,确定能够并行发送的写命令数量N,N为正整数;The data sending device determines the number of write commands N that can be sent in parallel according to the current network status, where N is a positive integer;
    所述数据发送设备生成所述N个写命令;其中,每条写命令中携带待存储的目标数据的标识、子数据以及该子数据在所述目标数据中的位置信息,该子数据为将所述目标数据划分得到的多个子数据中的一个,且每条写命令中携带的子数据不同;The data sending device generates the N write commands; wherein each write command carries an identifier of the target data to be stored, sub data, and position information of the sub data in the target data, and the sub data is One of a plurality of sub-data obtained by dividing the target data, and the sub-data carried in each write command is different;
    所述数据发送设备将生成的N个写命令,并行发送给数据存储设备连接的主机或者数据存储设备。The data sending device sends the generated N write commands to the host or data storage device connected to the data storage device in parallel.
  7. 如权利要求6所述的方法,其特征在于,还包括:The method according to claim 6, further comprising:
    所述数据发送设备接收所述数据存储设备发送的指示信息,所述指示信息用于指示所述数据发送设备发送的写命令中携带的子数据已存储完成;Receiving, by the data sending device, instruction information sent by the data storage device, where the instruction information is used to indicate that the sub data carried in the write command sent by the data sending device has been stored;
    所述数据发送设备根据所述指示信息,向所述数据存储设备发送后续写命令,或通过所述主机向所述数据存储设备发送后续写命令。The data sending device sends a subsequent write command to the data storage device according to the instruction information, or sends a subsequent write command to the data storage device through the host.
  8. 一种数据存储装置,其特征在于,包括:A data storage device, comprising:
    通信单元,用于接收至少一条写命令;A communication unit, configured to receive at least one write command;
    处理单元,用于从第一存储区域获取第一指示信息,其中,所述第一指示信息为所述数据存储装置存储完成第一子数据后生成的,所述第一指示信息包含目标数据的标识以及第二子数据在所述目标数据中的位置信息,所述第一子数据和第二子数据为所述目标数据包括的多个子数据中的两个子数据、且所述第二子数据是所述第一子数据相邻的下一个子数据;以及,根据获得的第一指示信息,从所述通信单元当前接收到的至少一条写命令以及第二存储区域中存储的至少一条写命令中,获得目标写命令;其中,所述目标写命令中携带所述目标数据的标识、第三子数据以及所述第三子数据在所述目标数据中的位置信息,且所述目标写命令中携带的位置信息与所述第一指示信息中的位置信息匹配;以及,从所述通信单元当前接收到的至少一条写命令中获取待处理写命令,其中,所述待处理写命令为当前接收到的至少一条写命令中除所述目标写命令之外、且携带所述目标数据的标识的写命令;A processing unit, configured to obtain first instruction information from a first storage area, where the first instruction information is generated after the data storage device stores the first sub-data, and the first instruction information includes the target data; An identifier and position information of a second sub-data in the target data, the first sub-data and the second sub-data are two sub-data among a plurality of sub-data included in the target data, and the second sub-data Is the next sub-data adjacent to the first sub-data; and according to the obtained first instruction information, at least one write command currently received from the communication unit and at least one write command stored in the second storage area To obtain a target write command; wherein the target write command carries an identifier of the target data, a third sub data, and position information of the third sub data in the target data, and the target write command The location information carried in the first location information matches the location information in the first indication information; and obtaining, from the at least one write command currently received by the communication unit, Processing the write command, wherein the write command to be processed for the current received at least one write command in write command other than the target, and the write command carrying the target identification data;
    命令存储单元,用于将所述处理单元获取的待处理写命令存储到所述第二存储区域中;A command storage unit, configured to store a write command to be processed obtained by the processing unit in the second storage area;
    数据存储单元,用于将所述处理单元获取的目标写命令中携带的第三子数据,存储到所述目标数据的标识对应的存储区域中,并更新所述第一指示信息中的位置信息,将更新后的所述第一指示信息存储到所述第一存储区域;更新后的所述第一指示信息中的位置信息为第四子数据在所述目标数据中的位置信息,在所述目标数据包括的多个子数据中,所述第四子数据是所述第三子数据相邻的下一子数据。A data storage unit, configured to store the third sub-data carried in the target write command obtained by the processing unit into a storage area corresponding to an identifier of the target data, and update the position information in the first instruction information Storing the updated first instruction information in the first storage area; the updated position information in the first instruction information is position information of fourth subdata in the target data, and Among the plurality of sub data included in the target data, the fourth sub data is a next sub data adjacent to the third sub data.
  9. 如权利要求8所述的数据存储装置,其特征在于,针对所述第二存储区域中存储的任意一条写命令,该写命令在所述第二存储区域中的存储顺序是根据该写命令中携带的位置信息确定的,该写命令中携带的位置信息用于标识该写命令中携带的子数据在所述目标数据中的位置。The data storage device according to claim 8, wherein, for any one write command stored in the second storage area, a storage order of the write command in the second storage area is based on the write command. The location information carried is determined, and the location information carried in the write command is used to identify the position of the sub-data carried in the write command in the target data.
  10. 如权利要求8或9所述的数据存储装置,其特征在于,所述通信单元还用于:The data storage device according to claim 8 or 9, wherein the communication unit is further configured to:
    在所述数据存储单元将所述处理单元获得的目标写命令中携带的第三子数据,存储到所述目标数据的标识对应的存储区域中之后,通过自身连接的主机向数据发送设备发送第二指示信息,或者,直接向数据发送设备发送第二指示信息;After the data storage unit stores the third sub-data carried in the target write command obtained by the processing unit into a storage area corresponding to the identifier of the target data, the data storage unit sends the first sub-data to the data sending device through the host connected to itself. Two instructions, or directly send the second instructions to the data sending device;
    其中,所述第二指示信息用于指示所述目标写命令中携带的第三子数据已存储完成,所述数据发送设备为发送所述目标写命令的设备。The second instruction information is used to indicate that the third sub-data carried in the target write command has been stored, and the data sending device is a device that sends the target write command.
  11. 如权利要求8-10任意一项所述的数据存储装置,其特征在于,所述命令存储单元具体用于:The data storage device according to any one of claims 8 to 10, wherein the command storage unit is specifically configured to:
    将所述处理单元获取到的待处理写命令中携带的所述目标数据的标识以及子数据在所述目标数据中的位置信息,对应存储到所述第二存储区域中。The identifier of the target data carried in the to-be-processed write command obtained by the processing unit and the position information of the sub-data in the target data are correspondingly stored in the second storage area.
  12. 如权利要求8-11任意一项所述的数据存储装置,其特征在于,所述数据存储装置为固态存储硬盘SSD。The data storage device according to any one of claims 8-11, wherein the data storage device is a solid-state storage hard disk SSD.
  13. 一种数据发送装置,其特征在于,包括:A data sending device, comprising:
    处理单元,用于根据当前网络状态,确定能够并行发送的写命令数量N,N为正整数;以及,生成所述N个写命令;其中,每条写命令中携带待存储的目标数据的标识、子数据以及该子数据在所述目标数据中的位置信息,该子数据为将所述目标数据划分得到的多个子数据中的一个,且每条写命令中携带的子数据不同;A processing unit, configured to determine the number of write commands N that can be sent in parallel according to the current network status, where N is a positive integer; and generate the N write commands; wherein each write command carries an identifier of target data to be stored , Sub data, and position information of the sub data in the target data, the sub data is one of a plurality of sub data obtained by dividing the target data, and the sub data carried in each write command are different;
    通信单元,用于将所述处理单元生成的N个写命令,并行发送给数据存储设备连接的主机或者数据存储设备。The communication unit is configured to send the N write commands generated by the processing unit in parallel to a host or a data storage device connected to the data storage device.
  14. 如权利要求13所述的数据发送装置,其特征在于,所述通信单元,还用于接收所述数据存储设备发送的指示信息,所述指示信息用于指示所述数据发送设备发送的写命令中携带的子数据已存储完成;并根据所述指示信息,向所述数据存储设备发送后续写命令,或通过所述主机向所述数据存储设备发送后续写命令。The data transmitting device according to claim 13, wherein the communication unit is further configured to receive instruction information sent by the data storage device, and the instruction information is used to indicate a write command sent by the data sending device. The sub-data carried in it has been stored; and according to the instruction information, a subsequent write command is sent to the data storage device, or a subsequent write command is sent to the data storage device through the host.
  15. 一种芯片,其特征在于,所述芯片与存储器相连或者所述芯片包括所述存储器,用于读取并执行所述存储器中存储的软件程序,以实现如权利要求1-7任一项所述的方法。A chip, characterized in that the chip is connected to a memory or the chip includes the memory, and is used to read and execute a software program stored in the memory, so as to implement the device according to any one of claims 1-7. The method described.
  16. 一种计算机存储介质,其特征在于,所述计算机存储介质上存储有计算机可执行指令,所述计算机可执行指令在被所述计算机调用时使所述计算机执行如权利要求1-7任一项所述的方法。A computer storage medium, characterized in that computer executable instructions are stored on the computer storage medium, and the computer executable instructions, when called by the computer, cause the computer to execute any one of claims 1-7 The method described.
  17. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得计算机执行如权利要求1-7任一项所述的方法。A computer program product containing instructions, wherein when the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1-7.
PCT/CN2018/094545 2018-07-04 2018-07-04 Data storage method and apparatus, and related device WO2020006715A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/094545 WO2020006715A1 (en) 2018-07-04 2018-07-04 Data storage method and apparatus, and related device
CN201880044615.0A CN110881277A (en) 2018-07-04 2018-07-04 Data storage method, device and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/094545 WO2020006715A1 (en) 2018-07-04 2018-07-04 Data storage method and apparatus, and related device

Publications (1)

Publication Number Publication Date
WO2020006715A1 true WO2020006715A1 (en) 2020-01-09

Family

ID=69059476

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/094545 WO2020006715A1 (en) 2018-07-04 2018-07-04 Data storage method and apparatus, and related device

Country Status (2)

Country Link
CN (1) CN110881277A (en)
WO (1) WO2020006715A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112631627B (en) * 2020-12-10 2023-02-24 武汉联影医疗科技有限公司 Software upgrading method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681790A (en) * 2012-03-02 2012-09-19 南京拓界信息技术有限公司 Data dump device and method and system for data dump by same
US20140068224A1 (en) * 2012-08-30 2014-03-06 Microsoft Corporation Block-level Access to Parallel Storage
CN105528371A (en) * 2014-09-30 2016-04-27 北京金山云网络技术有限公司 Method, device, and system for executing writing task
CN108052284A (en) * 2017-12-08 2018-05-18 北京奇虎科技有限公司 A kind of distributed data storage method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3093772B1 (en) * 2014-02-10 2018-07-18 Huawei Technologies Co., Ltd. Data processing method, data writing method, and related apparatus
CN103970844B (en) * 2014-04-28 2017-11-21 北京创世漫道科技有限公司 The wiring method and device of big data, read method and device and processing system
CN103955528B (en) * 2014-05-09 2015-09-23 北京华信安天信息科技有限公司 The method of writing in files data, the method for file reading data and device
CN111176559B (en) * 2015-12-04 2023-07-11 成都华为技术有限公司 Data writing method and device and dual-activity system
CN107493309B (en) * 2016-06-13 2020-07-31 阿里巴巴集团控股有限公司 File writing method and device in distributed system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681790A (en) * 2012-03-02 2012-09-19 南京拓界信息技术有限公司 Data dump device and method and system for data dump by same
US20140068224A1 (en) * 2012-08-30 2014-03-06 Microsoft Corporation Block-level Access to Parallel Storage
CN105528371A (en) * 2014-09-30 2016-04-27 北京金山云网络技术有限公司 Method, device, and system for executing writing task
CN108052284A (en) * 2017-12-08 2018-05-18 北京奇虎科技有限公司 A kind of distributed data storage method and device

Also Published As

Publication number Publication date
CN110881277A (en) 2020-03-13

Similar Documents

Publication Publication Date Title
US11467975B2 (en) Data processing method and NVMe storage device
US9734085B2 (en) DMA transmission method and system thereof
US9395921B2 (en) Writing data using DMA by specifying a buffer address and a flash memory address
US8423722B1 (en) System and method for high performance command processing in solid state drives
US20150186068A1 (en) Command queuing using linked list queues
EP3477461A1 (en) Devices and methods for data storage management
CN111344683A (en) Namespace allocation in non-volatile memory devices
KR102532173B1 (en) Memory access technology and computer system
US11467764B2 (en) NVMe-based data read method, apparatus, and system
US10216448B2 (en) Storage system with read request accelerator having dynamic internal data memory allocation
TWI660346B (en) Memory management method and storage controller
US20150253992A1 (en) Memory system and control method
US10951741B2 (en) Computer device and method for reading or writing data by computer device
JP7279889B2 (en) MEMORY BLOCK RECLAIM METHOD AND MEMORY BLOCK RECLAIM DEVICE
TWI734220B (en) Apparatus and method and computer program product for executing host input-output commands
CN113032293A (en) Cache manager and control component
US20150253994A1 (en) Information processing system, information processing device, information processing program and information processing method
US20190004726A1 (en) Key-value deduplication
WO2020006715A1 (en) Data storage method and apparatus, and related device
US8959278B2 (en) System and method for scalable movement and replication of data
CN113031849A (en) Direct memory access unit and control unit
US20240168876A1 (en) Solving submission queue entry overflow using metadata or data pointers
US20240168877A1 (en) Solving submission queue entry overflow with an additional out-of-order submission queue entry
WO2017041673A1 (en) Processing method and device for flush input and output request of magnetic disk
US20240168681A1 (en) Solving submission queue entry overflow with shadow submission queue

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

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

Country of ref document: EP

Kind code of ref document: A1