WO2023109864A1 - Data system, and data access method and device - Google Patents

Data system, and data access method and device Download PDF

Info

Publication number
WO2023109864A1
WO2023109864A1 PCT/CN2022/139000 CN2022139000W WO2023109864A1 WO 2023109864 A1 WO2023109864 A1 WO 2023109864A1 CN 2022139000 W CN2022139000 W CN 2022139000W WO 2023109864 A1 WO2023109864 A1 WO 2023109864A1
Authority
WO
WIPO (PCT)
Prior art keywords
state
data
metadata
address
target data
Prior art date
Application number
PCT/CN2022/139000
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 华为技术有限公司
Publication of WO2023109864A1 publication Critical patent/WO2023109864A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • 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/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms

Definitions

  • the present application relates to the field of storage technologies, and in particular to a data system, a data access method and equipment.
  • Remote direct memory access can bypass the processor in the remote host and directly access the data in the remote host through the network card of the remote host. Because RDMA bypasses the processor, it can save a lot of processor resources and effectively improve the efficiency of data interaction.
  • the storage system includes multiple nodes, and changes in node status (such as node expansion, node failure, data migration between nodes, etc.) will affect the storage location of data in the storage system.
  • changes in node status such as node expansion, node failure, data migration between nodes, etc.
  • the client accesses the data stored by the nodes in the distributed storage system through unilateral RDMA, since the node's processor is bypassed, it cannot perceive the change of the node status in the distributed storage system, which will lead to data access failure.
  • the application provides a data system, a data access system and equipment to ensure accurate reading of data in a server.
  • an embodiment of the present application provides a data system, and the data system includes a client and a server.
  • the client needs to read data from the server, it can send a data request to the server.
  • the data request includes a sequence, and the sequence includes: the address of the first state, the address of the metadata, and the address of the second state, where the first state and the second state is the state of the metadata, the first state and the second state are used to describe whether the metadata changes, and the address of the second state is the same as the address of the first state.
  • the server may acquire a plurality of data according to a sequence, the plurality of data including metadata, a first state before obtaining the metadata, and a second state after obtaining the metadata. After acquiring the plurality of data, the server may send a data response to the client, where the data response includes metadata, the first state, and the second state.
  • the client when the client needs to read the data in the server, when the client requests metadata from the server, it can request metadata from the server through a data request and obtain the metadata status before the metadata (section state) and the state of the metadata after the metadata is acquired (the second state). That is to say, the client can obtain multiple data from the server through a data request, which can effectively improve the interaction efficiency between the server and the client.
  • the client after the client obtains the first state and the second state, the client can determine the change of the metadata when obtaining the metadata through the first state and the second state, so as to determine the integrity and validity of the metadata. To ensure that the client can accurately access the data in the server.
  • the sequence includes the address of the first state, the address of the metadata, the address of the second state, and the address of the home state of the target data. That is to say, after the address of the first state, the address of metadata, and the address of the second state, the sequence further includes the address of the belonging state of the target data.
  • the target data is the data described by the metadata.
  • the data response fed back from the server to the client also includes the attribution status of the target data. After the server obtains the metadata, the first status, and the second status, it can also The address gets the attribution status of the target data.
  • the server can obtain the first state, the metadata, the second state and the attribution state of the target data sequentially according to the order of each address in the sequence.
  • the server can carry multiple acquired data in the data response, and feed the data response back to the client, so that the client can obtain the first state, metadata, second state, and the attribution of the target data from the data response state, the client can further determine the integrity of the metadata to ensure that the target data can be accessed accurately in the future.
  • the client may acquire metadata, the first state, and the second state therefrom.
  • the client may compare the first state with the second state to determine whether the first state is consistent with the second state.
  • the client can determine the integrity of the metadata by using the comparison result between the first state and the second state, so as to ensure that the client can accurately obtain the target data based on the complete metadata.
  • the attribution status of the target data is recorded in the metadata, and after receiving the data response, the client can obtain the first status, the metadata, the second status, and the attribution status of the target data. In addition to comparing the first state with the second state, the client can also compare the attribution state of the target data with the attribution state of the target data recorded in the metadata, and determine that the attribution state of the target data is consistent with the attribution state recorded in the metadata. Whether the attribution status of the target data is consistent.
  • the client can determine the integrity of the metadata by using the comparison result between the first state and the second state, and the comparison result between the attribution state of the target data and the attribution state of the target data recorded in the metadata, so as to ensure The client can accurately obtain target data based on complete metadata.
  • the client obtains the target data from the server according to the metadata after determining that the first state is consistent with the second state .
  • the client determines that the first state is consistent with the second state, and that the attribution state of the target data is consistent with the target data recorded in the metadata.
  • the target data is obtained from the server according to the metadata.
  • the client determines that the first state is inconsistent with the second state, or that the attribution state of the target data is different from the target data recorded in the metadata. If the attribution status is inconsistent, the client can determine that the metadata is invalid, and the client can request the metadata from the server again, or interact with the server to determine the server to which the target data belongs.
  • the client can determine the integrity of the metadata according to the data carried in the data response, so that the target data can be accurately read from the server later.
  • the sequence includes the address of the first state, the address of the metadata, the address of the second state, the address of the state to which the target data belongs, and the address of the target data. That is to say, in this sequence, the address of the first state, the address of the metadata, and the address of the second state also include the address of the belonging state and the address of the target data, and the target data is the data described by the metadata; the data response Including the attribution status of the target data and the target data; after the server obtains the metadata, the first state, and the second state, it can also obtain the attribution status of the target data according to the address of the attribution status of the target data, and obtain the attribution status of the target data according to the address of the target data target data.
  • the address of the target data is pre-saved by the client. For example, when the client uses the address of the target data to access the target data, the metadata of the target data can be saved.
  • the metadata of the target data includes the address of the target data.
  • the client may also only save the address of the target data.
  • the client when the client needs to read the data in the server, when the client requests metadata from the server, it can request metadata, the first state, the second state, and the target from the server through a data request data.
  • the client can request multiple data through one data request, which can effectively reduce the number of interactions between the client and the server, and improve the interaction efficiency between the server and the client.
  • the client may store metadata locally, and if the client determines that the locally stored metadata is inconsistent with the metadata obtained from the server, the terminal to obtain target data.
  • the client can directly compare the consistency of the metadata to determine whether the metadata has been changed. If the inconsistency is determined, the target data can be read by using the metadata obtained from the server to ensure the final target data accuracy.
  • the client when sending the data request, may send the data request to the network card of the server based on RDMA.
  • the client sends a data request to the network card of the server based on RDMA, which can bypass the processor of the server and reduce the occupation of the processor of the server.
  • the data request when the server internally processes the data request, can be processed by a network card in the server, and the network card can respectively obtain the metadata, the first state before obtaining the metadata, the And the second state after obtaining the metadata; sending a data response to the client.
  • the network card in the server can process the data request more efficiently, and can also reduce the resource occupation of the processor in the server.
  • the server can receive a data request from the client, and the data request includes a sequence, and the sequence includes: the address of the first state, the address of the metadata, and the address of the second state, wherein the first state and the second state use To describe whether the metadata has changed, the address of the second state is the same as the address of the first state; after receiving the data request, the server can obtain the metadata, the first state before obtaining the metadata, and obtain The second state after the metadata; and sending a data response to the client, the data response includes the metadata, the first state, and the second state.
  • the sequence further includes the address of the attribution state of the target data, the address of the attribution state of the target data is located after the address of the second state, the target data is the data described by the metadata, and the data response also includes the target For the attribution status of the data, after the server obtains the metadata, the first status, and the second status, the attribution status can be obtained according to the address of the attribution status of the target data.
  • the sequence further includes the address of the home state of the target data and the address of the target data, the address of the home state of the target data is located after the address of the second state, and the address of the target data is located in the home state of the target data
  • the target data is the data described by the metadata
  • the data response also includes the attribution status of the target data and the target data.
  • the server can also obtain the attribution state according to the address of the attribution state, and obtain the target data according to the address of the target data.
  • the network card of the server may process the data request and feed back a data response. That is to say, the network card at the server end can obtain the metadata, the first state before obtaining the metadata, and the second state after obtaining the metadata respectively according to the sequence; and send a data response to the client.
  • the embodiment of the present application provides a data access method, which can be executed by the client.
  • the client can send a data request to the server, and the data request includes a sequence, and the sequence includes: the address of the first state, the address of the metadata, and the address of the second state, wherein the first state and the second state are used for Describes whether the metadata has changed, and the address of the second state is the same as the address of the first state.
  • the client may receive the data response sent by the server, where the data response includes metadata, the first state, and the second state.
  • the sequence further includes the address of the attribution state of the target data, the address of the attribution state of the target data is located after the address of the second state, the target data is the data described by the metadata, and the data response also includes the target The attribution status of the data.
  • the client may compare the first state with the second state to determine whether the first state is consistent with the second state.
  • the attribution status of the target data is recorded in the metadata.
  • the client can check the attribution status of the target data and the attribution of the target data recorded in the metadata. The status is compared to determine whether the attribution status of the target data is consistent with the attribution status of the target data recorded in the metadata.
  • the client determines the integrity of the metadata
  • the client determines that the first state is consistent with the second state
  • the target data is obtained from the server according to the metadata.
  • the client determines that the first state is consistent with the second state, and that the attribution state of the target data is consistent with the target data recorded in the metadata.
  • the target data is obtained from the server according to the metadata.
  • the client determines that the first state is inconsistent with the second state, or that the attribution state of the target data is different from the target data recorded in the metadata. If the attribution status is inconsistent, the client can determine that the metadata is invalid, and the client can request the metadata from the server again, or interact with the server to determine the server to which the target data belongs.
  • the sequence further includes the address of the home state of the target data and the address of the target data, the address of the home state of the target data is located after the address of the second state, and the address of the target data is located in the home state of the target data
  • the target data is the data described by the metadata; the data response includes the attribution status of the target data and the target data.
  • the data request may be sent to the network card of the server based on RDMA.
  • the embodiment of the present application also provides a data access device, the data access device has the function of realizing the behavior in the method example of the second aspect above, and the beneficial effects can be referred to the description of the first aspect, which will not be repeated here.
  • the functions may be implemented by hardware, or may be implemented by executing corresponding software through hardware.
  • Hardware or software includes one or more units corresponding to the functions described above.
  • the structure of the device includes a receiving unit, an acquiring unit, and a sending unit, and these units can perform the corresponding functions in the method example of the second aspect above. For details, refer to the detailed description in the method example, which will not be repeated here. .
  • the embodiment of the present application also provides a data access device, the data access device has the function of implementing the behavior in the method example of the third aspect above, and the beneficial effects can be referred to the description of the first aspect, which will not be repeated here.
  • the functions may be implemented by hardware, or may be implemented by executing corresponding software through hardware.
  • Hardware or software includes one or more units corresponding to the functions described above.
  • the structure of the device includes a receiving unit, a sending unit, and optionally a determining unit. These units can perform the corresponding functions in the method example of the third aspect above. For details, refer to the detailed description in the method example. description, and will not be repeated here.
  • the embodiment of the present application further provides a computing device, where the computing device includes a processor, a network card, and a memory.
  • the network card has the function of realizing the above-mentioned second aspect and the behaviors in the method examples in each possible implementation manner of the second aspect.
  • the beneficial effects please refer to the description of the first aspect and will not repeat them here. .
  • computer program instructions are stored in the memory, and the processor is coupled to the memory, and the processor can call the computer-executed instructions stored in the memory to execute the above third aspect and various possible implementations of the third aspect methods in methods.
  • the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when it is run on a computer, the computer executes the above-mentioned second aspect and various possible implementations of the second aspect methods in methods. When it runs on a computer, the computer is made to execute the third aspect and the method in each possible implementation manner of the third aspect.
  • the present application further provides a computer program product including instructions, which, when run on a computer, cause the computer to execute the above second aspect and the method in each possible implementation manner of the second aspect.
  • the computer When it runs on a computer, the computer is made to execute the third aspect and the method in each possible implementation manner of the third aspect.
  • the present application also provides a computer chip, the chip is connected to the memory, and the chip is used to read and execute the software program stored in the memory, and execute the method in the above-mentioned second aspect and each possible implementation manner of the second aspect Or execute the third aspect and the method in each possible implementation manner of the third aspect.
  • FIG. 1 is a schematic structural diagram of a system provided by the present application.
  • FIG. 2 is a schematic diagram of a data access method provided by the present application.
  • 3-4 are schematic structural diagrams of a data access device provided in the present application.
  • Metadata is data describing data (data about data). Metadata can indicate the attributes of data. For example, metadata can record the storage address of data, the attribution status of data, etc.
  • the storage address is usually the physical address of the data in the storage system, and the attribution status of the data describes the node in the storage system where the data described by the metadata is located.
  • the embodiment of the present application does not limit the manner in which the metadata records the attribution status of the data, and a manner for recording the attribution status of the data is introduced below.
  • data is stored in units of shards, and data migration between nodes in the storage system can also be performed in units of shards.
  • a shard includes multiple pieces of data.
  • the version number of the shard will be updated every time it is migrated between nodes in the storage system. For example, if the shard is migrated from node A to node B, the shard version number of the shard recorded in node A will remain unchanged, and the version number of the shard on node B will be increased by one.
  • the metadata of the data in the slice may include a version number of the slice. Still take the migration of a fragment from node A to node B as an example.
  • the version number of the fragment in the metadata of the data in the fragment is consistent with the version number of the fragment recorded by node A.
  • the version number of the shard in the metadata of the new data is consistent with the version number of the shard recorded by Node B. It should be noted that the embodiment of the present application does not limit the type of the storage system, which may be a distributed storage system or a centralized storage system.
  • Metadata itself can also be regarded as a kind of data.
  • Metadata itself can also be regarded as a kind of data.
  • metadata description header which can record the status of the metadata.
  • metadata status is updated accordingly.
  • the embodiment of the present application does not limit the way of recording the metadata state.
  • the metadata status can be represented by a variable value, which is incremented by one every time the metadata changes.
  • RDMA is a technology that bypasses the operating system kernel of a remote device (such as a node in a storage system) to access data in its memory. Because it does not go through the operating system, it not only saves a lot of processor resources, but also improves system throughput and reduces It reduces the network communication delay of the system, and is especially suitable for wide application in large-scale parallel computer clusters.
  • RDMA has several major characteristics, (1) data is transmitted between the network and the remote device; (2) without the participation of the operating system kernel, all content related to sending and transmitting is offloaded to the network card; (3) virtual memory in user space The direct data transmission between the NIC does not involve the operating system kernel, and there is no additional data movement and copying.
  • client the two ends that need to exchange information
  • server the two ends that need to exchange information
  • the client is deployed on the user side, and the user can initiate a request to the server through the client.
  • the server can be deployed at the remote end.
  • the server generally refers to the storage system, and can be specifically understood as a node in the storage system.
  • Unilateral RDMA includes RDMA read (READ) operations and RDMA write (WRITE) operations.
  • the RDMA read operation is used for the client to read data in the storage space of the server.
  • the server Before the client performs the RDMA read operation, the server first allows the client to obtain the address of the data to be read in advance, that is, the address and length of the data to be read by the RDMA read operation are sent to the client.
  • the address of the data includes the address of some or all of the following metadata, the address of the metadata state, the address of the data attribution state, the address of the target data, and the like.
  • the client After the client obtains the address of the data to be read, it can directly read the data from the storage space of the server through the network card of the server, and the whole process does not require the participation of the processor.
  • the client device may send a data request in a unilateral RDMA manner, and read the data requested by the data request from the server.
  • Bilateral RDMA includes an RDMA send (SEND) operation and an RDMA receive (RECEIVE) operation, which requires the participation of the server processor.
  • the data system includes a client 120 and a server 110.
  • the server 110 may be a node in the storage system.
  • the embodiment of the present application does not The type of the storage system is not limited, and may be a distributed storage system or a centralized storage system.
  • Client 120 may be a physical machine or a virtual machine. Physical machines include, but are not limited to, desktop computers, servers, laptops, and mobile devices.
  • Users can access data in the server 110 through the client 120 , such as writing data in the server 110 or reading data from the server 110 .
  • the client 120 When the client 120 detects the user's operation on the application program and determines that the user needs to access the data in the server 110 , the client 120 can interact with the server 110 to access the data in the server 110 .
  • the client 120 may first obtain the metadata of the data, and obtain the data according to the metadata of the data.
  • the client 120 may request the metadata of the data from the server 110 through a data request, as well as the state of the server 110 before and after reading the metadata. After the client 120 obtains the metadata of the data and the status of the server 110 before and after reading the metadata, it can determine the metadata of the data by comparing the status of the server 110 before and after reading the metadata. The integrity of the data further determines the validity of the data obtained using this metadata. In this way, it can avoid the situation that the metadata obtained according to the metadata is invalid due to the change of the metadata during the process of reading the metadata. In addition, multiple data can be requested from the server 110 through one data request, which can effectively reduce the number of interactions between the server 110 and the client 120 and improve data access efficiency.
  • the client 120 may also request the metadata of the data, the status of the server 110 before and after reading the metadata, and the attribution status of the data from the server 110 through a data request.
  • the client 120 After the client 120 obtains the metadata of the data, the status of the server 110 before and after reading the metadata, and the attribution status of the data, it can compare the status of the server 110 before and after reading the metadata , or compare the attribution status of the acquired data with the attribution status of the data recorded in the metadata, determine the integrity of the metadata of the data, and further determine the validity of the data acquired by using the metadata.
  • the client 120 can acquire the data by using the previously saved data address of the data while acquiring the metadata of the data.
  • the client 120 may request the server 110 for the metadata of the data, the state of the server 110 before and after reading the metadata, and the data (the The data request carries the data address).
  • the client 120 After the client 120 obtains the metadata of the data and the status of the server 110 before and after reading the metadata, it can determine the metadata of the data by comparing the status of the server 110 before and after reading the metadata. The integrity of the data further determines the validity of obtaining the data by using the previously saved data address of the data.
  • the obtained data is also valid, and there is no need to use the metadata to obtain the data, which can reduce the number of interactions between the server 110 and the client 120 .
  • multiple data can be requested from the server 110 through one data request, which can effectively reduce the number of interactions between the server 110 and the client 120 and improve data access efficiency.
  • the server 110 includes a bus 111 , a processor 112 , a memory 113 , a network card 114 and a hard disk 115 .
  • a hard disk is used as the persistent storage of the server 110 as an example for illustration, but mechanical hard disks or other types of hard disks are also applicable to the embodiments of the present application.
  • the processor 112 may be a central processing unit (central processing unit, CPU), and the processor 112 may also be other general-purpose processors or modules with computing functions.
  • CPU central processing unit
  • the memory 113 may include a volatile memory (volatile memory), such as a random access memory (random access memory, RAM), a dynamic random access memory (dynamic random access memory, DRAM), and the like. It may also be a non-volatile memory (non-volatile memory), such as a storage-class memory (storage-class memory, SCM), or a combination of a volatile memory and a non-volatile memory.
  • volatile memory such as a random access memory (random access memory, RAM), a dynamic random access memory (dynamic random access memory, DRAM), and the like. It may also be a non-volatile memory (non-volatile memory), such as a storage-class memory (storage-class memory, SCM), or a combination of a volatile memory and a non-volatile memory.
  • the server 110 may also include one or more hard disks 115 .
  • the hard disk 115 can be used to permanently store data.
  • the hard disk 115 may also include a hard disk cache and a persistent storage medium.
  • the network card 114 is used for communicating with the client 120 and receiving a data request sent by the client 120 .
  • the network card can process the data request, and feed back to the client 120 according to the data request
  • the data request requests the data.
  • the network card 114 may process the data access request by invoking the computer-executed instructions stored in the memory 113, that is, execute the data access method provided in the embodiment of the present application.
  • the network card 114 may also invoke computer-executed instructions stored inside the network card 114 to execute the data access method provided in the embodiment of the present application.
  • computer storage instructions may also be programmed on the network card 114, and the network card 114 may execute the data access method provided in the embodiment of the present application.
  • the client 120 includes a bus 121 , a processor 122 , a memory 123 , and a network card 124 .
  • the functions and functions of the bus 121, processor 122, memory 123, and network card 124 are similar to those of the bus 111, processor 112, memory 113, network card 114, and hard disk 115.
  • the bus 121, processor 122, memory 123, and network card 124 are similar to those of the bus 111, processor 112, memory 113, network card 114, and hard disk 115.
  • the processor 122 can call the computer execution instructions stored in the memory 123 to execute the data access method provided by the embodiment of the present application.
  • the following describes the data access method provided by the embodiment of the present application with reference to FIG. 2 .
  • the data described by the metadata is called target data.
  • the method includes:
  • Step 201 the client 120 sends a data request to the server 110 when it needs to access target data.
  • the data request is used to request data from the server 110, and the data request carries an address sequence (the address sequence may also be referred to as a sequence for short), and the address sequence includes multiple addresses.
  • the multiple addresses are the addresses of the data that needs to be requested from the server 110 .
  • the user can trigger the client 120 to access the target data stored in the server by operating the application program running on the client 120 .
  • the client 120 accesses the target data, it needs to obtain the metadata of the target data first, and determine the data address of the target data according to the metadata, and then the client 120 can request the target from the server 110 according to the metadata of the target data. data.
  • the client 120 needs to obtain metadata first, and the data requested by the data request includes metadata.
  • the data requested by the data request may also include other data.
  • the address types included in the address sequence in the request and the data requested by the data request are explained:
  • the address sequence includes the address of the metadata state, the address of the metadata, and the address of the metadata state in order.
  • the data requested in the data request is metadata, a state of the metadata before reading the metadata, and a state of the metadata after reading the state of the metadata.
  • the metadata state before reading the metadata and the metadata state after reading the metadata state in this embodiment of the application, the metadata state before reading the metadata is referred to as the first state .
  • the state of the metadata after reading the metadata is referred to as the second state.
  • the address of the metadata here refers to the address of the metadata of the target data.
  • the address of the metadata state refers to the address of the metadata state of the target data.
  • the address of the metadata state may be the address of the description header of the metadata of the target data.
  • the address sequence includes in order the address of the first state, the address of the metadata, the address of the second state, and the address of the attribution state of the target data.
  • the data requested in the data request are metadata, the first state and the second state.
  • the address of the data attribution status refers to the address of the attribution status of the target data.
  • the data attribution status may be the version number of the segment to which the target data belongs in the server 110
  • the address of the data attribution status is the address in the server 110 that records the allocated version number.
  • the address sequence includes the address of the first state, the address of the metadata, the address of the second state, the address of the belonging state of the target data, and the address of the target data in order.
  • the data requested in the data request are metadata, the first state, the second state, the attribution state of the target data, and the target data.
  • the address of the target data is the address used by the client 120 to read the target data before. If the client 120 has also read the target data before, the client 120 can save the target locally when reading the target data.
  • the metadata of the data or the address of that target data are examples of the address of that target data.
  • the address sequence includes the address of the first state, the address of the metadata, the address of the second state, and the address of the target data in sequence.
  • the data requested by the data request are metadata, first state, second state, and target data.
  • the addresses that may be included in the above address sequence can be pre-acquired by the client 120, and this embodiment of this application does not limit the way that the client 120 pre-acquires the addresses included in the address sequence.
  • the server 110 can centrally store each metadata in the memory, the server 110 can provide the client 120 with the starting address of the metadata in the memory in advance, and the client 120 device calculates based on a preset algorithm The starting address of the metadata is processed to obtain the address of the metadata of the target data.
  • metadata state addresses when storing each metadata state, the server 110 may establish an association relationship between the address of the metadata state and the address of the corresponding metadata.
  • the association relationship may be notified to the client 120 by the server 110 in advance, or may be pre-scheduled between the server 110 and the client 120 .
  • the client 120 may determine the address of the metadata state based on the association relationship and the address of the metadata.
  • the server 110 may notify the client 120 of the address for recording the version number of each fragment in advance, and when the client 120 needs to determine the attribution status of the target data, it may first determine The segment to which the target data belongs is further determined to record the address of the version of the segment.
  • Step 202 the server 110 receives the data request, and obtains the data requested by the data according to the data request.
  • the server 110 can obtain the address sequence in the data request; the server 110 obtains the data stored at the address according to the order of multiple addresses in the address sequence.
  • the manner in which the server 110 processes different address sequences is described below:
  • the address sequence includes the address of the metadata state, the address of the metadata, and the address of the metadata state in order.
  • the server 110 first reads the first state according to the address of the metadata state, then reads the metadata according to the address of the metadata, and then reads the second state according to the address of the metadata state after obtaining the metadata.
  • the server 110 when processing the address sequence, the server 110 reads the metadata status once before and after reading the metadata, and the read metadata status is the first status and the second status respectively.
  • the processing of the data by the server 110 itself or the interaction between the servers 110 will cause the metadata of the data to change.
  • the server 110 performs data migration (the data address of the metadata record will change), modification, and deletion (the metadata of the data may be deleted) within the server 110 .
  • the processing of the data by the server 110 may lead to changes in the metadata of the data, that is, the server 110 may update the metadata of the data, resulting in a change in the status of the metadata. If the server 110 updates the metadata while the client 120 sends a data request to obtain the metadata, the metadata obtained by the client 120 from the server may be incomplete.
  • the server 110 reads the metadata at the request of the client 120 .
  • the address of the metadata state is also placed before and after the address of the metadata.
  • the client 120 may also obtain the state of the metadata before and after reading the metadata from the server.
  • the address sequence includes in order the address of the metadata state, the address of the metadata, the address of the metadata state, and the address of the attribution state of the target data.
  • the server 110 first reads the first state according to the address of the metadata state, then reads the metadata according to the address of the metadata, and after obtaining the metadata, reads the second state according to the address of the metadata state, and then reads the second state according to the address of the metadata state.
  • the address of the attribution status of the target data reads the attribution status of the target data.
  • the server 110 when processing the address sequence, not only reads the metadata, the first status, and the second status, but also reads the attribution status of the target data.
  • the processing of the data by the server 110 itself or the interaction between the servers 110 will cause the server 110 where the data is located to change, for example, the shard to which the target data belongs is migrated from the server 110 to another
  • the server 110 that is, the data ownership status changes.
  • data migration can be performed between the server 110 and other server 110, which will cause the ownership of the data to change from the server 110 to another server 110, and the server 110 itself can delete data, which will cause the data to no longer exist.
  • Attributed server 110 If the attribution status of the target data changes when the client 120 sends a data request to obtain the data request, the metadata obtained by the client 120 from the server may be incomplete.
  • the attribution status of the target data is in the Variety.
  • the address sequence carried in the data request also includes the address of the data attribution status.
  • the client 120 can also acquire the attribution status of the read target data from the server.
  • the address sequence includes the address of the first state, the address of the metadata, the address of the second state, the address of the belonging state of the target data, and the address of the target data in sequence.
  • the data requested in the data request are metadata, the first state, the second state, the attribution state of the target data, and the target data.
  • the server 110 first reads the first state according to the address of the metadata state, then reads the metadata according to the address of the metadata, and after obtaining the metadata, reads the second state according to the address of the metadata state, and then reads the second state according to the address of the metadata state.
  • the data attribution status reads the data attribution status, and then reads the target data according to the address of the target data.
  • the server 110 when processing the address sequence, the server 110 will not only read the metadata, the first state, the second state, and the data attribution state, but also read the target data.
  • the address sequence also carries the address of the target data, which is the address used by the client 120 to access the target data from the server 110 before.
  • the client 120 may save the address of the target data when accessing the target data before. Since the address sequence carries the address of the target data, that is to say, the server 110 will also read the target data and feed it back to the client 120 device. After the client 120 determines the integrity of the metadata, It also determines the validity of the target data fed back by the server 110. If the target data is valid, the client 120 does not need to obtain the target data from the server 110 according to the metadata, but directly obtains the target data from the server 110 this time. Feedback target data is enough.
  • the address sequence includes the address of the first state, the address of the metadata, the address of the second state, and the address of the target data in order.
  • the data requested by the data request are metadata, first state, second state, and target data.
  • the server 110 first reads the first state according to the address of the metadata state, then reads the metadata according to the address of the metadata, and after obtaining the metadata, reads the second state according to the address of the metadata state, and then reads the second state according to the address of the metadata state.
  • the address of the target data reads the target data.
  • the server 110 when processing the address sequence, the server 110 will not only read the metadata, the first state, and the second state, but also read the target data.
  • Step 203 The server 110 feeds back a data response to the client 120, and the data response carries the data read by the server 110.
  • the server 110 After the server 110 reads the data according to the address sequence, it can feed back the read data to the client 120 .
  • the address sequence includes the address of the first state, the address of the metadata, and the address of the second state in order.
  • the data response includes the first state, metadata, and the second state.
  • the address sequence includes the address of the first state, the address of the metadata, the address of the second state, and the address of the belonging state of the target data in order.
  • the data response includes the first status, metadata and the second status, the attribution status of the target data.
  • the address sequence includes the address of the first state, the address of the metadata, the address of the second state, the address of the belonging state of the target data, and the address of the target data in order.
  • the data response includes a first status, metadata, a second status, an attribution status of the target data, and the target data.
  • the address sequence includes the address of the first state, the address of the metadata, the address of the second state, and the address of the target data in order.
  • the data response includes a first state, metadata, a second state, and target data.
  • Step 204 the client 120 receives the data response, and checks the integrity of the metadata according to the data response.
  • the client 120 may parse the data carried in the data response to determine the integrity of the metadata.
  • the client 120 can compare the first state with the second state. When it is determined that the first state and the second state are consistent, it means that the metadata has not changed before and after reading, and the metadata carried in the data response is complete. , the client 120 may request the server 110 to read the target data based on the metadata. When it is determined that the first state and the second state are inconsistent, it means that the metadata has changed before and after reading, and the metadata carried in the data response is incomplete, the client 120 can request the metadata from the server 110 again, and the client The terminal 120 may also use bilateral RDMA to interact with the server 110 to obtain the target data.
  • the data response includes the first status, metadata and the second status, the attribution status of the target data.
  • the client 120 may compare the first status with the second status, and compare the attribution status of the target data recorded in the metadata with the attribution status of the target data carried in the data response. When the results of the above two comparisons are consistent, it means that the metadata obtained this time is complete and the attribution status of the target data has not changed.
  • the client 120 can request the server 110 to read the target data based on the metadata. When at least one result of the above two comparisons indicates inconsistency, it means that the metadata obtained this time is incomplete. Afterwards, the client 120 may request the metadata from the server 110 again, and the client 120 may also use bilateral RDMA to interact with the server 110 to obtain the target data. When the attribution status of the target data is inconsistent, the client 120 can interact with the server 110 to determine the server 110 to which the target data belongs, and then the client 120 can interact with the server 110 to which the target data belongs to obtain the target data.
  • the data response includes the first status, the metadata, the second status, the attribution status of the target data, and the target data.
  • the client 120 may compare the first status with the second status, and compare the data attribution status recorded in the metadata with the data attribution status carried in the data response. When the results of the above two comparisons are consistent, it means that the metadata obtained this time is complete, and the attribution status of the data has not changed, and the target data carried in the data response is valid, and the client 120 can directly obtain the data from the data response. Read target data. When at least one result of the above two comparisons indicates inconsistency, it means that the metadata obtained this time is incomplete. Afterwards, the client 120 may request the metadata from the server 110 again, and the client 120 may also use bilateral RDMA to interact with the server 110 to obtain the target data. When the attribution status of the target data is inconsistent, the client 120 can interact with the server 110 to determine the server 110 to which the target data belongs, and then the client 120 can interact with the server 110 to which the target data belongs to obtain the target data.
  • the client 120 will not only compare the first state with the second state, but also compare the data attribution state recorded in the metadata and the data carried in the data response.
  • the data attribution status comparison can also compare the metadata of the target data stored locally with the metadata obtained this time. That is to say, three kinds of comparisons need to be performed in this case, and when the results of these three kinds of comparisons all indicate the same, it means that the metadata obtained this time is complete, and the client 120 can directly read the target data from the data response. When at least one of the three comparisons indicates an inconsistency, it means that the target data read this time is invalid, and the client 120 cannot directly use the target data in the data response. 110 reacquires the target data (for example, among the three types of comparisons, only the locally stored metadata of the target data is inconsistent with the metadata obtained this time), and the client 120 can also acquire the target data in the aforementioned manner.
  • the data response includes the first state, metadata, second state, and target data.
  • the client 120 can compare the first state with the second state. When the comparison results indicate that they are consistent, it means that the metadata acquired this time is complete, and the target data carried in the data response is valid, and the client 120 can directly read the target data from the data response. When the result of the comparison indicates inconsistency, it means that the metadata obtained this time is incomplete. After that, the client 120 can request the metadata from the server 110 again.
  • the client 120 may also use bilateral RDMA to interact with the server 110 to acquire the target data.
  • the client 120 can compare the metadata of the target data stored locally and the obtained metadata for comparison. That is to say, in this case, two comparisons need to be performed. When the results of the two comparisons indicate the same, it means that the metadata acquired this time is complete, and the client 120 can directly read the target data from the data response. When at least one of the results of these two comparisons indicates an inconsistency, it means that the target data read this time is invalid, and the client 120 cannot directly use the target data in the data response. 110 reacquires the target data (for example, only the locally stored metadata of the target data in the two comparisons is inconsistent with the metadata obtained this time), and the client 120 can also acquire the target data in the aforementioned manner.
  • the interaction between the client 120 and the server 110 in step 201 and step 203 may be based on unilateral RDMA.
  • the embodiment of the present application does not limit the way in which the server 110 interacts with the client 120, any method that can bypass the processor of the server 110, and directly interacts between the client 120 and the network card of the server 110 is applicable In the embodiment of this application.
  • the embodiment of the present application also provides a data access device, which is used to execute the method executed by the server in the method embodiment shown in Figure 2 above, and related features can be found in The foregoing method embodiments will not be repeated here.
  • the data access device 300 includes a receiving unit 301, an acquiring unit 302, and a sending unit 303;
  • the receiving unit 301 is configured to receive a data request from a client, the data request includes a sequence, and the sequence includes: an address of a first state, an address of metadata, and an address of a second state, wherein the first state and the second state are used to describe Whether the metadata changes, the address of the second state is the same as the address of the first state; the receiving unit 301 can execute the method executed by the server in step 201 as shown in FIG. 2 .
  • the obtaining unit 302 is configured to respectively obtain metadata, a first state before obtaining the metadata, and a second state after obtaining the metadata according to the sequence.
  • the acquiring unit 302 may execute step 202 as shown in FIG. 2 .
  • the sending unit 303 is configured to send a data response to the client, where the data response includes metadata, a first state, and a second state.
  • the sending unit 303 may execute step 203 shown in FIG. 2 .
  • the sequence further includes the address of the attribution state of the target data, the address of the attribution state of the target data is located after the address of the second state, the target data is the data described by the metadata, and the data response also includes the target For the attribution status of the data, after acquiring the metadata, the first status, and the second status, the acquisition unit 302 may also acquire the attribution status of the target data according to the address of the attribution status of the target data.
  • the sequence further includes the address of the attribution state of the target data and the address of the target data, the address of the attribution state of the target data is located after the address of the second state, and the address of the target data is at the attribution state of the target data
  • the target data is the data described by the metadata; after acquiring the metadata, the first state, and the second state, the acquisition unit 302 can also acquire the attribution status of the target data according to the address of the attribution status of the target data, according to The address of the target data acquires the target data.
  • the acquiring unit 302 is deployed on a network card of the server.
  • the embodiment of the present application also provides a data access device, which is used to execute the method executed by the client in the method embodiment shown in Figure 2 above, and related features can be found in The foregoing method embodiments will not be repeated here.
  • the data access device 400 includes a receiving unit 401 and a sending unit 403 .
  • a determining unit 402 may also be included.
  • the sending unit 403 is configured to send a data request to the server, the data request includes a sequence, and the sequence includes: an address of a first state, an address of metadata, and an address of a second state, wherein the first state and the second state are used to describe Whether the metadata changes, the address of the second state is the same as the address of the first state.
  • the sending unit 403 may execute step 201 as shown in FIG. 2 .
  • the receiving unit 401 is configured to receive a data response sent by the server, where the data response includes metadata, a first state, and a second state.
  • the receiving unit 401 may execute step 203 shown in FIG. 2 .
  • the sequence further includes the address of the attribution state of the target data, the address of the attribution state of the target data is located after the address of the second state, the target data is the data described by the metadata, and the data response also includes the target The attribution status of the data.
  • the determining unit 402 may receive the data access response, and determine whether the obtained first state is consistent with the second state.
  • the attribution status of the target data is recorded in the metadata, and the determining unit 402 may also determine whether the attribution status of the target data is consistent with the attribution status of the target data recorded in the metadata.
  • the determining unit 402 obtains the target from the server according to the metadata when it is determined that the first state is consistent with the second state. data.
  • the determination unit 402 determines that the first status is consistent with the second status, and the attribution status of the target data is the same as the target data recorded in the metadata.
  • the target data is obtained from the server according to the metadata.
  • the determining unit 402 determines that the first status is inconsistent with the second status, or the attribution status of the target data is different from the target data recorded in the metadata.
  • inconsistent attribution status the client can determine that the metadata is invalid, and the client can request the metadata from the server again, or interact with the server to determine the server to which the target data belongs.
  • the sequence further includes the address of the attribution state of the target data and the address of the target data, the address of the attribution state of the target data is located after the address of the second state, and the address of the target data is at the attribution state of the target data
  • the target data is the data described by the metadata; the data response includes the attribution status of the target data and the target data.
  • the determining unit 402 obtains the target data from the server according to the metadata when determining that the metadata stored locally by the client is inconsistent with the metadata.
  • the sending unit 403 may send the data request to the network card of the server based on RDMA.
  • each functional unit in the embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the above-mentioned embodiments may be implemented in whole or in part by software, hardware, firmware or other arbitrary combinations.
  • the above-described embodiments may be implemented in whole or in part in the form of computer program products.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on the computer, the processes or functions according to the embodiments of the present invention will be generated in whole or in part.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center that includes one or more sets of available media.
  • the available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media.
  • the semiconductor medium may be a solid state drive (SSD).
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • 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 apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

