WO2023246560A1 - 数据存储方法及电子设备 - Google Patents

数据存储方法及电子设备 Download PDF

Info

Publication number
WO2023246560A1
WO2023246560A1 PCT/CN2023/099858 CN2023099858W WO2023246560A1 WO 2023246560 A1 WO2023246560 A1 WO 2023246560A1 CN 2023099858 W CN2023099858 W CN 2023099858W WO 2023246560 A1 WO2023246560 A1 WO 2023246560A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
message
storage
verification information
storage device
Prior art date
Application number
PCT/CN2023/099858
Other languages
English (en)
French (fr)
Inventor
周丽南
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023246560A1 publication Critical patent/WO2023246560A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0078Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
    • H04L1/009Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location arrangements specific to transmitters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors

Definitions

  • Embodiments of the present application relate to the field of storage, and in particular, to a data storage method and electronic device.
  • VBS Public cloud storage Virtual Block Service
  • the data writing method in the existing technology may cause errors to propagate if a virtual machine fails and data is sent abnormally, that is, data from other virtual machines is sent abnormally.
  • Embodiments of the present application provide a data storage method and electronic device.
  • electronic equipment can convert virtual machine anomalies into identifiable data transmission anomalies to ensure that the transport layer connection is uninterrupted, avoid abnormal virtualization from affecting normal virtual data transmission, and improve the reliability and stability of data storage.
  • embodiments of the present application provide a data storage method.
  • the method includes: the electronic device obtains a first write request and a second write request; the first write request is used to indicate writing the first data of the first virtual machine to the storage device, and the second write request is used to indicate writing the first data of the first virtual machine to the storage device.
  • the storage device writes second data of the second virtual machine.
  • the electronic device reads the first data and the second data from the local storage in response to the first write request and the second write request.
  • the electronic device If the electronic device successfully reads the first data but fails to read the second data, it sends a first data message to the storage device; the first data message includes the first data, first verification information, invalid data and second verification information; wherein the size of the invalid data is the same as the size of the second data; the first verification information is generated based on the first data, and the second verification information is different from the verification information generated based on the invalid data.
  • the electronic device receives a failure response message sent by the storage device; the failure response message includes location information of the invalid data in the first data message, and the failure response message is used to indicate that the storage device failed to verify the invalid data based on the second verification information.
  • the electronic device can only transmit the data of the normal virtual machine during the next transmission, thereby ensuring that the transmission layer connection is uninterrupted and the abnormal virtual machine will not affect the data storage of the normal virtual machine to avoid It avoids the problem of error diffusion and effectively improves the reliability and stability of data storage.
  • the electronic device may be a computing node or a network card in the computing node.
  • the first write request and the second write request may be sent by the virtual machine.
  • the first write request and the second write request may be sent by the CPU to the network card, or may be sent by the virtual machine to the network card.
  • the first write request includes a storage location of the first data in the local storage
  • the second write request includes a storage location of the second data in the local storage.
  • sending a first data message to the storage device includes: reading the first data is successful. , confirm that the status of the first virtual machine is normal. Reading the second data fails, and it is determined that the status of the second virtual machine is abnormal. In this way, the network card can determine whether the virtual machine is normal based on reading data. If the data is read successfully, the virtual machine is normal. If reading data fails, it is determined that the virtual machine is abnormal. When it is determined that the virtual machine is abnormal, the network card can perform error conversion, that is, convert the virtual machine status abnormal error into a data transmission error.
  • inventions of the present application provide an electronic device.
  • the electronic device includes: one or more processors; Memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, and when the computer program is executed by one or more processors, the electronic device performs the following steps: obtain the first write request and the first Two write requests; the first write request is used to instruct the writing of the first data of the first virtual machine to the storage device, and the second write request is used to instruct the writing of the second data of the second virtual machine to the storage device; response In response to the first write request and the second write request, read the first data and the second data from the local storage; if the reading of the first data is successful and the reading of the second data fails, the first data is sent to the storage device message; the first data message includes first data, first verification information, invalid data and second verification information; wherein the size of the invalid data is the same as the size of the second data; the first verification information is based on the first The second verification information is generated based on the data, and the second
  • the first write request includes the storage location of the first data in the local storage
  • the second write request includes the storage location of the second data in the local storage
  • the electronic device when the computer program is executed by one or more processors, the electronic device is caused to perform the following steps: generate invalid data and add an exception mark to the invalid data; exception The mark is used to indicate that the invalid data is different from the second data that needs to be written by the second virtual machine; based on the invalid data, the third verification information is generated; based on the exception mark, the third verification information is inverted to obtain the second verification information.
  • embodiments of the present application provide a computer program, which includes instructions for executing the method in the first aspect or any possible implementation of the first aspect.
  • embodiments of the present application provide a chip, which includes a processing circuit and transceiver pins.
  • the transceiver pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes the method in the first aspect or any possible implementation of the first aspect to control the receiving pin to receive the signal, so as to Control the sending pin to send signals.
  • embodiments of the present application provide a data storage system, which includes the electronic device and the storage device related to the first and second aspects.
  • Figure 1 is a schematic diagram of a communication system provided by an embodiment of the present application.
  • Figures 2a to 2b are schematic flow charts of an exemplary data storage method
  • Figure 4 is an exemplary module interaction diagram
  • Figures 6a to 6c are exemplary data splitting diagrams
  • Figure 7 is a schematic diagram of message reassembly
  • Figure 8a is a schematic structural diagram of an exemplary data part
  • Figure 8b is a schematic structural diagram of another check field exemplarily shown.
  • Figure 10 is a schematic diagram of an exemplary message structure
  • Figure 11 is a schematic diagram of an exemplary device structure.
  • a and/or B can mean: A exists alone, A and B exist simultaneously, and they exist alone. B these three situations.
  • multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
  • an object storage device (Objective Storage Device, OSD) service is installed in a single storage node.
  • OSD Objective Storage Device
  • the storage network may be an RDMA over Converged Ethernet (RoCE) or a Transmission Control Protocol (TCP, Transmission Control Protocol) network, which is not limited in this application.
  • RoCE RDMA over Converged Ethernet
  • TCP Transmission Control Protocol
  • TCP Transmission Control Protocol
  • FIGS. 2a to 2b are schematic flow charts of an exemplary data storage method. Please refer to Figure 2a, including the following steps:
  • the host of the computing node includes multiple VMs. Multiple VMs can send IO (Input/Output, input/output) requests to the network card, and the requests can include the physical address of the data to be written.
  • IO Input/Output, input/output
  • the data to be written is the data that the VM needs to write to the storage node
  • the physical address of the data to be written is the storage address of the data to be written on the host side.
  • the network card transmits the physical addresses of the data to be written to multiple VMs to the CPU.
  • the CPU splits and reorganizes the data to be written from multiple VMs to form multiple messages.
  • Each message may include part of the to-be-written data of at least one VM.
  • the CPU can indicate to the network card the physical address corresponding to the data contained in each message.
  • the host of the computing node includes multiple VMs. Multiple VMs can send IO requests to the network card, and the requests can include the physical address of the data to be written.
  • the data to be written is the data that the VM needs to write to the storage node
  • the physical address of the data to be written is the storage address of the data to be written on the host side.
  • the card transmits the physical addresses of the data to be written to multiple VMs to the CPU.
  • the CPU splits and reorganizes the data to be written from multiple VMs to form multiple messages.
  • Each message may include part of the to-be-written data of at least one VM.
  • the network card Based on the instruction of the CPU, the network card composes the data in the DDR memory into a message and sends it to the storage node through the storage network.
  • the network card fails to copy data from the storage, that is, it fails to successfully extract the data from the storage and copy it to the DDR. In other words, if an error occurs in step 1), subsequent steps (including step 2) and step 3)) will not proceed normally.
  • the network card since the network card first extracts the data, and then the CPU reorganizes and encapsulates the data, even if the virtual machine data is wrong, the CPU can avoid the wrong virtual machine, that is, when reorganizing the message, the data of the abnormal VM is not added. to avoid the problem of error proliferation caused by VM exceptions.
  • data needs to be moved from the host side to the DDR of the network card, which causes a burden on the network card and can easily become a performance bottleneck.
  • An embodiment of the present application provides a data storage method.
  • the network card can convert the abnormal VM data into invalid data, and modify the check field corresponding to the data so that the message is included. It can be sent normally to avoid link interruption caused by abnormal message sending and prevent the spread of errors.
  • the storage node can determine that the message contains invalid data based on the check field, and thus discard the data in the message to avoid invalid data being written to the disk (that is, being written to the storage medium). In this way, while preventing the spread of errors, writing of erroneous data can be avoided, effectively improving the security and reliability of data storage.
  • the host sends an IO request to the microcode module.
  • the VM in the host needs to write data to the storage node (hereinafter referred to as data to be written).
  • the VM in the host sends an IO request to the microcode.
  • the request includes but is not limited to: the identification information of the VM and the physical address of the data to be written.
  • FIG. 5 is a schematic diagram illustrating the corresponding relationship between data and addresses.
  • VM1 needs to write data 1 to the storage node. Data 1 is stored in the storage of the computing node, and the storage address is physical address 1.
  • VM2 needs to write data 2 to the storage node. Data 2 is stored in the storage of the computing node, and the storage address is physical address 2.
  • VM3 needs to write data 3 to the storage node. Data 3 is stored in the storage of the computing node, and the storage address is physical address 3.
  • the size of the data written by the VM can be set according to actual requirements. This application is only an illustrative example and is not limited by this application.
  • the VM can send an IO request to the microcode module through the interface between the host and the network card.
  • IO requests conform to the interface protocol between the host and the network card.
  • the microcode module interacts with the CPU in data.
  • the microcode module receives the IO request sent by the host and parses the IO request to obtain the physical address and other information in the IO request.
  • the microcode module can interact with the CPU based on a communication protocol with the CPU.
  • data exchange between the CPU and the microcode module can be carried out through VBS messages.
  • other protocols may also be used, which are not limited by this application.
  • the microcode module encapsulates the obtained physical address and other information into a VBS message and sends it to the CPU.
  • the CPU receives the VBS message and parses the VBS message to obtain the physical address and other information.
  • the CPU performs data splitting and reorganization based on the obtained physical address and other information.
  • the reassembled message may include the physical addresses of data for multiple VMs.
  • FIGs 6a to 6c are exemplary schematic diagrams of data splitting.
  • the CPU splits data 1 into three data blocks, namely data 11 (abbreviated as D11), data 12 (abbreviated as D12) and data 13 (abbreviated as D12). for D13).
  • the physical address corresponding to data 11 is physical address 11
  • the physical address corresponding to data 12 is physical address 12
  • the physical address corresponding to data 13 is physical address 13.
  • the CPU splits data 2 and splits tree 2 into 3 data blocks, namely data 21 (referred to as D21), data 22 (referred to as D22) and data 23 (referred to as D23).
  • the physical address corresponding to data 21 is physical address 21
  • the physical address corresponding to data 22 is physical address 22
  • the physical address corresponding to data 23 is physical address 23.
  • the CPU splits data 3 and splits data block 3 into two data blocks, namely data 31 (abbreviated as D31) and data 32 (abbreviated as D32).
  • the physical address corresponding to data 31 is physical address 31
  • the physical address corresponding to data 32 is physical address 32.
  • the CPU can reorganize the split data.
  • the CPU can reassemble data from multiple VMs into the same or different messages.
  • FIG. 7 is a schematic diagram of message reassembly. Referring to Figure 7, the CPU reorganizes the data D11 of VM1, the data D21 of VM2, and the data D31 of VM3 into message 1. The CPU reorganizes the data D12 of VM1, the data D22 of VM2, and the data D32 of VM3 into message 2. The CPU reorganizes the data D13 of VM1 and the data D23 of VM2 into message 3. It should be noted that the splitting and repeating methods shown in the embodiments of this application are only illustrative examples, and this application does not limit them.
  • the CPU sends a VBS message to the microcode module.
  • the message includes but is not limited to: each message includes information such as the physical address corresponding to the data.
  • the CPU sends a VBS message to the microcode module to indicate to the microcode module the physical address of the data contained in each message.
  • VBS message 1 includes physical address 11 of D11, physical address 21 of D21, and physical address 31 of D31 of message 1.
  • VBS message 2 includes the physical address 12 of D12, the physical address 22 of D22, and the physical address 32 of D32 in message 2.
  • VBS message 3 includes the physical address 13 of D13 and the physical address 23 of D23 in message 3.
  • the physical address of each message can also be carried and sent in the same VBS message, which is not limited in this application.
  • the microcode module sends the physical address to the logic engine.
  • the microcode module can encapsulate the obtained physical address into a message that conforms to the communication protocol based on the communication protocol between the microcode module and the logic engine, and send it to the logic engine to instruct the logic engine to based on the physical address indicated by the microcode module. Extract the corresponding data, encapsulate the data in a message and send it to the storage node.
  • the microcode module can also encapsulate the information carried in VBS message 1 into a VBS message and send it to the logic engine. That is to say, the microcode module sends VBS message 1, VBS message 2 and VBS message 3 to the logic engine. The information carried therein is the same as described above and will not be described again here.
  • the reading module receives the VBS message sent by the microcode module and parses the VBS message to Get the physical address in the message. For example, it includes physical address 11, physical address 21, physical address 31, etc., and the reorganization status of the data corresponding to each physical address can be determined based on instructions from the microcode module. For example, the logic engine may determine that data D11 corresponding to physical address 11, data D21 corresponding to physical address 21, and data D31 corresponding to physical address 31 belong to message 1 based on instructions from the microcode module. Other data are similar and will not be repeated here.
  • the reading module can read the corresponding data from the storage on the host side based on the obtained physical address (for example, physical address 11, physical address 21, and physical address 31). For example, the reading module reads data D11 from the storage space corresponding to physical address 11, reads data D21 from the storage space corresponding to physical address 21, and reads data D31 from the storage space corresponding to physical address 31.
  • the reading module can perform subsequent steps after reading the data contained in message 1, that is, after instructing the logic engine to send message 1, it can then read the data contained in message 2 and instruct the logic engine to send.
  • the reading module can also read the data contained in message 1, message 2 and message 3 at the same time, and instruct the logic engine to send message 1, message 2 and message 3. This application is not limited.
  • the reading module outputs the acquired data to the packaging module.
  • the encapsulation module encapsulates data.
  • the encapsulated message conforms to the communication protocol between the computing node and the storage node.
  • it may be a TCP message or an RDMA message, which is not limited by this application.
  • the message (for example, message 1) sent by the computing node to the storage node may be called a data message.
  • the encapsulated data message includes a control part and a data part.
  • the control part includes control information, and the control information includes but is not limited to: address information of the computing node, etc.
  • the data part includes but is not limited to data fields and verification fields.
  • the data fields are used to carry data, and the verification fields can also be called data integrity fields (Data Integrity Field, DIF), which are used to carry verification information, that is Cyclic Redundancy Check (CRC) information.
  • DIF Data Integrity Field
  • CRC Cyclic Redundancy Check
  • Figure 8a is a schematic structural diagram of an exemplary data part. Please refer to Figure 8a.
  • the encapsulation module can insert 8B of verification information into every 4KB of data.
  • the verification information is used to verify the data in the corresponding data field. That is, the data part includes at least one data field and at least one check information.
  • the length of each data field is 4KB (it may also be 512B, which is not limited in this application), and the length of the check field is 8B.
  • the encapsulation module can perform CRC calculation on the 4KB data in the data field to generate CRC information (ie, check information).
  • CRC information ie, check information
  • the encapsulation module inserts a check field after the data field, and the check field includes CRC information.
  • the check field includes the Guard field, App Tag field and Ref Tag field.
  • the Guard field length is 2B
  • the App Tag field length is 2B
  • the Ref Tag field length is 4B.
  • the Guard field is used to carry CRC information.
  • the App Tag field is used to carry application-related information.
  • the Ref Tag field can be used to carry the LBA address.
  • the CRC field may be used to carry CRC information.
  • Private fields can also be called reserved fields and can be used to carry user-defined information, etc.
  • the encapsulation module receives an instruction message from the reading module.
  • the instruction message includes data D11, D21, and D31.
  • the instruction message is used to indicate that D11, D21, and D31 are carried in message 1.
  • the encapsulation module detects whether each data block has an abnormality flag.
  • the exception identifier is used to indicate that the data is invalid data. Specific examples will be described in the following exception handling embodiment. In this example, the encapsulation module detects that there is no exception identifier in each data block as an example.
  • the encapsulation module can encapsulate data D11, D21 and D31 into data fields. During the encapsulation process, each 4K data is carried in a data field, and a check field with a length of 8B or 64B is inserted.
  • the storage node receives message 1.
  • the storage node parses message 1 to obtain the data in the data field and the verification information in the verification field.
  • the storage node verifies the corresponding data based on the verification information. For example, the storage node can perform CRC calculation based on the data in the data field to generate CRC information, and compare the generated CRC information with the CRC information in the check field to determine whether the received data is correct. If the two CRC information are consistent, the verification is successful, and the storage node continues to verify the next data field.
  • the storage node determines that the data has been received correctly, and writes the received data (for example, including D11, D21, and D31) into the storage medium.
  • D11, D21 and D31 can be stored in the storage media of the same or different storage nodes, which is not limited in this application.
  • the storage node sends a success response message to the computing node to indicate that the data has been successfully written to the storage node. It can also be understood as indicating that the business plane data processing is successful.
  • the reading module adds an exception mark to the invalid data to indicate that the data is invalid data.
  • the reading module can send a message to the encapsulating module every time it reads a piece of data, and the message complies with the communication protocol between the reading module and the encapsulating module.
  • the message may include an exception identification field, such as an abort (abort) field.
  • abort abort
  • the value of this field defaults to 0, which is used to indicate that the data is correct.
  • the reading module can correctly read the data of the VM, that is, the reading module
  • the block can confirm that no exception occurred in the VM.
  • the reading module does not need to modify the value of the abort field.
  • the message sent by the reading module to the encapsulating module may not include the abort field.
  • the reading module detects that the data reading of VM2 fails and generates invalid data
  • the reading module sends a message to the encapsulation module, and the message carries invalid data.
  • an exception mark is added before or after the invalid data.
  • the encapsulation module can determine that the received data is invalid data based on the exception flag.
  • the method of adding exception markers described in the embodiments of this application is only a schematic example. In other embodiments, other marking methods can also be used, and the purpose is to distinguish invalid data from correct data. This application is not limited.
  • the encapsulation module still encapsulates in the manner described above, that is, inserting CRC information for every 4KB of data.
  • the encapsulation module may detect an exception identifier corresponding to the invalid data based on any of the methods described above. For example, after receiving the message sent by the reading module, the encapsulation module obtains the data in the message and detects that the abort field value is 1, and can determine that the data is invalid data.
  • the way the encapsulating module detects exception flags depends on the way the reading module adds the exception flag.
  • the encapsulation module outputs message 1 to the transceiver module, and the transceiver module sends message 1 to the storage node through the storage network.
  • the network card performs the same processing on message 2 and message 3, that is, the data of VM2 in message 2 and message 3 are invalid data, and the CRC information corresponding to the invalid data is error information, which will not be repeated below. illustrate.
  • the storage node receives message 1 and parses message 1. For example, still taking Figure 9 as an example, the storage node verifies each data field corresponding to D11. The verification method can be referred to above, and will not be repeated here. Repeat. The storage node determines that the D11 verification is successful and that D11 is received correctly. The storage node verifies the data field of the invalid data. The CRC information calculated by the storage node based on the invalid data is inconsistent with the CRC information in the verification field. The storage node determines that the verification failed. The storage node discards the data in message 1, that is, the data in message 1 will not be written to the storage node.
  • the logic engine can send instruction information to the microcode module.
  • the transceiver module in the logic engine can receive the failure response message fed back by the storage node.
  • the transceiver module parses the failure response message to obtain the location information carried in it.
  • the transceiver module saves the location information into DDR.
  • the logic engine can send instruction information to the microcode module to instruct the storage node to feedback a failure response message.
  • the microcode module can send instruction information to the CPU to trigger the CPU to perform message response processing.
  • the CPU obtains the location information from the DDR and determines that the data corresponding to the location information in message 1 failed to be sent.
  • the network card processes messages 2 and 3 in the same manner as message 1.
  • the network card also receives the failure response message corresponding to message 2 and the failure response message of message 3 fed back by the storage node.
  • the failure response message corresponding to message 2 includes location information, and the location information is used to indicate the location of the invalid data in message 2.
  • the failure response message corresponding to message 3 includes location information, and the location information is used to indicate the location of the invalid data in message 3.
  • the network card processes the failure response message of Message 2 and the failure response message of Message 3 in the same manner as the failure response message of Message 1, which will not be described again here.
  • the CPU determines that the business plane data has failed to be sent, that is, the data of VM1 to VM3 has failed to be sent.
  • the CPU may further determine that the erroneous data in each message is the data of VM2 based on the location information in each failure response message.
  • FIG. 10 is a schematic diagram of an exemplary message structure. Please refer to Figure 10.
  • message 4 includes data D11 of VM1 and data D31 of VM3.
  • Message 5 includes data D12 of VM1 and data D32 of VM3.
  • Message 6 includes data D13 of VM1 and data D33 of VM3. That is, the message no longer includes the data of VM2.
  • the repetition method in Figure 10 is only a schematic example.
  • message 4 may also include D11, D31 and D12, which is not limited in this application.
  • the CPU after the CPU repeats the message, it still executes according to the process in Figure 4. That is, the CPU sends instruction information to the microcode module for indicating the physical address of the data included in the reassembled message 1, the physical address of the data included in the message 2, and the physical address of the data included in the message 3.
  • the microcode module instructs the logic engine to read the data based on the received message. Still taking message 1 as an example, the logic engine can read the data D11 of VM1 and the data D31 of VM3 from the memory on the host side based on the obtained physical address. The logic engine detects that the data was read successfully, And send message 1 carrying D11 and D31.
  • the relevant content in Figure 4 please refer to the relevant content in Figure 4 and will not be repeated here.
  • the storage node After receiving the message 1, the storage node processes the message 1, including but not limited to decapsulation and verification of data fields. For specific details, please refer to the above and will not be repeated here. After confirming that each data field is successfully verified, the storage node determines that data reception is successful. The storage node writes the data in message 1 (including D11 and D31) to the storage medium of the storage node. In this way, the data of the abnormal VM will not affect the writing of data of other normal VMs, and the computing node and the storage node can communicate normally.
  • the CPU may instruct the network card to send the next message after each message is successfully sent. For example, the CPU instructs the network card to send the data of message 1, and after receiving the successful response message of message 1, it instructs the network card to send message 2. Correspondingly, if the CPU detects that the failure response message of message 1 has been received, the CPU executes the reorganization process.
  • the check field may include a private field.
  • the encapsulation module determines that the data includes invalid data based on the instruction of the reading module, during the encapsulation process, the encapsulation module can still encapsulate according to the solution described above. That is, based on the data, corresponding verification information is generated. Among them, the verification information corresponding to the invalid data is generated after inversion.
  • the encapsulation module can add an exception mark in the private field of the check field corresponding to the invalid data. In this way, when the storage node detects that the private field includes an exception flag, it may not perform CRC verification of invalid data, thereby reducing the storage processing burden.
  • the storage can directly determine the data reception failure based on the exception mark and execute subsequent processes.
  • FIG. 11 shows a schematic block diagram of a device 1100 according to an embodiment of the present application.
  • the device 1100 may include: a processor 1101 and a transceiver/transceiver pin 1102, and optionally, a memory 1103.
  • bus 1104 includes, in addition to a data bus, a power bus, a control bus, and a status signal bus.
  • bus 1104 various buses are referred to as bus 1104 in the figure.
  • the memory 1103 may be used for instructions in the foregoing method embodiments.
  • the processor 1101 can be used to execute instructions in the memory 1103, and control the receiving pin to receive signals, and control the transmitting pin to send signals.
  • the device 1100 may be a computing node, a storage node, a network card in a computing node, or a chip in a storage node in the above method embodiment.
  • This embodiment also provides a computer storage medium that stores computer instructions.
  • the electronic device When the computer instructions are run on an electronic device, the electronic device causes the electronic device to execute the above related method steps to implement the method in the above embodiment.
  • This embodiment also provides a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to perform the above related steps to implement the method in the above embodiment.
  • inventions of the present application also provide a device.
  • This device may be a chip, a component or a module.
  • the device may include a connected processor and a memory.
  • the memory is used to store computer execution instructions.
  • the processor can execute computer execution instructions stored in the memory, so that the chip executes the methods in each of the above method embodiments.
  • the electronic equipment, computer storage media, computer program products or chips provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the corresponding methods provided above. The beneficial effects of the method will not be repeated here.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of modules or units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be combined or can be integrated into another device, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • a unit described as a separate component may or may not be physically separate.
  • a component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.
  • Integrated units may be stored in a readable storage medium if they are implemented in the form of software functional units and sold or used as independent products.
  • the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium , including several instructions to cause a device (which can be a microcontroller, a chip, etc.) or a processor to execute all or part of the steps of the methods of various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code.
  • the steps of the methods or algorithms described in connection with the disclosure of the embodiments of this application can be implemented in hardware or by a processor executing software instructions.
  • Software instructions can be composed of corresponding software modules.
  • Software modules can be stored in random access memory (Random Access Memory, RAM), flash memory, read only memory (Read Only Memory, ROM), erasable programmable read only memory ( Erasable Programmable ROM (EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), register, hard disk, removable hard disk, compact disc (CD-ROM) or any other form of storage media well known in the art.
  • An exemplary storage medium is coupled to the processor such that the processor can read information from the storage medium and write information to the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and storage media may be located in an ASIC.
  • Computer-readable media includes computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • Storage media can be any available media that can be accessed by a general purpose or special purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请实施例提供了一种数据存储方法及电子设备。在该方法中,电子设备在读取虚拟机的数据失败的情况下,可将虚拟机异常错误转换为可识别的数据传输异常,即,电子设备将数据所对应的校验信息修改为错误的校验信息,从而使得存储设备可基于错误的校验信息,确定数据传输异常,即存储设备可对数据进行拦截,以避免将错误数据写入到存储设备中。电子设备可在下一次传输时,只传输状态正常的虚拟机的数据,从而保证传输层连接不断链,异常虚拟机不会影响到正常虚拟机的数据存储,避免错误扩散的问题,有效提升数据存储的可靠性和稳定性。

Description

数据存储方法及电子设备
本申请要求于2022年06月23日提交中国国家知识产权局、申请号为202210719077.9、申请名称为“数据存储方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及存储领域,尤其涉及一种数据存储方法及电子设备。
背景技术
公有云存储虚拟块服务(Virtual Block Service,VBS)是将存储节点的硬盘虚拟为一个存储资源池,对虚拟机提供虚拟卷存储。在实际应用中,多个虚机下发的IO请求被切片分割打散到整个资源池所有硬盘中,从而实现对目标存储节点的均衡访问。
但是,已有技术中的数据写入方式,如果虚拟机出现故障,导致数据发送异常时,可能导致错误扩散,即其它虚拟机的数据均发送异常。
发明内容
本申请实施例提供一种数据存储方法和电子设备。在该方法中,电子设备可将虚拟机异常转换为可识别的数据传输异常,以确保传输层连接不断链,避免异常虚拟影响正常虚拟的数据传输,提高数据存储的可靠性和稳定性。
第一方面,本申请实施例提供一种数据存储方法。该方法包括:电子设备获取第一写入请求和第二写入请求;第一写入请求用于指示向存储设备写入第一虚拟机的第一数据,第二写入请求用于指示向存储设备写入第二虚拟机的第二数据。电子设备响应于第一写入请求和第二写入请求,从本地存储中读取第一数据和第二数据。电子设备若读取第一数据成功,且读取第二数据失败,向存储设备发送第一数据消息;第一数据消息中包括第一数据、第一校验信息、无效数据和第二校验信息;其中,无效数据的大小与第二数据的大小相同;第一校验信息为基于第一数据生成的,第二校验信息与基于无效数据生成的校验信息不同。电子设备接收存储设备发送的失败响应消息;失败响应消息包括无效数据在第一数据消息中的位置信息,失败响应消息用于指示存储设备基于第二校验信息对无效数据验证失败。电子设备响应于失败响应消息,向存储设备发送第二数据消息;第二数据消息中包括第一数据和第一校验信息。电子设备接收存储设备发送的成功响应消息,成功响应消息用于指示存储设备将第一数据写入存储设备。这样,电子设备在读取虚拟机的数据失败的情况下,可将虚拟机异常错误转换为可识别的数据传输异常,即,电子设备将数据所对应的校验信息修改为错误的校验信息,从而使得存储设备可基于错误的校验信息,确定数据传输异常,即存储设备可对数据进行拦截,以避免将错误数据写入到存储设备中。电子设备可在下一次传输时,只传输状态正常的虚拟机的数据,从而保证传输层连接不断链,异常虚拟机不会影响到正常虚拟机的数据存储,避 免错误扩散的问题,有效提升数据存储的可靠性和稳定性。
示例性的,电子设备可以是计算节点,也可以是计算节点中的网卡。
示例性的,若电子设备是计算节点,相应的,第一写入请求和第二写入请求可以是虚拟机发送的。示例性的,若电子设备是网卡,第一写入请求和第二写入请求可以是CPU发送给网卡的,也可以是虚拟机发送给网卡的。
根据第一方面,第一写入请求中包括第一数据在本地存储中的存储位置,第二写入请求中包括第二数据在本地存储中的存储位置。这样,网卡可以基于存储位置,直接从主机侧读取数据,从而实现数据的DMA。
根据第一方面,或者以上第一方面的任意一种实现方式,电子设备响应于第一写入请求和第二写入请求,从本地存储中读取第一数据和第二数据,包括:电子设备基于第一数据在本地存储中的存储位置,读取第一数据。电子设备基于第二数据在本地存储中的存储位置,读取第二数据。这样,网卡可以基于存储位置,直接从主机侧读取数据,从而实现数据的DMA。
根据第一方面,或者以上第一方面的任意一种实现方式,若读取第一数据成功,且读取第二数据失败,向存储设备发送第一数据消息,包括:读取第一数据成功,确定第一虚拟机的状态正常。读取第二数据失败,确定第二虚拟机的状态异常。这样,网卡可基于读取数据的情况,确定虚拟机是否正常。若读取数据成功,则虚拟机正常。若读取数据失败,则确定虚拟机异常。在确定虚拟机异常的情况下,网卡可执行错误转换,即将虚拟机状态异常错误转换为数据传输错误。
根据第一方面,或者以上第一方面的任意一种实现方式,若读取第一数据成功,且读取第二数据失败,向存储设备发送第一数据消息,包括:生成无效数据,并向无效数据增加异常标记;异常标记用于指示无效数据与第二虚拟机需要写入的第二数据不相同;基于无效数据,生成第三校验信息;基于异常标记,对第三校验信息取反,得到第二校验信息。这样,网卡通过生成无效数据,可使得数据消息能够正常传输。并且,通过设置错误的校验信息,可以使得存储节点对数据进行拦截,以避免错误数据(即无效数据)存储到存储设备上,并且可保证传输层不断链。
根据第一方面,或者以上第一方面的任意一种实现方式,响应于失败响应消息,向存储设备发送第二数据消息,包括:基于第一数据,重新生成第一校验信息;将第一数据与第一校验信息进行封装,得到第二数据消息。这样,电子设备通过重新传输正确的数据,以去除异常虚拟机的数据,使得正常虚拟机的数据能够存储到存储设备,从而避免异常虚拟机的错误扩散到正常虚拟机,有效提高数据存储的可靠性。
第二方面,本申请实施例提供一种电子设备。该电子设备包括:一个或多个处理器; 存储器;以及一个或多个计算机程序,其中一个或多个计算机程序存储在存储器上,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:获取第一写入请求和第二写入请求;第一写入请求用于指示向存储设备写入第一虚拟机的第一数据,第二写入请求用于指示向存储设备写入第二虚拟机的第二数据;响应于第一写入请求和第二写入请求,从本地存储中读取第一数据和第二数据;若读取第一数据成功,且读取第二数据失败,向存储设备发送第一数据消息;第一数据消息中包括第一数据、第一校验信息、无效数据和第二校验信息;其中,无效数据的大小与第二数据的大小相同;第一校验信息为基于第一数据生成的,第二校验信息与基于无效数据生成的校验信息不同;接收存储设备发送的失败响应消息;失败响应消息包括无效数据在第一数据消息中的位置信息,失败响应消息用于指示存储设备基于第二校验信息对无效数据验证失败;响应于失败响应消息,向存储设备发送第二数据消息;第二数据消息中包括第一数据和第一校验信息;接收存储设备发送的成功响应消息,成功响应消息用于指示存储设备将第一数据写入存储设备。
根据第二方面,第一写入请求中包括第一数据在本地存储中的存储位置,第二写入请求中包括第二数据在本地存储中的存储位置。
根据第二方面,或者以上第二方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:基于第一数据在本地存储中的存储位置,读取第一数据;基于第二数据在本地存储中的存储位置,读取第二数据。
根据第二方面,或者以上第二方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:读取第一数据成功,确定第一虚拟机的状态正常;读取第二数据失败,确定第二虚拟机的状态异常。
根据第二方面,或者以上第二方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:生成无效数据,并向无效数据增加异常标记;异常标记用于指示无效数据与第二虚拟机需要写入的第二数据不相同;基于无效数据,生成第三校验信息;基于异常标记,对第三校验信息取反,得到第二校验信息。
根据第二方面,或者以上第二方面的任意一种实现方式,当计算机程序被一个或多个处理器执行时,使得电子设备执行以下步骤:基于第一数据,重新生成第一校验信息;将第一数据与第一校验信息进行封装,得到第二数据消息。
第二方面以及第二方面的任意一种实现方式分别与第一方面以及第一方面的任意一种实现方式相对应。第二方面以及第二方面的任意一种实现方式所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。
第三方面,本申请实施例提供了一种计算机可读介质,用于存储计算机程序,该计 算机程序包括用于执行第一方面或第一方面的任意可能的实现方式中的方法的指令。
第四方面,本申请实施例提供了一种计算机程序,该计算机程序包括用于执行第一方面或第一方面的任意可能的实现方式中的方法的指令。
第五方面,本申请实施例提供了一种芯片,该芯片包括处理电路、收发管脚。其中,该收发管脚、和该处理电路通过内部连接通路互相通信,该处理电路执行第一方面或第一方面的任一种可能的实现方式中的方法,以控制接收管脚接收信号,以控制发送管脚发送信号。
第六方面,本申请实施例提供一种数据存储***,该***包括上述第一方面和第二方面涉及的电子设备和存储设备。
附图说明
图1为本申请实施例提供的一种通信***示意图;
图2a~图2b为示例性示出的数据存储方法的流程示意图;
图3为示例性示出的计算节点的结构示意图;
图4为示例性示出的模块交互示意图;
图5为示例性示出的数据与地址对应关系示意图;
图6a~图6c为示例性示出的数据拆分示意图;
图7为示例性示出的消息重组示意图;
图8a为示例性示出的数据部分的结构示意图;
图8b为示例性示出的另一种校验字段的结构示意图;
图9为示例性示出的消息结构示意图;
图10为示例性示出的消息结构示意图;
图11为示例性示出的装置结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。
本申请实施例的说明书和权利要求书中的术语“第一”和“第二”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一目标对象和第二目标对象等是用于区别不同的目标对象,而不是用于描述目标对象的特定顺序。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
在本申请实施例的描述中,除非另有说明,“多个”的含义是指两个或两个以上。例如,多个处理单元是指两个或两个以上的处理单元;多个***是指两个或两个以上的***。
在对本申请实施例的技术方案说明之前,首先结合附图对本申请实施例的通信***进行说明。图1为本申请实施例提供的一种通信***示意图。该通信***中包括但不限于:计算节点、存储网络和存储节点。计算节点与存储节点的数量可以是多个,本申请对设备数量不做限定。
示例性的,单一计算节点可以是服务器、电脑等电子设备。计算节点支持虚拟块服务。每个计算节点中配置有至少一个虚拟机(Virtual Machine,VM)、至少一个智能网卡(也可以简称网卡)。
可选地,至少一个虚拟机设置于计算节点的主机侧。网卡可通过PCIe接口(也可以是其它接口,本申请不做限定)与主机进行数据交互。网卡对主机呈现为NVMe(Non Volatile Memory Host Controller Interface Specificatio,非易失性内存主机控制器接口规范)或VirtIO(虚拟输入输出)设备。网卡与CPU之间可创通过PCIe接口进行数据交互。需要说明的是,本申请实施例中以CPU与网卡为独立装置为例进行说明。在其他实施例中,CPU也可以与网卡集成在一起,并通过总线进行数据交互,本申请不做限定。
示例性的,单一存储节点中安装有对象存储设备(Objective Storage Device,OSD)服务。
在本申请实施例中,计算节点中的VBS服务可将多个存储节点虚拟为一个存储池,以为计算节点提供虚拟存储服务。可以理解为,计算节点将通过存储网络发送至存储池。存储池可将数据写入到多个存储节点中。
示例性的,存储网络可以是RDMA融合以太网(RDMA over Converged Ethernet,RoCE),也可以是传输控制协议(TCP,Transmission Control Protocol)网络,本申请不做限定。
图2a~图2b为示例性示出的数据存储方法的流程示意图。请参照图2a,包括以下步骤:
1)计算节点的主机中包括多个VM。多个VM可向网卡发送IO(Input/Output,输入/输出)请求,请求中可包括待写入数据的物理地址。在本申请实施例中,待写入数据即为VM需要写入到存储节点中的数据,待写入数据的物理地址为待写入数据在主机侧的存储地址。
2)网卡将多个VM的待写入数据的物理地址传输至CPU。CPU将多个VM的待写入数据进行拆分与重组,以组成多个消息。每个消息中可以包括至少一个VM的待写入数据中的部分数据。CPU可向网卡指示每个消息中所包含的数据所对应的物理地址。
3)网卡可基于CPU指示的物理地址,从主机的存储中提取数据。网卡按照CPU的指示,将数据组成多个消息,并通过存储网络发送至存储节点。存储节点接收消息,并提取消息中携带的数据,以将数据存储到存储节点的存储介质中。需要说明的是,如上文所述,多个存储节点虚拟化为存储池,本申请实施例中所述的存储节点可选地为存储池中的任一存储,也可以理解为是存储池中的存储控制器等,本申请不做限定。
图2a所示的网卡读取数据的方式即为DMA(Direct Memory Access,直接存储器访问),即,网卡根据CPU的指示,直接从计算节点的存储(也可以理解为是VM所对应的存储)中读取数据。在该方式中,如果多个虚拟机中的至少一个虚拟机发生异常,例如VM发生FLR(Function Level Reset功能层复位),使得网卡无法从存储中提取到正确的数据。相应的,网卡无法向存储节点发送消息。在该场景下,网卡将反复尝试重传该消息,在VM异常的情况下,网卡反复发送消息失败。经过一定次数的重传后,网卡确定与存储之间的连接错误,并断开连接。这样,其它VM的数据也无法正常发送,造成虚拟机错误扩散。
图2b为示例性示出的另一种数据存储方式。请参照图2b,具体包括:
1)计算节点的主机中包括多个VM。多个VM可向网卡发送IO请求,请求中可包括待写入数据的物理地址。在本申请实施例中,待写入数据即为VM需要写入到存储节点中的数据,待写入数据的物理地址为待写入数据在主机侧的存储地址。
网卡基于IO请求,从主机的存储中提取数据,并将数据保存到网卡对应的DDR(Double Data Rate,双倍速率)存储器中。
2)卡将多个VM的待写入数据的物理地址传输至CPU。CPU将多个VM的待写入数据进行拆分与重组,以组成多个消息。每个消息中可以包括至少一个VM的待写入数据中的部分数据。
3)网卡基于CPU的指示,将DDR存储器中的数据组成消息,并通过存储网络发送到存储节点。
在图2b所示的方法中,若至少一个虚拟机发生异常,网卡从存储中拷贝数据失败,即,未能成功从存储中提取数据并拷贝到DDR中。也就是说,步骤1)即出错,则后续步骤(包括步骤2)和步骤3))则无法正常进行。在该方法中,由于网卡先提取数据,而后CPU才针对数据进行重组与封装,即使虚拟机数据出错,CPU也可以避开出错的虚拟机,即,在重组消息时,不加入异常VM的数据,以避免VM异常导致错误扩散的问题。但是,该方式中由于需要将数据从主机侧搬移到网卡的DDR上,造成网卡负担,极易成为性能瓶颈。
本申请实施例中提供一种数据存储方法,在该方法中,计算节点在检测到VM异常后,网卡可将异常VM的数据转换为无效数据,并修改数据对应的校验字段,使得包含消息能够正常发送,避免消息发送异常导致链接中断,防止错误扩散。存储节点可基于校验字段,确定消息中包括无效数据,从而丢弃消息中的数据,以避免无效数据落盘(即写入存储介质)。这样,可在防止错误扩散的同时,避免写入错误数据,有效提升数据存储的安全性与可靠性。
图3为示例性示出的计算节点的结构示意图。请参照图3,计算节点包括但不限于: 主机、网卡和CPU。主机上可配置有多个VM,例如包括VM1、VM2和VM3,具体数量可根据实际需求设置,本申请不做限定。示例性的,CPU可以与网卡集成在一起,也可以是独立的,本申请不做限定。在本申请实施例中,网卡中可包括微码模块和逻辑引擎模块。微码模块可用于与CPU进行数据交互。逻辑引擎可用于数据的提取与发送。
结合图3所示的结构示意图,图4为示例性示出的模块交互示意图,请参照图4,具体包括如下步骤:
S401,主机向微码模块发送IO请求。
示例性的,主机中的VM响应于接收到的用户操作,需要向存储节点写入数据(以下称为待写入数据)。主机中的VM向微码发送IO请求,请求中包括但不限于:VM的标识信息、待写入数据的物理地址。
举例说明,图5为示例性示出的数据与地址对应关系示意图。请参照图5,VM1需要向存储节点写入数据1,数据1存储于计算节点的存储中,存储地址为物理地址1。VM2需要向存储节点写入数据2,数据2存储于计算节点的存储中,存储地址为物理地址2。VM3需要向存储节点写入数据3,数据3存储于计算节点的存储中,存储地址为物理地址3。VM写入的数据大小可根据实际需求设置,本申请仅为示意性举例,本申请不做限定。
仍参照图5,示例性的,VM1向微码模块发送的IO请求中包括但不限于:VM1的标识信息与物理地址1,用于指示VM1的待写入数据存储在物理地址1中。VM2向微码模块发送的IO请求中包括但不限于:VM2的标识信息与物理地址2,用于指示VM2的待写入数据存储在物理地址2中。VM3向微码模块发送的IO请求中包括但不限于:VM3的标识信息与物理地址1,用于指示VM3的待写入数据存储在物理地址3中。
示例性的,VM可通过主机与网卡之间的接口向微码模块发送IO请求。IO请求符合主机与网卡之间的接口协议。
S402,微码模块与CPU进行数据交互。
示例性的,如上文所述,微码模块接收到主机发送的IO请求,并对IO请求进行解析,以获取IO请求中的物理地址等信息。示例性的,微码模块可基于与CPU之间的通信协议与CPU进行数据交互。例如,在本申请实施例中,CPU与微码模块之间可通过VBS消息进行数据交互。在其他实施例中,也可以是其它协议,本申请不做限定。
示例性的,微码模块将获取到的物理地址等信息封装成VBS消息,发送给CPU。
CPU接收到VBS消息,对VBS消息进行解析,以获取其中的物理地址等信息。CPU基于获取到的物理地址等信息,进行数据拆分与重组等处理。可选地,重组后的消息可能包括多个VM的数据的物理地址。
图6a~图6c为示例性示出的数据拆分示意图。请参照图6a,示例性的,CPU对数据1进行拆分,将数据1拆分为3个数据块,分别为数据11(简称为D11)、数据12(简称为D12)和数据13(简称为D13)。其中,数据11对应的物理地址为物理地址11、数据12对应的物理地址为物理地址12、数据13对应的物理地址为物理地址13。同样的,请参照图6b,CPU对数据2进行拆分,将树2拆分为3个数据块,分别为数据21(简称为D21)、数据22(简称为D22)和数据23(简称为D23)。其中,数据21对应的物理地址 为物理地址21、数据22对应的物理地址为物理地址22、数据23对应的物理地址为物理地址23。请参照图6c,CPU对数据3进行拆分,将数据块3拆分为2个数据块,分别为数据31(简称为D31)、数据32(简称为D32)。其中,数据31对应的物理地址为物理地址31、数据32对应的物理地址为物理地址32。
需要说明的是,如上文所述,CPU接收到的是数据所对应的物理地址。相应的,CPU对数据进行划分,实际上也是对物理地址进行划分。进一步需要说明的是,拆分后的数据块的物理地址属于原数据的物理地址。
示例性的,CPU可将拆分后的数据进行重组。可选地,CPU可将多个VM的数据重组到相同或不同消息中。举例说明,图7为示例性示出的消息重组示意图。请参照图7,CPU将VM1的数据D11、VM2的数据D21和VM3的数据D31重组为消息1。CPU将VM1的数据D12、VM2的数据D22和VM3的数据D32重组为消息2。CPU将VM1的数据D13、VM2的数据D23重组为消息3。需要说明的是,本申请实施例中所示的拆分与重复方式仅为示意性举例,本申请不做限定。
示例性的,CPU向微码模块发送VBS消息,消息中包括但不限于:每个消息中包括数据所对应的物理地址等信息。举例说明,仍以图7中的消息重组方式为例,CPU向微码模块发送VBS消息,以向微码模块指示每个消息包含的数据的物理地址。例如,VBS消息1中包括消息1的D11的物理地址11、D21的物理地址21和D31的物理地址31。VBS消息2中包括消息2的D12的物理地址12、D22的物理地址22和D32的物理地址32。VBS消息3中包括消息3的D13的物理地址13、D23的物理地址23。当然,在其他实施例中,每个消息的物理地址也可以承载于同一个VBS消息中发送,本申请不做限定。
S403,微码模块向逻辑引擎发送物理地址。
示例性的,微码模块接收到CPU发送的VBS消息(包括VBS消息1~VBS消息3),并对VBS消息进行解析,以获取VBS消息中携带的物理地址。例如微码模块可获取到VBS消息1中的消息1的D11的物理地址11、D21的物理地址21和D31的物理地址31。微码模块可基于VBS消息1的指示,确定D11、D21和D31是需要封装在一个消息中的。VBS消息2和VBS消息3与VBS消息1的处理相同,此处不再逐一说明。
微码模块可基于微码模块与逻辑引擎之间的通信协议,将获取到的物理地址封装为符合通信协议的消息,并发送给逻辑引擎,以指示逻辑引擎基于微码模块指示的物理地址,提取对应的数据,并将数据封装在消息中发送给存储节点。可选地,微码模块同样可将VBS消息1所携带的信息封装到一个VBS消息中发送给逻辑引擎。也就是说,微码模块向逻辑引擎发送VBS消息1、VBS消息2和VBS消息3,其中携带的信息与上文所述相同,此处不再赘述。
S404,逻辑引擎读取数据。
可选地,逻辑引擎中可以进一步包括读取模块、封装模块与收发模块。其中,读取模块用于基于物理地址,从主机侧的存储中读取(或提取)数据。封装模块用于对数据进行封装。收发模块用于发送封装后的消息。
具体地,读取模块接收到微码模块发送的VBS消息,并对VBS消息进行解析,以 获取消息中的物理地址。例如包括物理地址11、物理地址21和物理地址31等,并可基于微码模块的指示,确定各物理地址所对应的数据的重组情况。例如,逻辑引擎可基于微码模块的指示,确定物理地址11所对应的数据D11、物理地址21所对应的数据D21和物理地址31所对应的数据D31属于消息1。其它数据类似,此处不再重复说明。
示例性的,读取模块可基于获取到的物理地址(例如物理地址11、物理地址21和物理地址31),从主机侧的存储中读取对应的数据。例如,读取模块从物理地址11对应的存储空间中读取数据D11、从物理地址21对应的存储空间中读取数据D21、从物理地址31对应的存储空间中读取数据D31。可选地,读取模块可以在读取消息1所包含的数据后,执行后续的步骤,即指示逻辑引擎发送消息1后,再读取消息2所包含的数据并指示逻辑引擎发送。可选地,读取模块也可以同时读取消息1、消息2和消息3所包含的数据,并指示逻辑引擎发送消息1、消息2和消息3。本申请不做限定。
读取模块将获取到的数据输出至封装模块。封装模块对数据进行封装。在本申请实施例中,封装后的消息符合计算节点与存储节点之间的通信协议,例如可以是TCP消息,也可以是RDMA消息,本申请不做限定。在本申请实施例中,为区分其它消息,将计算节点发送给存储节点的消息(例如消息1)可称为数据消息。
示例性的,封装后的数据消息中包括控制部分与数据部分。控制部分中包括控制信息,控制信息包括但不限于:计算节点的地址信息等。数据部分中包括但不限于数据字段和校验字段,其中,数据字段用于承载数据,校验字段也可以称为数据完整性字段(Data Integrity Field,DIF),用于承载校验信息,即循环冗余校验(Cyclic Redundancy Check,CRC)信息。
图8a为示例性示出的数据部分的结构示意图。请参照图8a,在本申请实施例中,封装模块可在每4KB数据***8B的校验信息,校验信息用于对对应的数据字段中的数据进行校验。即,数据部分包括至少一个数据字段和至少一个校验信息,每个数据字段的长度为4KB(也可以是512B,本申请不做限定),校验字段的长度为8B。
在本申请实施例中,封装模块可以对数据字段中的4KB数据进行CRC计算,以生成CRC信息(即校验信息)。具体计算方法可参照已有技术实施例,本申请不再赘述。封装模块在数据字段后***校验字段,校验字段中包括CRC信息。
仍参照图8a,校验字段中包括Guard字段、App Tag字段和Ref Tag字段。其中,Guard字段长度为2B、App Tag字段长度为2B、Ref Tag字段长度为4B。Guard字段用于承载CRC信息。App Tag字段用于承载应用相关信息。Ref Tag字段可用于承载LBA地址。
图8b为示例性示出的另一种校验字段的结构示意图。请参照图8b,示例性的,校验字段可以包括CRC字段和私有字段。校验字段长度为64B。即,封装模块可以在每个4KB长度的数据字段后***长度为64B的校验字段。示例性的,CRC字段长度为2B,私有字段长度为62B。可选地,CRC字段长度也可以是4B,私有字段长度为60B,本申请不做限定。
示例性的,CRC字段可用于承载CRC信息。私有字段也可以称为保留字段,可用于承载用户自定义的信息等。
仍以图7中的消息结构为例进行说明,以消息1的处理为例进行说明,其它消息的 处理方式可参照消息1,本文不再逐一举例说明。示例性的,封装模块接收到读取模块的指示消息,指示消息中包括数据D11、D21和D31,指示消息用于指示D11、D21和D31携带于消息1。封装模块检测各数据块是否有异常标识。在本申请实施例中,异常标识用于指示数据为无效数据,具体示例将在下面的异常处理实施例中进行描述。在该示例中,以封装模块检测到各数据块未存在异常标识为例进行说明。封装模块可将数据D11、D21和D31封装到数据字段中。封装过程中,每4K数据承载在一个数据字段中,并***一个长度为8B或者是64B的校验字段。
封装模块将消息1输出至收发模块,收发模块可将消息1通过存储网络发送给存储节点。
存储节点(具体可以是存储池的存储控制器,下文中不再重复说明)接收消息1。存储节点对消息1进行解析,以获取其中的数据字段中的数据和校验字段中的校验信息。存储节点基于校验信息,对对应的数据进行校验。例如,存储节点可以基于数据字段中的数据进行CRC计算,以生成CRC信息,并将生成的CRC信息与校验字段中的CRC信息进行比较,以确定接收到的数据是否正确。如果两个CRC信息一致,则校验成功,存储节点继续对下一个数据字段进行校验。所有数据字段校验成功,存储节点确定正确接收到数据,并将接收到的数据(例如包括D11、D21和D31)写入到存储介质中。需要说明的是,如上文所述,多个存储节点虚拟为存储池,相应的,D11、D21和D31可以存储在相同或不同的存储节点的存储介质中,本申请不做限定。存储节点向计算节点发送成功响应消息,用于指示已成功将数据写入到存储节点中,也可以理解为是用于指示业务面数据处理成功。
下面结合附图对VM发生异常的场景下的数据存储流程进行详细说明。仍参照图4,计算节点执行S401~S403,具体细节可参照上文,此处不再赘述。
示例性的,若在S404之前,主机中的至少一个VM发生异常,例如VM2发生FLR,则逻辑引擎中的读取模块在执行S404时,无法从存储中获取到数据,或者是从存储中获取到的数据可能是存在错误的。读取模块检测到待写入数据的VM发生异常后,生成无效数据,无效数据与异常VM的数据块的大小是相同的。并且,读取模块为该无效数据添加异常标记,以指示该数据为无效数据。相应的,封装模块可基于异常标识,确定读取模块输入的数据为无效数据。
举例说明,以VM2发生FLR异常为例进行说明。在S404,读取模块基于CPU指示的物理地址,依次读取VM的数据。仍以消息1为例,读取模块在读取VM2的数据D21时,由于VM2发生异常,读取模块未能获取到D21。读取模块确定VM2的数据读取失败。接着,读取模块生成无效数据,无效数据的大小与D21的数据大小相同。无效数据可以是任意数据,也可以是全0数据,本申请不做限定。
示例性的,读取模块为该无效数据添加异常标记,以指示数据为无效数据。一种可能的实现方式中,读取模块可以每读取一个数据,即向封装模块发送一条消息,消息符合读取模块与封装模块之间的通信协议。可选地,消息中可以包括异常标识字段,例如为abort(丢弃)字段。该字段的数值默认为0,用于指示数据为正确数据。例如在图4所述的S404中,即在正常处理流程中,读取模块能够正确读取VM的数据,即,读取模 块可确定VM未发生异常。读取模块可不修改abort字段的数值。相应的,封装模块接收到读取模块发送的消息,并检测到abort字段数值为0,确定获取到的数据为正确数据,则继续执行后续流程。另一个示例中,仍以VM2异常为例,读取模块检测到VM2的数据读取失败,读取模块生成无效数据后,向封装模块发送携带无效数据的消息,消息中的abort字段的数值为1,用于指示消息中的数据为无效数据(也可以理解为异常数据)。相应的,封装模块接收消息,并检测到abort字段的数值为1,确定消息中携带的数据为无效数据。
另一种可能的实现方式中,读取模块向封装模块发送的消息中也可以不包括abort字段。读取模块检测到VM2的数据读取失败,并生成无效数据后,读取模块向封装模块发送消息,消息中携带无效数据。其中,无效数据之前或者之后添加有异常标记,例如标记仍然可以是“abort=1”。可以理解为,异常标记与无效数据均为消息的数据部分。相应的,封装模块可基于异常标记,确定接收到的数据为无效数据。需要说明的是,本申请实施例中所述的添加异常标记的方式仅为示意性举例,在其它实施例中,还可以是其它标记方式,其目的在于区分无效数据与正确数据。本申请不做限定。
示例性的,封装模块仍按照上文所述的方式进行封装,即,每4KB数据***CRC信息。示例性的,封装模块在对无效数据进行封装时,封装模块可基于上文所述的任一方式,检测到无效数据对应异常标识。例如,封装模块可以是在接收到读取模块发送的消息,封装模块获取消息中的数据,并检测到abort字段数值为1,可确定数据为无效数据。再例如,封装模块可在接收到读取模块发送的消息后,获取消息中的数据,并检测到数据之前或之后包括异常标识,例如“abort=1”,可确定数据为无效数据。封装模块检测异常标识的方式取决于读取模块添加异常标识的方式。
示例性的,封装模块基于异常标识确定接收到的数据为无效数据后,封装模块仍按照上文中的封装方式对无效数据进行处理,即,封装模块将每4K的无效数据承载于一个数据字段中,数据字段后***校验字段。在本申请实施例中,封装模块生成对应于无效数据的校验信息时,可以是对4KB的无效数据进行CRC计算,以生成CRC信息。接着,封装模块对CRC信息进行取反,以生成与正确的CRC信息完全不同的CRC信息,并将CRC信息添加至校验字段中。在其他实施例中,封装模块也可以生成任一与正确的CRC信息不同的数值,生成方式可根据实际需求设置,本申请不做限定。
图9为示例性示出的消息结构示意图。请参照图9,封装模块将D11、无效数据与D31进行封装,生成数据消息。其中,数据消息中,D11与D31对应的每个数据字段所对应的CRC信息即为正确的CRC信息,而无效数据对应的每个数据字段所对应的CRC信息即为错误的CRC信息。
仍以消息1为例,封装模块将消息1输出至收发模块,收发模块将消息1通过存储网络发送给存储节点。示例性的,网卡对消息2和消息3做同样处理,即,消息2和消息3中的VM2的数据均为无效数据,且,无效数据所对应的CRC信息为错误信息,下文中不再重复说明。
仍以消息1为例,存储节点接收到消息1,并对消息1进行解析。例如,仍以图9为例,存储节点对D11对应的每个数据字段进行校验,校验方式可参照上文,此处不再 赘述。存储节点确定D11校验成功,确定正确接收到D11。存储节点对无效数据的数据字段进行校验,存储节点基于无效数据所计算的CRC信息,与校验字段中的CRC信息不一致,存储节点确定校验失败。存储节点丢弃消息1中的数据,即消息1中的数据不会写入到存储节点中。
示例性的,存储节点向计算节点发送失败响应消息,失败响应消息中可以包括无效数据的位置信息,用于指示消息1中该位置信息所对应的数据接收失败。
一个示例中,位置信息可以是无效数据在消息1中的起始位置信息。另一个示例中,位置信息也可以是无效数据在消息1的数据字段中的起始位置信息。具体指示方式可以根据实际需求设置,本申请不做限定。
S405,逻辑引擎可向微码模块发送指示信息。
在本申请实施例中,逻辑引擎中的收发模块可接收到存储节点反馈的失败响应消息。收发模块对失败响应消息进行解析,以获取到其中携带的位置信息。收发模块将位置信息保存到DDR中。逻辑引擎可向微码模块发送指示信息,用于指示存储节点反馈失败响应消息。微码模块可向CPU发送指示信息,用于触发CPU执行消息响应处理。CPU响应于微码模块的指示,从DDR中获取到位置信息,可确定消息1中的该位置信息所对应的数据发送失败。
示例性的,如上文所述,VM2异常的情况下,网卡对消息2和消息3的处理与消息1相同。相应的,网卡同样接收到存储节点反馈的对应于消息2的失败响应消息和消息3的失败响应消息。其中,对应于消息2的失败响应消息中包括位置信息,位置信息用于指示无效数据在消息2中的位置。对应于消息3的失败响应消息中包括位置信息,位置信息用于指示无效数据在消息3中的位置。
示例性的,网卡对消息2的失败响应消息和消息3的失败响应消息的处理与消息1的失败响应消息相同,此处不再赘述。
示例性的,CPU基于消息1~消息3的失败响应消息,确定业务面数据发送失败,即,VM1~VM3的数据均发送失败。CPU可进一步基于各失败响应消息中的位置信息,确定每个消息中出错的数据均为VM2的数据。
示例性的,CPU重新执行数据重组流程,在将数据重组的过程中,去除发生异常的VM(如VM2)的数据。举例说明,图10为示例性示出的消息结构示意图。请参照图10,CPU去除VM2的数据后,消息4中包括VM1的数据D11和VM3的数据D31。消息5中包括VM1的数据D12和VM3的数据D32。消息6中包括VM1的数据D13和VM3的数据D33。即,消息中不再包括VM2的数据。需要说明的是,图10中的重复方式仅为示意性举例,例如在其它实施例中消息4也可以包括D11、D31和D12,本申请不做限定。
示例性的,CPU执行消息重复后,仍按照图4中的流程执行。即,CPU向微码模块发送指示信息,用于指示重组后的消息1中所包括的数据的物理地址、消息2中包括的数据的物理地址以及消息3中所包括的数据的物理地址。微码模块基于接收到的消息,指示逻辑引擎读取数据。仍以消息1为例,逻辑引擎可基于获取到的物理地址,从主机侧的存储器中读取VM1的数据D11和VM3的数据D31。逻辑引擎检测到数据读取成功, 并发送携带D11和D31的消息1。详细细节可参照图4中的相关内容,此处不再赘述。
示例性的,存储节点接收到消息1后,对消息1进行处理,包括但不限于解封装以及对数据字段进行校验等处理,具体细节可参照上文,此处不再赘述。存储节点在确定各数据字段验证成功后,确定数据接收成功。存储节点将消息1中的数据(包括D11和D31)写入到存储节点的存储介质中。这样,发生异常的VM的数据将不会影响其它正常VM的数据的写入,计算节点与存储节点之间可正常通信。
在一种可能的实现方式中,CPU可在每发送一个消息成功后,再向网卡指示下一个消息的发送。例如,CPU向网卡指示消息1的数据,并在接收到消息1的成功响应消息后,再指示网卡发送消息2。相应的,若CPU检测到接收到消息1的失败响应消息,则CPU执行重组流程。
在另一种可能的实现方式中,如图8b所示,校验字段可包括私有字段。示例性的,封装模块基于读取模块的指示,确定数据中包括无效数据之后,在封装过程中,封装模块可仍然上文所述方案进行封装。即,基于数据,生成对应的校验信息。其中,无效数据对应的校验信息为取反后生成的。封装模块可在无效数据对应的校验字段的私有字段中增加异常标记。这样,存储节点在检测到私有字段中包括异常标记的情况下,可以不执行对无效数据的CRC验证,从而降低存储的处理负担。存储可直接基于异常标记确定数据接收失败,并执行后续的流程。
可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
一个示例中,图11示出了本申请实施例的一种装置1100的示意性框图装置1100可包括:处理器1101和收发器/收发管脚1102,可选地,还包括存储器1103。
装置1100的各个组件通过总线1104耦合在一起,其中总线1104除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图中将各种总线都称为总线1104。
可选地,存储器1103可以用于前述方法实施例中的指令。该处理器1101可用于执行存储器1103中的指令,并控制接收管脚接收信号,以及控制发送管脚发送信号。
装置1100可以是上述方法实施例中的计算节点、存储节点、计算节点中的网卡或存储节点中的芯片。
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的方法。
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的方法。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的方法。
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
本申请各个实施例的任意内容,以及同一实施例的任意内容,均可以自由组合。对上述内容的任意组合均在本申请的范围之内。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人 员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。
结合本申请实施例公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(Random Access Memory,RAM)、闪存、只读存储器(Read Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(Electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。

Claims (15)

  1. 一种数据存储方法,其特征在于,包括:
    获取第一写入请求和第二写入请求;所述第一写入请求用于指示向存储设备写入第一虚拟机的第一数据,所述第二写入请求用于指示向所述存储设备写入第二虚拟机的第二数据;
    响应于所述第一写入请求和所述第二写入请求,从本地存储中读取所述第一数据和所述第二数据;
    若读取所述第一数据成功,且读取所述第二数据失败,向所述存储设备发送第一数据消息;所述第一数据消息中包括所述第一数据、第一校验信息、无效数据和第二校验信息;其中,所述无效数据的大小与所述第二数据的大小相同;所述第一校验信息为基于所述第一数据生成的,所述第二校验信息与基于所述无效数据生成的校验信息不同;
    接收所述存储设备发送的失败响应消息;所述失败响应消息包括所述无效数据在所述第一数据消息中的位置信息,所述失败响应消息用于指示所述存储设备基于所述第二校验信息对所述无效数据验证失败;
    响应于所述失败响应消息,向所述存储设备发送第二数据消息;所述第二数据消息中包括所述第一数据和所述第一校验信息;
    接收所述存储设备发送的成功响应消息,所述成功响应消息用于指示所述存储设备将所述第一数据写入所述存储设备。
  2. 根据权利要求1所述的方法,其特征在于,所述第一写入请求中包括所述第一数据在本地存储中的存储位置,所述第二写入请求中包括所述第二数据在本地存储中的存储位置。
  3. 根据权利要求2所述的方法,其特征在于,所述响应于所述第一写入请求和所述第二写入请求,从本地存储中读取所述第一数据和所述第二数据,包括:
    基于所述第一数据在本地存储中的存储位置,读取所述第一数据;
    基于所述第二数据在本地存储中的存储位置,读取所述第二数据。
  4. 根据权利要求1所述的方法,其特征在于,所述若读取所述第一数据成功,且读取所述第二数据失败,向所述存储设备发送第一数据消息,包括:
    读取所述第一数据成功,确定所述第一虚拟机的状态正常;
    读取所述第二数据失败,确定所述第二虚拟机的状态异常。
  5. 根据权利要求4所述的方法,其特征在于,所述若读取所述第一数据成功,且读取所述第二数据失败,向所述存储设备发送第一数据消息,包括:
    生成所述无效数据,并向所述无效数据增加异常标记;所述异常标记用于指示所述无效数据与所述第二虚拟机需要写入的所述第二数据不相同;
    基于所述无效数据,生成第三校验信息;
    基于所述异常标记,对所述第三校验信息取反,得到所述第二校验信息。
  6. 根据权利要求1所述的方法,其特征在于,所述响应于所述失败响应消息,向所述存储设备发送第二数据消息,包括:
    基于所述第一数据,重新生成所述第一校验信息;
    将所述第一数据与所述第一校验信息进行封装,得到所述第二数据消息。
  7. 一种电子设备,其特征在于,包括:
    一个或多个处理器;
    存储器;
    以及一个或多个计算机程序,其中所述一个或多个计算机程序存储在所述存储器上,当所述计算机程序被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    获取第一写入请求和第二写入请求;所述第一写入请求用于指示向存储设备写入第一虚拟机的第一数据,所述第二写入请求用于指示向所述存储设备写入第二虚拟机的第二数据;
    响应于所述第一写入请求和所述第二写入请求,从本地存储中读取所述第一数据和所述第二数据;
    若读取所述第一数据成功,且读取所述第二数据失败,向所述存储设备发送第一数据消息;所述第一数据消息中包括所述第一数据、第一校验信息、无效数据和第二校验信息;其中,所述无效数据的大小与所述第二数据的大小相同;所述第一校验信息为基于所述第一数据生成的,所述第二校验信息与基于所述无效数据生成的校验信息不同;
    接收所述存储设备发送的失败响应消息;所述失败响应消息包括所述无效数据在所述第一数据消息中的位置信息,所述失败响应消息用于指示所述存储设备基于所述第二校验信息对所述无效数据验证失败;
    响应于所述失败响应消息,向所述存储设备发送第二数据消息;所述第二数据消息中包括所述第一数据和所述第一校验信息;
    接收所述存储设备发送的成功响应消息,所述成功响应消息用于指示所述存储设备将所述第一数据写入所述存储设备。
  8. 根据权利要求7所述的电子设备,其特征在于,所述第一写入请求中包括所述第一数据在本地存储中的存储位置,所述第二写入请求中包括所述第二数据在本地存储中的存储位置。
  9. 根据权利要求8所述的电子设备,其特征在于,当所述计算机程序被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    基于所述第一数据在本地存储中的存储位置,读取所述第一数据;
    基于所述第二数据在本地存储中的存储位置,读取所述第二数据。
  10. 根据权利要求7所述的电子设备,其特征在于,当所述计算机程序被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    读取所述第一数据成功,确定所述第一虚拟机的状态正常;
    读取所述第二数据失败,确定所述第二虚拟机的状态异常。
  11. 根据权利要求10所述的电子设备,其特征在于,当所述计算机程序被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    生成所述无效数据,并向所述无效数据增加异常标记;所述异常标记用于指示所述无效数据与所述第二虚拟机需要写入的所述第二数据不相同;
    基于所述无效数据,生成第三校验信息;
    基于所述异常标记,对所述第三校验信息取反,得到所述第二校验信息。
  12. 根据权利要求7所述的电子设备,其特征在于,当所述计算机程序被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:
    基于所述第一数据,重新生成所述第一校验信息;
    将所述第一数据与所述第一校验信息进行封装,得到所述第二数据消息。
  13. 一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-6任一项所述的方法。
  14. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-6任一项所述的方法。
  15. 一种芯片,其特征在于,包括一个或多个接口电路和一个或多个处理器;所述接口电路用于从电子设备的存储器接收信号,并向所述处理器发送所述信号,所述信号包括存储器中存储的计算机指令;当所述处理器执行所述计算机指令时,使得所述电子设备执行权利要求1-6任一项所述的方法。
PCT/CN2023/099858 2022-06-23 2023-06-13 数据存储方法及电子设备 WO2023246560A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210719077.9 2022-06-23
CN202210719077.9A CN117319242A (zh) 2022-06-23 2022-06-23 数据存储方法及电子设备

Publications (1)

Publication Number Publication Date
WO2023246560A1 true WO2023246560A1 (zh) 2023-12-28

Family

ID=89245027

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/099858 WO2023246560A1 (zh) 2022-06-23 2023-06-13 数据存储方法及电子设备

Country Status (2)

Country Link
CN (1) CN117319242A (zh)
WO (1) WO2023246560A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103823708A (zh) * 2014-02-27 2014-05-28 深圳市深信服电子科技有限公司 虚拟机读写请求处理的方法和装置
US20170024132A1 (en) * 2015-07-22 2017-01-26 Samsung Electronics Co., Ltd. Storage device for supporting virtual machine, storage system including the storage device, and method of operating the same
CN107092538A (zh) * 2017-03-14 2017-08-25 平安科技(深圳)有限公司 虚拟机数据备份方法及***
CN108509156A (zh) * 2018-04-04 2018-09-07 腾讯科技(深圳)有限公司 数据读取方法、装置、设备及***
US20200133495A1 (en) * 2018-10-31 2020-04-30 EMC IP Holding Company LLC Method, electronic device and computer program product for reading data
CN113254166A (zh) * 2021-07-13 2021-08-13 云宏信息科技股份有限公司 一种处理io请求的方法、存储介质和虚拟化模拟器

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103823708A (zh) * 2014-02-27 2014-05-28 深圳市深信服电子科技有限公司 虚拟机读写请求处理的方法和装置
US20170024132A1 (en) * 2015-07-22 2017-01-26 Samsung Electronics Co., Ltd. Storage device for supporting virtual machine, storage system including the storage device, and method of operating the same
CN107092538A (zh) * 2017-03-14 2017-08-25 平安科技(深圳)有限公司 虚拟机数据备份方法及***
CN108509156A (zh) * 2018-04-04 2018-09-07 腾讯科技(深圳)有限公司 数据读取方法、装置、设备及***
US20200133495A1 (en) * 2018-10-31 2020-04-30 EMC IP Holding Company LLC Method, electronic device and computer program product for reading data
CN113254166A (zh) * 2021-07-13 2021-08-13 云宏信息科技股份有限公司 一种处理io请求的方法、存储介质和虚拟化模拟器

Also Published As

Publication number Publication date
CN117319242A (zh) 2023-12-29

Similar Documents

Publication Publication Date Title
US9152593B2 (en) Universal PCI express port
US20240121180A1 (en) System and method for facilitating operation management in a network interface controller (nic) for accelerators
US8365057B2 (en) Processing of data integrity field
US8099274B2 (en) Facilitating input/output processing of one or more guest processing systems
US8341237B2 (en) Systems, methods and computer program products for automatically triggering operations on a queue pair
US10104005B2 (en) Data buffering
CN106021147B (zh) 在逻辑驱动器模型下呈现直接存取的存储设备
US11086525B2 (en) Resilient external memory
WO2022139929A1 (en) Offload of decryption operations
US11726666B2 (en) Network adapter with efficient storage-protocol emulation
KR102059121B1 (ko) 트랜잭셔널 미들웨어 머신 환경에서 컴플렉스 메시지 헤더를 지원하기 위한 시스템 및 방법
JP2018060419A (ja) ストレージ制御装置およびストレージ装置
WO2023246560A1 (zh) 数据存储方法及电子设备
US20170060674A1 (en) Persistent checksum data validation
US20190028542A1 (en) Method and device for transmitting data
CN113422792B (zh) 数据传输方法、装置、电子设备及计算机存储介质
US11768622B2 (en) Differential snapshot without array support
WO2018131550A1 (ja) コネクション管理ユニット、およびコネクション管理方法
TW202328912A (zh) 用於將計算裝置功能與計算引擎相關聯的裝置以及方法
CN117560361A (zh) 批量文件传输方法、客户端及服务器

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

Country of ref document: EP

Kind code of ref document: A1