






本申请涉及存储技术领域,尤其涉及访问数据的方法及装置。The present application relates to the field of storage technologies, and in particular, to a method and apparatus for accessing data.
随着信息量的日益增多,数据的存储和读取成为了处理信息时常用的技术手段。通常服务端(server)会配置数据库,数据库中的数据是以键值(key-value)的形式存储的。若客户端(client)想要读取服务端的数据,客户端会将要读取的数据的key发送给服务端。服务端会根据接收到的key在数据库中查找。若查找到相同的key,则根据key获取要读取的数据,并将要读取的数据发送给客户端。若未查找到相同的key,则读取失败。然而,数据库通常包括很多的数据,通过上述方式读取数据会花费较长的时间,用户体验差。With the increasing amount of information, the storage and reading of data has become a common technical means when processing information. Usually the server will configure the database, and the data in the database is stored in the form of key-value. If the client (client) wants to read the data of the server, the client will send the key of the data to be read to the server. The server will look it up in the database based on the received key. If the same key is found, the data to be read is obtained according to the key, and the data to be read is sent to the client. If the same key is not found, the read fails. However, the database usually includes a lot of data, and it takes a long time to read the data through the above method, and the user experience is poor.
发明内容SUMMARY OF THE INVENTION
本申请提供访问数据的方法及装置,可以降低访问时延。The present application provides a method and apparatus for accessing data, which can reduce the access delay.
为达到上述目的,本申请的实施例采用如下技术方案:To achieve the above object, the embodiments of the present application adopt the following technical solutions:
第一方面,本申请提供一种访问数据的方法,该方法可以应用于存储系统中。该存储系统包括客户端和服务端,该客户端和该服务端之间可以通过内存访问协议通信。该方法包括:客户端向服务端发送第一读请求,其中,该第一读请求包括待读取数据的元数据的位置信息,该位置信息用于指示该元数据位于该服务端中的位置,并且该元数据的位置信息是根据该待读取数据的关键字与预测信息获得的。服务端接收该第一读请求,根据该位置信息读取该元数据,并且根据该元数据获得该待读取数据,将该待读取数据发送给该客户端。In a first aspect, the present application provides a method for accessing data, which can be applied to a storage system. The storage system includes a client and a server, and the client and the server can communicate through a memory access protocol. The method includes: the client sends a first read request to the server, wherein the first read request includes location information of metadata of the data to be read, and the location information is used to indicate the location of the metadata in the server , and the location information of the metadata is obtained according to the keyword and prediction information of the data to be read. The server receives the first read request, reads the metadata according to the location information, obtains the data to be read according to the metadata, and sends the data to be read to the client.
基于上述第一方面提供的技术方案,客户端可以根据待读取数据的关键字和预测信息预测待读取数据的元数据的位置信息,根据元数据的位置信息读取元数据,根据元数据获得待读取数据。在上述过程中,服务端是根据位置信息直接读取数据的,服务端的处理器可以不参与,因此可以降低访问时延。Based on the technical solution provided in the first aspect, the client can predict the location information of the metadata of the data to be read according to the keyword of the data to be read and the prediction information, read the metadata according to the location information of the metadata, and read the metadata according to the location information of the metadata. Get the data to be read. In the above process, the server directly reads the data according to the location information, and the processor of the server does not need to participate, so the access delay can be reduced.
一种可能的实现方式,预测信息包括预测模型或预测列表,该预测列表包括至少一个首地址,每个首地址是该服务端中一段连续内存的起始地址。基于上述方法,客户端可以通过多种方式预测待读取数据的元数据的位置信息,提高了客户端预测待读取数据的元数据的位置信息的灵活性和多样性。In a possible implementation manner, the prediction information includes a prediction model or a prediction list, the prediction list includes at least one first address, and each first address is a start address of a segment of continuous memory in the server. Based on the above method, the client can predict the location information of the metadata of the data to be read in various ways, which improves the flexibility and diversity of the client's prediction of the location information of the metadata of the data to be read.
一种可能的实现方式,预测信息包括该预测模型,该方法还包括:服务端训练数据以生成该预测模型;服务端将该预测模型发送给该客户端。基于上述方法,在预测信息包括预测模型的情况下,服务端可以通过训练数据的方式得到预测模型,并将预测模型发送给客户端,使得客户端可以根据预测模型预测待读取数据的元数据的位置信息。In a possible implementation manner, the prediction information includes the prediction model, and the method further includes: the server trains data to generate the prediction model; the server sends the prediction model to the client. Based on the above method, when the prediction information includes a prediction model, the server can obtain the prediction model through training data, and send the prediction model to the client, so that the client can predict the metadata of the data to be read according to the prediction model location information.
一种可能的实现方式,该方法还包括:该服务端配置第一索引,该第一索引包括多个数据的关键字,该位置信息用于指示该元数据位于该第一索引中的位置;根据该位置信息读取该元数据具体包括:该服务端根据位置信息从第一索引中读取该元数据。基于上述方法,客户端可以从第一索引中读取元数据。A possible implementation manner, the method further includes: the server configures a first index, the first index includes a plurality of data keywords, and the position information is used to indicate the position of the metadata in the first index; Reading the metadata according to the location information specifically includes: the server reading the metadata from the first index according to the location information. Based on the above method, the client can read metadata from the first index.
一种可能的实现方式,该第一索引是静态的,该第一索引中的关键字不变。基于上述方法,服务端在一段时间内,不会将新增加的key写入第一索引,一方面,服务端不需要频繁的训练数据,生成新的预测模型,减小了服务端的计算开销。另一方面,第一索引也不会分 裂,因此客户端在根据预测模型得到一个地址后,不需要通过翻译表将该地址转换为待读取数据在服务端的实际地址,客户端可以不用存储翻译表,节约了客户端的内存开销。In a possible implementation manner, the first index is static, and the keywords in the first index remain unchanged. Based on the above method, the server will not write the newly added key into the first index for a period of time. On the one hand, the server does not need frequent training data to generate a new prediction model, which reduces the computing overhead of the server. On the other hand, the first index will not be split, so after the client obtains an address according to the prediction model, it does not need to convert the address to the actual address of the data to be read on the server through the translation table, and the client does not need to store the translation. table, saving the memory overhead of the client.
一种可能的实现方式,该方法还包括:该服务端配置第二索引,该第二索引用于记录更新数据的关键字,该更新数据的关键字会定期写入该第一索引。基于上述方法,若服务端需要新增加key,可以将新增加的key写入第二索引,可以使得第一索引保持静态。In a possible implementation manner, the method further includes: configuring, by the server, a second index, where the second index is used to record a keyword for updating data, and the keyword for updating data is regularly written into the first index. Based on the above method, if the server needs to add a new key, it can write the newly added key into the second index, so that the first index can be kept static.
一种可能的实现方式,根据该位置信息读取该元数据具体包括:当该第一索引中未保存有该待读取数据的关键字时,从该第二索引中获得该待读取数据的元数据的存储地址,从而读取该元数据。基于上述方法,在第一索引中未获取到待读取数据的情况下,可以在第二索引中读取待读取数据。A possible implementation manner, reading the metadata according to the location information specifically includes: when the keyword of the data to be read is not stored in the first index, obtaining the data to be read from the second index The storage address of the metadata to read the metadata. Based on the above method, in the case where the data to be read is not obtained in the first index, the data to be read can be read in the second index.
一种可能的实现方式,该方法还包括:服务端预测该客户端将要读取的数据;若该将要读取的数据的元数据未包括在该第一索引和该第二索引中,该服务端将该将要读取的数据的元数据写入该第二索引。基于上述方法,服务端可以将预测的客户端将要读取的数据的元数据提前写入第二索引中,当客户端需要读取服务端预测的数据的情况下,服务端可以快速返回该数据,提高了服务端的响应速度。A possible implementation manner, the method further includes: the server predicts the data to be read by the client; if the metadata of the data to be read is not included in the first index and the second index, the service The terminal writes the metadata of the data to be read into the second index. Based on the above method, the server can write the metadata of the data predicted by the client to be read into the second index in advance. When the client needs to read the data predicted by the server, the server can quickly return the data , which improves the response speed of the server.
一种可能的实现方式,服务端把将要读取的数据的元数据写入该第二索引之后,该方法还包括:服务端将该第二索引写入该第一索引,得到第三索引;服务端训练该第三索引以生成新的预测模型;服务端将该新的预测模型发送给该客户端。基于上述方法,服务端可以定期或不定期的重新训练模型,使得客户端根据新的模型预测待读取数据的元数据的位置,可以在减少服务端的计算开销,服务端和客户端的内存开销的基础上,降低访问时延。In a possible implementation manner, after the server writes the metadata of the data to be read into the second index, the method further includes: the server writes the second index into the first index to obtain a third index; The server trains the third index to generate a new prediction model; the server sends the new prediction model to the client. Based on the above method, the server can retrain the model regularly or irregularly, so that the client can predict the location of the metadata of the data to be read according to the new model, which can reduce the computing overhead of the server and the memory overhead of the server and the client. On the basis, reduce the access delay.
一种可能的实现方式,预测信息包括该预测列表,该方法还包括:服务端获取该至少一个首地址以生成该预测列表;服务端将该预测列表发送给该客户端。基于上述方法,在预测信息包括预测列表的情况下,服务端可以获取预测列表,并将预测列表发送给客户端,使得客户端可以根据预测列表预测待读取数据的元数据的位置信息。In a possible implementation manner, the prediction information includes the prediction list, and the method further includes: the server obtains the at least one first address to generate the prediction list; the server sends the prediction list to the client. Based on the above method, when the prediction information includes a prediction list, the server can obtain the prediction list and send the prediction list to the client, so that the client can predict the location information of the metadata of the data to be read according to the prediction list.
一种可能的实现方式,该元数据的位置信息是根据该待读取数据的关键字与预测信息获得的具体包括:该元数据的位置信息是对该待读取数据的关键字做哈希运算,根据该哈希运算的结果查询该预测列表得到的。基于上述方法,客户端可以通过哈希运算以及查表即可的得到元数据的位置信息,十分便捷。A possible implementation manner, the location information of the metadata is obtained according to the keyword and prediction information of the data to be read. Specifically, the location information of the metadata is obtained by hashing the keyword of the data to be read. operation, obtained by querying the prediction list according to the result of the hash operation. Based on the above method, the client can obtain the location information of the metadata through hash operation and table lookup, which is very convenient.
一种可能的实现方式,客户端向该服务端发送第一读请求之前,该方法还包括:客户端根据该待读取数据的关键字确定该待读取数据的关键字是否保存在该服务端中;客户端向该服务端发送第一读请求具体包括:当确定结果为该待读取数据的关键字保存在该服务端中时,客户端向该服务端发送第一读请求。基于上述方法,客户端可以在确定服务端中保存了待读取数据的关键字之后,向服务端发送第一读请求,可以减小信令开始。A possible implementation, before the client sends the first read request to the server, the method further includes: the client determines, according to the keyword of the data to be read, whether the keyword of the data to be read is stored in the service Sending the first read request from the client to the server specifically includes: when it is determined that the keyword of the data to be read is stored in the server, the client sends the first read request to the server. Based on the above method, the client can send a first read request to the server after determining that the keyword of the data to be read is stored in the server, which can reduce the start of signaling.
第二方面,本申请提供一种访问数据的装置,该装置包括网卡和内存,该网卡支持内存访问协议;网卡,用于接收第一读请求,该第一读请求包括待读取数据的元数据的位置信息,该位置信息用于指示该元数据位于该内存中的位置,并且该元数据的位置信息是根据该待读取数据的关键字与预测信息获得的;网卡,还用于根据该位置信息读取该元数据,根据该元数据获得该待读取数据,将该待读取数据发送给客户端。In a second aspect, the present application provides a device for accessing data, the device includes a network card and a memory, the network card supports a memory access protocol; the network card is used to receive a first read request, where the first read request includes an element of the data to be read The location information of the data, the location information is used to indicate the location of the metadata in the memory, and the location information of the metadata is obtained according to the keyword and prediction information of the data to be read; the network card is also used according to The location information reads the metadata, obtains the data to be read according to the metadata, and sends the data to be read to the client.
一种可能的实现方式,预测信息包括预测模型或预测列表,该预测列表包括至少一个首地址,每个首地址是该访问数据的装置中一段连续内存的起始地址。In a possible implementation manner, the prediction information includes a prediction model or a prediction list, the prediction list includes at least one first address, and each first address is a start address of a segment of continuous memory in the device for accessing data.
一种可能的实现方式,预测信息包括该预测模型,该装置还包括:处理器;处理器,用于训练数据以生成该预测模型;网卡,还用于将该预测模型发送给该客户端。In a possible implementation manner, the prediction information includes the prediction model, and the apparatus further includes: a processor; the processor is used for training data to generate the prediction model; and the network card is further used for sending the prediction model to the client.
一种可能的实现方式,处理器,还用于配置第一索引,该第一索引包括多个数据的关键字,该位置信息用于指示该元数据位于该第一索引中的位置;网卡,具体用于根据该位置信息从该第一索引中读取该元数据。In a possible implementation manner, the processor is further configured to configure a first index, where the first index includes keywords of multiple data, and the location information is used to indicate a location where the metadata is located in the first index; the network card, Specifically, it is used to read the metadata from the first index according to the location information.
一种可能的实现方式,第一索引是静态的,该第一索引中的关键字不变。In a possible implementation manner, the first index is static, and the key in the first index does not change.
一种可能的实现方式,处理器,还用于配置第二索引,该第二索引用于记录更新数据的关键字,该更新数据的关键字会定期写入该第一索引。In a possible implementation manner, the processor is further configured to configure a second index, where the second index is used to record the key of the updated data, and the key of the updated data is written into the first index periodically.
一种可能的实现方式,网卡,具体用于当该第一索引中未保存有该待读取数据的关键字时,从该第二索引中获得该待读取数据的元数据的存储地址,从而读取该元数据。A possible implementation, the network card is specifically used to obtain the storage address of the metadata of the to-be-read data from the second index when the first index does not store the keyword of the to-be-read data, Thereby reading the metadata.
一种可能的实现方式,处理器,还用于预测该客户端将要读取的数据;处理器,还用于若该将要读取的数据的元数据未包括在该第一索引和该第二索引中,将该将要读取的数据的元数据写入该第二索引。In a possible implementation manner, the processor is further configured to predict the data to be read by the client; the processor is further configured to predict the data to be read if the metadata of the data to be read is not included in the first index and the second index. In the index, the metadata of the data to be read is written into the second index.
一种可能的实现方式,处理器,还用于将该第二索引写入该第一索引,得到第三索引;处理器,还用于训练该第三索引以生成新的预测模型;网卡,还用于将该新的预测模型发送给该客户端。In a possible implementation manner, the processor is further configured to write the second index into the first index to obtain a third index; the processor is further configured to train the third index to generate a new prediction model; the network card, Also used to send the new predictive model to the client.
一种可能的实现方式,预测信息包括该预测列表,该装置还包括处理器;处理器,用于获取该至少一个首地址以生成该预测列表;网卡,还用于将该预测列表发送给该客户端。A possible implementation manner, the prediction information includes the prediction list, and the apparatus further includes a processor; the processor is configured to obtain the at least one first address to generate the prediction list; the network card is further configured to send the prediction list to the client.
一种可能的实现方式,元数据的位置信息是根据该待读取数据的关键字与预测信息获得的具体包括:元数据的位置信息是对该待读取数据的关键字做哈希运算,根据该哈希运算的结果查询该预测列表得到的。A possible implementation manner, the location information of the metadata is obtained according to the keyword of the data to be read and the prediction information, which specifically includes: the location information of the metadata is to perform a hash operation on the keyword of the data to be read, Obtained by querying the prediction list according to the result of the hash operation.
第三方面,本申请提供一种访问数据的装置,该装置包括网卡和内存,该网卡支持内存访问协议;网卡,用于向服务端发送第一读请求,该第一读请求包括待读取数据的元数据的位置信息,该位置信息用于指示该元数据位于该服务端中的位置,并且该元数据的位置信息是根据该待读取数据的关键字与预测信息获得的;网卡,还用于接收待读取数据。In a third aspect, the present application provides a device for accessing data, the device includes a network card and a memory, the network card supports a memory access protocol; the network card is used to send a first read request to a server, where the first read request includes a to-be-read request The location information of the metadata of the data, the location information is used to indicate the location of the metadata in the server, and the location information of the metadata is obtained according to the keyword and prediction information of the data to be read; the network card, Also used to receive data to be read.
一种可能的实现方式,预测信息包括预测模型或预测列表,该预测列表包括至少一个首地址,每个首地址是该服务端中一段连续内存的起始地址。In a possible implementation manner, the prediction information includes a prediction model or a prediction list, the prediction list includes at least one first address, and each first address is a start address of a segment of continuous memory in the server.
一种可能的实现方式,预测信息包括该预测模型,网卡,还用于接收该预测模型;或者,预测信息包括该预测列表,网卡,还用于接收该预测列表。In a possible implementation manner, the prediction information includes the prediction model, and the network card is further used to receive the prediction model; or, the prediction information includes the prediction list, and the network card is further used to receive the prediction list.
一种可能的实现方式,该装置还包括:处理器;处理器,用于根据该待读取数据的关键字确定该待读取数据的关键字是否保存在该服务端中;网卡,具体用于当确定结果为该待读取数据的关键字保存在该服务端中时,向该服务端发送第一读请求。A possible implementation manner, the device further includes: a processor; the processor is configured to determine whether the keyword of the data to be read is stored in the server according to the keyword of the data to be read; a network card, specifically using When it is determined that the keyword of the data to be read is stored in the server, a first read request is sent to the server.
第四方面,本申请提供一种计算机可读介质,其上存储有计算机程序或指令,所述计算机程序或指令被执行时使得计算机执行上述第一方面、或第一方面任一种可能的实现方式中所述的方法。In a fourth aspect, the present application provides a computer-readable medium on which a computer program or instruction is stored, and when the computer program or instruction is executed, enables a computer to execute the first aspect or any possible implementation of the first aspect. method described in the method.
第五方面,本申请提供一种计算机程序产品,其包括计算机程序代码,所述计算机程序代码在计算机上运行时,使得计算机执行上述第一方面、或第一方面任一种可能的实现方式中所述的方法。In a fifth aspect, the present application provides a computer program product, which includes computer program code, when the computer program code runs on a computer, the computer program code causes the computer to execute the first aspect or any of the possible implementations of the first aspect. the method described.
第六方面,本申请提供一种存储系统,该存储系统包括客户端和服务端,该客户端和该服务端之间通过内存访问协议通信。客户端,用于向该服务端发送第一读请求,该第一读请求包括待读取数据的元数据的位置信息,该位置信息用于指示该元数据位于该服务端中的位置,并且该元数据的位置信息是根据该待读取数据的关键字与预测信息获得的;服务端,用于接收该第一读请求,根据该位置信息读取该元数据,并且根据该元数据获得该待读取数据, 将该待读取数据发送给该客户端。In a sixth aspect, the present application provides a storage system, the storage system includes a client and a server, and the client and the server communicate through a memory access protocol. a client, configured to send a first read request to the server, where the first read request includes location information of metadata of the data to be read, where the location information is used to indicate the location where the metadata is located in the server, and The location information of the metadata is obtained according to the keyword and prediction information of the data to be read; the server is used to receive the first read request, read the metadata according to the location information, and obtain the metadata according to the metadata. The data to be read is sent to the client.
一种可能的实现方式,预测信息包括预测模型或预测列表,该预测列表包括至少一个首地址,每个首地址是该服务端中一段连续内存的起始地址。In a possible implementation manner, the prediction information includes a prediction model or a prediction list, the prediction list includes at least one first address, and each first address is a start address of a segment of continuous memory in the server.
一种可能的实现方式,预测信息包括该预测模型;服务端,还用于训练数据以生成该预测模型;服务端,还用于将该预测模型发送给该客户端。In a possible implementation manner, the prediction information includes the prediction model; the server is further used for training data to generate the prediction model; the server is also used for sending the prediction model to the client.
一种可能的实现方式,服务端,还用于配置第一索引,该第一索引包括多个数据的关键字,该位置信息用于指示该元数据位于该第一索引中的位置;服务端,具体用于根据该位置信息从该第一索引中读取该元数据。A possible implementation manner, the server is further configured to configure a first index, where the first index includes keywords of multiple data, and the location information is used to indicate the location where the metadata is located in the first index; the server , which is specifically used to read the metadata from the first index according to the location information.
一种可能的实现方式,第一索引是静态的,该第一索引中的关键字不变。In a possible implementation manner, the first index is static, and the key in the first index does not change.
一种可能的实现方式,服务端,还用于配置第二索引,该第二索引用于记录更新数据的关键字,该更新数据的关键字会定期写入该第一索引。In a possible implementation manner, the server is further configured to configure a second index, where the second index is used to record the keyword of the updated data, and the keyword of the updated data will be written into the first index periodically.
一种可能的实现方式,服务端,具体用于当该第一索引中未保存有该待读取数据的关键字时,从该第二索引中获得该待读取数据的元数据的存储地址,从而读取该元数据。A possible implementation, the server is specifically used to obtain the storage address of the metadata of the data to be read from the second index when the keyword of the data to be read is not stored in the first index , which reads the metadata.
一种可能的实现方式,服务端,还用于预测该客户端将要读取的数据;若该将要读取的数据的元数据未包括在该第一索引和该第二索引中,服务端,还用于将该将要读取的数据的元数据写入该第二索引。A possible implementation, the server, is also used to predict the data to be read by the client; if the metadata of the data to be read is not included in the first index and the second index, the server, Also used to write the metadata of the data to be read into the second index.
一种可能的实现方式,服务端,还用于将该第二索引写入该第一索引,得到第三索引;服务端,还用于训练该第三索引以生成新的预测模型;服务端,还用于将该新的预测模型发送给该客户端。A possible implementation, the server is also used to write the second index into the first index to obtain a third index; the server is also used to train the third index to generate a new prediction model; the server , which is also used to send the new predictive model to the client.
一种可能的实现方式,预测信息包括该预测列表,服务端,还用于获取该至少一个首地址以生成该预测列表;服务端,还用于将该预测列表发送给该客户端。In a possible implementation manner, the prediction information includes the prediction list, the server is further configured to obtain the at least one first address to generate the prediction list; the server is further configured to send the prediction list to the client.
一种可能的实现方式,元数据的位置信息是根据该待读取数据的关键字与预测信息获得的具体包括:元数据的位置信息是对该待读取数据的关键字做哈希运算,根据该哈希运算的结果查询该预测列表得到的。A possible implementation manner, the location information of the metadata is obtained according to the keyword of the data to be read and the prediction information, which specifically includes: the location information of the metadata is to perform a hash operation on the keyword of the data to be read, Obtained by querying the prediction list according to the result of the hash operation.
一种可能的实现方式,客户端,还用于根据该待读取数据的关键字确定该待读取数据的关键字是否保存在该服务端中;客户端,还具体用于当确定结果为该待读取数据的关键字保存在该服务端中时,向该服务端发送第一读请求。In a possible implementation manner, the client is further configured to determine whether the keyword of the data to be read is stored in the server according to the keyword of the data to be read; the client is also specifically used to determine whether the keyword of the data to be read is When the keyword of the data to be read is stored in the server, a first read request is sent to the server.
第七方面,本申请提供一种访问数据的方法,该方法应用于存储系统中,该存储系统包括客户端和服务端,该客户端和该服务端之间通过内存访问协议通信。该方法包括:客户端向服务端发送第一读请求,该第一读请求包括待读取数据的位置信息,该位置信息用于指示该待读取数据位于该服务端中的位置,并且该待读取数据的位置信息是根据该待读取数据的关键字与预测信息获得的;服务端接收该第一读请求,根据该位置信息获得该待读取数据,将该待读取数据发送给该客户端。In a seventh aspect, the present application provides a method for accessing data. The method is applied to a storage system. The storage system includes a client and a server, and the client and the server communicate through a memory access protocol. The method includes: a client sends a first read request to a server, the first read request includes location information of data to be read, the location information is used to indicate the location of the data to be read in the server, and the The location information of the data to be read is obtained according to the keyword and prediction information of the data to be read; the server receives the first read request, obtains the data to be read according to the location information, and sends the data to be read to the client.
一种可能的实现方式,该预测信息包括预测模型或预测列表,该预测列表包括至少一个首地址,每个首地址是该服务端中一段连续内存的起始地址。In a possible implementation manner, the prediction information includes a prediction model or a prediction list, the prediction list includes at least one first address, and each first address is a start address of a segment of continuous memory in the server.
一种可能的实现方式,预测信息包括该预测模型,该方法还包括:服务端训练数据以生成该预测模型;服务端将该预测模型发送给该客户端。In a possible implementation manner, the prediction information includes the prediction model, and the method further includes: the server trains data to generate the prediction model; the server sends the prediction model to the client.
一种可能的实现方式,该方法还包括:服务端配置第一索引,该第一索引包括多个数据的关键字,该位置信息用于指示该待读取数据位于该第一索引中的位置;根据该位置信息读取该元数据具体包括:服务端根据该位置信息从该第一索引中读取该待读取数据。A possible implementation manner, the method further includes: the server configures a first index, the first index includes a plurality of data keywords, and the position information is used to indicate the position of the to-be-read data in the first index ; Reading the metadata according to the location information specifically includes: the server reads the data to be read from the first index according to the location information.
一种可能的实现方式,第一索引是静态的,第一索引中的关键字不变。In a possible implementation manner, the first index is static, and the keywords in the first index remain unchanged.
一种可能的实现方式,该方法还包括:服务端配置第二索引,该第二索引用于记录更新数据的关键字,该更新数据的关键字会定期写入该第一索引。In a possible implementation manner, the method further includes: configuring a second index on the server side, where the second index is used to record a keyword for updating data, and the keyword for updating data is regularly written into the first index.
一种可能的实现方式,根据该位置信息获得该待读取数据具体包括:当该第一索引中未保存有该待读取数据的关键字时,从该第二索引中获得该待读取数据的存储地址,从而读取该待读取数据。A possible implementation manner, obtaining the data to be read according to the location information specifically includes: when the keyword of the data to be read is not stored in the first index, obtaining the data to be read from the second index The storage address of the data, so as to read the data to be read.
一种可能的实现方式,该方法还包括:服务端预测该客户端将要读取的数据;若该将要读取的数据未包括在该第一索引和该第二索引中,该服务端将该将要读取的数据写入该第二索引。A possible implementation, the method further includes: the server predicts the data to be read by the client; if the data to be read is not included in the first index and the second index, the server predicts the data to be read by the server. Write the data to be read into this second index.
一种可能的实现方式,服务端将该将要读取的数据写入该第二索引之后,该方法还包括:服务端将该第二索引写入该第一索引,得到第三索引;服务端训练该第三索引以生成新的预测模型;服务端将该新的预测模型发送给该客户端。A possible implementation manner, after the server writes the data to be read into the second index, the method further includes: the server writes the second index into the first index to obtain a third index; the server The third index is trained to generate a new prediction model; the server sends the new prediction model to the client.
一种可能的实现方式,预测信息包括该预测列表,该方法还包括:服务端获取该至少一个首地址以生成该预测列表;服务端将该预测列表发送给该客户端。In a possible implementation manner, the prediction information includes the prediction list, and the method further includes: the server obtains the at least one first address to generate the prediction list; the server sends the prediction list to the client.
一种可能的实现方式,待读取数据的位置信息是根据该待读取数据的关键字与预测信息获得的具体包括:待读取数据的位置信息是对该待读取数据的关键字做哈希运算,根据该哈希运算的结果查询该预测列表得到的。A possible implementation manner, the location information of the data to be read is obtained according to the keyword of the data to be read and the prediction information, which specifically includes: the location information of the data to be read is obtained from the keyword of the data to be read. Hash operation, obtained by querying the prediction list according to the result of the hash operation.
一种可能的实现方式,客户端向该服务端发送第一读请求之前,该方法还包括:客户端根据该待读取数据的关键字确定该待读取数据的关键字是否保存在该服务端中;客户端向服务端发送第一读请求具体包括:当确定结果为该待读取数据的关键字保存在该服务端中时,客户端向该服务端发送第一读请求。A possible implementation, before the client sends the first read request to the server, the method further includes: the client determines, according to the keyword of the data to be read, whether the keyword of the data to be read is stored in the service Sending the first read request from the client to the server specifically includes: when it is determined that the keyword of the data to be read is stored in the server, the client sends the first read request to the server.
第八方面,本申请提供一种访问数据的装置,该装置包括网卡和内存,该网卡支持内存访问协议;网卡,用于接收第一读请求,该第一读请求包括待读取数据的位置信息,该位置信息用于指示该待读取数据位于该内存中的位置,并且该待读取数据的位置信息是根据该待读取数据的关键字与预测信息获得的;网卡,还用于根据该位置信息读取该待读取数据,将该待读取数据发送给客户端。In an eighth aspect, the present application provides a device for accessing data, the device includes a network card and a memory, the network card supports a memory access protocol; the network card is used for receiving a first read request, and the first read request includes the position of the data to be read information, the location information is used to indicate the location of the data to be read in the memory, and the location information of the data to be read is obtained according to the keyword and prediction information of the data to be read; the network card is also used for The data to be read is read according to the location information, and the data to be read is sent to the client.
一种可能的实现方式,预测信息包括预测模型或预测列表,该预测列表包括至少一个首地址,每个首地址是该访问数据的装置中一段连续内存的起始地址。In a possible implementation manner, the prediction information includes a prediction model or a prediction list, the prediction list includes at least one first address, and each first address is a start address of a segment of continuous memory in the device for accessing data.
一种可能的实现方式,预测信息包括该预测模型,该装置还包括:处理器;处理器,用于训练数据以生成该预测模型;网卡,还用于将该预测模型发送给该客户端。In a possible implementation manner, the prediction information includes the prediction model, and the apparatus further includes: a processor; the processor is used for training data to generate the prediction model; and the network card is further used for sending the prediction model to the client.
一种可能的实现方式,处理器,还用于配置第一索引,该第一索引包括多个数据的关键字,该位置信息用于指示该待读取数据位于该第一索引中的位置;网卡,具体用于根据该位置信息从该第一索引中读取该待读取数据。In a possible implementation manner, the processor is further configured to configure a first index, where the first index includes a plurality of data keywords, and the location information is used to indicate the location where the data to be read is located in the first index; The network card is specifically configured to read the to-be-read data from the first index according to the location information.
一种可能的实现方式,第一索引是静态的,该第一索引中的关键字不变。In a possible implementation manner, the first index is static, and the key in the first index does not change.
一种可能的实现方式,处理器,还用于配置第二索引,该第二索引用于记录更新数据的关键字,该更新数据的关键字会定期写入该第一索引。In a possible implementation manner, the processor is further configured to configure a second index, where the second index is used to record the key of the updated data, and the key of the updated data is written into the first index periodically.
一种可能的实现方式,网卡,具体用于当该第一索引中未保存有该待读取数据的关键字时,从该第二索引中获得该待读取数据的存储地址,从而读取该待读取数据。A possible implementation, the network card, is specifically used to obtain the storage address of the data to be read from the second index when the keyword of the data to be read is not stored in the first index, thereby reading The data to be read.
一种可能的实现方式,处理器,还用于预测该客户端将要读取的数据;处理器,还用于若该将要读取的数据未包括在该第一索引和该第二索引中,将该将要读取的数据写入该第二索引。In a possible implementation manner, the processor is further configured to predict the data to be read by the client; the processor is further configured to, if the data to be read is not included in the first index and the second index, Write the data to be read into the second index.
一种可能的实现方式,处理器,还用于将该第二索引写入该第一索引,得到第三索引; 处理器,还用于训练该第三索引以生成新的预测模型;网卡,还用于将该新的预测模型发送给该客户端。In a possible implementation manner, the processor is further configured to write the second index into the first index to obtain a third index; the processor is further configured to train the third index to generate a new prediction model; the network card, Also used to send the new predictive model to the client.
一种可能的实现方式,预测信息包括该预测列表,该装置还包括处理器;处理器,用于获取该至少一个首地址以生成该预测列表;网卡,还用于将该预测列表发送给该客户端。A possible implementation manner, the prediction information includes the prediction list, and the apparatus further includes a processor; the processor is configured to obtain the at least one first address to generate the prediction list; the network card is further configured to send the prediction list to the client.
一种可能的实现方式,待读取数据的位置信息是根据该待读取数据的关键字与预测信息获得的具体包括:待读取数据的位置信息是对该待读取数据的关键字做哈希运算,根据该哈希运算的结果查询该预测列表得到的。A possible implementation manner, the location information of the data to be read is obtained according to the keyword of the data to be read and the prediction information, which specifically includes: the location information of the data to be read is obtained from the keyword of the data to be read. Hash operation, obtained by querying the prediction list according to the result of the hash operation.
第九方面,本申请提供一种访问数据的装置,该装置包括网卡和内存,该网卡支持内存访问协议;网卡,用于向服务端发送第一读请求,该第一读请求包括待读取数据的位置信息,该位置信息用于指示该待读取数据位于该服务端中的位置,并且该待读取数据的位置信息是根据该待读取数据的关键字与预测信息获得的;网卡,还用于接收待读取数据。In a ninth aspect, the present application provides a device for accessing data, the device includes a network card and a memory, the network card supports a memory access protocol; the network card is used to send a first read request to a server, and the first read request includes a to-be-read request The location information of the data, the location information is used to indicate the location of the data to be read in the server, and the location information of the data to be read is obtained according to the keyword and prediction information of the data to be read; network card , which is also used to receive data to be read.
一种可能的实现方式,预测信息包括预测模型或预测列表,该预测列表包括至少一个首地址,每个首地址是该服务端中一段连续内存的起始地址。In a possible implementation manner, the prediction information includes a prediction model or a prediction list, the prediction list includes at least one first address, and each first address is a start address of a segment of continuous memory in the server.
一种可能的实现方式,预测信息包括该预测模型,网卡,还用于接收该预测模型;或者,预测信息包括该预测列表,网卡,还用于接收该预测列表。In a possible implementation manner, the prediction information includes the prediction model, and the network card is further used to receive the prediction model; or, the prediction information includes the prediction list, and the network card is further used to receive the prediction list.
一种可能的实现方式,该装置还包括:处理器;处理器,用于根据该待读取数据的关键字确定该待读取数据的关键字是否保存在该服务端中;网卡,具体用于当确定结果为该待读取数据的关键字保存在该服务端中时,向该服务端发送第一读请求。A possible implementation manner, the device further includes: a processor; the processor is configured to determine whether the keyword of the data to be read is stored in the server according to the keyword of the data to be read; a network card, specifically using When it is determined that the keyword of the data to be read is stored in the server, a first read request is sent to the server.
第十方面,本申请提供一种计算机可读介质,其上存储有计算机程序或指令,所述计算机程序或指令被执行时使得计算机执行上述第七方面、或第七方面任一种可能的实现方式中所述的方法。In a tenth aspect, the present application provides a computer-readable medium on which a computer program or instruction is stored, and when the computer program or instruction is executed, enables a computer to execute the seventh aspect or any possible implementation of the seventh aspect. method described in the method.
第十一方面,本申请提供一种计算机程序产品,其包括计算机程序代码,所述计算机程序代码在计算机上运行时,使得计算机执行上述第七方面、或第七方面任一种可能的实现方式中所述的方法。In an eleventh aspect, the present application provides a computer program product, which includes computer program code, which, when running on a computer, causes the computer to execute the seventh aspect or any possible implementation manner of the seventh aspect. method described in.
第十二方面,本申请提供一种存储系统,该存储系统包括客户端和服务端,该客户端和该服务端之间通过内存访问协议通信。客户端,用于向该服务端发送第一读请求,该第一读请求包括待读取数据的位置信息,该位置信息用于指示该待读取数据位于该服务端中的位置,并且该待读取数据的位置信息是根据该待读取数据的关键字与预测信息获得的;服务端,用于接收该第一读请求,根据该位置信息获得该待读取数据,将该待读取数据发送给该客户端。In a twelfth aspect, the present application provides a storage system, the storage system includes a client and a server, and the client and the server communicate through a memory access protocol. The client is used to send a first read request to the server, where the first read request includes location information of the data to be read, the location information is used to indicate the location of the data to be read in the server, and the The position information of the data to be read is obtained according to the keyword and prediction information of the data to be read; the server is used to receive the first read request, obtain the data to be read according to the position information, and use the data to be read. Get the data and send it to the client.
一种可能的实现方式,该预测信息包括预测模型或预测列表,该预测列表包括至少一个首地址,每个首地址是该服务端中一段连续内存的起始地址。In a possible implementation manner, the prediction information includes a prediction model or a prediction list, the prediction list includes at least one first address, and each first address is a start address of a segment of continuous memory in the server.
一种可能的实现方式,预测信息包括该预测模型;服务端,还用于训练数据以生成该预测模型;服务端,还用于将该预测模型发送给该客户端。In a possible implementation manner, the prediction information includes the prediction model; the server is further used for training data to generate the prediction model; the server is also used for sending the prediction model to the client.
一种可能的实现方式,服务端,还用于配置第一索引,该第一索引包括多个数据的关键字,该位置信息用于指示该待读取数据位于该第一索引中的位置;服务端,具体用于根据该位置信息从该第一索引中读取该待读取数据。In a possible implementation, the server is further configured to configure a first index, where the first index includes a plurality of data keywords, and the location information is used to indicate the location of the data to be read in the first index; The server is specifically configured to read the data to be read from the first index according to the location information.
一种可能的实现方式,第一索引是静态的,该第一索引中的关键字不变。In a possible implementation manner, the first index is static, and the key in the first index does not change.
一种可能的实现方式,服务端,还用于配置第二索引,该第二索引用于记录更新数据的关键字,该更新数据的关键字会定期写入该第一索引。In a possible implementation manner, the server is further configured to configure a second index, where the second index is used to record the keyword of the updated data, and the keyword of the updated data will be written into the first index periodically.
一种可能的实现方式,服务端,具体用于当该第一索引中未保存有该待读取数据的关键字时,从该第二索引中获得该待读取数据的存储地址,从而读取该待读取数据。A possible implementation, the server, is specifically used to obtain the storage address of the data to be read from the second index when the keyword of the data to be read is not stored in the first index, so as to read Get the data to be read.
一种可能的实现方式,服务端,还用于预测该客户端将要读取的数据;若该将要读取的数据未包括在该第一索引和该第二索引中,服务端,还用于将该将要读取的数据写入该第二索引。A possible implementation, the server, is also used to predict the data to be read by the client; if the data to be read is not included in the first index and the second index, the server is also used for Write the data to be read into the second index.
一种可能的实现方式,服务端,还用于将该第二索引写入该第一索引,得到第三索引;服务端,还用于训练该第三索引以生成新的预测模型;服务端,还用于将该新的预测模型发送给该客户端。A possible implementation, the server is also used to write the second index into the first index to obtain a third index; the server is also used to train the third index to generate a new prediction model; the server , which is also used to send the new predictive model to the client.
一种可能的实现方式,预测信息包括该预测列表,服务端,还用于获取该至少一个首地址以生成该预测列表;服务端,还用于将该预测列表发送给该客户端。In a possible implementation manner, the prediction information includes the prediction list, the server is further configured to obtain the at least one first address to generate the prediction list; the server is further configured to send the prediction list to the client.
一种可能的实现方式,待读取数据的位置信息是根据该待读取数据的关键字与预测信息获得的具体包括:待读取数据的位置信息是对该待读取数据的关键字做哈希运算,根据该哈希运算的结果查询该预测列表得到的。A possible implementation manner, the location information of the data to be read is obtained according to the keyword of the data to be read and the prediction information, which specifically includes: the location information of the data to be read is obtained from the keyword of the data to be read. Hash operation, obtained by querying the prediction list according to the result of the hash operation.
一种可能的实现方式,客户端,还用于根据该待读取数据的关键字确定该待读取数据的关键字是否保存在该服务端中;客户端,还具体用于当确定结果为该待读取数据的关键字保存在该服务端中时,向该服务端发送第一读请求。In a possible implementation manner, the client is further configured to determine whether the keyword of the data to be read is stored in the server according to the keyword of the data to be read; the client is also specifically used to determine whether the keyword of the data to be read is When the keyword of the data to be read is stored in the server, a first read request is sent to the server.
图1为本申请实施例提供的存储系统架构示意图;1 is a schematic diagram of a storage system architecture provided by an embodiment of the present application;
图2为本申请实施例提供的节点的硬件结构示意图;FIG. 2 is a schematic diagram of a hardware structure of a node provided by an embodiment of the present application;
图3为本申请实施例提供的访问数据的方法的流程示意图一;3 is a schematic flowchart 1 of a method for accessing data provided by an embodiment of the present application;
图4为本申请实施例提供的第一索引的示意图;4 is a schematic diagram of a first index provided by an embodiment of the present application;
图5为本申请实施例提供的预测模型、第一索引、第二索引的对应关系示意图;FIG. 5 is a schematic diagram of a corresponding relationship between a prediction model, a first index, and a second index provided by an embodiment of the present application;
图6为本申请实施例提供的访问数据的方法的流程示意图二;6 is a second schematic flowchart of a method for accessing data provided by an embodiment of the present application;
图7为本申请实施例提供的访问数据的方法的流程示意图三。FIG. 7 is a third schematic flowchart of a method for accessing data provided by an embodiment of the present application.
下面结合附图对本申请实施例的实施方式进行详细描述。The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
本申请实施例提供的方法可用于各种支持内存访问协议的存储系统。下面以图1所示存储系统10为例,对本申请实施例提供的方法进行描述。The methods provided by the embodiments of the present application can be used in various storage systems that support memory access protocols. The method provided by this embodiment of the present application is described below by taking the
如图1所示,为本申请实施例提供的存储系统10的架构示意图。图1中,存储系统10包括客户端101和服务端102,客户端101与服务端102之间通过内存网络协议通信。其中,客户端101是软件模块或者硬件组件,它用于向服务端102发送读/写请求。当客户端101是软件模块时,它是由客户端101所在节点的处理器运行内存中的程序指令来执行的。服务端102可以是一个节点,它用于接收客户端101发送的读/写请求,解析并执行所述读/写请求。当服务端102是一个节点时,它也需要一定的计算资源(处理器资源和内存资源),该计算资源可以运行内存中的程序指令来执行。这里的计算资源可以由服务端102的处理器和/或网卡以及内存来提供。As shown in FIG. 1 , it is a schematic diagram of the architecture of a
图1中的客户端101和服务端102可以部署在同一个节点,也可以部署在不同的节点。客户端101和服务端102之间可以采用各种内存访问协议通信,例如,远端直接内存访问(remote direct memory access,RDMA)协议、计算快速链接(compute express link,CXL)协议、开放式相干加速器处理器接口(open coherent accelerator processor interface,OpenCAPI)协议、Gen-Z(generation Z)、用于加速器的缓存一致互联协议(cache coherent interconnect for accelerators,CCIX)等。图1中的客户端101和服务端102之间也可以采用未来演进的内存 网络协议通信,不予限制。本申请下述实施例是以客户端和服务端之间采用RDMA协议通信为例进行介绍的。客户端和服务端采用其他内存网络协议通信的情况,可以参考本申请下述实施例中对应的描述,不予赘述。本实施例中所称的节点,是指存储阵列或者存储服务器或者通用计算机等任何既具有计算资源也具有存储资源的设备。The
图1所示的存储系统10仅用于举例,并非用于限制本申请的技术方案。本领域的技术人员应当明白,在具体实现过程中,存储系统10还可以包括其他节点,同时也可根据具体需要来确定节点的数量,不予限制。The
请参考图2,图2为节点20的硬件结构示意图。节点20上部署了客户端101,或者,节点20为服务端102。该节点20包括处理器201和网卡202,用于实现本申请实施例提供的方法。处理器201上配置了内存203。本申请实施例中,内存也可以称为缓存、存储器等。Please refer to FIG. 2 , which is a schematic diagram of the hardware structure of the
处理器201可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。The
网卡202可以支持各种内存访问协议。若节点20上部署了客户端101,网卡202可以用于发送读/写请求。若节点20为服务端102,网卡202可以用于接收读/写请求,解析并执行所述读/写请求。可以理解的,本申请实施例中的网卡也可以替换为芯片,该芯片也支持各种内存访问协议,并且可以执行本申请实施例中网卡执行的动作。The
内存203可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,但不限于此。内存203可以是独立存在,并与处理器201相耦合。内存203也可以和处理器201集成在一起。本申请实施例提供的内存通常可以具有非易失性。Memory 203 may be read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM) or other types of information and instructions dynamic storage device, but not limited to this. The memory 203 may exist independently and be coupled to the
可以理解的,客户端101可以通过单边RDMA读/写服务端102中的数据,也可以通过双边RDMA读/写服务端102中的数据。下面以服务端102的硬件结构如图2所示为例,分别介绍客户端101通过单边RDMA读内存203中的数据,以及通过双边RDMA读内存203中的数据的具体过程。It can be understood that the
对于单边RDMA,客户端101可以直接确定待读取数据的元数据在内存203中的位置,因此在读请求中携带所述元数据数据的位置信息,将所述读请求发送给服务端102。服务端102通过网卡202读取该位置信息对应的元数据,根据该元数据获得待读取数据。上述过程中,处理器201对客户端101的一系列操作不感知。换句话说,处理器201不知道客户端101执行了读操作,因而减少了处理器201参与数据传输过程的消耗,提升了系统处理业务的性能,具有高带宽、低时延及低CPU占用率的特点。For unilateral RDMA, the
对于双边RDMA,客户端101并不知道所述待读取数据的元数据存储在内存203中的位置,因此只能向服务端102请求读取所述待读取数据,而读请求中并没有携带所述元数据的位置信息。服务端102接收到该读请求后,查询所述元数据的位置信息并返回给客户端101,客户端101会再次向服务端102发起读请求,这次的读请求中包含所述元数据的位置信息。服务端102再根据该元数据的位置信息获取元数据,并进一步获得待读取数据,并将该待读取数据发送给客户端101。在该过程中,需要处理器201参与,也就是说,双边RDMA需要处理器201处理读请求,所以单边RDMA相对于双边RDMA,读取数据的时间更短,对处理器的占用率更低,用户体验更好。因此,单边RDMA的应用越来越广。For bilateral RDMA, the
可以理解的,内存203中的数据可以通过哈希表(hashtable)或索引的形式存储。下面 分别对哈希表和索引进行介绍。It can be understood that the data in the memory 203 can be stored in the form of a hash table (hashtable) or an index. The hash table and index are introduced separately below.
1、哈希表1. Hash table
服务端102可以在内存203中的至少一段连续内存上配置哈希表,其中,每段连续内存对应一个哈希表。进一步的,每段连续内存可以被划分为多个内存块,每个内存块中可以存储数据的键值对,即关键字(key)和值(value)。本申请中,value为元数据或者为数据本身。本申请下述实施例是以value为元数据为例进行阐述的,value为数据本身的情况可以参考value为元数据中对应的描述。The
其中,每个内存块在该内存块所属的连续内存中的地址不同。示例性的,以一段连续内存的大小为4M,该连续内存按照4kb为单位划分内存块为例,该连续内存包括1024个内存块,也就是说,该连续内存上可以存储1024个数据的键值对。The addresses of each memory block in the contiguous memory to which the memory block belongs are different. Exemplarily, the size of a segment of contiguous memory is 4M, and the contiguous memory is divided into memory blocks in units of 4kb as an example, the contiguous memory includes 1024 memory blocks, that is, the contiguous memory can store 1024 data keys. value pair.
服务端102在将数据的键值对写入哈希表的过程中,可以对该数据的key进行哈希运算,得到数据的哈希值;对该数据的哈希值做取模运算得到该数据的键值对的存储位置。具体的,服务端102将该数据的哈希值对内存203中哈希表的数量取模,得到第一余数。该第一余数与至少一个哈希表中的第一哈希表对应。服务端102可以确定将该数据的键值对写入到第一哈希表中。In the process of writing the key-value pair of the data into the hash table, the
进一步的,该数据的键值对在第一哈希表中的位置可以通过如下方法获得:服务端102将该数据的哈希值对第一哈希表对应的连续内存的大小取模,得到第二余数。该第二余数可以用于确定该数据的键值对在第一哈希表对应的连续内存中的地址。例如,第二余数为要写入键值对的第一内存块在第一哈希表对应的连续内存中的索引,服务端102可以将该键值对写入第一内存块中。Further, the position of the key-value pair of the data in the first hash table can be obtained by the following method: the
可以理解的,若内存203中的数据通过哈希表的形式存储,客户端101通过单边RDMA读内存203中的数据之前,可以采用与上述服务端102确定数据的键值对在内存203中的位置类似的方法,确定待读取数据的元数据在内存203中的位置。后续,客户端101可以向服务端102发送第一读请求,第一读请求中包括待读取数据的元数据的位置信息,这样网卡202即可根据该位置信息读取元数据,根据元数据获得待读取数据,将待读取数据发送给客户端101。It can be understood that if the data in the memory 203 is stored in the form of a hash table, before the
示例性的,客户端101对待读取数据的key进行哈希运算,根据哈希运算的结果查询预测列表,得到待读取数据的元数据的位置信息。其中,预测列表包括至少一个首地址,每个首地址是内存203中一段连续内存的起始地址。Exemplarily, the
进一步的,客户端101对待读取数据的key进行哈希运算,得到待读取数据的哈希值;将待读取数据的哈希值对预测列表中连续内存的首地址的数量(连续内存的首地址的数量与内存203中哈希表的数量相同)取模,得到第三余数。第三余数与预测列表指示的至少一段连续内存中的第一内存对应。客户端101将待读取数据的哈希值对第一内存的大小取模,得到第四余数。第四余数可以用于确定待读取数据的元数据在第一内存中的地址。例如,第四余数为用于存储待读取数据的元数据的第二内存块在第一内存中的索引。客户端101查询预测列表,得到第一内存的首地址,根据第一内存的首地址和第四余数可以得到待读取数据的元数据的位置信息。客户端101在根据待读取数据的key得到元数据的位置信息的过程中,通过哈希计算、取模和加法运算即可得到元数据的位置信息,计算开销较小。Further, the
综上所述,哈希表占用内存203一段连续的空间,它里面的key是离散的,不支持区间查询和范围查询,也不易扩展。内存203中可以有多段连续的空间,每段对应一个首地址,客户端101需要先获取某段的首地址,知道待读取数据在哪段,再进一步获取在该段中的位 置。To sum up, the hash table occupies a continuous space of 203 in memory, and the keys in it are discrete. It does not support interval query and range query, and it is not easy to expand. In the memory 203, there can be multiple continuous segments, each segment corresponds to a first address, and the
2、索引2. Index
服务端102配置第一索引,例如,在内存203中配置第一索引。其中,第一索引包括多个数据的key。进一步的,第一索引还可以包括多个数据中、每个数据的value。第一索引中的key和value存储在一段连续的内存上。例如,第一索引可以为数组或列表等。The
示例性的,第一索引可以如图3所示。图3中,第一索引包括多个键值对。其中,第一个键值对包括key301和value305,第二个键值对包括key302和value306,第三个键值对包括key303和value307,…,最后一个键值对包括key304和value308。Exemplarily, the first index may be as shown in FIG. 3 . In FIG. 3, the first index includes a plurality of key-value pairs. Among them, the first key-value pair includes key301 and value305, the second key-value pair includes key302 and value306, the third key-value pair includes key303 and value307, ..., and the last key-value pair includes key304 and value308.
进一步可选的,第一索引中的key和key对应的value,可以按照顺序排列。例如,按照key从小到大的顺序排列。以图3所示的第一索引为例,key301<key302<key303<key304。Further optionally, the key in the first index and the value corresponding to the key may be arranged in order. For example, in order of keys from small to large. Taking the first index shown in FIG. 3 as an example, key301<key302<key303<key304.
可以理解的,若内存203中的数据通过第一索引的形式存储,客户端101通过单边RDMA读内存203中的数据之前,客户端101可以根据待读取数据的key和预测模型得到待读取数据的元数据的位置信息。其中,预测模型可以处理器201训练数据生成,并发送给客户端101的。元数据的位置信息可以用于指示元数据位于服务端102中的位置。例如,元数据的位置信息用于指示元数据位于第一索引中的位置。后续,客户端101可以向服务端102发送第一读请求,第一读请求中包括待读取数据的元数据的位置信息,这样网卡202即可根据该位置信息读取元数据,根据元数据获得待读取数据,将待读取数据发送给客户端101。It can be understood that if the data in the memory 203 is stored in the form of the first index, before the
可选的,第一索引是静态的。也就是说,第一索引中的key不变,并且在预设的时间范围内,第一索引中的key的数量是不变的。换句话说,不会改变第一索引中的key,并且在预设的时间范围内不会在第一索引中增加新的key,但是可以更新第一索引中的key对应的value。Optionally, the first index is static. That is, the keys in the first index are unchanged, and within a preset time range, the number of keys in the first index is unchanged. In other words, the key in the first index will not be changed, and no new key will be added to the first index within the preset time range, but the value corresponding to the key in the first index may be updated.
在这种情况下,服务端102配置第二索引,例如,在内存203中配置第二索引。第二索引可以用于记录更新数据的key。也就是说,若需要增加新的key,可以将新增加的key写入第二索引。In this case, the
其中,第二索引包括多个数据的key和value。进一步的,第二索引中的key和key对应的value,可以按照顺序排列。例如,按照key从小到大的顺序排列。示例性的,第二索引包括B+树(tree)、B树、二叉树或有序的列表等。The second index includes keys and values of multiple data. Further, the key in the second index and the value corresponding to the key can be arranged in order. For example, in order of keys from small to large. Exemplarily, the second index includes a B+ tree, a B tree, a binary tree, an ordered list, and the like.
可以理解的,若服务端102不配置第二索引,而是将新增加的key写入第一索引,一方面,第一索引中key的的位置会改变,在这种情况下,服务端102训练预测模型的过程中,还需要生成翻译表(translation table),该预测模型可以预测待读取数据的逻辑地址,翻译表可以将该逻辑地址转换为待读取数据在内存203的实际地址。而内存203中存储的数据一般较多,所以翻译表占用的空间也较大,导致服务端102和客户端101的内存开销较大。另一方面,第一索引在key大于一定阈值的情况下,还会进行分裂。在这种情况下,根据原先训练的预测模型和翻译表确定的实际地址就不准确。因此,服务端102需要重新对新的第一索引进行训练得到新的模型和翻译表,服务端102的计算开销较大。It can be understood that if the
一种可能的实现方式,更新数据的key会定期写入第一索引。可以理解的,若待读取数据的元数据位于第二索引,则客户端101通过单边RDMA是读取不到待读取数据的。因此,服务端102可以定期将第二索引写入第一索引,并训练新的第一索引得到新的预测模型,将新的预测模型发送给客户端101,这样客户端101就可以根据新的预测模型进行单边RDMA。In a possible implementation, the key for updating the data is periodically written to the first index. It can be understood that if the metadata of the data to be read is located at the second index, the
可以理解的,本申请实施例不限制预测模型和第一索引的数量。也就是说,服务端可以存储多个预测模型,以及每个预测模型对应的第一索引。一个预测模型和该预测模型对应的第一索引对应一段内存范围。进一步的,第二索引的数量与预测模型的数量相同。换句话说, 本申请实施例中,预测模型、第一索引,和第二索引一一对应。It can be understood that the embodiments of the present application do not limit the number of prediction models and first indexes. That is, the server can store multiple prediction models and the first index corresponding to each prediction model. A prediction model and the first index corresponding to the prediction model correspond to a range of memory. Further, the number of second indexes is the same as the number of prediction models. In other words, in this embodiment of the present application, the prediction model, the first index, and the second index are in one-to-one correspondence.
示例性的,如图4所示,服务端上存储有预测模型401-预测模型403,第一索引404-第一索引406,以及第二索引407-第二索引409。其中,预测模型401、第一索引404和第二索引407对应内存范围1,预测模型402、第一索引405和第二索引408对应内存范围2,预测模型403、第一索引406和第二索引409对应内存范围3。若服务端上要插入的数据是内存范围1中的数据,则将该数据插入到第二索引407中;若服务端上要插入的数据是内存范围2中的数据,则将该数据插入到第二索引408中;若服务端上要插入的数据是内存范围3中的数据,则将该数据插入到第二索引409中。Exemplarily, as shown in FIG. 4 , a prediction model 401 - a
综上所述,内存203中的数据通过索引的形式存储,若要进行单边RDMA,是需要经过训练的,计算开销较大。但是,通过索引的形式存储数据容易扩展,而且key是连续的,支持区间查询和范围查询,在内存中占用的空间也小。To sum up, the data in the memory 203 is stored in the form of an index. To perform unilateral RDMA, it needs to be trained, and the computational cost is relatively high. However, storing data in the form of an index is easy to expand, and the keys are continuous, support interval queries and range queries, and occupy a small space in memory.
下面结合图1和图2对本申请实施例提供的访问数据的方法进行具体阐述。The method for accessing data provided by the embodiments of the present application will be described in detail below with reference to FIG. 1 and FIG. 2 .
可以理解的,本申请实施例中同一个步骤或者具有相同功能的步骤或者技术特征在不同实施例之间可以互相参考借鉴。It can be understood that the same step or steps or technical features with the same function in the embodiments of the present application may be referred to and referenced from each other between different embodiments.
可以理解的,本申请实施例中,客户端和/或服务端可以执行本申请实施例中的部分或全部步骤,这些步骤仅是示例,本申请实施例还可以执行其它步骤或者各种步骤的变形。此外,各个步骤可以按照本申请实施例呈现的不同的顺序来执行,并且有可能并非要执行本申请实施例中的全部步骤。It can be understood that, in the embodiments of the present application, the client and/or the server may perform some or all of the steps in the embodiments of the present application, these steps are only examples, and the embodiments of the present application may also perform other steps or various steps. deformed. In addition, various steps may be performed in different orders presented in the embodiments of the present application, and it may not be necessary to perform all the steps in the embodiments of the present application.
在本申请实施例中,访问数据的方法的执行主体的具体结构,本申请实施例并未特别限定,只要能够实现本申请实施例的提供的方法即可。例如,本申请实施例提供的访问数据的方法的执行主体可以是客户端,或者为应用于客户端中的部件,例如,芯片,本申请对此不进行限定。或者,本申请实施例提供的访问数据的方法的执行主体可以是服务端,或者为应用于服务端中的部件,例如,芯片,本申请对此不进行限定。下述实施例以访问数据的方法的执行主体分别为客户端、服务端为例进行描述。In the embodiments of the present application, the specific structure of the execution body of the method for accessing data is not particularly limited in the embodiments of the present application, as long as the methods provided by the embodiments of the present application can be implemented. For example, the execution body of the method for accessing data provided by the embodiments of the present application may be a client, or a component applied in the client, such as a chip, which is not limited in this application. Alternatively, the execution body of the method for accessing data provided by the embodiments of the present application may be a server, or a component applied to the server, such as a chip, which is not limited in this application. The following embodiments are described by taking an example that the execution bodies of the method for accessing data are the client and the server respectively.
如图5所示,为本申请实施例提供的一种访问数据的方法,该访问数据的方法可以应用于图1所示的存储系统10中。该访问数据的方法包括S501-S502。As shown in FIG. 5 , a method for accessing data provided in an embodiment of the present application can be applied to the
S501:客户端向服务端发送第一读请求。S501: The client sends a first read request to the server.
其中,客户端可以为图1所示存储系统10中的客户端101。服务端可以为图1所示存储系统10中的服务端102。第一读请求为单边RDMA的读请求,它包括待读取数据的元数据的位置信息。The client may be the
其中,待读取数据为客户端要读取的服务端中的数据。元数据的位置信息可以用于指示元数据位于服务端中的位置,并且该位置信息是根据待读取数据的key和预测信息得到的。一种可能的实现方式,元数据的位置信息可以指示元数据位于服务端中的内存的起始地址。The data to be read is the data in the server to be read by the client. The location information of the metadata can be used to indicate the location of the metadata in the server, and the location information is obtained according to the key and prediction information of the data to be read. In a possible implementation manner, the location information of the metadata may indicate the starting address of the memory where the metadata is located in the server.
其中,预测信息可以包括预测模型或预测列表。客户端可以根据服务端中数据的存储形式,确定采用预测模型或预测列表获取位置信息。可以理解的,服务端中的数据可以以哈希表的形式存储,也可以以索引的形式存储。哈希表和索引的介绍可以参考上述图2所示实施例中对应的描述,此处不再赘述。下面分别以服务端中的数据以第一索引的形式和哈希表的形式存储为例,介绍预测模块。The prediction information may include a prediction model or a prediction list. The client can determine to use a prediction model or a prediction list to obtain location information according to the storage form of the data in the server. It is understandable that the data in the server can be stored in the form of a hash table or in the form of an index. For the introduction of the hash table and the index, reference may be made to the corresponding description in the above-mentioned embodiment shown in FIG. 2 , and details are not repeated here. The following describes the prediction module by taking the example that the data in the server is stored in the form of the first index and in the form of a hash table respectively.
情况1:服务端配置第一索引,预测信息包括预测模型。在这种情况下,元数据的位置信息是根据待读取数据的key和预测模型得到的。例如,将待读取数据的key作为预测模型的输入,该预测模型可以输出元数据的位置信息。Case 1: The server configures the first index, and the prediction information includes a prediction model. In this case, the location information of the metadata is obtained based on the key of the data to be read and the prediction model. For example, the key of the data to be read is used as the input of the prediction model, and the prediction model can output the location information of the metadata.
对于情况1,元数据的位置信息可以用于指示元数据位于第一索引中的位置,例如,元数据的位置信息指示了元数据在第一索引中的位置的起始地址。For case 1, the location information of the metadata may be used to indicate the location of the metadata in the first index, for example, the location information of the metadata indicates the starting address of the location of the metadata in the first index.
一种可能的实现方式,S501之前,图5所示的方法还包括:服务端训练数据以生成预测模型;服务端将预测模型发送给客户端。进一步的,服务端训练数据以生成预测模型,具体包括:服务端训练第一索引以生成预测模型。例如,服务端可以通过一种或多种算法对第一索引进行模型训练,生成预测模型。这样客户端即可根据待读取数据的key和预测模型得到待读取数据的元数据的位置信息。A possible implementation manner, before S501, the method shown in FIG. 5 further includes: the server trains the data to generate the prediction model; the server sends the prediction model to the client. Further, the server trains the data to generate the prediction model, which specifically includes: the server trains the first index to generate the prediction model. For example, the server can use one or more algorithms to perform model training on the first index to generate a prediction model. In this way, the client can obtain the location information of the metadata of the data to be read according to the key of the data to be read and the prediction model.
进一步的,服务端对第一索引进行模型训练,生成预测模型的过程中,还可以生成该预测模型的误差。预测模型的误差可以反映预测模型预测的位置的准确率。Further, the server performs model training on the first index, and in the process of generating the prediction model, the error of the prediction model may also be generated. The error of the prediction model can reflect the accuracy of the location predicted by the prediction model.
一种可能的实现方式,S501之前,客户端根据待读取数据的key确定待读取数据的key是否保存在服务端中,当确定结果为待读取数据的key保存在服务端中时,客户端向服务端发送第一读请求。A possible implementation manner, before S501, the client determines whether the key of the data to be read is stored in the server according to the key of the data to be read, and when the determination result is that the key of the data to be read is stored in the server, The client sends the first read request to the server.
进一步的,对于上述情况1,客户端根据待读取数据的key确定待读取数据的key是否保存在第一索引中,当确定结果为待读取数据的key保存在第一索引中,客户端向服务端发送第一读请求。当确定结果为待读取数据的key未保存在第一索引中,客户端通过双边RDMA读取待读取数据。Further, for the above case 1, the client determines whether the key of the data to be read is stored in the first index according to the key of the data to be read, and when the determination result is that the key of the data to be read is stored in the first index, the client The terminal sends the first read request to the server. When it is determined that the key of the data to be read is not stored in the first index, the client reads the data to be read through bilateral RDMA.
一种可能的实现方式,客户端可以将待读取数据的key输入到过滤器,例如布隆过滤器(bloom filter,BF)、计数布隆过滤器(counted bloom filter,Counted BF),紧凑型范围过滤器(succinct range filters,SuRF)、学习型过滤器等,以确定待读取数据的key是否保存在第一索引中。示例性的,客户端将待读取数据的key输入到过滤器中,若过滤器输出的值为“0”,则客户端可以确定待读取数据的key未保存在第一索引中;若过滤器输出的值为“1”,则客户端可以确定待读取数据的key保存在第一索引中。A possible implementation, the client can input the key of the data to be read into the filter, such as bloom filter (bloom filter, BF), counted bloom filter (counted bloom filter, Counted BF), compact Range filters (succinct range filters, SuRF), learning filters, etc., to determine whether the key of the data to be read is stored in the first index. Exemplarily, the client inputs the key of the data to be read into the filter, and if the value output by the filter is "0", the client can determine that the key of the data to be read is not stored in the first index; if If the value of the filter output is "1", the client can determine that the key of the data to be read is stored in the first index.
进一步的,服务端可以根据一种或多种算法得到过滤器,并将过滤器发送给客户端,以便客户端根据过滤器确定待读取数据的key是否保存在第一索引中。Further, the server can obtain the filter according to one or more algorithms, and send the filter to the client, so that the client can determine whether the key of the data to be read is stored in the first index according to the filter.
可以理解的,客户端接收到过滤器后,若第一索引和第二索引没有被更新,则客户端可以一直使用上述过滤器。若第二索引中新增加了数据,服务端可以根据新增加的数据更新过滤器,以便在客户端通过双边RDMA访问服务端的情况下,服务端根据更新后的过滤器确定服务端是否存储客户端要访问的数据。It can be understood that after the client receives the filter, if the first index and the second index have not been updated, the client can always use the above filter. If data is newly added to the second index, the server can update the filter according to the newly added data, so that when the client accesses the server through bilateral RDMA, the server determines whether the server stores the client according to the updated filter. The data to be accessed.
可以理解的,若服务端中删除了数据,服务端可以重新训练得到新的过滤器,将新的过滤器发送给客户端。应理解,若该删除操作是服务端发起的内存资源回收流程,则服务端删除的数据为要淘汰的数据,服务端可以不重新训练过滤器。Understandably, if the data is deleted from the server, the server can retrain to obtain a new filter and send the new filter to the client. It should be understood that if the deletion operation is a memory resource recovery process initiated by the server, the data deleted by the server is the data to be eliminated, and the server may not retrain the filter.
情况2:服务端配置至少一个哈希表,预测信息包括预测列表。在这种情况下,元数据的位置信息是根据待读取数据的key和预测列表得到的。客户端根据待读取数据的key和预测列表得到元数据的位置信息的过程可以参考上述图2所示实施例中对应的描述。Case 2: The server configures at least one hash table, and the prediction information includes a prediction list. In this case, the location information of the metadata is obtained from the key and prediction list of the data to be read. For the process that the client obtains the location information of the metadata according to the key of the data to be read and the prediction list, reference may be made to the corresponding description in the embodiment shown in FIG. 2 above.
对于情况2,元数据的位置信息可以指示元数据在哈希表中的位置,例如,元数据的位置信息可以指示元数据在哈希表中的位置的起始地址。For case 2, the location information of the metadata may indicate the location of the metadata in the hash table, for example, the location information of the metadata may indicate the starting address of the location of the metadata in the hash table.
一种可能的实现方式,S501之前,图5所示的方法还包括:服务端获取至少一段连续内存的首地址,以生成预测列表;服务端将预测类别发送给客户端。这样客户端即可根据待读取数据的key和预测列表得到待读取数据的元数据的位置信息。A possible implementation manner, before S501, the method shown in FIG. 5 further includes: the server obtains the first address of at least a segment of continuous memory to generate a prediction list; the server sends the prediction category to the client. In this way, the client can obtain the location information of the metadata of the data to be read according to the key of the data to be read and the prediction list.
一种可能的实现方式,以客户端和服务端通过RDMA协议通信为例,对于上述情况1和情况2,客户端的网卡向服务端的网卡发送第一读请求。A possible implementation manner, taking the communication between the client and the server through the RDMA protocol as an example, for the above cases 1 and 2, the network card of the client sends a first read request to the network card of the server.
对应的,服务端接收来自客户端的第一读请求。Correspondingly, the server receives the first read request from the client.
S502:服务端根据元数据的位置信息读取元数据,根据元数据获得待读取数据,将待读取数据发送给客户端。S502: The server reads the metadata according to the location information of the metadata, obtains the data to be read according to the metadata, and sends the data to be read to the client.
一种可能的实现方式,对于上述情况1,服务端根据元数据的位置信息读取元数据,具体包括:服务端根据元数据的位置信息从第一索引中读取元数据。进一步的,服务端在第一索引中,读取以元数据的位置信息指示的位置为起始位置,以服务端读取数据的读取宽度为大小的内存块,将该内存块发送给客户端。A possible implementation manner, for the above situation 1, the server reads the metadata according to the location information of the metadata, which specifically includes: the server reads the metadata from the first index according to the location information of the metadata. Further, in the first index, the server reads the memory block whose size is indicated by the position information of the metadata as the starting position and the reading width of the data read by the server as the size, and sends the memory block to the client. end.
一种可能的实现方式,对于上述情况2,服务端根据元数据的位置信息读取元数据,具体包括:服务端根据元数据的位置信息从至少一段连续内存中读取元数据。进一步的,服务端在至少一段连续内存中,读取以元数据的位置信息指示的位置为起始位置,以服务端读取数据的读取宽度为大小的内存块,将该内存块发送给客户端。A possible implementation manner, for the above situation 2, the server reads the metadata according to the location information of the metadata, which specifically includes: the server reads the metadata from at least a segment of continuous memory according to the location information of the metadata. Further, in at least a segment of continuous memory, the server reads a memory block with the position indicated by the location information of the metadata as the starting position and the reading width of the data read by the server as the size, and sends the memory block to client.
其中,服务端读取数据的读取宽度可以大于或等于待读取数据的元数据的大小与两倍的预测模型的误差之和。The read width of the data read by the server may be greater than or equal to the sum of the size of the metadata of the data to be read and twice the error of the prediction model.
可以理解的,对于上述情况1,在具体应用中,为了使得服务端发送给客户端的内存块中包括待读取数据的元数据,服务端或客户端可以调整元数据的位置信息。若服务端调整元数据的位置信息,服务端可以将元数据的位置信息指示的位置减小第一偏移,得到调整后的位置,服务端读取的内存块是以调整后的位置为起始位置,以服务端读取数据的读取宽度为大小的内存块。若客户端调整元数据的位置信息,客户端根据待读取数据的key和预测模型得到元数据的位置信息后,可以将元数据的位置信息指示的位置减小第一偏移,得到调整后的位置,并把调整后的位置包括在第一读请求中发送给服务端。这样服务端接收到第一读请求后,可以读取以调整后的位置为起始位置,以服务端读取数据的读取宽度为大小的内存块。上述第一偏移大于或等于预测模型的误差。It can be understood that for the above case 1, in a specific application, in order to make the memory block sent by the server to the client include metadata of the data to be read, the server or the client can adjust the location information of the metadata. If the server adjusts the location information of the metadata, the server can reduce the position indicated by the location information of the metadata by the first offset to obtain the adjusted location. The memory block read by the server starts from the adjusted location. The starting position, a memory block with the size of the read width of the data read by the server. If the client adjusts the location information of the metadata, after obtaining the location information of the metadata according to the key of the data to be read and the prediction model, the client can reduce the location indicated by the location information of the metadata by the first offset, and obtain the adjusted location information. position, and include the adjusted position in the first read request and send it to the server. In this way, after the server receives the first read request, it can read the memory block starting from the adjusted position and taking the read width of the data read by the server as the size. The above-mentioned first offset is greater than or equal to the error of the prediction model.
可以理解的,服务端的处理器,例如CPU,对S502的过程不感知,也就是说,服务端的处理器不参与S502中读取数据的过程,因此可以缩短读取数据的时间,提高用户体验。It can be understood that the processor of the server, such as the CPU, is not aware of the process of S502, that is, the processor of the server does not participate in the process of reading data in S502, so the time for reading data can be shortened and the user experience can be improved.
可以理解的,在具体应用中,客户端可以对服务端中的元数据进行更新和/或插入操作。下面对客户端对服务端中的元数据进行更新和/或插入操作的具体过程进行阐述。该更新操作可以作用于第一索引和第二索引。该插入操作可以作用于第二索引。It can be understood that, in a specific application, the client can update and/or insert the metadata in the server. The specific process for the client to update and/or insert the metadata in the server will be described below. The update operation can act on the first index and the second index. The insert operation can act on the second index.
示例性的,以客户端对服务端中的元数据进行更新操作(update)为例,客户端可以向服务端发送第二读请求,第二读请求包括要更新的key和要更新的key对应的value。服务端接收到第二读请求后,根据第二读请求在第一索引和/或第二索引中查找要更新的key。若查到要更新的key,服务端将第一索引和/或第二索引中要更新的key对应的value,更新为第二读请求中,要更新的key对应的value。若未查找到要更新的key,更新操作失败。Exemplarily, taking the client performing an update operation (update) on the metadata in the server as an example, the client may send a second read request to the server, and the second read request includes the key to be updated and the corresponding key to be updated. value. After receiving the second read request, the server searches the first index and/or the second index for the key to be updated according to the second read request. If the key to be updated is found, the server updates the value corresponding to the key to be updated in the first index and/or the second index to the value corresponding to the key to be updated in the second read request. If the key to be updated is not found, the update operation fails.
示例性的,以客户端对服务端中的元数据进行插入操作(insert)为例,客户端可以向服务端发送第三读请求,第三读请求包括要插入的key和该要插入的key对应的value。服务端接收到第三读请求后,根据第三读请求在第一索引和/或第二索引中查找要插入的key。若未查找到该要插入的key,服务端将要插入的key和该要插入的key对应的value插入到第二索引中。若查找到该要插入的key,插入操作失败。Exemplarily, taking the client performing an insert operation (insert) on the metadata in the server as an example, the client may send a third read request to the server, and the third read request includes the key to be inserted and the key to be inserted. the corresponding value. After receiving the third read request, the server searches the first index and/or the second index for the key to be inserted according to the third read request. If the key to be inserted is not found, the server inserts the key to be inserted and the value corresponding to the key to be inserted into the second index. If the key to be inserted is found, the insert operation fails.
示例性的,以客户端对服务端中的元数据进行更新和插入操作(put)为例,客户端可以向服务端发送第四读请求,第四读请求包括要更新和插入的key和该key对应的value。服务端接收到第四读请求后,根据第四读请求在第一索引和/或第二索引中查找要更新和插入的key。若查到该key,服务端将第一索引和/或第二索引中该key对应的value,更新为第四读 请求中,该key对应的value。若未查找到该key,服务端将该key和该key对应的value插入到第二索引中。Exemplarily, taking the client to update and insert the metadata in the server as an example, the client can send a fourth read request to the server, and the fourth read request includes the key to be updated and inserted and the The value corresponding to the key. After receiving the fourth read request, the server searches the first index and/or the second index for the key to be updated and inserted according to the fourth read request. If the key is found, the server updates the value corresponding to the key in the first index and/or the second index to the value corresponding to the key in the fourth read request. If the key is not found, the server inserts the key and the value corresponding to the key into the second index.
可以理解的,服务端配置上述第一索引和第二索引可以使得客户端通过预测模型准确预测要待读取数据在第一索引中的位置。若第一索引中未保存有待读取数据的key时,可以从第二索引中获得待读取数据的元数据的存储地址,从而读取元数据。如此,服务端可以不用频繁地训练模型,可以减少服务端的计算开销。具体的,S502中,服务端根据位置信息读取元数据,具体包括:当第一索引中未保存有待读取数据的关键字时,从第二索引中获得待读取数据的元数据的存储地址,从而读取元数据。It can be understood that the configuration of the first index and the second index on the server side enables the client to accurately predict the position of the data to be read in the first index through the prediction model. If the key of the data to be read is not stored in the first index, the storage address of the metadata of the data to be read can be obtained from the second index, so as to read the metadata. In this way, the server does not need to train the model frequently, which can reduce the computing overhead of the server. Specifically, in S502, the server reads the metadata according to the location information, which specifically includes: when the keyword of the data to be read is not stored in the first index, obtaining the storage of the metadata of the data to be read from the second index address to read metadata.
也就是说,当S502中服务端读取的内存块中未包括待读取数据的元数据,客户端向服务端发送第五读请求,第五读请求包括待读取数据的key。服务端接收到第五读请求后,可以在第二索引中查找待读取数据的key,并获得待读取数据的元数据的存储地址,从而读取元数据。That is, when the memory block read by the server in S502 does not include metadata of the data to be read, the client sends a fifth read request to the server, and the fifth read request includes the key of the data to be read. After receiving the fifth read request, the server can look up the key of the data to be read in the second index, and obtain the storage address of the metadata of the data to be read, so as to read the metadata.
可以理解的,若第二索引中未查找到待读取数据的key,服务端也可以在第一索引中查找,以避免因为预测模型预测的位置信息不准确导致数据读取失败的情况。It is understandable that if the key of the data to be read is not found in the second index, the server can also search in the first index to avoid the failure of data reading due to inaccurate location information predicted by the prediction model.
可以理解的,服务端在接收到第五读请求后,也可以先在第一索引中查找待读取数据的key,再在第二索引中查找待读取数据的key,本申请实施例不予限制。It is understandable that, after receiving the fifth read request, the server can also first search for the key of the data to be read in the first index, and then search for the key of the data to be read in the second index. be restricted.
可以理解的,服务端也可以根据第五读请求,同时在第一索引和第二索引中查找待读取数据的key,以减小服务端读取数据的时间。It can be understood that the server can also search for the key of the data to be read in the first index and the second index at the same time according to the fifth read request, so as to reduce the time for the server to read the data.
一种可能的实现方式,第五读请求为双边RDMA读请求。In a possible implementation manner, the fifth read request is a bilateral RDMA read request.
基于图5所示的方法,客户端可以根据待读取数据的关键字和预测信息预测待读取数据的元数据的位置信息,根据元数据的位置信息读取元数据,根据元数据获得待读取数据。在上述过程中,服务端的处理器不参与,因此可以降低访问时延。Based on the method shown in FIG. 5 , the client can predict the location information of the metadata of the data to be read according to the keyword of the data to be read and the prediction information, read the metadata according to the location information of the metadata, and obtain the metadata to be read according to the metadata. Read data. In the above process, the processor of the server does not participate, so the access delay can be reduced.
可选的,在图5所示方法的一种可能的实现方式中,服务端具备预取功能。也就是说,服务端可以预测客户端将要读取的数据,并将预测的客户端将要读取的数据的元数据提前写入第二索引中。具体的,如图6所示,图5所示的方法还包括S601-S602。Optionally, in a possible implementation manner of the method shown in FIG. 5 , the server has a prefetch function. That is, the server can predict the data to be read by the client, and write the metadata of the predicted data to be read by the client into the second index in advance. Specifically, as shown in FIG. 6 , the method shown in FIG. 5 further includes S601-S602.
S601:服务端预测客户端将要读取的数据。S601: The server predicts the data to be read by the client.
一种可能的实现方式,服务端根据历史上客户端访问的数据,确定客户端将要读取的数据。In a possible implementation, the server determines the data to be read by the client according to the data accessed by the client in history.
示例性的,若客户端前两次访问服务端时,读取了数据1、数据2和数据3。在客户端第三次访问服务端时,服务端可以预测客户端要读取的是数据1、数据2和数据3。Exemplarily, if the client has read data 1, data 2, and data 3 when accessing the server for the first two times. When the client accesses the server for the third time, the server can predict that the client will read data 1, data 2, and data 3.
另一种可能的实现方式,服务端接收来自客户端的指示信息,该指示信息用于指示客户端将要访问的数据。服务端根据该指示信息预测客户端将要读取的数据。In another possible implementation manner, the server receives indication information from the client, where the indication information is used to indicate the data to be accessed by the client. The server predicts the data to be read by the client according to the indication information.
S602:若将要读取的数据的元数据未包括在第一索引和第二索引中,服务端将客户端将要读取的数据的元数据写入第二索引。S602: If the metadata of the data to be read is not included in the first index and the second index, the server writes the metadata of the data to be read by the client into the second index.
一种可能的实现方式,服务端将客户端将要读取的数据的元数据写入第二索引中,使得写入后的第二索引中的key和该key对应的value,按照key的大小有序排列。A possible implementation is that the server writes the metadata of the data to be read by the client into the second index, so that the key in the second index after writing and the value corresponding to the key have the following values according to the size of the key. arranged in order.
可以理解的,本申请实施例不限制S601-S602的执行顺序,例如,S601-S602可以在S501之前、S502之前或S502之后执行。It can be understood that this embodiment of the present application does not limit the execution order of S601-S602. For example, S601-S602 may be executed before S501, before S502, or after S502.
可以理解的,本申请实施例不限制S601-S602的执行次数,也就是说,服务端可以不断的预测客户端将要读取的数据,若客户端将要读取的数据未包括在第一索引和第二索引中,服务端就将客户端将要读取的数据的元数据写入第二索引。It is understandable that this embodiment of the present application does not limit the execution times of S601-S602, that is to say, the server can continuously predict the data to be read by the client, if the data to be read by the client is not included in the first index and In the second index, the server writes the metadata of the data to be read by the client into the second index.
基于图6所示的方法,服务端可以将预测的客户端将要读取的数据的元数据提前写入第二索引中,当客户端需要读取服务端预测的数据的情况下,服务端可以快速返回该数据,提高了服务端的响应速度。Based on the method shown in FIG. 6 , the server can write the metadata of the predicted data to be read by the client into the second index in advance. When the client needs to read the data predicted by the server, the server can The data is returned quickly, which improves the response speed of the server.
对于上述情况1,可以将新增加的key写入第二索引中,这样第一索引就不会出现分裂的情况,服务端可以不用频繁地训练模型,进而可以减少服务端的计算开销。服务端和客户端也不需要存储翻译表,可以减小服务端和客户端的内存的开销。然而,当第二索引中写入的元数据较多时,客户端要读取的数据很有可能都包括在第二索引中。在这种情况下,若还是采用上述预测模型预测待读取数据的元数据的位置信息,根据位置信息获取获取待读取数据的元数据,很可能会因为该元数据中未包括在第一索引中,而导致客户端需要再次向服务端发送读请求(同上述第五读请求),增加了客户端读取数据的时间,影响用户体验。因此,服务端可以定期或不定期的重新训练模型,使得客户端根据新的模型预测要读取的数据的位置,可以在减少服务端的计算开销,服务端和客户端的内存开销的基础上,减少客户端读取数据的时间,提高用户体验。For the above case 1, the newly added key can be written into the second index, so that the first index will not be split, and the server can not train the model frequently, thereby reducing the computing overhead of the server. The server and client also do not need to store translation tables, which can reduce the memory overhead of the server and client. However, when there is a lot of metadata written in the second index, the data to be read by the client is likely to be included in the second index. In this case, if the above prediction model is still used to predict the location information of the metadata of the data to be read, and the metadata of the data to be read is obtained according to the location information, it is likely that the metadata is not included in the first In the index, the client needs to send a read request to the server again (same as the fifth read request above), which increases the time for the client to read the data and affects the user experience. Therefore, the server can retrain the model regularly or irregularly, so that the client can predict the location of the data to be read according to the new model, which can reduce the computing overhead of the server and the memory overhead of the server and the client. The time for the client to read data to improve the user experience.
可选的,在图5所示方法的一种可能的实现方式中,服务端可以定期或不定期的重新训练模型,使得客户端根据新的预测模型预测待读取数据的元数据的位置信息。具体的,如图7所示,图5所示的方法还包括S701-S703。Optionally, in a possible implementation of the method shown in FIG. 5 , the server may retrain the model regularly or irregularly, so that the client can predict the location information of the metadata of the data to be read according to the new prediction model. . Specifically, as shown in FIG. 7 , the method shown in FIG. 5 further includes S701-S703.
S701:服务端将第二索引写入第一索引,得到第三索引。S701: The server writes the second index into the first index to obtain the third index.
一种可能的实现方式,服务端可以在下述情况下将第二索引写入第一索引。In a possible implementation manner, the server may write the second index into the first index under the following conditions.
情况A:服务端定期将第二索引写入第一索引。例如,服务端每隔12小时将第二索引写入第一索引。Case A: The server periodically writes the second index into the first index. For example, the server writes the second index into the first index every 12 hours.
情况B:服务端不定期将第二索引写入第一索引。例如,第二索引的大小大于或等于一个预设的阈值的情况下,服务端将第二索引写入第一索引。Case B: The server occasionally writes the second index into the first index. For example, when the size of the second index is greater than or equal to a preset threshold, the server writes the second index into the first index.
情况C:服务端通过预测客户端将要读取的数据,并将预测的客户端将要读取的数据的元数据写入第二索引中的情况下,也就是说,S602之后,服务端将第二索引写入第一索引。Case C: In the case where the server predicts the data to be read by the client, and writes the metadata of the predicted data to be read by the client into the second index, that is, after S602, the server will The second index writes to the first index.
对于上述情况C,S602中,服务端将客户端将要读取的数据的元数据写入第二索引,具体包括:服务端将客户端将要读取的数据的key写入第二索引,将第二索引中,客户端将要读取的数据的value设置为空。可以理解的,服务端将客户端将要读取的数据的key写入到第二索引中所用的时间较短,而服务端将客户端将要读取的数据的value拷贝到第二索引中所用的时间比较长。所以服务端可以先将客户端将要读取的数据的key写入第二索引中,而将客户端将要读取的数据的value设置为空,以使得服务端可以尽快训练模型,将训练好的模型发送给客户端。这样客户端就可以在发起读请求前获取到训练好的模型。后续,客户端可以通过训练好的模型预测待读取数据在第三索引中的位置,快速读取数据。For the above situation C, in S602, the server writes the metadata of the data to be read by the client into the second index, which specifically includes: the server writes the key of the data to be read by the client into the second index, and writes the first index In the secondary index, the client sets the value of the data to be read to null. Understandably, the time taken by the server to write the key of the data to be read by the client into the second index is shorter, while the time taken by the server to copy the value of the data to be read by the client into the second index longer time. Therefore, the server can first write the key of the data to be read by the client into the second index, and set the value of the data to be read by the client to be empty, so that the server can train the model as soon as possible, and the trained The model is sent to the client. In this way, the client can obtain the trained model before initiating a read request. Subsequently, the client can use the trained model to predict the position of the data to be read in the third index, and quickly read the data.
一种可能的实现方式,第三索引中的数据的key和value,按照key的大小有序排列。In a possible implementation, the keys and values of the data in the third index are arranged in order according to the size of the keys.
进一步的,S701之前,服务端可以拷贝第一索引。S701中,第二索引可以写入拷贝的第一索引中,得到第三索引。服务端在拷贝第一索引的过程中,可以将原先第一索引中数据的key拷贝到新的第一索引中,将数据的value以指针的方式指向原先第一索引中该数据的value,在模型训练完成后,再将新的第一索引中的指针通过拷贝替换为原先第一索引中对应的value。类似的,在第二索引写入拷贝的第一索引,得到第三索引的过程中,可以将第二索引中的数据的key写入拷贝的第一索引中,将数据的value以指针的方式指向第二索引中该数据的value,在模型训练完成后,再将第三索引中的指针通过拷贝替换为第二索引中对应的value。如此,若在服务端拷贝第一索引,至模型训练的过程中,第一索引或第二索引中的数据的value被 更新,也不会影响第三索引的准确性。Further, before S701, the server may copy the first index. In S701, the second index may be written into the copied first index to obtain the third index. In the process of copying the first index, the server can copy the key of the data in the original first index to the new first index, and point the value of the data in the form of a pointer to the value of the data in the original first index. After the model training is completed, the pointer in the new first index is replaced with the corresponding value in the original first index by copying. Similarly, when the second index is written into the first index of the copy and the third index is obtained, the key of the data in the second index can be written into the first index of the copy, and the value of the data can be written in the form of a pointer Point to the value of the data in the second index. After the model training is completed, the pointer in the third index is copied and replaced with the corresponding value in the second index. In this way, if the first index is copied on the server, during the model training process, the value of the data in the first index or the second index is updated, and the accuracy of the third index will not be affected.
可以理解的,在S701中,若第一索引和第二索引中存在相同的key,则将第二索引中该key对应的value作为第三索引中,该key对应的value。It can be understood that in S701, if the same key exists in the first index and the second index, the value corresponding to the key in the second index is used as the value corresponding to the key in the third index.
可以理解的,服务端开始执行S701时,服务端不在第二索引中新增加key。若有数据的key需要写入到服务端中,可以写入第四索引中。第四索引包括多个数据的key和value。进一步的,第四索引中的key和key对应的value,可以按照顺序排列。例如,按照key从小到大的顺序排列。例如,第四索引包括B+树、B树、二叉树或有序的列表等。It can be understood that when the server starts to execute S701, the server does not add a new key to the second index. If the key of data needs to be written to the server, it can be written to the fourth index. The fourth index includes keys and values of multiple data. Further, the key in the fourth index and the value corresponding to the key can be arranged in order. For example, in order of keys from small to large. For example, the fourth index includes a B+ tree, a B tree, a binary tree, an ordered list, or the like.
S702:服务端训练第三索引以生成新的预测模型。S702: The server trains the third index to generate a new prediction model.
其中,新的预测模型用于根据待读取数据的关键字预测待读取数据的元数据在第三索引中的位置。The new prediction model is used to predict the position of the metadata of the data to be read in the third index according to the keyword of the data to be read.
一种可能的实现方式,服务端通过一种或多种算法对第三索引进行模型训练得到新的预测模型。In a possible implementation manner, the server performs model training on the third index through one or more algorithms to obtain a new prediction model.
可以理解的,对于上述情况C,S702之后,服务端根据客户端将要读取的数据的value,更新第三索引,使得第三索引中,客户端将要读取的数据的key对应的value为客户端将要读取的数据的value。It can be understood that for the above case C, after S702, the server updates the third index according to the value of the data to be read by the client, so that in the third index, the value corresponding to the key of the data to be read by the client is the value of the client. The value of the data that the endpoint will read.
本申请实施例中,服务端通过训练得到模型的过程中还可以为每个模型生成对应的版本号或序列号。该模型对应的版本号或序列号与该模型对应的索引的版本号或序列号一致。这样服务端可以将预测模型和该预测模型对应的索引联系起来。In this embodiment of the present application, the server may also generate a corresponding version number or serial number for each model in the process of obtaining the model through training. The version number or serial number corresponding to the model is consistent with the version number or serial number of the index corresponding to the model. In this way, the server can associate the prediction model with the index corresponding to the prediction model.
S703:服务端将新的预测模型发送给客户端。S703: The server sends the new prediction model to the client.
一种可能的实现方式,对于上述情况A和情况B,服务端可以向与服务端通信连接的一个或多个客户端发送新的预测模型。对于上述情况C,服务端可以向服务端的预测对象,即S601中的客户端发送新的预测模型。上述情况C中,服务端是预测的S601中的客户端将要读取的数据,提前将S601中的客户端将要读取的数据写入第二索引中,其他客户端可能不会读取上述数据,因此可以不用向其他客户端发送新的预测模型。In a possible implementation manner, for the above case A and case B, the server may send a new prediction model to one or more clients that are in communication with the server. For the above case C, the server may send a new prediction model to the prediction object of the server, that is, the client in S601. In the above case C, the server predicts the data to be read by the client in S601, and writes the data to be read by the client in S601 into the second index in advance, and other clients may not read the above data. , so you don't have to send new predictive models to other clients.
可以理解的,在客户端启用新的预测模型之前,服务端和客户端之间还可以通过图5或图6所示的方法读取数据、更新数据或插入数据。不同的是,在插入数据时,不在第二索引中插入数据,而是在第四索引中插入数据。在读取数据时,若第一索引和第二索引中都未查找到要读取的数据,还可以在第四索引中查找数据。It can be understood that before the client enables the new prediction model, the server and the client can also read data, update data or insert data through the method shown in FIG. 5 or FIG. 6 . The difference is that when inserting data, data is not inserted in the second index, but in the fourth index. When reading data, if the data to be read is not found in the first index and the second index, the data can also be searched in the fourth index.
对应的,客户端接收来自服务端的新的预测模型。Correspondingly, the client receives the new prediction model from the server.
可以理解的,客户端接收到新的预测模型后,可以通过新的预测模型预测待读取数据的元数据在第三索引中的位置。进一步的,客户端可以删除旧的预测模型。It can be understood that after receiving the new prediction model, the client can use the new prediction model to predict the position of the metadata of the data to be read in the third index. Further, clients can delete old predictive models.
可以理解的,S701-S703还可以在图6所示的方法中执行,不予限制。It can be understood that S701-S703 can also be performed in the method shown in FIG. 6 , which is not limited.
基于图7所示的方法,服务端可以定期或不定期的重新训练模型,使得客户端根据新的模型预测待读取数据的元数据的位置,可以在减少服务端的计算开销,服务端和客户端的内存开销的基础上,降低访问时延。Based on the method shown in Figure 7, the server can retrain the model regularly or irregularly, so that the client can predict the location of the metadata of the data to be read according to the new model, which can reduce the computing overhead of the server, the server and the client. On the basis of the memory overhead of the terminal, the access delay is reduced.
上述图5、图6或图7所示的方法中,第一索引、第二索引、第三索引、第四索引和哈希表中存储的是数据的元数据。在具体应用中,第一索引、第二索引、第三索引、第四索引和哈希表中也可以存储数据。以第一索引存储数据为例,第一索引可以包括多个数据的key和每个key对应的数据。第一索引、第二索引、第三索引、第四索引和哈希表中存储数据的情况下,本申请实施例提供的访问数据的方法的具体过程可以参考上述图5、图6或图7所示方法中所述,不同的有以下几处:In the method shown in FIG. 5 , FIG. 6 or FIG. 7 , the metadata of the data is stored in the first index, the second index, the third index, the fourth index and the hash table. In a specific application, data may also be stored in the first index, the second index, the third index, the fourth index and the hash table. Taking the data stored in the first index as an example, the first index may include keys of multiple data and data corresponding to each key. In the case where data is stored in the first index, the second index, the third index, the fourth index, and the hash table, the specific process of the method for accessing data provided by the embodiment of the present application may refer to the above-mentioned FIG. 5 , FIG. 6 or FIG. 7 . described in the method shown, with the following differences:
1、S501中的第一读请求包括待读取数据的位置信息,该待读取数据的位置信息可以用于指示待读取数据位于服务端中的位置,并且待读取数据的位置信息是根据待读取数据的key和预测信息得到的。1. The first read request in S501 includes the position information of the data to be read, the position information of the data to be read can be used to indicate the position of the data to be read in the server, and the position information of the data to be read is: Obtained according to the key and prediction information of the data to be read.
2、S502中,服务端不是根据位置信息读取元数据,而是根据位置信息获得待读取数据,将待读取数据发送给客户端。2. In S502, the server does not read the metadata according to the location information, but obtains the data to be read according to the location information, and sends the data to be read to the client.
3、S602中,服务端要确定的是将要读取的数据是否包括在第一索引和第二索引中,若将要读取的数据未包括在第一索引和第二索引中,服务端将客户端将要读取的数据写入第二索引。3. In S602, what the server needs to determine is whether the data to be read is included in the first index and the second index, if the data to be read is not included in the first index and the second index, the server will The terminal writes the data to be read into the second index.
本领域普通技术人员将会理解,本发明的各个方面、或各个方面的可能实现方式可以被具体实施为系统、方法或者计算机程序产品。因此,本发明的各方面、或各个方面的可能实现方式可以采用完全硬件实施例、完全软件实施例(包括固件、驻留软件等等),或者组合软件和硬件方面的实施例的形式,在这里都统称为“电路”、“模块”或者“系统”。此外,本发明的各方面、或各个方面的可能实现方式可以采用计算机程序产品的形式,计算机程序产品是指存储在计算机可读介质中的计算机可读程序代码。As will be appreciated by one of ordinary skill in the art, various aspects of the present invention, or possible implementations of various aspects, may be embodied as a system, method or computer program product. Thus, aspects of the present invention, or possible implementations of various aspects, may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, etc.), or a combination of software and These are collectively referred to herein as "circuits," "modules," or "systems." Furthermore, aspects of the present invention, or possible implementations of various aspects, may take the form of a computer program product, which refers to computer readable program code stored on a computer readable medium.
计算机可读介质包含但不限于电子、磁性、光学、电磁、红外或半导体系统、设备或者装置,或者前述的任意适当组合,如随机访问存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM)、光盘。Computer readable media include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing, such as random access memory (RAM), read only memory (ROM), erasable Programmable Read Only Memory (EPROM), CD-ROM.
计算机中的处理器读取存储在计算机可读介质中的计算机可读程序代码,使得处理器能够执行在流程图中每个步骤、或各步骤的组合中规定的功能动作。A processor in the computer reads the computer-readable program code stored in the computer-readable medium, enabling the processor to perform the functional actions specified in each step, or combination of steps, in the flowchart.
计算机可读程序代码可以完全在用户的计算机上执行、部分在用户的计算机上执行、作为单独的软件包、部分在用户的计算机上并且部分在远程计算机上,或者完全在远程计算机或者服务器上执行。也应该注意,在某些替代实施方案中,在流程图中各步骤、或框图中各块所注明的功能可能不按图中注明的顺序发生。例如,依赖于所涉及的功能,接连示出的两个步骤、或两个块实际上可能被大致同时执行,或者这些块有时候可能被以相反顺序执行。The computer readable program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server . It should also be noted that, in some alternative implementations, the functions noted in the steps in the flowcharts, or blocks in the block diagrams, may occur out of the order noted in the figures. For example, two steps, or two blocks shown in succession, may in fact be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。本领域普通技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art may use different methods of implementing the described functionality for each particular application, but such implementations should not be considered beyond the scope of the present invention.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,本领域普通技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited to this. Those of ordinary skill in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered within the scope of the present invention. within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110083500.6ACN114817232A (en) | 2021-01-21 | 2021-01-21 | Method and device for accessing data |
| CN202110083500.6 | 2021-01-21 |
| Publication Number | Publication Date |
|---|---|
| WO2022156650A1true WO2022156650A1 (en) | 2022-07-28 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/072421CeasedWO2022156650A1 (en) | 2021-01-21 | 2022-01-17 | Data access method and apparatus |
| Country | Link |
|---|---|
| CN (1) | CN114817232A (en) |
| WO (1) | WO2022156650A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116991338A (en)* | 2023-09-28 | 2023-11-03 | 北京超弦存储器研究院 | Data access method, controller, CXL (volatile memory) memory module and storage system |
| WO2024060934A1 (en)* | 2022-09-22 | 2024-03-28 | 北京火山引擎科技有限公司 | Data processing method and apparatus |
| US12366998B2 (en) | 2023-09-28 | 2025-07-22 | Beijing Superstring Academy Of Memory Technology | CXL memory module and controller, method for accessing data, and storage system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116028677B (en)* | 2023-03-14 | 2023-08-29 | 阿里云计算有限公司 | Data operation method and system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150006478A1 (en)* | 2013-06-28 | 2015-01-01 | Silicon Graphics International Corp. | Replicated database using one sided rdma |
| US9448901B1 (en)* | 2015-12-15 | 2016-09-20 | International Business Machines Corporation | Remote direct memory access for high availability nodes using a coherent accelerator processor interface |
| CN109445905A (en)* | 2018-06-22 | 2019-03-08 | 华为技术有限公司 | Virtual-machine data communication means and system and virtual machine configuration method and apparatus |
| CN110221779A (en)* | 2019-05-29 | 2019-09-10 | 清华大学 | The construction method of distributed persistence memory storage system |
| CN111538603A (en)* | 2020-04-20 | 2020-08-14 | 上海交通大学 | Key-value store read access method and system accelerated by machine learning and RDMA |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150006478A1 (en)* | 2013-06-28 | 2015-01-01 | Silicon Graphics International Corp. | Replicated database using one sided rdma |
| US9448901B1 (en)* | 2015-12-15 | 2016-09-20 | International Business Machines Corporation | Remote direct memory access for high availability nodes using a coherent accelerator processor interface |
| CN109445905A (en)* | 2018-06-22 | 2019-03-08 | 华为技术有限公司 | Virtual-machine data communication means and system and virtual machine configuration method and apparatus |
| CN110221779A (en)* | 2019-05-29 | 2019-09-10 | 清华大学 | The construction method of distributed persistence memory storage system |
| CN111538603A (en)* | 2020-04-20 | 2020-08-14 | 上海交通大学 | Key-value store read access method and system accelerated by machine learning and RDMA |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2024060934A1 (en)* | 2022-09-22 | 2024-03-28 | 北京火山引擎科技有限公司 | Data processing method and apparatus |
| CN116991338A (en)* | 2023-09-28 | 2023-11-03 | 北京超弦存储器研究院 | Data access method, controller, CXL (volatile memory) memory module and storage system |
| CN116991338B (en)* | 2023-09-28 | 2023-12-22 | 北京超弦存储器研究院 | Data access method, controller, CXL (volatile memory) memory module and storage system |
| US12366998B2 (en) | 2023-09-28 | 2025-07-22 | Beijing Superstring Academy Of Memory Technology | CXL memory module and controller, method for accessing data, and storage system |
| Publication number | Publication date |
|---|---|
| CN114817232A (en) | 2022-07-29 |
| Publication | Publication Date | Title |
|---|---|---|
| WO2022156650A1 (en) | Data access method and apparatus | |
| CN108810041B (en) | Data writing and capacity expansion method and device for distributed cache system | |
| US10423641B2 (en) | Hierarchical coherency log for managing a distributed data storage system | |
| US10831612B2 (en) | Primary node-standby node data transmission method, control node, and database system | |
| US9495398B2 (en) | Index for hybrid database | |
| CN108829344A (en) | Data storage method, device and storage medium | |
| WO2018099107A1 (en) | Hash table management method and device, and computer storage medium | |
| US8386717B1 (en) | Method and apparatus to free up cache memory space with a pseudo least recently used scheme | |
| WO2017050014A1 (en) | Data storage processing method and device | |
| US9317470B1 (en) | Method and system for incremental cache lookup and insertion | |
| CN104424219B (en) | A kind of management method and device of data file | |
| US11500873B2 (en) | Methods and systems for searching directory access groups | |
| CN106934048A (en) | Online data moving method, agent node | |
| CN106375425A (en) | Distributed cache processing method and device | |
| CN113867627A (en) | Method and system for optimizing performance of storage system | |
| CN106528451A (en) | Cloud storage framework for second level cache prefetching for small files and construction method thereof | |
| CN114356893A (en) | Metadata tuning method, device, equipment and storage medium based on machine learning | |
| CN117009389A (en) | Data caching method, device, electronic equipment and readable storage medium | |
| CN115237954A (en) | Method, PIM device and system for cuckoo hash query based on PIM device | |
| CN109948056B (en) | Evaluation method and device for a recommendation system | |
| CN112463073A (en) | Object storage distributed quota method, system, equipment and storage medium | |
| CN106302374B (en) | It is a kind of for improve list item access bandwidth and atomicity operation device and method | |
| CN104978283A (en) | Memory access control method and device | |
| US10073874B1 (en) | Updating inverted indices | |
| CN113806389A (en) | Data processing method and device, computing equipment and storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application | Ref document number:22742129 Country of ref document:EP Kind code of ref document:A1 | |
| NENP | Non-entry into the national phase | Ref country code:DE | |
| 122 | Ep: pct application non-entry in european phase | Ref document number:22742129 Country of ref document:EP Kind code of ref document:A1 |