Abstract

Provided are a data system, and a data access method and a device. In the present application, when accessing data in a server, a client sends a data request to the server, wherein the data request comprises a sequence, and the sequence comprises an address of a metadata state, an address of metadata, and an address of a metadata state. The server acquires a plurality of pieces of data according to the sequence, wherein the plurality of pieces of data comprise metadata, a first state before the metadata is acquired, and a second state after the metadata is acquired. After acquiring the plurality of pieces of data, the server sends a data response to a client, wherein the data response comprises the metadata, the first state and the second state. When the client requests the metadata from the server, same acquires the plurality of pieces of data from the server by means of the data request, such that the efficiency of interaction between the server and the client can be effectively improved. After acquiring the first state and the second state, the client determines the integrity of the metadata by means of the first state and the second state, such that it is ensured that the client can accurately access the data in the server.

Description

一种数据系统、数据访问方法及设备A data system, data access method and device 技术领域technical field
本申请涉及存储技术领域,尤其涉及一种数据系统、数据访问方法及设备。The present application relates to the field of storage technologies, and in particular to a data system, a data access method and equipment.
背景技术Background technique
远程直接内存访问(remote direct memory access,RDMA),尤其是单边RDMA,能够绕过远程主机中的处理器,直接通过远程主机的网卡访问远程主机中数据。由于RDMA绕过了处理器,能够大量节约处理器资源,能够有效提升数据交互效率。Remote direct memory access (remote direct memory access, RDMA), especially unilateral RDMA, can bypass the processor in the remote host and directly access the data in the remote host through the network card of the remote host. Because RDMA bypasses the processor, it can save a lot of processor resources and effectively improve the efficiency of data interaction.
但对于采用分布式架构的存储系统,该种存储系统中包括多个节点,节点状态的变化(如节点扩充、节点故障、节点间的数据迁移等)会影响存储系统中数据的存储位置。当客户端通过单边RDMA访问分布式存储系统中节点存储的数据时,由于绕过了节点的处理器,无法感知分布式存储系统中节点状态的变化,会导致数据访问失败。However, for a storage system using a distributed architecture, the storage system includes multiple nodes, and changes in node status (such as node expansion, node failure, data migration between nodes, etc.) will affect the storage location of data in the storage system. When the client accesses the data stored by the nodes in the distributed storage system through unilateral RDMA, since the node's processor is bypassed, it cannot perceive the change of the node status in the distributed storage system, which will lead to data access failure.
发明内容Contents of the invention
本申请提供一种数据系统、数据访问系统及设备,用以保证准确地读取服务端中的数据。The application provides a data system, a data access system and equipment to ensure accurate reading of data in a server.
第一方面,本申请实施例提供了一种数据系统,该数据系统包括客户端以及服务端。当客户端需要从服务端读取数据时,可以向服务端发送数据请求,数据请求包括序列,序列包括:第一状态的地址、元数据的地址以及第二状态的地址,其中,第一状态和第二状态为元数据的状态,该第一状态和第二状态用于描述元数据是否发生变化,第二状态的地址与第一状态的地址相同。In a first aspect, an embodiment of the present application provides a data system, and the data system includes a client and a server. When the client needs to read data from the server, it can send a data request to the server. The data request includes a sequence, and the sequence includes: the address of the first state, the address of the metadata, and the address of the second state, where the first state and the second state is the state of the metadata, the first state and the second state are used to describe whether the metadata changes, and the address of the second state is the same as the address of the first state.
服务端在接收到数据请求后,可以根据序列获取多个数据,该多个数据包括元数据、获取元数据之前的第一状态、以及获取元数据之后的第二状态。服务端在获取该多个数据之后,可以向客户端发送数据响应,数据响应包括元数据、第一状态、以及第二状态。After receiving the data request, the server may acquire a plurality of data according to a sequence, the plurality of data including metadata, a first state before obtaining the metadata, and a second state after obtaining the metadata. After acquiring the plurality of data, the server may send a data response to the client, where the data response includes metadata, the first state, and the second state.
通过上述系统,当客户端需要读取服务端中的数据,客户端在向服务端请求元数据时,可以通过一个数据请求向服务端请求元数据、获取该元数据之前的元数据状态(第一状态)以及获取该元数据之后的元数据状态(第二状态)。也就是说,客户端可以通过数据请求从服务端获取多个数据,能够有效提升服务端与客户端之间的交互效率。另外,客户端在获取了第一状态和第二状态之后,可以通过该第一状态和第二状态确定在获取元数据时该元数据的变化情况,便于确定元数据的完整性以及有效性,以保证客户端能够准确的访问服务端中的数据。Through the above system, when the client needs to read the data in the server, when the client requests metadata from the server, it can request metadata from the server through a data request and obtain the metadata status before the metadata (section state) and the state of the metadata after the metadata is acquired (the second state). That is to say, the client can obtain multiple data from the server through a data request, which can effectively improve the interaction efficiency between the server and the client. In addition, after the client obtains the first state and the second state, the client can determine the change of the metadata when obtaining the metadata through the first state and the second state, so as to determine the integrity and validity of the metadata. To ensure that the client can accurately access the data in the server.
在一种可能的实现方式中,序列包括第一状态的地址、元数据的地址、第二状态的地址以及目标数据的归属状态的地址。也就是说,该序列中在第一状态的地址、元数据的地址、第二状态的地址之后,还包括目标数据的归属状态的地址。目标数据为元数据所描述的数据,服务端向客户端反馈的数据响应还包括目标数据的归属状态,服务端在获取元数据、第一状态、以及第二状态之后,还可以根据归属状态的地址获取目标数据的归属状态。In a possible implementation manner, the sequence includes the address of the first state, the address of the metadata, the address of the second state, and the address of the home state of the target data. That is to say, after the address of the first state, the address of metadata, and the address of the second state, the sequence further includes the address of the belonging state of the target data. The target data is the data described by the metadata. The data response fed back from the server to the client also includes the attribution status of the target data. After the server obtains the metadata, the first status, and the second status, it can also The address gets the attribution status of the target data.
通过上述系统,服务端可以按照序列中各个地址的顺序依次获取第一状态、元数据、第二状态以及目标数据的归属状态。服务端可以将获取的多个数据携带在数据响应中,并将该数据响应反馈给客户端,以便客户端能够从数据响应中,获取第一状态、元数据、第二状态 以及目标数据的归属状态,该客户端能够进一步确定该元数据的完整性,保证后续可以准确访问目标数据。Through the above system, the server can obtain the first state, the metadata, the second state and the attribution state of the target data sequentially according to the order of each address in the sequence. The server can carry multiple acquired data in the data response, and feed the data response back to the client, so that the client can obtain the first state, metadata, second state, and the attribution of the target data from the data response state, the client can further determine the integrity of the metadata to ensure that the target data can be accessed accurately in the future.
在一种可能的实现方式中,客户端在接收数据响应后,可以从中获取元数据、第一状态以及第二状态。客户端可以对第一状态和第二状态进行比对,确定第一状态与第二状态是否一致。In a possible implementation manner, after receiving the data response, the client may acquire metadata, the first state, and the second state therefrom. The client may compare the first state with the second state to determine whether the first state is consistent with the second state.
通过上述系统,客户端能够利用第一状态与第二状态的比对结果确定元数据的完整性,以便保证客户端基于完整的元数据能够准确的获取目标数据。Through the above system, the client can determine the integrity of the metadata by using the comparison result between the first state and the second state, so as to ensure that the client can accurately obtain the target data based on the complete metadata.
在一种可能的实现方式中,元数据中记录了目标数据的归属状态,客户端在接收到数据响应后,可从中获取第一状态、元数据、第二状态、以及目标数据的归属状态。客户端除了对第一状态和第二状态进行比对,还可以对目标数据的归属状态与元数据中记录的目标数据的归属状态进行比对,确定目标数据的归属状态与元数据中记录的目标数据的归属状态是否一致。In a possible implementation manner, the attribution status of the target data is recorded in the metadata, and after receiving the data response, the client can obtain the first status, the metadata, the second status, and the attribution status of the target data. In addition to comparing the first state with the second state, the client can also compare the attribution state of the target data with the attribution state of the target data recorded in the metadata, and determine that the attribution state of the target data is consistent with the attribution state recorded in the metadata. Whether the attribution status of the target data is consistent.
通过上述系统,客户端能够利用第一状态与第二状态的比对结果、以及目标数据的归属状态与元数据中记录的目标数据的归属状态的比对结果确定元数据的完整性,以便保证客户端基于完整的元数据能够准确的获取目标数据。Through the above system, the client can determine the integrity of the metadata by using the comparison result between the first state and the second state, and the comparison result between the attribution state of the target data and the attribution state of the target data recorded in the metadata, so as to ensure The client can accurately obtain target data based on complete metadata.
在一种可能的实现方式中,若数据响应中携带第一状态、第二状态以及元数据,客户端在确定第一状态与第二状态一致的情况下,根据元数据从服务端获取目标数据。In a possible implementation, if the data response carries the first state, the second state, and metadata, the client obtains the target data from the server according to the metadata after determining that the first state is consistent with the second state .
若数据响应中携带第一状态、第二状态、元数据以及目标数据的归属状态,客户端在确定第一状态与第二状态一致、以及目标数据的归属状态与元数据中记录的目标数据的归属状态一致情况下,根据元数据从服务端获取目标数据。If the data response carries the first state, the second state, metadata, and the attribution state of the target data, the client determines that the first state is consistent with the second state, and that the attribution state of the target data is consistent with the target data recorded in the metadata. When the attribution status is consistent, the target data is obtained from the server according to the metadata.
若数据响应中携带第一状态、第二状态、元数据以及目标数据的归属状态,客户端在确定第一状态与第二状态不一致、或目标数据的归属状态与元数据中记录的目标数据的归属状态不一致情况下,客户端可以确定该元数据无效,客户端可以再次向服务端请求该元数据,或与服务端交互确定该目标数据归属的服务端。If the data response carries the first state, the second state, metadata, and the attribution state of the target data, the client determines that the first state is inconsistent with the second state, or that the attribution state of the target data is different from the target data recorded in the metadata. If the attribution status is inconsistent, the client can determine that the metadata is invalid, and the client can request the metadata from the server again, or interact with the server to determine the server to which the target data belongs.
通过上述系统,客户端能够根据数据响应中携带的数据确定元数据的完整性,以便后续能够准确的从服务端读取目标数据。Through the above system, the client can determine the integrity of the metadata according to the data carried in the data response, so that the target data can be accurately read from the server later.
在一种可能的实现方式中,序列包括第一状态的地址、元数据的地址、第二状态的地址、目标数据的归属状态的地址和目标数据的地址。也即在该序列中,第一状态的地址、元数据的地址、第二状态的地址之后还包括归属状态的地址、目标数据的地址,目标数据为元数据所描述的数据;该数据响应中包括目标数据的归属状态和目标数据;服务端在获取元数据、第一状态、以及第二状态之后,还可以根据目标数据的归属状态的地址获取目标数据的归属状态,根据目标数据的地址获取目标数据。该目标数据的地址是客户端预先保存的,如该客户端之前利用目标数据的地址访问该目标数据时,可以保存该目标数据的元数据,目标数据的元数据中包括该目标数据的地址,当然,客户端也可以仅保存该目标数据的地址。In a possible implementation manner, the sequence includes the address of the first state, the address of the metadata, the address of the second state, the address of the state to which the target data belongs, and the address of the target data. That is to say, in this sequence, the address of the first state, the address of the metadata, and the address of the second state also include the address of the belonging state and the address of the target data, and the target data is the data described by the metadata; the data response Including the attribution status of the target data and the target data; after the server obtains the metadata, the first state, and the second state, it can also obtain the attribution status of the target data according to the address of the attribution status of the target data, and obtain the attribution status of the target data according to the address of the target data target data. The address of the target data is pre-saved by the client. For example, when the client uses the address of the target data to access the target data, the metadata of the target data can be saved. The metadata of the target data includes the address of the target data. Of course, the client may also only save the address of the target data.
通过上述系统,当客户端需要读取服务端中的数据,客户端在向服务端请求元数据时,可以通过一个数据请求向服务端请求元数据、第一状态、第二状态、以及该目标数据。客户端通过一个数据请求可以请求多个数据,能够有效减少客户端与服务端的交互次数,提升服务端与客户端之间的交互效率。Through the above system, when the client needs to read the data in the server, when the client requests metadata from the server, it can request metadata, the first state, the second state, and the target from the server through a data request data. The client can request multiple data through one data request, which can effectively reduce the number of interactions between the client and the server, and improve the interaction efficiency between the server and the client.
在一种可能的实现方式中,客户端本地可以保存有元数据,客户端在确定本地保存的元数据与从服务端获取的元数据不一致的情况下,根据从服务端获取的元数据从服务端获取目 标数据。In a possible implementation, the client may store metadata locally, and if the client determines that the locally stored metadata is inconsistent with the metadata obtained from the server, the terminal to obtain target data.
通过上述系统,客户端可以直接比较元数据的一致性,确定元数据是否发送变化,在确定不一致的情况下,在利用从服务端获取的元数据读取目标数据,能够保证最终获取的目标数据的准确性。Through the above system, the client can directly compare the consistency of the metadata to determine whether the metadata has been changed. If the inconsistency is determined, the target data can be read by using the metadata obtained from the server to ensure the final target data accuracy.
在一种可能的实现方式中,客户端在发送数据请求时,可以基于RDMA向服务端的网卡发送数据请求。In a possible implementation manner, when sending the data request, the client may send the data request to the network card of the server based on RDMA.
通过上述系统,客户端基于RDMA向服务端的网卡发送数据请求,可以绕过服务端的处理器,能够减少对服务端的处理器的占用。Through the above system, the client sends a data request to the network card of the server based on RDMA, which can bypass the processor of the server and reduce the occupation of the processor of the server.
在一种可能的实现方式中,服务端内在处理该数据请求时,可以由该服务端中的网卡处理该数据请求,该网卡可以根据序列分别获取元数据、获取元数据之前的第一状态、以及获取元数据之后的第二状态;向客户端发送数据响应。In a possible implementation manner, when the server internally processes the data request, the data request can be processed by a network card in the server, and the network card can respectively obtain the metadata, the first state before obtaining the metadata, the And the second state after obtaining the metadata; sending a data response to the client.
通过上述系统,该服务端中的网卡可以更加高效的处理该数据请求,另外也可以减少对服务端中处理器的资源的占用。Through the above system, the network card in the server can process the data request more efficiently, and can also reduce the resource occupation of the processor in the server.
第二方面,本申请实施例提供了一种数据访问方法,该方法可以由服务端执行,有益效果可以参见第一方面的相关说明。在该方法中,服务端可以接收来自客户端的数据请求,数据请求包括序列,序列包括:第一状态的地址、元数据的地址以及第二状态的地址,其中,第一状态和第二状态用于描述元数据是否发生变化,第二状态的地址与第一状态的地址相同;服务端在接收到该数据请求后,可以根据序列分别获取元数据、获取元数据之前的第一状态、以及获取元数据之后的第二状态;并向客户端发送数据响应,数据响应包括元数据、第一状态、以及第二状态。In the second aspect, the embodiment of the present application provides a data access method, which can be executed by the server, and for the beneficial effect, please refer to the related description of the first aspect. In this method, the server can receive a data request from the client, and the data request includes a sequence, and the sequence includes: the address of the first state, the address of the metadata, and the address of the second state, wherein the first state and the second state use To describe whether the metadata has changed, the address of the second state is the same as the address of the first state; after receiving the data request, the server can obtain the metadata, the first state before obtaining the metadata, and obtain The second state after the metadata; and sending a data response to the client, the data response includes the metadata, the first state, and the second state.
在一种可能的实现方式中,序列还包括目标数据的归属状态的地址,目标数据的归属状态的地址位于第二状态的地址之后,目标数据为元数据所描述的数据,数据响应还包括目标数据的归属状态,服务端在获取元数据、第一状态、以及第二状态之后,可以根据目标数据的归属状态的地址获取归属状态。In a possible implementation, the sequence further includes the address of the attribution state of the target data, the address of the attribution state of the target data is located after the address of the second state, the target data is the data described by the metadata, and the data response also includes the target For the attribution status of the data, after the server obtains the metadata, the first status, and the second status, the attribution status can be obtained according to the address of the attribution status of the target data.
在一种可能的实现方式中,序列还包括目标数据的归属状态的地址和目标数据的地址,目标数据的归属状态的地址位于第二状态的地址之后,目标数据的地址位于目标数据的归属状态的地址之后,目标数据为元数据所描述的数据;数据响应还包括目标数据的归属状态以及目标数据。服务端在获取元数据、第一状态、以及第二状态之后,还可以根据归属状态的地址获取归属状态,根据目标数据的地址获取目标数据。In a possible implementation, the sequence further includes the address of the home state of the target data and the address of the target data, the address of the home state of the target data is located after the address of the second state, and the address of the target data is located in the home state of the target data After the address, the target data is the data described by the metadata; the data response also includes the attribution status of the target data and the target data. After obtaining the metadata, the first state, and the second state, the server can also obtain the attribution state according to the address of the attribution state, and obtain the target data according to the address of the target data.
在一种可能的实现方式中,服务端内部在处理该数据请求时,可以由服务端的网卡处理该数据请求,并反馈数据响应。也就是说,服务端的网卡可以根据序列分别获取元数据、获取元数据之前的第一状态、以及获取元数据之后的第二状态;并向客户端发送数据响应。In a possible implementation manner, when the server internally processes the data request, the network card of the server may process the data request and feed back a data response. That is to say, the network card at the server end can obtain the metadata, the first state before obtaining the metadata, and the second state after obtaining the metadata respectively according to the sequence; and send a data response to the client.
第三方面,本申请实施例提供了一种数据访问方法,该方法可以由客户端执行,有益效果可以参见第一方面的相关说明,此处不再赘述。该方法中,客户端可以向服务端发送数据请求,数据请求包括序列,序列包括:第一状态的地址、元数据的地址以及第二状态的地址,其中,第一状态和第二状态用于描述元数据是否发生变化,第二状态的地址与第一状态的地址相同。之后,客户端可以接收服务端发送的数据响应,数据响应包括元数据、第一状态、以及第二状态。In the third aspect, the embodiment of the present application provides a data access method, which can be executed by the client. For the beneficial effects, please refer to the relevant description of the first aspect, and details will not be repeated here. In this method, the client can send a data request to the server, and the data request includes a sequence, and the sequence includes: the address of the first state, the address of the metadata, and the address of the second state, wherein the first state and the second state are used for Describes whether the metadata has changed, and the address of the second state is the same as the address of the first state. Afterwards, the client may receive the data response sent by the server, where the data response includes metadata, the first state, and the second state.
在一种可能的实现方式中,序列还包括目标数据的归属状态的地址,目标数据的归属状态的地址位于第二状态的地址之后,目标数据为元数据所描述的数据,数据响应还包括目标 数据的归属状态。In a possible implementation, the sequence further includes the address of the attribution state of the target data, the address of the attribution state of the target data is located after the address of the second state, the target data is the data described by the metadata, and the data response also includes the target The attribution status of the data.
在一种可能的实现方式中,客户端在接收到数据访问响应之后,可以对第一状态和第二状态进行比对,确定第一状态与第二状态是否一致。In a possible implementation manner, after receiving the data access response, the client may compare the first state with the second state to determine whether the first state is consistent with the second state.
在一种可能的实现方式中,元数据中记录了目标数据的归属状态,客户端在接收到数据访问响应之后,客户端可以对目标数据的归属状态以及该元数据中记录的目标数据的归属状态进行比对,确定目标数据的归属状态与元数据中记录的目标数据的归属状态是否一致。In a possible implementation, the attribution status of the target data is recorded in the metadata. After the client receives the data access response, the client can check the attribution status of the target data and the attribution of the target data recorded in the metadata. The status is compared to determine whether the attribution status of the target data is consistent with the attribution status of the target data recorded in the metadata.
在一种可能的实现方式中,客户端在确定元数据的完整性时,若数据响应中携带第一状态、第二状态以及元数据,客户端在确定第一状态与第二状态一致的情况下,根据元数据从服务端获取目标数据。In a possible implementation, when the client determines the integrity of the metadata, if the data response carries the first state, the second state, and the metadata, the client determines that the first state is consistent with the second state Next, the target data is obtained from the server according to the metadata.
若数据响应中携带第一状态、第二状态、元数据以及目标数据的归属状态,客户端在确定第一状态与第二状态一致、以及目标数据的归属状态与元数据中记录的目标数据的归属状态一致情况下,根据元数据从服务端获取目标数据。If the data response carries the first state, the second state, metadata, and the attribution state of the target data, the client determines that the first state is consistent with the second state, and that the attribution state of the target data is consistent with the target data recorded in the metadata. When the attribution status is consistent, the target data is obtained from the server according to the metadata.
若数据响应中携带第一状态、第二状态、元数据以及目标数据的归属状态,客户端在确定第一状态与第二状态不一致、或目标数据的归属状态与元数据中记录的目标数据的归属状态不一致情况下,客户端可以确定该元数据无效,客户端可以再次向服务端请求该元数据,或与服务端交互确定该目标数据归属的服务端。If the data response carries the first state, the second state, metadata, and the attribution state of the target data, the client determines that the first state is inconsistent with the second state, or that the attribution state of the target data is different from the target data recorded in the metadata. If the attribution status is inconsistent, the client can determine that the metadata is invalid, and the client can request the metadata from the server again, or interact with the server to determine the server to which the target data belongs.
在一种可能的实现方式中,序列还包括目标数据的归属状态的地址和目标数据的地址,目标数据的归属状态的地址位于第二状态的地址之后,目标数据的地址位于目标数据的归属状态的地址之后,目标数据为元数据所描述的数据;数据响应中包括目标数据的归属状态和目标数据。In a possible implementation, the sequence further includes the address of the home state of the target data and the address of the target data, the address of the home state of the target data is located after the address of the second state, and the address of the target data is located in the home state of the target data After the address of , the target data is the data described by the metadata; the data response includes the attribution status of the target data and the target data.
在一种可能的实现方式中,客户端向客户端发送数据请求时,可以基于RDMA向服务端的网卡发送数据请求。In a possible implementation manner, when the client sends a data request to the client, the data request may be sent to the network card of the server based on RDMA.
第四方面,本申请实施例还提供了一种数据访问装置,该数据访问装置具有实现上述第二方面的方法实例中行为的功能,有益效果可以参见第一方面的描述此处不再赘述。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的单元。在一个可能的设计中,装置的结构中包括接收单元、获取单元以及发送单元,这些单元可以执行上述第二方面方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。In the fourth aspect, the embodiment of the present application also provides a data access device, the data access device has the function of realizing the behavior in the method example of the second aspect above, and the beneficial effects can be referred to the description of the first aspect, which will not be repeated here. The functions may be implemented by hardware, or may be implemented by executing corresponding software through hardware. Hardware or software includes one or more units corresponding to the functions described above. In a possible design, the structure of the device includes a receiving unit, an acquiring unit, and a sending unit, and these units can perform the corresponding functions in the method example of the second aspect above. For details, refer to the detailed description in the method example, which will not be repeated here. .
第五方面,本申请实施例还提供了一种数据访问装置,该数据访问装置具有实现上述第三方面的方法实例中行为的功能,有益效果可以参见第一方面的描述此处不再赘述。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的单元。在一个可能的设计中,装置的结构中包括接收单元、以及发送单元,可选的,还包括确定单元,这些单元可以执行上述第三方面方法示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。In the fifth aspect, the embodiment of the present application also provides a data access device, the data access device has the function of implementing the behavior in the method example of the third aspect above, and the beneficial effects can be referred to the description of the first aspect, which will not be repeated here. The functions may be implemented by hardware, or may be implemented by executing corresponding software through hardware. Hardware or software includes one or more units corresponding to the functions described above. In a possible design, the structure of the device includes a receiving unit, a sending unit, and optionally a determining unit. These units can perform the corresponding functions in the method example of the third aspect above. For details, refer to the detailed description in the method example. description, and will not be repeated here.
第六方面,本申请实施例还提供了一种计算设备,该计算设备包括处理器、网卡以及存储器。In a sixth aspect, the embodiment of the present application further provides a computing device, where the computing device includes a processor, a network card, and a memory.
在一种可能的实施方式中,该网卡具有实现上述第二方面以及第二方面的各个可能的实现方式中的方法实例中行为的功能,有益效果可以参见第一方面的描述此处不再赘述。In a possible implementation manner, the network card has the function of realizing the above-mentioned second aspect and the behaviors in the method examples in each possible implementation manner of the second aspect. For the beneficial effects, please refer to the description of the first aspect and will not repeat them here. .
在另一种可能的实施方式中,存储器中存储计算机程序指令,处理器与存储器耦合,处理器可调用该存储器中存储的计算机执行指令,执行上述第三方面以及第三方面的各个可能 的实现方式中的方法。In another possible implementation manner, computer program instructions are stored in the memory, and the processor is coupled to the memory, and the processor can call the computer-executed instructions stored in the memory to execute the above third aspect and various possible implementations of the third aspect methods in methods.
第七方面,本申请还提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第二方面以及第二方面的各个可能的实现方式中的方法。当其在计算机上运行时,使得计算机执行上述第三方面以及第三方面的各个可能的实现方式中的方法。In the seventh aspect, the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when it is run on a computer, the computer executes the above-mentioned second aspect and various possible implementations of the second aspect methods in methods. When it runs on a computer, the computer is made to execute the third aspect and the method in each possible implementation manner of the third aspect.
第八方面,本申请还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第二方面以及第二方面的各个可能的实现方式中的方法。当其在计算机上运行时,使得计算机执行上述第三方面以及第三方面的各个可能的实现方式中的方法。In an eighth aspect, the present application further provides a computer program product including instructions, which, when run on a computer, cause the computer to execute the above second aspect and the method in each possible implementation manner of the second aspect. When it runs on a computer, the computer is made to execute the third aspect and the method in each possible implementation manner of the third aspect.
第九方面,本申请还提供一种计算机芯片,芯片与存储器相连,芯片用于读取并执行存储器中存储的软件程序,执行上述第二方面以及第二方面的各个可能的实现方式中的方法或执行上述第三方面以及第三方面的各个可能的实现方式中的方法。In the ninth aspect, the present application also provides a computer chip, the chip is connected to the memory, and the chip is used to read and execute the software program stored in the memory, and execute the method in the above-mentioned second aspect and each possible implementation manner of the second aspect Or execute the third aspect and the method in each possible implementation manner of the third aspect.
附图说明Description of drawings
图1为本申请提供的一种系统的架构示意图;FIG. 1 is a schematic structural diagram of a system provided by the present application;
图2为本申请提供的一种数据访问方法示意图;FIG. 2 is a schematic diagram of a data access method provided by the present application;
图3-图4为本申请提供的一种数据访问装置的结构示意图。3-4 are schematic structural diagrams of a data access device provided in the present application.
具体实施方式Detailed ways
在对本申请所提供的数据处理方法进行说明之前,先对本申请涉及的概念进行说明:Before explaining the data processing method provided by this application, first explain the concepts involved in this application:
1、元数据(metadata)。1. Metadata.
又称中介数据、中继数据。元数据为描述数据的数据(data about data),元数据可以指示数据的属性,如元数据可以记录数据的存储地址、数据的归属状态等。Also known as intermediary data and relay data. Metadata is data describing data (data about data). Metadata can indicate the attributes of data. For example, metadata can record the storage address of data, the attribution status of data, etc.
其中,该存储地址通常为该数据在存储系统中的物理地址,数据的归属状态描述的是存储系统中该元数据所描述的数据所在的节点。Wherein, the storage address is usually the physical address of the data in the storage system, and the attribution status of the data describes the node in the storage system where the data described by the metadata is located.
本申请实施例并不限定元数据记录数据的归属状态的方式,下面介绍一种记录数据的归属状态的方式。The embodiment of the present application does not limit the manner in which the metadata records the attribution status of the data, and a manner for recording the attribution status of the data is introduced below.
在存储系统中,数据是以分片为单位进行存储的,存储系统中节点之间的数据的迁移也可以以分片为单位进行。一个分片包括多个数据。对于任一分片,在存储系统中的节点之间每迁移一次,该分片的版本号会发生更新。例如,该分片从节点A迁移到节点B,节点A中记录的分片的分片版本号将保持不变,节点B上该分片的版本号会加一。另外,该分片中数据的元数据中可以包括分片的版本号。仍以分片从节点A迁移到节点B为例,在分片迁移之前,该分片中数据的元数据中分片的版本号与节点A记录的分片版本号一致,在分片迁移之后,向该分片写入新的数据时,新的数据的元数据中分片的版本号与节点B记录的分片版本号一致。需要说明的是,本申请实施例并不限定存储系统的类型,可以为分布式存储系统,也可以为集中式存储系统。In the storage system, data is stored in units of shards, and data migration between nodes in the storage system can also be performed in units of shards. A shard includes multiple pieces of data. For any shard, the version number of the shard will be updated every time it is migrated between nodes in the storage system. For example, if the shard is migrated from node A to node B, the shard version number of the shard recorded in node A will remain unchanged, and the version number of the shard on node B will be increased by one. In addition, the metadata of the data in the slice may include a version number of the slice. Still take the migration of a fragment from node A to node B as an example. Before the migration of the fragment, the version number of the fragment in the metadata of the data in the fragment is consistent with the version number of the fragment recorded by node A. After the migration of the fragment , when new data is written to the shard, the version number of the shard in the metadata of the new data is consistent with the version number of the shard recorded by Node B. It should be noted that the embodiment of the present application does not limit the type of the storage system, which may be a distributed storage system or a centralized storage system.
2、元数据状态。2. Metadata status.
元数据本身也可以看做一种数据。对于任一元数据,存在元数据的描述头,该描述头可以记录该元数据状态。当元数据发生更新时,该元数据状态也会相应更新。Metadata itself can also be regarded as a kind of data. For any metadata, there is a metadata description header, which can record the status of the metadata. When metadata is updated, the metadata status is updated accordingly.
本申请实施例并不限定记录该元数据状态的方式。例如,元数据状态可以利用一个可变的数值表征,每当元数据发生一次变化,该数值会加一。The embodiment of the present application does not limit the way of recording the metadata state. For example, the metadata status can be represented by a variable value, which is incremented by one every time the metadata changes.
3、远程直接内存访问(remote direct memory access,RDMA)。3. Remote direct memory access (RDMA).
RDMA是一种绕过远程设备(如存储系统中的节点)操作系统内核访问其内存中数据的技术,由于不经过操作系统,不仅节省了大量处理器资源,同样也提高了系统吞吐量、降低了系统的网络通信延迟,尤其适合在大规模并行计算机集群中有广泛应用。RDMA is a technology that bypasses the operating system kernel of a remote device (such as a node in a storage system) to access data in its memory. Because it does not go through the operating system, it not only saves a lot of processor resources, but also improves system throughput and reduces It reduces the network communication delay of the system, and is especially suitable for wide application in large-scale parallel computer clusters.
RDMA有几大特点,(1)数据通过网络与远程设备间进行数据传输;(2)没有操作系统内核的参与,有关发送传输的所有内容都卸载到网卡上;(3)在用户空间虚拟内存与网卡之间直接进行数据传输不涉及操作系统内核,没有额外的数据移动和复制。RDMA has several major characteristics, (1) data is transmitted between the network and the remote device; (2) without the participation of the operating system kernel, all content related to sending and transmitting is offloaded to the network card; (3) virtual memory in user space The direct data transmission between the NIC does not involve the operating system kernel, and there is no additional data movement and copying.
4、单边RDMA和双边RDMA。4. Unilateral RDMA and bilateral RDMA.
在这里将需要交互信息的两端分别称为客户端设备(简称客户端)和服务端。客户端部署在用户侧,用户可以通过客户端向服务端发起请求。服务端可以部署在远端,服务端泛指存储系统,具体可以理解为存储系统中的节点。Here, the two ends that need to exchange information are respectively referred to as a client device (client for short) and a server. The client is deployed on the user side, and the user can initiate a request to the server through the client. The server can be deployed at the remote end. The server generally refers to the storage system, and can be specifically understood as a node in the storage system.
单边RDMA包括RDMA读(READ)操作以及RDMA写(WRITE)操作。Unilateral RDMA includes RDMA read (READ) operations and RDMA write (WRITE) operations.
以单边RDMA中的RDMA读操作为例,RDMA读操作用于客户端读取服务端的存储空间中的数据。Taking the RDMA read operation in unilateral RDMA as an example, the RDMA read operation is used for the client to read data in the storage space of the server.
在客户端进行RDMA读操作之前,服务端首先允许客户端预先获取需要读取的数据的地址,即将RDMA读操作要读取的数据的地址、长度等信息发送给客户端。在本申请实施例中,数据的地址包括下列的部分或全部元数据的地址、元数据状态的地址、数据归属状态的地址、目标数据的地址等。客户端在获取需要读取的数据的地址后,可以直接通过服务器端的网卡从服务端的存储空间中读取数据,整个过程不需要处理器参与。Before the client performs the RDMA read operation, the server first allows the client to obtain the address of the data to be read in advance, that is, the address and length of the data to be read by the RDMA read operation are sent to the client. In this embodiment of the present application, the address of the data includes the address of some or all of the following metadata, the address of the metadata state, the address of the data attribution state, the address of the target data, and the like. After the client obtains the address of the data to be read, it can directly read the data from the storage space of the server through the network card of the server, and the whole process does not require the participation of the processor.
在本申请实施例中客户端设备可以采用单边RDMA的方式发送数据请求,从服务端中读取该数据请求所请求的数据。In the embodiment of the present application, the client device may send a data request in a unilateral RDMA manner, and read the data requested by the data request from the server.
双边RDMA包括RDMA发送(SEND)操作以及RDMA接收(RECEIVE)操作,该操作需要服务端的处理器参与。Bilateral RDMA includes an RDMA send (SEND) operation and an RDMA receive (RECEIVE) operation, which requires the participation of the server processor.
如图1所示,为本申请实施例提供的一种数据系统的结构示意图,该数据系统包括客户端120和服务端110,该服务端110可以为存储系统中的节点,本申请实施例并不限定存储系统的类型,可以为分布式存储系统,也可以为集中式存储系统。As shown in Figure 1, it is a schematic structural diagram of a data system provided by the embodiment of the present application. The data system includes a client 120 and a server 110. The server 110 may be a node in the storage system. The embodiment of the present application does not The type of the storage system is not limited, and may be a distributed storage system or a centralized storage system.
用户通过应用程序来存取数据。运行这些应用程序的计算机被称为“客户端设备”,也可以简称为客户端120。客户端120可以是物理机,也可以是虚拟机。物理机包括但不限于桌面电脑、服务器、笔记本电脑以及移动设备。Users access data through applications. The computers running these applications are called “client devices” and may also be referred to as clients 120 for short. Client 120 may be a physical machine or a virtual machine. Physical machines include, but are not limited to, desktop computers, servers, laptops, and mobile devices.
用户可以通过客户端120访问服务端110中的数据,如在服务端110中写入数据、或从服务端110中读取数据。Users can access data in the server 110 through the client 120 , such as writing data in the server 110 or reading data from the server 110 .
当客户端120检测到用户对应用程序的操作,确定用户需要访问服务端110中的数据,客户端120可以与服务端110进行交互,访问服务端110中的数据。When the client 120 detects the user's operation on the application program and determines that the user needs to access the data in the server 110 , the client 120 can interact with the server 110 to access the data in the server 110 .
客户端120在与服务端110交互访问服务端110中的数据时,客户端120可以先获取该数据的元数据,根据该数据的元数据获取该数据。When the client 120 interacts with the server 110 to access the data in the server 110, the client 120 may first obtain the metadata of the data, and obtain the data according to the metadata of the data.
在获取该数据的元数据时,客户端120可以通过一个数据请求向服务端110请求数据的元数据、以及服务端110在读取该元数据之前以及之后的状态。客户端120在获取数据的元数据、以及服务端110在读取该元数据之前以及之后的状态后,可以通过比对服务端110在读取该元数据之前以及之后的状态,确定数据的元数据的完整性,进一步可以确定利用该元数据所获取的数据的有效性。这样能够避免在读取元数据过程中,元数据发生变化,使得根 据元数据所获取的数据无效的情况。另外,通过一个数据请求就可以向服务端110请求多种数据,能够有效减少服务端110与客户端120之间的交互次数,提高数据访问效率。When acquiring the metadata of the data, the client 120 may request the metadata of the data from the server 110 through a data request, as well as the state of the server 110 before and after reading the metadata. After the client 120 obtains the metadata of the data and the status of the server 110 before and after reading the metadata, it can determine the metadata of the data by comparing the status of the server 110 before and after reading the metadata. The integrity of the data further determines the validity of the data obtained using this metadata. In this way, it can avoid the situation that the metadata obtained according to the metadata is invalid due to the change of the metadata during the process of reading the metadata. In addition, multiple data can be requested from the server 110 through one data request, which can effectively reduce the number of interactions between the server 110 and the client 120 and improve data access efficiency.
在获取该数据的元数据时,客户端120也可以通过一个数据请求向服务端110请求数据的元数据、服务端110在读取该元数据之前以及之后的状态、以及数据的归属状态。客户端120在获取数据的元数据、服务端110在读取该元数据之前以及之后的状态、以及数据的归属状态后,可以通过比对服务端110在读取该元数据之前以及之后的状态、或比对获取的数据的归属状态以及元数据中记录的数据的归属状态,确定数据的元数据的完整性,进一步确定利用元数据所获取的数据的有效性。这样能够避免在读取元数据过程中,元数据发生变化或数据的归属状态发生变化,使得根据元数据所获取的数据无效的情况。另外,通过一个数据请求就可以向服务端110请求多种数据,能够有效减少服务端110与客户端120之间的交互次数,提高数据访问效率。When acquiring the metadata of the data, the client 120 may also request the metadata of the data, the status of the server 110 before and after reading the metadata, and the attribution status of the data from the server 110 through a data request. After the client 120 obtains the metadata of the data, the status of the server 110 before and after reading the metadata, and the attribution status of the data, it can compare the status of the server 110 before and after reading the metadata , or compare the attribution status of the acquired data with the attribution status of the data recorded in the metadata, determine the integrity of the metadata of the data, and further determine the validity of the data acquired by using the metadata. In this way, it is possible to avoid the situation that the metadata obtained according to the metadata is invalid due to the change of the metadata or the change of the attribution status of the data during the process of reading the metadata. In addition, multiple data can be requested from the server 110 through one data request, which can effectively reduce the number of interactions between the server 110 and the client 120 and improve data access efficiency.
客户端120在与服务端110交互访问服务端110中的数据时,客户端120可以在获取该数据的元数据的同时,利用之前保存的该数据的数据地址获取该数据。客户端120在获取该数据的元数据时,客户端120可以通过一个数据请求向服务端110请求数据的元数据、服务端110在读取该元数据之前以及之后的状态、以及该数据(该数据请求中携带有数据地址)。客户端120在获取数据的元数据、以及服务端110在读取该元数据之前以及之后的状态后,可以通过比对服务端110在读取该元数据之前以及之后的状态,确定数据的元数据的完整性,进一步确定利用之前保存的该数据的数据地址获取该数据的有效性。这样能够避免在读取元数据过程中,元数据发生变化,使得根据元数据所获取的数据无效的情况。在确定元数据完整的情况下,获得的数据也有效,也就无需再利用元数据获取该数据,能够减少服务端110与客户端120的交互次数。另外,通过一个数据请求就可以向服务端110请求多种数据,能够有效减少服务端110与客户端120之间的交互次数,提高数据访问效率。When the client 120 interacts with the server 110 to access the data in the server 110 , the client 120 can acquire the data by using the previously saved data address of the data while acquiring the metadata of the data. When the client 120 obtains the metadata of the data, the client 120 may request the server 110 for the metadata of the data, the state of the server 110 before and after reading the metadata, and the data (the The data request carries the data address). After the client 120 obtains the metadata of the data and the status of the server 110 before and after reading the metadata, it can determine the metadata of the data by comparing the status of the server 110 before and after reading the metadata. The integrity of the data further determines the validity of obtaining the data by using the previously saved data address of the data. In this way, it can avoid the situation that the metadata obtained according to the metadata is invalid due to the change of the metadata during the process of reading the metadata. When it is determined that the metadata is complete, the obtained data is also valid, and there is no need to use the metadata to obtain the data, which can reduce the number of interactions between the server 110 and the client 120 . In addition, multiple data can be requested from the server 110 through one data request, which can effectively reduce the number of interactions between the server 110 and the client 120 and improve data access efficiency.
具体到服务端110的结构,参见图3,该服务端110包括总线111、处理器112、内存113、网卡114以及硬盘115。Specifically, referring to FIG. 3 for the structure of the server 110 , the server 110 includes a bus 111 , a processor 112 , a memory 113 , a network card 114 and a hard disk 115 .
需要说明的是,在本申请实施例中以硬盘作为服务端110的持久化存储器为例进行说明,但对机械硬盘或者其他类型的硬盘也同样适用于本申请实施例。It should be noted that, in the embodiment of the present application, a hard disk is used as the persistent storage of the server 110 as an example for illustration, but mechanical hard disks or other types of hard disks are also applicable to the embodiments of the present application.
处理器112可以为中央处理器(central processing unit,CPU),该处理器112还可以是其他通用处理器或具备计算功能的模块等。The processor 112 may be a central processing unit (central processing unit, CPU), and the processor 112 may also be other general-purpose processors or modules with computing functions.
内存113可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)、动态随机存取存储器(dynamic random access memory,DRAM)等。也可以为非易失性存储器(non-volatile memory),例如存储级存储器(storage-class memory,SCM)等,或者易失性存储器与非易失性存储器的组合等。The memory 113 may include a volatile memory (volatile memory), such as a random access memory (random access memory, RAM), a dynamic random access memory (dynamic random access memory, DRAM), and the like. It may also be a non-volatile memory (non-volatile memory), such as a storage-class memory (storage-class memory, SCM), or a combination of a volatile memory and a non-volatile memory.
该服务端110中还可以包括一个或多个硬盘115。这硬盘115可以用于永久地存储数据。具体到硬盘115内部,硬盘115中也可以包括硬盘缓存以及持久化存储介质。The server 110 may also include one or more hard disks 115 . The hard disk 115 can be used to permanently store data. Specifically, inside the hard disk 115, the hard disk 115 may also include a hard disk cache and a persistent storage medium.
网卡114用于与客户端120通信,接收客户端120发送的数据请求。The network card 114 is used for communicating with the client 120 and receiving a data request sent by the client 120 .
当客户端120向服务端110发送数据请求(例如客户端120采用单边RDMA与服务端110交互)时,在服务端110内部,网卡可以处理该数据请求,根据该数据请求向客户端120反馈该数据请求所请求的数据。例如,网卡114可以通过调用内存113中存储的计算机执行指令,处理该数据访问请求,也即执行本申请实施例提供的数据访问方法。又例如,网卡114也可以调用网卡114内部存储的计算机执行指令,执行本申请实施例提供的数据访问方法。 又例如,网卡114上也可以烧写有计算机存储指令,网卡114可以执行本申请实施例提供的数据访问方法。When the client 120 sends a data request to the server 110 (for example, the client 120 uses unilateral RDMA to interact with the server 110), inside the server 110, the network card can process the data request, and feed back to the client 120 according to the data request The data request requests the data. For example, the network card 114 may process the data access request by invoking the computer-executed instructions stored in the memory 113, that is, execute the data access method provided in the embodiment of the present application. For another example, the network card 114 may also invoke computer-executed instructions stored inside the network card 114 to execute the data access method provided in the embodiment of the present application. For another example, computer storage instructions may also be programmed on the network card 114, and the network card 114 may execute the data access method provided in the embodiment of the present application.
具体到客户端120的结构,参见图3,该客户端120包括总线121、处理器122、内存123、网卡124。关于总线121、处理器122、内存123、网卡124的功能和作用与总线111、处理器112、内存113、网卡114以及硬盘115类似,具体可以参见前述说明,此处不再赘述。Specifically, referring to FIG. 3 for the structure of the client 120 , the client 120 includes a bus 121 , a processor 122 , a memory 123 , and a network card 124 . The functions and functions of the bus 121, processor 122, memory 123, and network card 124 are similar to those of the bus 111, processor 112, memory 113, network card 114, and hard disk 115. For details, please refer to the foregoing description, and will not repeat them here.
当客户端120与服务端110交互时,在客户端120内部,处理器122可以调用内存123存储的计算机执行指令,执行本申请实施例提供的数据访问方法。When the client 120 interacts with the server 110, inside the client 120, the processor 122 can call the computer execution instructions stored in the memory 123 to execute the data access method provided by the embodiment of the present application.
下面结合如图2,对本申请实施例提供的数据访问方法进行说明,为了方便说明,将该元数据所描述的数据称为目标数据。该方法包括:The following describes the data access method provided by the embodiment of the present application with reference to FIG. 2 . For the convenience of description, the data described by the metadata is called target data. The method includes:
步骤201:客户端120在需要访问目标数据时,向服务端110发送数据请求。该数据请求用于向服务端110请求数据,该数据请求中携带有地址序列(地址序列也可以简称为序列),该地址序列包括多个地址。该多个地址为需要向服务端110请求的数据的地址。Step 201: the client 120 sends a data request to the server 110 when it needs to access target data. The data request is used to request data from the server 110, and the data request carries an address sequence (the address sequence may also be referred to as a sequence for short), and the address sequence includes multiple addresses. The multiple addresses are the addresses of the data that needs to be requested from the server 110 .
用户可以通过操作运行在客户端120上的应用程序,触发客户端120访问存储在服务器中的目标数据。The user can trigger the client 120 to access the target data stored in the server by operating the application program running on the client 120 .
客户端120在访问目标数据时,需要先获取该目标数据的元数据,根据该元数据确定该目标数据的数据地址,进而客户端120可以根据该目标数据的元数据向服务端110请求该目标数据。When the client 120 accesses the target data, it needs to obtain the metadata of the target data first, and determine the data address of the target data according to the metadata, and then the client 120 can request the target from the server 110 according to the metadata of the target data. data.
也就是说,客户端120需要先获取元数据,该数据请求所请求的数据包括元数据,另外为了保证元数据的完整性,该数据请求所请求的数据还可以包括其他数据,下面对数据请求所中地址序列包括的地址类型以及该数据请求所请求的数据进行说明:That is to say, the client 120 needs to obtain metadata first, and the data requested by the data request includes metadata. In addition, in order to ensure the integrity of the metadata, the data requested by the data request may also include other data. The address types included in the address sequence in the request and the data requested by the data request are explained:
第一种、地址序列中按序包括元数据状态的地址、元数据的地址、元数据状态的地址。该数据请求用于请求的数据为元数据、读取该元数据之前元数据状态以及读取该元数据状态之后元数据状态。为了方便区分,读取该元数据之前的元数据状态以及读取该元数据状态之后的元数据状态,在本申请实施例中,将读取该元数据之前的元数据状态称为第一状态。将读取该元数据之后的元数据状态称为第二状态。这里的元数据的地址是指目标数据的元数据的地址。元数据状态的地址是指该目标数据的元数据状态的地址。例如,该元数据状态的地址可以为该目标数据的元数据的描述头的地址。In the first type, the address sequence includes the address of the metadata state, the address of the metadata, and the address of the metadata state in order. The data requested in the data request is metadata, a state of the metadata before reading the metadata, and a state of the metadata after reading the state of the metadata. In order to facilitate distinction, the metadata state before reading the metadata and the metadata state after reading the metadata state, in this embodiment of the application, the metadata state before reading the metadata is referred to as the first state . The state of the metadata after reading the metadata is referred to as the second state. The address of the metadata here refers to the address of the metadata of the target data. The address of the metadata state refers to the address of the metadata state of the target data. For example, the address of the metadata state may be the address of the description header of the metadata of the target data.
第二种、地址序列中按序包括第一状态的地址、元数据的地址、第二状态的地址、目标数据的归属状态的地址。该数据请求用于请求的数据为元数据、第一状态以及第二状态。这里的数据归属状态的地址是指该目标数据的归属状态的地址。例如,该数据归属状态可以为服务端110中该目标数据所属的分片的版本号,该数据归属状态的地址即为该服务端110中记录该分配的版本号的地址。In the second type, the address sequence includes in order the address of the first state, the address of the metadata, the address of the second state, and the address of the attribution state of the target data. The data requested in the data request are metadata, the first state and the second state. Here, the address of the data attribution status refers to the address of the attribution status of the target data. For example, the data attribution status may be the version number of the segment to which the target data belongs in the server 110 , and the address of the data attribution status is the address in the server 110 that records the allocated version number.
第三种、地址序列中按序包括第一状态的地址、元数据的地址、第二状态的地址、目标数据的归属状态的地址、目标数据的地址。该数据请求用于请求的数据为元数据、第一状态、第二状态、目标数据的归属状态以及目标数据。目标数据的地址为客户端120在之前读取该目标数据时所使用的地址,如客户端120之前也读取过目标数据,客户端120在之前读取目标数据时,可以在本地保存该目标数据的元数据或该目标数据的地址。In the third type, the address sequence includes the address of the first state, the address of the metadata, the address of the second state, the address of the belonging state of the target data, and the address of the target data in order. The data requested in the data request are metadata, the first state, the second state, the attribution state of the target data, and the target data. The address of the target data is the address used by the client 120 to read the target data before. If the client 120 has also read the target data before, the client 120 can save the target locally when reading the target data. The metadata of the data or the address of that target data.
第四种、地址序列中按序包括第一状态的地址、元数据的地址、第二状态的地址、目标数据的地址。该数据请求用于请求的数据为元数据、第一状态、第二状态、以及目标数据。Fourth, the address sequence includes the address of the first state, the address of the metadata, the address of the second state, and the address of the target data in sequence. The data requested by the data request are metadata, first state, second state, and target data.
值得注意的是,上述地址序列中可能包括的地址为客户端120可以预先获取的,本申请 实施例并限定客户端120预先获取该地址序列中包括的地址的方式。例如,对于元数据地址,服务端110可以将各个元数据集中存储在内存中,服务端110可以预先向客户端120提供内存中元数据的起始地址,客户端120设备基于预设的算法计算对于元数据的起始地址进行处理,获得该目标数据的元数据的地址。又例如,对于元数据状态地址,服务端110在存储各个元数据状态时,可以建立元数据状态的地址与相应元数据的地址的关联关系。该关联关系可以是服务端110预先通知给客户端120的,也可以是服务端110与客户端120之间预先预定的。客户端120在确定了元数据的地址之后,可以基于该关联关系和元数据的地址确定该元数据状态的地址。又例如,对于目标数据的归属状态的地址,服务端110可以预先将记录各个分片的版本号的地址通知给客户端120,当客户端120需要确定该目标数据的归属状态时,可以先确定该目标数据所属的分片,之后再进一步确定记录该分片的版本的地址。It should be noted that the addresses that may be included in the above address sequence can be pre-acquired by the client 120, and this embodiment of this application does not limit the way that the client 120 pre-acquires the addresses included in the address sequence. For example, for the metadata address, the server 110 can centrally store each metadata in the memory, the server 110 can provide the client 120 with the starting address of the metadata in the memory in advance, and the client 120 device calculates based on a preset algorithm The starting address of the metadata is processed to obtain the address of the metadata of the target data. For another example, for metadata state addresses, when storing each metadata state, the server 110 may establish an association relationship between the address of the metadata state and the address of the corresponding metadata. The association relationship may be notified to the client 120 by the server 110 in advance, or may be pre-scheduled between the server 110 and the client 120 . After determining the address of the metadata, the client 120 may determine the address of the metadata state based on the association relationship and the address of the metadata. For another example, for the address of the attribution status of the target data, the server 110 may notify the client 120 of the address for recording the version number of each fragment in advance, and when the client 120 needs to determine the attribution status of the target data, it may first determine The segment to which the target data belongs is further determined to record the address of the version of the segment.
步骤202:服务端110接收该数据请求,根据该数据请求获取该数据所请求的数据。Step 202: the server 110 receives the data request, and obtains the data requested by the data according to the data request.
服务端110在接收到该数据请求后,可以获取该数据请求中的地址序列;服务端110按照该地址序列中多个地址的顺序,依次根据各个地址获取该地址上存储的数据。下面对服务端110处理不同地址序列的方式进行说明:After receiving the data request, the server 110 can obtain the address sequence in the data request; the server 110 obtains the data stored at the address according to the order of multiple addresses in the address sequence. The manner in which the server 110 processes different address sequences is described below:
第一种、地址序列中按序包括元数据状态的地址、元数据的地址、元数据状态的地址。In the first type, the address sequence includes the address of the metadata state, the address of the metadata, and the address of the metadata state in order.
服务端110先根据元数据状态的地址读取第一状态,之后再根据元数据的地址读取元数据,再获取元数据之后,再根据元数据状态的地址读取第二状态。The server 110 first reads the first state according to the address of the metadata state, then reads the metadata according to the address of the metadata, and then reads the second state according to the address of the metadata state after obtaining the metadata.
可见,服务端110在处理该地址序列时,在读取元数据之前以及读取元数据之后,分别读取一次元数据状态,读取的元数据状态分别为第一状态、以及第二状态。It can be seen that when processing the address sequence, the server 110 reads the metadata status once before and after reading the metadata, and the read metadata status is the first status and the second status respectively.
对于服务端110,服务端110自身对数据的处理或服务端110之间的交互,会使得该数据的元数据发生变化。例如,服务端110在服务端110内部对数据进行迁移(元数据记录的数据地址会变化)、修改、删除(该数据的元数据可能会被删除)。服务端110对数据进行处理,可能会导致该数据的元数据的变化,也即服务端110可能会对数据的元数据进行更新,导致元数据状态发生变化。若客户端120发送数据请求以获取元数据的同时,服务端110对该元数据进行了更新,那么可能会导致客户端120从服务器获取的元数据是不完整的。在本申请实施例中,为了避免客户端120在从服务端110获取元数据(也可以理解为,服务端110在客户端120的请求下读取元数据)同时,元数据在更新。数据请求中所携带的地址序列中在元数据的地址之前以及之后还放置有元数据状态的地址。这样,客户端120除了从服务端110获取元数据,还可以从服务器获取读取该元数据之前以及读取该元数据之后的元数据的状态。For the server 110, the processing of the data by the server 110 itself or the interaction between the servers 110 will cause the metadata of the data to change. For example, the server 110 performs data migration (the data address of the metadata record will change), modification, and deletion (the metadata of the data may be deleted) within the server 110 . The processing of the data by the server 110 may lead to changes in the metadata of the data, that is, the server 110 may update the metadata of the data, resulting in a change in the status of the metadata. If the server 110 updates the metadata while the client 120 sends a data request to obtain the metadata, the metadata obtained by the client 120 from the server may be incomplete. In this embodiment of the present application, in order to prevent the client 120 from updating the metadata while the client 120 is obtaining the metadata from the server 110 (it can also be understood that the server 110 reads the metadata at the request of the client 120 ). In the address sequence carried in the data request, the address of the metadata state is also placed before and after the address of the metadata. In this way, in addition to obtaining the metadata from the server 110, the client 120 may also obtain the state of the metadata before and after reading the metadata from the server.
第二种、地址序列中按序包括元数据状态的地址、元数据的地址、元数据状态的地址、目标数据的归属状态的地址。In the second type, the address sequence includes in order the address of the metadata state, the address of the metadata, the address of the metadata state, and the address of the attribution state of the target data.
服务端110先根据元数据状态的地址读取第一状态,之后再根据元数据的地址读取元数据,再获取元数据之后,再根据元数据状态的地址读取第二状态,之后再根据目标数据的归属状态的地址读取目标数据的归属状态。The server 110 first reads the first state according to the address of the metadata state, then reads the metadata according to the address of the metadata, and after obtaining the metadata, reads the second state according to the address of the metadata state, and then reads the second state according to the address of the metadata state. The address of the attribution status of the target data reads the attribution status of the target data.
可见,服务端110在处理该地址序列时,除了读取元数据、第一状态、以及第二状态,还读取目标数据的归属状态。It can be seen that, when processing the address sequence, the server 110 not only reads the metadata, the first status, and the second status, but also reads the attribution status of the target data.
关于获取第一状态以及第二状态的原因可以参见前述说明,此处不再赘述。For the reasons for obtaining the first state and the second state, reference may be made to the foregoing description, which will not be repeated here.
对于服务端110,服务端110自身对数据的处理或服务端110之间的交互,会使得该数据的所在服务端110发生变化,如该目标数据所属的分片从该服务端110迁移到其他服务端 110,也即该数据归属状态发生变化。例如,服务端110与其他服务端110之间可以进行数据迁移,会导致数据的归属从该服务端110变为另一个服务端110,服务端110自身可以进行数据删除,会导致数据不存在所归属的服务端110。若客户端120发送数据请求以获取数据请求的同时,该目标数据的归属状态发生了变化,那么可能会导致客户端120从服务器获取的元数据是不完整的。在本申请实施例中,为了避免客户端120在从服务端110获取元数据(也可以理解为,服务端110在客户端120的请求下读取元数据)同时,该目标数据的归属状态在变化。数据请求中所携带的地址序列还包括了数据归属状态的地址。这样,客户端120除了从服务端110获取元数据,还可以从服务器获取读取该目标数据的归属状态。For the server 110, the processing of the data by the server 110 itself or the interaction between the servers 110 will cause the server 110 where the data is located to change, for example, the shard to which the target data belongs is migrated from the server 110 to another The server 110, that is, the data ownership status changes. For example, data migration can be performed between the server 110 and other server 110, which will cause the ownership of the data to change from the server 110 to another server 110, and the server 110 itself can delete data, which will cause the data to no longer exist. Attributed server 110 . If the attribution status of the target data changes when the client 120 sends a data request to obtain the data request, the metadata obtained by the client 120 from the server may be incomplete. In this embodiment of the application, in order to prevent the client 120 from obtaining metadata from the server 110 (it can also be understood that the server 110 reads the metadata under the request of the client 120), the attribution status of the target data is in the Variety. The address sequence carried in the data request also includes the address of the data attribution status. In this way, in addition to acquiring metadata from the server 110, the client 120 can also acquire the attribution status of the read target data from the server.
第三种、地址序列中按序包括第一状态的地址、元数据的地址、第二状态的地址、目标数据的归属状态的地址、目标数据的地址。该数据请求用于请求的数据为元数据、第一状态、第二状态、目标数据的归属状态以及目标数据。In the third type, the address sequence includes the address of the first state, the address of the metadata, the address of the second state, the address of the belonging state of the target data, and the address of the target data in sequence. The data requested in the data request are metadata, the first state, the second state, the attribution state of the target data, and the target data.
服务端110先根据元数据状态的地址读取第一状态,之后再根据元数据的地址读取元数据,再获取元数据之后,再根据元数据状态的地址读取第二状态,之后再根据数据归属状态读取数据归属状态,之后在根据目标数据的地址读取目标数据。The server 110 first reads the first state according to the address of the metadata state, then reads the metadata according to the address of the metadata, and after obtaining the metadata, reads the second state according to the address of the metadata state, and then reads the second state according to the address of the metadata state. The data attribution status reads the data attribution status, and then reads the target data according to the address of the target data.
可见,服务端110在处理该地址序列时,除了读取元数据、第一状态、第二状态,以及数据归属状态,还会读取目标数据。It can be seen that, when processing the address sequence, the server 110 will not only read the metadata, the first state, the second state, and the data attribution state, but also read the target data.
关于读取第一状态、第二状态以及数据归属状态的原因可以参见前述说明,此处不再赘述。The reasons for reading the first state, the second state, and the data attribution state can be referred to the foregoing description, and will not be repeated here.
该地址序列中还携带有目标数据的地址,该目标数据的地址为客户端120在此之前从服务端110访问目标数据时所采用的地址。客户端120可以在之前访问该目标数据时,保存该目标数据的地址。由于该地址序列中携带了目标数据的地址,也即是说,服务端110也会读取该目标数据,并反馈给客户端120设备,当客户端120在确定了元数据的完整性后,也就确定了服务端110反馈的目标数据的有效性,在该目标数据有效的情况下,客户端120也就无需再根据元数据从服务端110获取目标数据,而直接获取此次服务端110反馈的目标数据即可。The address sequence also carries the address of the target data, which is the address used by the client 120 to access the target data from the server 110 before. The client 120 may save the address of the target data when accessing the target data before. Since the address sequence carries the address of the target data, that is to say, the server 110 will also read the target data and feed it back to the client 120 device. After the client 120 determines the integrity of the metadata, It also determines the validity of the target data fed back by the server 110. If the target data is valid, the client 120 does not need to obtain the target data from the server 110 according to the metadata, but directly obtains the target data from the server 110 this time. Feedback target data is enough.
第四种、地址序列中按序包括第一状态的地址、元数据的地址、第二状态的地址、目标数据的地址。该数据请求用于请求的数据为元数据、第一状态、第二状态、以及目标数据。Fourth, the address sequence includes the address of the first state, the address of the metadata, the address of the second state, and the address of the target data in order. The data requested by the data request are metadata, first state, second state, and target data.
服务端110先根据元数据状态的地址读取第一状态,之后再根据元数据的地址读取元数据,再获取元数据之后,再根据元数据状态的地址读取第二状态,之后再根据目标数据的地址读取目标数据。The server 110 first reads the first state according to the address of the metadata state, then reads the metadata according to the address of the metadata, and after obtaining the metadata, reads the second state according to the address of the metadata state, and then reads the second state according to the address of the metadata state. The address of the target data reads the target data.
可见,服务端110在处理该地址序列时,除了读取元数据、第一状态、第二状态,还会读取目标数据。It can be seen that, when processing the address sequence, the server 110 will not only read the metadata, the first state, and the second state, but also read the target data.
关于读取第一状态、第二状态以及目标数据的原因可以参见前述说明,此处不再赘述。For the reasons for reading the first state, the second state, and the target data, reference may be made to the foregoing description, which will not be repeated here.
步骤203:服务端110向客户端120反馈数据响应,该数据响应中携带有该服务端110读取的数据。Step 203: The server 110 feeds back a data response to the client 120, and the data response carries the data read by the server 110.
服务端110在按照地址序列读取了数据之后,可以向客户端120反馈携带有所读取的数据。After the server 110 reads the data according to the address sequence, it can feed back the read data to the client 120 .
当地址序列中按序包括第一状态的地址、元数据的地址、第二状态的地址。该数据响应 中包括第一状态、元数据、第二状态。When the address sequence includes the address of the first state, the address of the metadata, and the address of the second state in order. The data response includes the first state, metadata, and the second state.
当地址序列中按序包括第一状态的地址、元数据的地址、第二状态的地址、目标数据的归属状态的地址。该数据响应中包括第一状态、元数据以及第二状态、目标数据的归属状态。When the address sequence includes the address of the first state, the address of the metadata, the address of the second state, and the address of the belonging state of the target data in order. The data response includes the first status, metadata and the second status, the attribution status of the target data.
当地址序列中按序包括第一状态的地址、元数据的地址、第二状态的地址、目标数据的归属状态的地址、目标数据的地址。该数据响应包括第一状态、元数据、第二状态、目标数据的归属状态以及目标数据。When the address sequence includes the address of the first state, the address of the metadata, the address of the second state, the address of the belonging state of the target data, and the address of the target data in order. The data response includes a first status, metadata, a second status, an attribution status of the target data, and the target data.
当地址序列中按序包括第一状态的地址、元数据的地址、第二状态的地址、目标数据的地址。该数据响应包括第一状态、元数据、第二状态、以及目标数据。When the address sequence includes the address of the first state, the address of the metadata, the address of the second state, and the address of the target data in order. The data response includes a first state, metadata, a second state, and target data.
步骤204:客户端120接收该数据响应,根据该数据响应校验元数据的完整性。Step 204: the client 120 receives the data response, and checks the integrity of the metadata according to the data response.
客户端120在接收到该数据响应后,可以解析该数据响应中携带的数据,以确定元数据的完整性。After receiving the data response, the client 120 may parse the data carried in the data response to determine the integrity of the metadata.
当该数据响应中包括第一状态、元数据、第二状态。When the data response includes the first state, metadata, and the second state.
客户端120可以对第一状态和第二状态进行比对,当确定第一状态以及第二状态一致,说明元数据在读取之前以及读取之后未发生变化,数据响应中携带的元数据完整,客户端120可以基于该元数据向服务端110请求读取目标数据。当确定第一状态以及第二状态不一致,说明元数据在读取之前以及读取之后发生了变化,数据响应中携带的元数据不完整,客户端120可以再次向服务端110请求元数据,客户端120也可以采用双边RDMA与服务端110交互获取该目标数据。The client 120 can compare the first state with the second state. When it is determined that the first state and the second state are consistent, it means that the metadata has not changed before and after reading, and the metadata carried in the data response is complete. , the client 120 may request the server 110 to read the target data based on the metadata. When it is determined that the first state and the second state are inconsistent, it means that the metadata has changed before and after reading, and the metadata carried in the data response is incomplete, the client 120 can request the metadata from the server 110 again, and the client The terminal 120 may also use bilateral RDMA to interact with the server 110 to obtain the target data.
当该数据响应中包括第一状态、元数据以及第二状态、目标数据的归属状态。When the data response includes the first status, metadata and the second status, the attribution status of the target data.
客户端120可以对第一状态和第二状态进行比对,对元数据中记录的目标数据的归属状态以及数据响应中携带的目标数据的归属状态比对。当上述两种比对的结果均指示一致,说明此次获取的元数据完整,且目标数据的归属状态未发生变化,客户端120可以基于该元数据向服务端110请求读取目标数据。当上述两种比对中至少存在一个结果指示不一致,说明此次获取的元数据不完整。之后,客户端120可以再次向服务端110请求元数据,客户端120也可以采用双边RDMA与服务端110交互获取该目标数据。当目标数据的归属状态不一致,客户端120可以与服务端110交互确定该目标数据所归属的服务端110,之后,客户端120可以与该目标数据所归属的服务端110交互获取该目标数据。The client 120 may compare the first status with the second status, and compare the attribution status of the target data recorded in the metadata with the attribution status of the target data carried in the data response. When the results of the above two comparisons are consistent, it means that the metadata obtained this time is complete and the attribution status of the target data has not changed. The client 120 can request the server 110 to read the target data based on the metadata. When at least one result of the above two comparisons indicates inconsistency, it means that the metadata obtained this time is incomplete. Afterwards, the client 120 may request the metadata from the server 110 again, and the client 120 may also use bilateral RDMA to interact with the server 110 to obtain the target data. When the attribution status of the target data is inconsistent, the client 120 can interact with the server 110 to determine the server 110 to which the target data belongs, and then the client 120 can interact with the server 110 to which the target data belongs to obtain the target data.
当该数据响应包括第一状态、元数据、第二状态、目标数据的归属状态以及目标数据。When the data response includes the first status, the metadata, the second status, the attribution status of the target data, and the target data.
客户端120可以对第一状态和第二状态进行比对,对元数据中记录的数据归属状态以及数据响应中携带的数据归属状态比对。当上述两种比对的结果均指示一致,说明此次获取的元数据完整,且数据的归属状态未发生变化,数据响应中携带的目标数据是有效的,客户端120可以直接从数据响应中读取目标数据。当上述两种比对中至少存在一个结果指示不一致,说明此次获取的元数据不完整。之后,客户端120可以再次向服务端110请求元数据,客户端120也可以采用双边RDMA与服务端110交互获取该目标数据。当目标数据的归属状态不一致,客户端120可以与服务端110交互确定该目标数据所归属的服务端110,之后,客户端120可以与该目标数据所归属的服务端110交互获取该目标数据。The client 120 may compare the first status with the second status, and compare the data attribution status recorded in the metadata with the data attribution status carried in the data response. When the results of the above two comparisons are consistent, it means that the metadata obtained this time is complete, and the attribution status of the data has not changed, and the target data carried in the data response is valid, and the client 120 can directly obtain the data from the data response. Read target data. When at least one result of the above two comparisons indicates inconsistency, it means that the metadata obtained this time is incomplete. Afterwards, the client 120 may request the metadata from the server 110 again, and the client 120 may also use bilateral RDMA to interact with the server 110 to obtain the target data. When the attribution status of the target data is inconsistent, the client 120 can interact with the server 110 to determine the server 110 to which the target data belongs, and then the client 120 can interact with the server 110 to which the target data belongs to obtain the target data.
需要说明的是,若客户端120之前本地保存过目标数据的元数据,客户端120除了对第一状态和第二状态进行比对,对元数据中记录的数据归属状态以及数据响应中携带的数据归属状态比对,还可以对本地保存的目标数据的元数据以及此次获取的元数据进行比对。也即这种情况下需要进行三种比对,当这三种比对的结果均指示一致,说明此次获取的元数据完 整,客户端120可以直接从数据响应中读取目标数据。当这三种比对中至少一个结果指示不一致,说明此次读取的目标数据无效,客户端120不能直接使用数据响应中的目标数据,客户端120可以根据数据响应中的元数据从服务端110重新获取目标数据(如三种比对中只有本地保存的目标数据的元数据与此次获取的元数据的比对的结果指示不一致),客户端120也可以按照前述方式获取目标数据。It should be noted that, if the client 120 has saved the metadata of the target data locally before, the client 120 will not only compare the first state with the second state, but also compare the data attribution state recorded in the metadata and the data carried in the data response. The data attribution status comparison can also compare the metadata of the target data stored locally with the metadata obtained this time. That is to say, three kinds of comparisons need to be performed in this case, and when the results of these three kinds of comparisons all indicate the same, it means that the metadata obtained this time is complete, and the client 120 can directly read the target data from the data response. When at least one of the three comparisons indicates an inconsistency, it means that the target data read this time is invalid, and the client 120 cannot directly use the target data in the data response. 110 reacquires the target data (for example, among the three types of comparisons, only the locally stored metadata of the target data is inconsistent with the metadata obtained this time), and the client 120 can also acquire the target data in the aforementioned manner.
当该数据响应包括第一状态、元数据、第二状态、以及目标数据。When the data response includes the first state, metadata, second state, and target data.
客户端120可以对第一状态和第二状态进行比对。当比对的结果指示一致,说明此次获取的元数据完整,数据响应中携带的目标数据是有效的,客户端120可以直接从数据响应中读取目标数据。当比对的结果指示不一致,说明此次获取的元数据不完整,之后,客户端120可以再次向服务端110请求元数据。客户端120也可以采用双边RDMA与服务端110交互获取该目标数据。The client 120 can compare the first state with the second state. When the comparison results indicate that they are consistent, it means that the metadata acquired this time is complete, and the target data carried in the data response is valid, and the client 120 can directly read the target data from the data response. When the result of the comparison indicates inconsistency, it means that the metadata obtained this time is incomplete. After that, the client 120 can request the metadata from the server 110 again. The client 120 may also use bilateral RDMA to interact with the server 110 to acquire the target data.
需要说明的是,若客户端120之前本地保存过目标数据的元数据,客户端120除了对第一状态和第二状态进行比对,还可以对本地保存的目标数据的元数据以及此次获取的元数据进行比对。也即这种情况下需要进行两种比对,当这两种比对的结果均指示一致,说明此次获取的元数据完整,客户端120可以直接从数据响应中读取目标数据。当这两种比对中至少一个结果指示不一致,说明此次读取的目标数据无效,客户端120不能直接使用数据响应中的目标数据,客户端120可以根据数据响应中的元数据从服务端110重新获取目标数据(如两种比对中只有本地保存的目标数据的元数据与此次获取的元数据的比对的结果指示不一致),客户端120也可以按照前述方式获取目标数据。It should be noted that, if the client 120 has stored the metadata of the target data locally before, the client 120 can compare the metadata of the target data stored locally and the obtained metadata for comparison. That is to say, in this case, two comparisons need to be performed. When the results of the two comparisons indicate the same, it means that the metadata acquired this time is complete, and the client 120 can directly read the target data from the data response. When at least one of the results of these two comparisons indicates an inconsistency, it means that the target data read this time is invalid, and the client 120 cannot directly use the target data in the data response. 110 reacquires the target data (for example, only the locally stored metadata of the target data in the two comparisons is inconsistent with the metadata obtained this time), and the client 120 can also acquire the target data in the aforementioned manner.
需要说明的是,在本申请实施例中,在步骤201以及步骤203中客户端120与服务端110之间的交互可以是基于单边RDMA进行的。在实际应用中,本申请实施例并不限定该服务端110与客户端120交互的方式,凡是可以绕过服务端110的处理器,客户端120与服务端110的网卡直接交互的方式均适用于本申请实施例。It should be noted that, in the embodiment of the present application, the interaction between the client 120 and the server 110 in step 201 and step 203 may be based on unilateral RDMA. In practical applications, the embodiment of the present application does not limit the way in which the server 110 interacts with the client 120, any method that can bypass the processor of the server 110, and directly interacts between the client 120 and the network card of the server 110 is applicable In the embodiment of this application.
基于与方法实施例同一发明构思,本申请实施例还提供了一种数据访问装置,该数据访问装置用于执行上述如图2所示的方法实施例中服务端执行的方法,相关特征可参见上述方法实施例,此处不再赘述。如图3所示,数据访问装置300包括接收单元301、获取单元302以及发送单元303;Based on the same inventive concept as the method embodiment, the embodiment of the present application also provides a data access device, which is used to execute the method executed by the server in the method embodiment shown in Figure 2 above, and related features can be found in The foregoing method embodiments will not be repeated here. As shown in FIG. 3 , the data access device 300 includes a receiving unit 301, an acquiring unit 302, and a sending unit 303;
接收单元301,用于接收来自客户端的数据请求,数据请求包括序列,序列包括:第一状态的地址、元数据的地址以及第二状态的地址,其中,第一状态和第二状态用于描述元数据是否发生变化,第二状态的地址与第一状态的地址相同;接收单元301可以执行如图2所示的步骤201中服务端执行的方法。The receiving unit 301 is configured to receive a data request from a client, the data request includes a sequence, and the sequence includes: an address of a first state, an address of metadata, and an address of a second state, wherein the first state and the second state are used to describe Whether the metadata changes, the address of the second state is the same as the address of the first state; the receiving unit 301 can execute the method executed by the server in step 201 as shown in FIG. 2 .
获取单元302,用于根据序列分别获取元数据、获取元数据之前的第一状态、以及获取元数据之后的第二状态。获取单元302可以执行如图2所示的步骤202。The obtaining unit 302 is configured to respectively obtain metadata, a first state before obtaining the metadata, and a second state after obtaining the metadata according to the sequence. The acquiring unit 302 may execute step 202 as shown in FIG. 2 .
发送单元303,用于向客户端发送数据响应,数据响应包括元数据、第一状态、以及第二状态。发送单元303可以执行如图2所示的步骤203。The sending unit 303 is configured to send a data response to the client, where the data response includes metadata, a first state, and a second state. The sending unit 303 may execute step 203 shown in FIG. 2 .
在一种可能的实施方式中,序列还包括目标数据的归属状态的地址,目标数据的归属状态的地址位于第二状态的地址之后,目标数据为元数据所描述的数据,数据响应还包括目标数据的归属状态,获取单元302在获取元数据、第一状态、以及第二状态之后,还可以根据目标数据的归属状态的地址获取目标数据的归属状态。In a possible implementation, the sequence further includes the address of the attribution state of the target data, the address of the attribution state of the target data is located after the address of the second state, the target data is the data described by the metadata, and the data response also includes the target For the attribution status of the data, after acquiring the metadata, the first status, and the second status, the acquisition unit 302 may also acquire the attribution status of the target data according to the address of the attribution status of the target data.
在一种可能的实施方式中,序列还包括目标数据的归属状态的地址和目标数据的地址, 目标数据的归属状态的地址位于第二状态的地址之后,目标数据的地址位于目标数据的归属状态的地址之后,目标数据为元数据所描述的数据;获取单元302在获取元数据、第一状态、以及第二状态之后,还可以根据目标数据的归属状态的地址获取目标数据的归属状态,根据目标数据的地址获取目标数据。In a possible implementation, the sequence further includes the address of the attribution state of the target data and the address of the target data, the address of the attribution state of the target data is located after the address of the second state, and the address of the target data is at the attribution state of the target data After the address of the target data, the target data is the data described by the metadata; after acquiring the metadata, the first state, and the second state, the acquisition unit 302 can also acquire the attribution status of the target data according to the address of the attribution status of the target data, according to The address of the target data acquires the target data.
在一种可能的实施方式中,获取单元302部署在服务端的网卡上。In a possible implementation manner, the acquiring unit 302 is deployed on a network card of the server.
基于与方法实施例同一发明构思,本申请实施例还提供了一种数据访问装置,该数据访问装置用于执行上述如图2所示的方法实施例中客户端执行的方法,相关特征可参见上述方法实施例,此处不再赘述。如图4所示,数据访问装置400包括接收单元401以及发送单元403。可选的,还可以包括确定单元402。Based on the same inventive concept as the method embodiment, the embodiment of the present application also provides a data access device, which is used to execute the method executed by the client in the method embodiment shown in Figure 2 above, and related features can be found in The foregoing method embodiments will not be repeated here. As shown in FIG. 4 , the data access device 400 includes a receiving unit 401 and a sending unit 403 . Optionally, a determining unit 402 may also be included.
发送单元403,用于向服务端发送数据请求,数据请求包括序列,序列包括:第一状态的地址、元数据的地址以及第二状态的地址,其中,第一状态和第二状态用于描述元数据是否发生变化,第二状态的地址与第一状态的地址相同。发送单元403可以执行如图2所示的步骤201。The sending unit 403 is configured to send a data request to the server, the data request includes a sequence, and the sequence includes: an address of a first state, an address of metadata, and an address of a second state, wherein the first state and the second state are used to describe Whether the metadata changes, the address of the second state is the same as the address of the first state. The sending unit 403 may execute step 201 as shown in FIG. 2 .
接收单元401,用于接收服务端发送的数据响应,数据响应包括元数据、第一状态、以及第二状态。接收单元401可以执行如图2所示的步骤203。The receiving unit 401 is configured to receive a data response sent by the server, where the data response includes metadata, a first state, and a second state. The receiving unit 401 may execute step 203 shown in FIG. 2 .
在一种可能的实施方式中,序列还包括目标数据的归属状态的地址,目标数据的归属状态的地址位于第二状态的地址之后,目标数据为元数据所描述的数据,数据响应还包括目标数据的归属状态。In a possible implementation, the sequence further includes the address of the attribution state of the target data, the address of the attribution state of the target data is located after the address of the second state, the target data is the data described by the metadata, and the data response also includes the target The attribution status of the data.
在一种可能的实施方式中,确定单元402可以接收数据访问响应,确定获取第一状态与第二状态是否一致。In a possible implementation manner, the determining unit 402 may receive the data access response, and determine whether the obtained first state is consistent with the second state.
在一种可能的实施方式中,元数据中记录了目标数据的归属状态,确定单元402还可以确定目标数据的归属状态与元数据中记录的目标数据的归属状态是否一致。In a possible implementation manner, the attribution status of the target data is recorded in the metadata, and the determining unit 402 may also determine whether the attribution status of the target data is consistent with the attribution status of the target data recorded in the metadata.
在一种可能的实施方式中,若数据响应中携带第一状态、第二状态以及元数据,确定单元402在确定第一状态与第二状态一致的情况下,根据元数据从服务端获取目标数据。In a possible implementation manner, if the data response carries the first state, the second state, and metadata, the determining unit 402 obtains the target from the server according to the metadata when it is determined that the first state is consistent with the second state. data.
若数据响应中携带第一状态、第二状态、元数据以及目标数据的归属状态,确定单元402在确定第一状态与第二状态一致、以及目标数据的归属状态与元数据中记录的目标数据的归属状态一致情况下,根据元数据从服务端获取目标数据。If the data response carries the first status, the second status, metadata and the attribution status of the target data, the determination unit 402 determines that the first status is consistent with the second status, and the attribution status of the target data is the same as the target data recorded in the metadata. In the case of consistent attribution status, the target data is obtained from the server according to the metadata.
若数据响应中携带第一状态、第二状态、元数据以及目标数据的归属状态,确定单元402在确定第一状态与第二状态不一致、或目标数据的归属状态与元数据中记录的目标数据的归属状态不一致情况下,客户端可以确定该元数据无效,客户端可以再次向服务端请求该元数据,或与服务端交互确定该目标数据归属的服务端。If the data response carries the first status, the second status, metadata and the attribution status of the target data, the determining unit 402 determines that the first status is inconsistent with the second status, or the attribution status of the target data is different from the target data recorded in the metadata. In the case of inconsistent attribution status, the client can determine that the metadata is invalid, and the client can request the metadata from the server again, or interact with the server to determine the server to which the target data belongs.
在一种可能的实施方式中,序列还包括目标数据的归属状态的地址和目标数据的地址,目标数据的归属状态的地址位于第二状态的地址之后,目标数据的地址位于目标数据的归属状态的地址之后,目标数据为元数据所描述的数据;数据响应中包括目标数据的归属状态和目标数据。In a possible implementation, the sequence further includes the address of the attribution state of the target data and the address of the target data, the address of the attribution state of the target data is located after the address of the second state, and the address of the target data is at the attribution state of the target data After the address of , the target data is the data described by the metadata; the data response includes the attribution status of the target data and the target data.
在一种可能的实施方式中,客户端本地保存的元数据,确定单元402在确定本地保存的元数据与元数据不一致的情况下,根据元数据从服务端获取目标数据。In a possible implementation, the determining unit 402 obtains the target data from the server according to the metadata when determining that the metadata stored locally by the client is inconsistent with the metadata.
在一种可能的实施方式中,发送单元403向所述客户端发送数据请求时,可以基于RDMA向所述服务端的网卡发送所述数据请求。In a possible implementation manner, when sending the data request to the client, the sending unit 403 may send the data request to the network card of the server based on RDMA.
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分, 实际实现时可以有另外的划分方式。在本申请的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。It should be noted that the division of units in the embodiment of the present application is schematic, and is only a logical function division, and there may be another division manner in actual implementation. Each functional unit in the embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘(solid state drive,SSD)。The above-mentioned embodiments may be implemented in whole or in part by software, hardware, firmware or other arbitrary combinations. When implemented using software, the above-described embodiments may be implemented in whole or in part in the form of computer program products. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on the computer, the processes or functions according to the embodiments of the present invention will be generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center that includes one or more sets of available media. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, DVD), or semiconductor media. The semiconductor medium may be a solid state drive (SSD).
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart 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, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变形在内。Obviously, those skilled in the art can make various changes and modifications to the application without departing from the scope of the application. In this way, if these modifications and variations of the application fall within the scope of the claims of the application and their equivalent technologies, the application also intends to include these modifications and variations.

Claims (19)

  1. 一种数据系统,其特征在于,所述数据系统包括客户端以及服务端;A data system, characterized in that the data system includes a client and a server;
    所述客户端,用于向所述服务端发送数据请求,所述数据请求包括序列,所述序列包括:第一状态的地址、元数据的地址以及所述第二状态的地址,其中,所述第一状态和所述第二状态用于描述所述元数据是否发生变化,所述第二状态的地址与所述第一状态的地址相同;The client is configured to send a data request to the server, the data request includes a sequence, and the sequence includes: an address of the first state, an address of metadata, and an address of the second state, wherein the The first state and the second state are used to describe whether the metadata changes, and the address of the second state is the same as the address of the first state;
    所述服务端,用于接收所述数据请求,根据所述序列分别获取所述元数据、获取所述元数据之前的所述第一状态、以及获取所述元数据之后的所述第二状态;向所述客户端发送数据响应,所述数据响应包括所述元数据、所述第一状态、以及所述第二状态。The server is configured to receive the data request, respectively obtain the metadata, the first state before obtaining the metadata, and the second state after obtaining the metadata according to the sequence ; sending a data response to the client, where the data response includes the metadata, the first state, and the second state.
  2. 如权利要求1所述的系统,其特征在于,所述序列还包括目标数据的归属状态的地址,所述归属状态的地址位于所述第二状态的地址之后,所述目标数据为所述元数据所描述的数据,所述数据响应还包括所述归属状态,所述服务端在获取所述元数据、所述第一状态、以及所述第二状态之后,还用于:The system of claim 1, wherein the sequence further includes an address of a home state of target data, the address of the home state following the address of the second state, the target data being the element The data described by the data, the data response also includes the attribution status, and after the server obtains the metadata, the first status, and the second status, it is further used to:
    根据所述归属状态的地址获取所述归属状态。The attribution status is acquired according to the address of the attribution status.
  3. 如权利要求1或2所述的系统,其特征在于,所述客户端,用于接收所述数据访问响应,确定所述第一状态与所述第二状态是否一致。The system according to claim 1 or 2, wherein the client is configured to receive the data access response and determine whether the first state is consistent with the second state.
  4. 如权利要求3所述的系统,其特征在于,所述元数据中记录了所述目标数据的归属状态,所述客户端,还用于:The system according to claim 3, wherein the attribution status of the target data is recorded in the metadata, and the client is further used for:
    确定所述归属状态与所述元数据中记录的所述目标数据的归属状态是否一致。Determine whether the attribution status is consistent with the attribution status of the target data recorded in the metadata.
  5. 如权利要求4所述的系统,其特征在于,所述客户端,用于:在所述第一状态与所述第二状态一致、且所述归属状态与所述元数据中记录所述目标数据的归属状态一致的情况下,根据所述元数据从所述服务端获取所述目标数据。The system according to claim 4, wherein the client is configured to: record the target in the first state consistent with the second state, and in the attribution state and the metadata If the attribution status of the data is consistent, the target data is acquired from the server according to the metadata.
  6. 如权利要求1所述的系统,其特征在于,所述序列还包括目标数据的归属状态的地址和所述目标数据的地址,所述归属状态的地址位于所述第二状态的地址之后,所述目标数据的地址位于所述归属状态的地址之后,所述目标数据为所述元数据所描述的数据;所述数据响应还包括所述归属状态的地址和所述目标数据;所述服务端在获取所述元数据、所述第一状态、以及所述第二状态之后,还用于:The system of claim 1, wherein the sequence further includes an address of a home state of the target data and an address of the target data, the address of the home state is located after the address of the second state, the The address of the target data is located after the address of the home state, and the target data is the data described by the metadata; the data response also includes the address of the home state and the target data; the server After obtaining the metadata, the first state, and the second state, it is further used to:
    根据所述归属状态的地址获取所述归属状态,根据所述目标数据的地址获取所述目标数据。The attribution status is acquired according to the address of the attribution status, and the target data is acquired according to the address of the target data.
  7. 如权利要求6所述的系统,其特征在于,所述客户端,还用于:在确定本地保存的元数据与从所述元数据不一致的情况下,根据所述元数据从所述服务端获取所述目标数据。The system according to claim 6, wherein the client is further configured to: when it is determined that the metadata stored locally is inconsistent with the metadata, from the server according to the metadata Get the target data.
  8. 如权利要求1-7任一项所述的系统,其特征在于,所述客户端,具体用于:The system according to any one of claims 1-7, wherein the client is specifically used for:
    基于远程直接内存访问RDMA向所述服务端的网卡发送所述数据请求。Sending the data request to the network card of the server based on remote direct memory access (RDMA).
  9. 如权利要求8所述的系统,其特征在于,所述服务端,具体用于:The system according to claim 8, wherein the server is specifically used for:
    所述网卡根据所述序列分别获取所述元数据、获取所述元数据之前的所述第一状态、以及获取所述元数据之后的所述第二状态;向所述客户端发送所述数据响应。The network card respectively acquires the metadata, the first state before acquiring the metadata, and the second state after acquiring the metadata according to the sequence; and sends the data to the client response.
  10. 一种数据访问方法,其特征在于,所方法包括:A data access method, characterized in that the method comprises:
    服务端接收来自客户端的数据请求,所述数据请求包括序列,所述序列包括:第一状态的地址、元数据的地址以及所述第二状态的地址,其中,所述第一状态和所述第二状态用于描述所述元数据是否发生变化,所述第二状态的地址与所述第一状态的地址相同;The server receives a data request from the client, the data request includes a sequence, and the sequence includes: an address of a first state, an address of metadata, and an address of the second state, wherein the first state and the The second state is used to describe whether the metadata has changed, and the address of the second state is the same as the address of the first state;
    所述服务端根据所述序列分别获取所述元数据、获取所述元数据之前的所述第一状态、以及获取所述元数据之后的所述第二状态;The server respectively acquires the metadata, the first state before acquiring the metadata, and the second state after acquiring the metadata according to the sequence;
    所述服务端向所述客户端发送数据响应,所述数据响应包括所述元数据、所述第一状态、以及所述第二状态。The server sends a data response to the client, and the data response includes the metadata, the first state, and the second state.
  11. 如权利要求10所述的方法,其特征在于,所述序列还包括目标数据的归属状态的地址,所述归属状态的地址位于所述第二状态的地址之后,所述目标数据为所述元数据所描述的数据,所述数据响应还包括所述归属状态,所述服务端在获取所述元数据、所述第一状态、以及所述第二状态之后,还包括:The method of claim 10, wherein the sequence further includes the address of the home state of the target data, the address of the home state is located after the address of the second state, the target data is the element The data described by the data, the data response also includes the attribution status, and after the server obtains the metadata, the first status, and the second status, it further includes:
    所述服务端根据所述归属状态的地址获取所述归属状态。The server obtains the attribution status according to the address of the attribution status.
  12. 如权利要求10所述的方法,其特征在于,所述序列还包括目标数据的归属状态的地址和目标数据的地址,所述归属状态的地址位于所述第二状态的地址之后,所述目标数据的地址位于所述归属状态的地址之后,所述目标数据为所述元数据所描述的数据;所述数据响应还包括所述归属状态的地址和所述目标数据;所述服务端在获取所述元数据、所述第一状态、以及所述第二状态之后,还包括:The method of claim 10, wherein the sequence further includes an address of a home state of the target data and an address of the target data, the address of the home state is located after the address of the second state, the address of the target The address of the data is located after the address of the attribution status, and the target data is the data described by the metadata; the data response also includes the address of the attribution status and the target data; the server obtains After the metadata, the first state, and the second state, further include:
    根据所述归属状态的地址获取所述归属状态,根据所述目标数据的地址获取所述目标数据。The attribution status is acquired according to the address of the attribution status, and the target data is acquired according to the address of the target data.
  13. 如权利要求10-12任一项所述的方法,其特征在于,所述服务端根据所述序列分别获取所述元数据、获取所述元数据之前的所述第一状态,包括:The method according to any one of claims 10-12, wherein the server respectively acquires the metadata and the first state before acquiring the metadata according to the sequence, including:
    所述服务端的网卡根据所述序列分别获取所述元数据、获取所述元数据之前的所述第一状态、以及获取所述元数据之后的所述第二状态。The network card of the server respectively obtains the metadata, the first state before obtaining the metadata, and the second state after obtaining the metadata according to the sequence.
  14. 一种数据访问装置,其特征在于,所装置包括接收单元、获取单元以及发送单元:A data access device, characterized in that the device includes a receiving unit, an acquiring unit, and a sending unit:
    所述接收单元,用于接收来自客户端的数据请求,所述数据请求包括序列,所述序列包括:第一状态的地址、元数据的地址以及所述第二状态的地址,其中,所述第一状态和所述第二状态用于描述所述元数据是否发生变化,所述第二状态的地址与所述第一状态的地址相同;The receiving unit is configured to receive a data request from a client, the data request includes a sequence, and the sequence includes: an address of the first state, an address of metadata, and an address of the second state, wherein the second A state and the second state are used to describe whether the metadata changes, and the address of the second state is the same as the address of the first state;
    所述获取单元,用于根据所述序列分别获取所述元数据、获取所述元数据之前的所述第一状态、以及获取所述元数据之后的所述第二状态;The acquiring unit is configured to respectively acquire the metadata, the first state before acquiring the metadata, and the second state after acquiring the metadata according to the sequence;
    所述发送单元,用于向所述客户端发送数据响应,所述数据响应包括所述元数据、所述第一状态、以及所述第二状态。The sending unit is configured to send a data response to the client, where the data response includes the metadata, the first state, and the second state.
  15. 如权利要求14所述的装置,其特征在于,所述序列还包括目标数据的归属状态的地址,所述归属状态的地址位于所述第二状态的地址之后,所述目标数据为所述元数据所描述的数据,所述数据响应还包括所述归属状态,所述获取单元在获取所述元数据、所述第一状态、以及所述第二状态之后,还用于:The apparatus of claim 14, wherein the sequence further includes the address of the home state of the target data, the address of the home state is located after the address of the second state, the target data is the The data described by the data, the data response also includes the attribution status, and after the acquisition unit acquires the metadata, the first status, and the second status, it is further configured to:
    根据所述归属状态的地址获取所述归属状态。The attribution status is acquired according to the address of the attribution status.
  16. 如权利要求14所述的装置,其特征在于,所述序列还包括目标数据的归属状态的地址和所述目标数据的地址,所述归属状态的地址位于所述第二状态的地址之后,所述目标数据的地址位于所述归属状态的地址之后,所述目标数据为所述元数据所描述的数据;所述数据响应还包括所述目标数据的归属状态和所述目标数据;所述获取单元在获取所述元数据、所述第一状态、以及所述第二状态之后,还用于:The apparatus according to claim 14, wherein the sequence further comprises an address of a home state of the target data and an address of the target data, the address of the home state is located after the address of the second state, the The address of the target data is located after the address of the attribution status, and the target data is the data described by the metadata; the data response also includes the attribution status of the target data and the target data; the acquiring After obtaining the metadata, the first state, and the second state, the unit is further configured to:
    根据所述归属状态的地址获取所述归属状态,根据所述目标数据的地址获取所述目标数据。The attribution status is acquired according to the address of the attribution status, and the target data is acquired according to the address of the target data.
  17. 如权利要求14-16任一项所述的装置,其特征在于,所述获取单元部署在网卡上。The device according to any one of claims 14-16, wherein the acquiring unit is deployed on a network card.
  18. 一种计算机存储介质,其特征在于,所述计算机可读存储介质存储有计算机可执行指 令,所述计算机可执行指令用于使计算机执行权利要求10至13任一项所述的方法。A computer storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to make a computer execute the method according to any one of claims 10 to 13.
  19. 一种计算设备,其特征在于,所述计算设备包括网卡,所述网卡执行计算指令用于使计算机执行权利要求10至13任一项所述的方法。A computing device, characterized in that the computing device includes a network card, and the network card executes computing instructions for causing the computer to execute the method according to any one of claims 10 to 13.
PCT/CN2022/139000 2021-12-16 2022-12-14 Data system, and data access method and device WO2023109864A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202111542089.0 2021-12-16
CN202111542089 2021-12-16
CN202210142866.0 2022-02-16
CN202210142866.0A CN116266842A (en) 2021-12-16 2022-02-16 Data system, data access method and device

Publications (1)

Publication Number Publication Date
WO2023109864A1 true WO2023109864A1 (en) 2023-06-22

Family

ID=86744080

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/139000 WO2023109864A1 (en) 2021-12-16 2022-12-14 Data system, and data access method and device

Country Status (2)

Country Link
CN (1) CN116266842A (en)
WO (1) WO2023109864A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104618482A (en) * 2015-02-02 2015-05-13 浙江宇视科技有限公司 Cloud data access method, server, traditional storage device and architecture
CN104754021A (en) * 2013-12-31 2015-07-01 伊姆西公司 Device and method for promoting access of data in distributed storage system
CN110191194A (en) * 2019-06-13 2019-08-30 华中科技大学 A kind of Distributed File System Data transmission method and system based on RDMA network
CN110888889A (en) * 2018-08-17 2020-03-17 阿里巴巴集团控股有限公司 Data information updating method, device and equipment
CN111708734A (en) * 2020-05-29 2020-09-25 苏州浪潮智能科技有限公司 Metadata access method, system, device and medium for distributed system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104754021A (en) * 2013-12-31 2015-07-01 伊姆西公司 Device and method for promoting access of data in distributed storage system
US20150186520A1 (en) * 2013-12-31 2015-07-02 Emc Corporation Facilitating access to data in distributed storage system
CN104618482A (en) * 2015-02-02 2015-05-13 浙江宇视科技有限公司 Cloud data access method, server, traditional storage device and architecture
CN110888889A (en) * 2018-08-17 2020-03-17 阿里巴巴集团控股有限公司 Data information updating method, device and equipment
CN110191194A (en) * 2019-06-13 2019-08-30 华中科技大学 A kind of Distributed File System Data transmission method and system based on RDMA network
CN111708734A (en) * 2020-05-29 2020-09-25 苏州浪潮智能科技有限公司 Metadata access method, system, device and medium for distributed system

Also Published As

Publication number Publication date
CN116266842A (en) 2023-06-20

Similar Documents

Publication Publication Date Title
US20200356277A1 (en) De-duplication of client-side data cache for virtual disks
US20160179581A1 (en) Content-aware task assignment in distributed computing systems using de-duplicating cache
US20220382685A1 (en) Method and Apparatus for Accessing Storage System
CN104239575A (en) Virtual machine mirror image file storage and distribution method and device
TW201220197A (en) for improving the safety and reliability of data storage in a virtual machine based on cloud calculation and distributed storage environment
CN110908589B (en) Data file processing method, device, system and storage medium
US11314454B2 (en) Method and apparatus for managing storage device in storage system
CN108540510B (en) Cloud host creation method and device and cloud service system
WO2023185770A1 (en) Cloud data caching method and apparatus, device and storage medium
US11321021B2 (en) Method and apparatus of managing mapping relationship between storage identifier and start address of queue of storage device corresponding to the storage identifier
US11157456B2 (en) Replication of data in a distributed file system using an arbiter
WO2021213281A1 (en) Data reading method and system
CN110018879B (en) Delay loading method and device applied to distributed system
CN116560562A (en) Method and device for reading and writing data
US10545667B1 (en) Dynamic data partitioning for stateless request routing
US20240012800A1 (en) Data processing method, server, and system
WO2016206070A1 (en) File updating method and storage device
WO2021226822A1 (en) Log write method and apparatus, electronic device, and storage medium
WO2023109864A1 (en) Data system, and data access method and device
US10503409B2 (en) Low-latency lightweight distributed storage system
WO2023050856A1 (en) Data processing method and storage system
WO2022257685A1 (en) Storage system, network interface card, processor, and data access method, apparatus, and system
CN111221826A (en) Method, system, device and medium for processing shared cache synchronization message
WO2023273803A1 (en) Authentication method and apparatus, and storage system
CN116594551A (en) Data storage method and device

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

Country of ref document: EP

Kind code of ref document: A1