WO2012126229A1 - Distributed cache system data access method and device - Google Patents

Distributed cache system data access method and device Download PDF

Info

Publication number
WO2012126229A1
WO2012126229A1 PCT/CN2011/077589 CN2011077589W WO2012126229A1 WO 2012126229 A1 WO2012126229 A1 WO 2012126229A1 CN 2011077589 W CN2011077589 W CN 2011077589W WO 2012126229 A1 WO2012126229 A1 WO 2012126229A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
memory
storage mode
request
read
Prior art date
Application number
PCT/CN2011/077589
Other languages
French (fr)
Chinese (zh)
Inventor
李豪伟
韩银俊
郭斌
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012126229A1 publication Critical patent/WO2012126229A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/2895Intermediate processing functionally located close to the data provider application, e.g. reverse proxies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/288Distributed intermediate devices, i.e. intermediate devices for interaction with other intermediate devices on the same level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Definitions

  • the present invention relates to the field of distributed caching, and more particularly to a method and apparatus for data access in a distributed caching system. Background technique
  • Cloud Computing is Grid Computing, Distributed Computing, Parallel Computing, Utility Computing, Network Storage Technologies, Virtualization. And load balancing (Load Balance) and other traditional computer technology and network technology development and fusion products.
  • Cloud computing aims to integrate multiple relatively low-cost computing entities into a system with powerful computing power through the network.
  • Distributed caching is a domain in the field of cloud computing. Its role is to provide distributed storage services for massive data and high-speed read and write access.
  • a distributed cache system consists of several server nodes and clients interconnected.
  • the server node is responsible for storing data, and the client can read, update, and delete data of the server node.
  • the data in the server node is composed of a key (Key) and a value (Value).
  • the Key is equivalent to the data index, and the Value is the data content represented by the Key.
  • Key and Value are one-to-one relationships.
  • Option 1 using all memory in a distributed cache system to store large amounts of data, can ensure access efficiency, but this requires a high economic cost, only in some projects that are very important or can create higher economic value. Use, it is difficult to apply in ordinary projects;
  • the main object of the present invention is to provide a method and apparatus for data access of a distributed cache system, improve data access efficiency, and improve the cost performance of the distributed cache system.
  • the present invention provides a method for data access of a distributed cache system, including: a server node receives a data access request sent by a client, determines a storage mode of the accessed data according to the data access request, and accesses the data according to the storage mode. And return the access result to the client.
  • the determining, by the data access request, the storage mode of the accessed data includes: reading an application identifier ID in the data access request, and acquiring the accessed according to the corresponding relationship between the locally configured application ID and the storage mode.
  • the storage mode of the data includes: reading an application identifier ID in the data access request, and acquiring the accessed according to the corresponding relationship between the locally configured application ID and the storage mode.
  • the received data access request is a data update request
  • the accessing the data according to the storage mode includes: determining the memory storage mode, and updating the data in the memory according to the key KEY and the value Value in the data update request. Or, determine the memory plus normal hard disk storage mode, update the data in the hard disk according to the KEY and Value in the data update request, and then update the data in the memory; or, determine the memory plus SSD mode, determine the remaining memory Space, update the data in memory, otherwise, free up memory space, and then update the data in memory.
  • the received data access request is a data read request
  • the accessing the data according to the storage mode includes: determining to be a memory storage mode, and reading data in the memory according to a KEY in the data read request; Or, determine the memory plus normal hard disk storage mode, read the data in the memory according to the KEY, if there is no data to be read in the memory, read the data from the hard disk; or, determine the memory plus solid state hard disk mode, The data to be read is determined according to the index information in the memory, and then the storage location of the data is determined according to the index information, and the data is read.
  • the received data access request is a data deletion request
  • the accessing the data according to the storage mode includes: determining the memory storage mode, deleting the data in the memory according to the KEY in the data deletion request; or determining Add the normal hard disk storage mode to the memory, delete the data in the hard disk according to the KEY in the data deletion request, and then delete the data in the memory; or, determine the memory plus the solid state hard disk storage mode, and determine the deletion according to the index information in the memory.
  • the data exists, and the data is deleted according to the storage location of the data in the index information.
  • the invention also provides a device for data access of a distributed cache system, comprising: a data storage module and an information feedback module;
  • a data access module configured to receive a data access request sent by the client, obtain a storage mode of the data to be accessed according to the data access request, access the data according to the storage mode, and send the access result to the information feedback module;
  • the feedback module is set to return the access result to the client.
  • the data access module specifically includes an access mode unit, a data update unit, a data read unit, and a data deletion unit.
  • the access mode unit is configured to read an application ID in the data access request according to the local Corresponding relationship between the configured application ID and the storage mode, obtaining a storage mode of the accessed data, receiving the data access request as a data update request, and transmitting the acquired storage mode and data update request to the data update unit;
  • the request is a data read request, and the data read request and the acquired storage mode are sent to the data read unit;
  • the received data access request is a data delete request, and the data deletion request and the acquired storage are performed.
  • the mode is sent to the data deletion unit.
  • the data update unit is configured to: when the acquired storage mode is the memory storage mode, update the data in the memory according to the KEY and the value in the data update request; or, when the memory is added to the normal hard disk storage mode, Update the data in the hard disk according to the KEY and Value of the data in the data update request, and then update the data in the memory; or, when adding the solid state hard disk storage mode to the memory, determine that there is remaining space in the memory, and update the data in the memory; otherwise, Free up memory space and then update the data in memory.
  • the data reading unit is configured to: when the acquired storage mode is the memory storage mode, read the data in the memory according to the KEY in the data read request; or, when the memory is added to the normal hard disk storage mode
  • the data is first read from the memory, and if there is no data to be read in the memory, the data is read from the hard disk and cached in the memory; or, is the memory
  • the SSD storage mode is added, the data to be read exists according to the index information in the memory, and then the storage location of the data is determined according to the index information, and the data is read.
  • the data deletion unit is configured to: when the stored storage mode is the memory storage mode, delete the data in the memory according to the KEY in the data deletion request; or, when adding the normal hard disk storage mode to the memory, according to the KEY, first delete the data in the ordinary hard disk, and further delete the data in the memory; or, when adding the solid state hard disk storage mode to the memory, determine the data to be deleted according to the index information in the memory, according to the storage location of the data in the index information , delete data.
  • the method and device for data access of the distributed cache system use different access modes for different data storage modes, thereby improving data access efficiency and improving distributed The cost performance of the cache system.
  • 1 is a schematic diagram of an embodiment of a method for implementing data access in a distributed cache system according to the present invention
  • 2 is a schematic diagram of an embodiment of an apparatus for implementing data access in a distributed cache system according to the present invention.
  • the basic idea of the present invention is: the client sends a data access request to the server node, the server node acquires a storage mode to access the data according to the data access request, and then accesses the data according to the storage mode, and returns the access result to the client. .
  • the present invention provides a method for data access of a distributed cache system, as shown in FIG. 1, including the following steps:
  • Step 101 The client sends a data access request to the server node.
  • the client sends a data access request to the server node, where the data access request is: a data update request, or a data read request, or a data delete request; wherein the data update request is data write or replace, including an application Identification (ID), and the KEY, Value of the updated data.
  • the application ID is used to identify the service application system.
  • the embodiment of the present invention divides the storage mode of the corresponding service application data according to the service application system corresponding to the application ID, and may also use other methods.
  • the data read request includes an application ID and a KEY of the read data; the data deletion request includes an application ID, and a KEY of the deleted data.
  • Step 102 The server node acquires a storage mode of the data to be stored according to the data access request, and then accesses the data according to the storage mode.
  • the server node reads the application ID in the data access request, and obtains the storage mode corresponding to the application ID in the data access request according to the corresponding relationship between the locally configured application ID and the storage mode, that is, the storage mode corresponding to the data to be accessed.
  • the data to be accessed is the data to be updated, read or deleted.
  • the accessing data according to the access mode includes:
  • Receiving a data update request if the data to be updated is in the memory storage mode, then according to the data
  • the KEY and Value in the new request update the data in the memory, and the memory storage mode stores and manages the data in the memory, and the update is specifically: when replacing the data, querying the memory according to the KEY in the data update request
  • the saved data if the KEY of the data in the memory matches the KEY in the data update request, it can be determined that the data exists in the memory, and the Value of the corresponding KEY data in the memory is overwritten by the Value in the data update request, if there is no data and data update If the KEY in the request matches, the data does not exist in the memory, and the update fails.
  • the data in the request is updated according to the data.
  • KEY and Value update the data in the hard disk, and then determine that the data exists in the memory, and update the data in the memory, the process of determining that the data in the memory is the same as the process of determining the data in the memory during the update process of the memory storage mode, The description is not repeated here; the update is the same as the update process of the memory storage mode, and details are not described herein again;
  • the memory plus normal hard disk storage mode is a storage mode of data stored independently by the memory and the hard disk, and the data stored in the memory may be hot data, that is, data that is frequently accessed; or, the data to be updated is memory plus solid state.
  • the hard disk storage mode determines whether there is any remaining space in the memory according to the memory capacity information stored in the memory. If the memory capacity information indicates that there is remaining space in the memory, the data in the memory is updated, and if there is no remaining space, the memory space is released, and then Updating the data in the memory, and updating the storage location of the data moved to the SSD, the data in the update memory is the same as the update in the memory storage mode, and details are not described herein again.
  • the least recently used (LRU) algorithm moves the earliest data to the solid state hard disk, and the memory plus solid state hard disk storage mode is an index information stored in the memory, the memory There is space left, memory access data, no memory The remaining space accesses the data in the solid state hard disk, and manages the data in the memory and the solid state hard disk through the index information stored in the memory, and the access speed of the solid state hard disk data is greater than the access speed of the ordinary hard disk data, as the memory Extended, the data is only saved in one place in the memory or SSD.
  • the index information is the update or delete operation of the memory according to the memory and the SSD, and the package is updated in real time.
  • the data to be read is a memory storage mode
  • reading the data in the memory according to the KEY in the data read request includes: according to the KEY in the data read request Query the KEY of the data in the memory. If the KEY in the data read request matches, the data is read. If there is no data matching the KEY in the data read request, there is no data to be read, and the read fails. Or, the data to be read is the memory plus normal hard disk storage mode. According to the KEY in the data read request, the data is read from the memory first. If there is no data to be read in the memory, the data is read from the hard disk.
  • the data is cached into the memory, and the reading process is the same as the reading process of the memory storage mode, and will not be described here; or, the data to be read is the memory plus solid state hard disk storage mode, according to the index information in the memory.
  • Determine whether the data to be read exists the data to be read exists, the data to be read according to the storage location of the data in the index information, the data to be read If there is no read operation, the message that the data does not exist is returned to the client, and determining whether the data to be read exists according to the index information in the memory includes: KEY in the data read request and KEY in the index information In comparison, if the KEY in the data read request matches, the data to be read exists.
  • the data to be deleted is the memory storage mode, and the data in the memory is deleted according to the KEY in the data deletion request, where the deleting comprises: querying the data in the memory according to the KEY in the data deletion request KEY, if there is a KEY in the data deletion request, it is determined that the data to be deleted exists, and then the data in the memory is deleted. Otherwise, the data to be deleted does not exist, and the deletion fails.
  • the data to be deleted is a memory plus normal hard disk storage mode. According to the KEY in the data deletion request, the data in the hard disk is deleted first, and then the data in the memory is deleted. The deletion process is the same as the deletion process of the memory storage mode.
  • the data to be deleted is the memory plus SSD storage mode. According to the index information in the memory, it is determined whether the data to be deleted exists. If the deleted data exists, the data is deleted according to the storage location of the data in the index information. Data, and delete the index information corresponding to the data, to delete If the data does not exist, the deletion will not be performed.
  • the process of determining whether the data to be deleted exists, and the process of receiving the data read request and the data to be read is the memory plus SSD storage mode, the process of determining whether the data to be read exists is the same, and details are not described herein again.
  • Step 103 The server node replies to the client with an access result.
  • the access result includes: when receiving the data update request, returning the updated message to the client, and when receiving the data read request, returning the read data to the client, if the data to be read does not exist, The message that the data does not exist is returned to the client; when the data deletion request is received, the message that the data has been deleted is returned to the client, and if the data does not exist, the message that the data does not exist is returned to the client.
  • the present invention further provides a device for data access of a distributed cache system.
  • the device includes: a data access module 201, an information feedback module 202;
  • the data access module 201 is configured to receive a data access request sent by the client, acquire an access mode of the data to be accessed according to the data access request, access the data according to the access mode, and send the access result to the information.
  • the information feedback module 202 is configured to send the access result to the client.
  • the data access module 201 includes: an access mode unit 2011, a data update unit 2012, a data reading unit 2013, and a data deletion unit 2014;
  • the access mode unit 2011 is configured to receive and read an application ID in the data access request, acquire a storage mode of the data to be accessed according to the corresponding relationship between the configured application ID and the storage mode, and receive the data access.
  • the request is a data update request, and the obtained storage mode and data update request is sent to the data update unit 2012; or the received data access request is a data read request, and the data read request and the acquired storage mode are sent to The data reading unit 2013; or, the received data access request is a data deletion request, and the data deletion request and the acquired storage mode are sent to the data deletion unit 2014.
  • the data update unit 2012 when the storage mode for acquiring is the memory storage mode, according to the number Update the data in the memory according to the KEY and Value in the update request; or, when adding the normal hard disk storage mode to the memory, update the data in the hard disk according to the KEY and Value of the data in the data update request, and then update the data in the memory; or When adding the SSD storage mode to the memory, determine the remaining space in the memory, update the data in the memory, otherwise, release the memory space, and then update the data in the memory.
  • the KEY in the first reading data from the memory if there is no data to be read in the memory, the data is read from the hard disk and cached into the memory; or, when the memory is added to the solid state hard disk storage mode, according to the index in the memory
  • the information determines that the data to be read exists, and then determines the storage location of the data based on the index information, and reads the data.
  • the data deletion unit 2014 when the storage mode used for obtaining is the memory storage mode, deletes the data in the memory according to the KEY in the data deletion request; or, when the memory is added to the normal hard disk storage mode, according to the KEY, Delete the data in the normal hard disk, and further delete the data in the memory; or, when adding the SSD storage mode to the memory, determine the data to be deleted according to the index information in the memory, and delete the data according to the storage location of the data in the index information. And delete the index information corresponding to the data.
  • the data update unit 2012 is specifically configured to determine, according to the memory capacity information stored in the memory, whether there is any remaining space in the memory, and if there is no remaining space, move the data with the earliest storage time in the memory to the fast solid state hard disk by using the LRU algorithm. To free up memory space.

Abstract

Disclosed are a distributed cache system data access method, comprising: a server node receives a data access request sent by a client terminal; determines the storage mode of the data to be accessed according to the data access request, accesses the data according to the storage mode; and returns the access result to the client terminal. Also disclosed is a distributed cache system data access device. The data access efficiency is improved and the price/performance ratio of the distributed cache system is increased using the method and device.

Description

一种分布式緩存系统数据存取的方法及装置 技术领域  Method and device for data access of distributed cache system
本发明涉及分布式緩存领域, 特别是指一种分布式緩存系统数据存取 的方法及装置。 背景技术  The present invention relates to the field of distributed caching, and more particularly to a method and apparatus for data access in a distributed caching system. Background technique
云计算( Cloud Computing )是网格计算( Grid Computing )、 分布式计 算( Distributed Computing )、并行计算( Parallel Computing )、效用计算( Utility Computing )、 网络存 I ( Network Storage Technologies )、 虚拟 ( Virtualization )、 负载均衡( Load Balance )等传统计算机技术和网络技术 发展融合的产物。 云计算旨在通过网络把多个成本相对较低的计算实体整 合成一个具有强大计算能力的系统。 分布式緩存是云计算范畴中的一个领 域, 其作用是提供海量数据的分布式存储服务以及高速读写访问的能力。  Cloud Computing is Grid Computing, Distributed Computing, Parallel Computing, Utility Computing, Network Storage Technologies, Virtualization. And load balancing (Load Balance) and other traditional computer technology and network technology development and fusion products. Cloud computing aims to integrate multiple relatively low-cost computing entities into a system with powerful computing power through the network. Distributed caching is a domain in the field of cloud computing. Its role is to provide distributed storage services for massive data and high-speed read and write access.
分布式緩存系统由若干服务器节点和客户端互相连接构成。 服务器节 点负责数据的存储, 客户端可以对服务器节点的数据进行读取、 更新以及 删除等操作。 服务器节点中的数据由键(Key )、 以及值(Value )构成, Key 相当于数据索引, Value是 Key所代表的数据内容。 Key和 Value是一对一 的关系。  A distributed cache system consists of several server nodes and clients interconnected. The server node is responsible for storing data, and the client can read, update, and delete data of the server node. The data in the server node is composed of a key (Key) and a value (Value). The Key is equivalent to the data index, and the Value is the data content represented by the Key. Key and Value are one-to-one relationships.
在分布式緩存系统中, 如何提高大批量数据的存取效率, 是比较难以 解决的问题。 对大量不同的数据反复做读取、 更新、 删除等动作, 内存緩 存很快就会耗尽。 为了提高存储容量, 往往需要内存和硬盘组合起来存储 数据。 这样, 分布式緩存中的一部分数据必然要存储在硬盘上, 如果要读 取硬盘上的数据, 会花费很长的时间在磁盘 10上, 读操作将变得很慢, 这 就是所述大批量数据存取效率问题。 现有技术中, 大批量数据的存取效率 一般有两种解决方法: In the distributed cache system, how to improve the access efficiency of large-volume data is a difficult problem to solve. The memory cache is quickly exhausted by repeatedly reading, updating, and deleting a large amount of different data. In order to increase storage capacity, it is often necessary to combine memory and hard disk to store data. In this way, a part of the data in the distributed cache must be stored on the hard disk. If the data on the hard disk is to be read, it will take a long time on the disk 10, and the read operation will become very slow, which is the large quantity. Data access efficiency issues. In the prior art, access efficiency of large amounts of data There are generally two solutions:
方案 1 , 在分布式緩存系统中全部使用内存来存储大批量数据, 可以确 保存取效率, 但这需要付出很高的经济代价, 只能在一些非常重要或能创 造较高经济价值的项目中使用, 很难应用在普通的项目中;  Option 1, using all memory in a distributed cache system to store large amounts of data, can ensure access efficiency, but this requires a high economic cost, only in some projects that are very important or can create higher economic value. Use, it is difficult to apply in ordinary projects;
方案 2, 釆用内存和硬盘组合起来存储数据的方式,数据全部保存在硬 盘上, 读取数据时, 将数据从硬盘中读取, 并緩存到内存中, 这种方法主 要的缺点是, 一些需要较高存取效率的数据也需要先从硬盘中读取, 緩存 到内存, 与普通数据共用一种存储数据的方式, 数据的存取只能获得普通 的存取效率, 导致存取效率较低。 发明内容  Option 2, using the combination of memory and hard disk to store data, the data is all stored on the hard disk, when reading data, the data is read from the hard disk and cached into the memory. The main disadvantage of this method is that some Data that requires higher access efficiency also needs to be read from the hard disk first, cached to memory, and shared with a common data to store data. Data access can only obtain common access efficiency, resulting in better access efficiency. low. Summary of the invention
有鉴于此, 本发明的主要目的在于提供一种分布式緩存系统数据存取 的方法及装置, 提升数据的存取效率, 并提高分布式緩存系统的性价比。  In view of this, the main object of the present invention is to provide a method and apparatus for data access of a distributed cache system, improve data access efficiency, and improve the cost performance of the distributed cache system.
为解决上述技术问题, 本发明的技术方案是这样实现的:  In order to solve the above technical problem, the technical solution of the present invention is implemented as follows:
本发明提供了一种分布式緩存系统数据存取的方法, 包括: 服务器节 点接收客户端发送的数据存取请求, 根据数据存取请求确定所存取数据的 存储模式, 根据存储模式存取数据, 并向客户端返回存取结果。  The present invention provides a method for data access of a distributed cache system, including: a server node receives a data access request sent by a client, determines a storage mode of the accessed data according to the data access request, and accesses the data according to the storage mode. And return the access result to the client.
上述方案中, 所述根据数据存取请求确定所存取数据的存储模式包括: 读取数据存取请求中的应用标识 ID,根据本地配置的应用 ID与存储模式的 对应关系, 获取所存取数据的存储模式。  In the above solution, the determining, by the data access request, the storage mode of the accessed data includes: reading an application identifier ID in the data access request, and acquiring the accessed according to the corresponding relationship between the locally configured application ID and the storage mode. The storage mode of the data.
上述方案中, 接收的所述数据存取请求为数据更新请求, 所述根据存 储模式存取数据包括:确定为内存存储模式,根据数据更新请求中的键 KEY 及值 Value, 更新内存中的数据; 或, 确定为内存加普通硬盘存储模式, 根 据数据更新请求中的 KEY及 Value , 更新硬盘中的数据, 然后更新内存中 的数据; 或, 确定为内存加固态硬盘模式, 确定内存中有剩余空间, 更新 内存中的数据, 否则, 释放内存空间, 然后更新内存中的数据。 上述方案中, 接收的所述数据存取请求为数据读取请求, 所述根据存 储模式存取数据包括: 确定为内存存储模式,根据数据读取请求中的 KEY, 读取内存中的数据; 或, 确定为内存加普通硬盘存储模式, 根据所述 KEY 读取内存中的数据, 若内存中没有要读取的数据, 则从硬盘中读取数据; 或, 确定为内存加固态硬盘模式, 根据内存中的索引信息确定要读取的数 据存在, 然后根据索引信息确定数据的存储位置, 读取数据。 In the above solution, the received data access request is a data update request, and the accessing the data according to the storage mode includes: determining the memory storage mode, and updating the data in the memory according to the key KEY and the value Value in the data update request. Or, determine the memory plus normal hard disk storage mode, update the data in the hard disk according to the KEY and Value in the data update request, and then update the data in the memory; or, determine the memory plus SSD mode, determine the remaining memory Space, update the data in memory, otherwise, free up memory space, and then update the data in memory. In the above solution, the received data access request is a data read request, and the accessing the data according to the storage mode includes: determining to be a memory storage mode, and reading data in the memory according to a KEY in the data read request; Or, determine the memory plus normal hard disk storage mode, read the data in the memory according to the KEY, if there is no data to be read in the memory, read the data from the hard disk; or, determine the memory plus solid state hard disk mode, The data to be read is determined according to the index information in the memory, and then the storage location of the data is determined according to the index information, and the data is read.
上述方案中, 接收的所述数据存取请求为数据删除请求, 所述根据存 储模式存取数据包括: 确定为内存存储模式,根据数据删除请求中的 KEY, 删除内存中的数据; 或, 确定为内存加普通硬盘存储模式, 根据数据删除 请求中的 KEY先删除硬盘中的数据, 然后删除内存中的数据; 或, 确定为 内存加固态硬盘存储模式, 根据内存中的索引信息确定要删除的数据存在, 根据索引信息中数据的存储位置, 删除数据。  In the above solution, the received data access request is a data deletion request, and the accessing the data according to the storage mode includes: determining the memory storage mode, deleting the data in the memory according to the KEY in the data deletion request; or determining Add the normal hard disk storage mode to the memory, delete the data in the hard disk according to the KEY in the data deletion request, and then delete the data in the memory; or, determine the memory plus the solid state hard disk storage mode, and determine the deletion according to the index information in the memory. The data exists, and the data is deleted according to the storage location of the data in the index information.
本发明还提供了一种分布式緩存系统数据存取的装置, 包括: 数据存 取模块、 信息反馈模块;  The invention also provides a device for data access of a distributed cache system, comprising: a data storage module and an information feedback module;
数据存取模块, 设置为接收客户端发送的数据存取请求, 根据数据存 取请求获取要存取的数据的存储模式, 根据存储模式存取数据, 并将存取 结果发送给信息反馈模块;  a data access module, configured to receive a data access request sent by the client, obtain a storage mode of the data to be accessed according to the data access request, access the data according to the storage mode, and send the access result to the information feedback module;
信息反馈模块, 设置为将存取结果返回客户端。  The feedback module is set to return the access result to the client.
上述方案中, 所述数据存取模块具体包括存取模式单元、 数据更新单 元、 数据读取单元以及数据删除单元; 存取模式单元, 设置为读取数据存 取请求中的应用 ID ,根据本地配置的应用 ID与存储模式的对应关系,获取 所存取数据的存储模式, 接收的数据存取请求为数据更新请求, 将获取的 存储模式及数据更新请求发送给数据更新单元; 接收的数据存取请求为数 据读取请求, 将所述数据读取请求及获取的存储模式发送给数据读取单元; 接收的数据存取请求为数据删除请求, 将所述数据删除请求及获取的存储 模式发送给数据删除单元。 In the above solution, the data access module specifically includes an access mode unit, a data update unit, a data read unit, and a data deletion unit. The access mode unit is configured to read an application ID in the data access request according to the local Corresponding relationship between the configured application ID and the storage mode, obtaining a storage mode of the accessed data, receiving the data access request as a data update request, and transmitting the acquired storage mode and data update request to the data update unit; The request is a data read request, and the data read request and the acquired storage mode are sent to the data read unit; the received data access request is a data delete request, and the data deletion request and the acquired storage are performed. The mode is sent to the data deletion unit.
上述方案中, 所述数据更新单元, 设置为: 获取的存储模式为内存存 储模式时, 根据数据更新请求中的 KEY及 Value, 更新内存中的数据; 或, 为内存加普通硬盘存储模式时,根据数据更新请求中数据的 KEY及 Value, 更新硬盘中数据, 然后, 更新内存中的数据; 或, 为内存加固态硬盘存储 模式时, 确定内存中有剩余空间, 更新内存中的数据, 否则, 释放内存空 间, 然后更新内存中的数据。  In the above solution, the data update unit is configured to: when the acquired storage mode is the memory storage mode, update the data in the memory according to the KEY and the value in the data update request; or, when the memory is added to the normal hard disk storage mode, Update the data in the hard disk according to the KEY and Value of the data in the data update request, and then update the data in the memory; or, when adding the solid state hard disk storage mode to the memory, determine that there is remaining space in the memory, and update the data in the memory; otherwise, Free up memory space and then update the data in memory.
上述方案中, 所述数据读取单元, 设置为: 获取的存储模式为内存存 储模式时, 根据数据读取请求中的 KEY, 读取内存中的数据; 或, 为内存 加普通硬盘存储模式时, 根据所述 KEY, 根据数据读取请求中的 KEY, 先 从内存读取数据, 若内存中没有要读取的数据, 则从硬盘中读取数据, 并 緩存到内存中; 或, 为内存加固态硬盘存储模式时, 根据内存中索引信息 确定要读取的数据存在, 然后根据索引信息确定数据的存储位置, 读取数 据。  In the above solution, the data reading unit is configured to: when the acquired storage mode is the memory storage mode, read the data in the memory according to the KEY in the data read request; or, when the memory is added to the normal hard disk storage mode According to the KEY, according to the KEY in the data read request, the data is first read from the memory, and if there is no data to be read in the memory, the data is read from the hard disk and cached in the memory; or, is the memory When the SSD storage mode is added, the data to be read exists according to the index information in the memory, and then the storage location of the data is determined according to the index information, and the data is read.
上述方案中, 所述数据删除单元, 设置为: 获取的存储模式为内存存 储模式时, 根据数据删除请求中的 KEY, 删除内存中的数据; 或, 为内存 加普通硬盘存储模式时, 根据所述 KEY, 先删除普通硬盘中的数据, 进一 步删除内存中的数据; 或, 为内存加固态硬盘存储模式时, 根据内存中的 索引信息确定要删除的数据存在, 根据索引信息中数据的存储位置, 删除 数据。  In the above solution, the data deletion unit is configured to: when the stored storage mode is the memory storage mode, delete the data in the memory according to the KEY in the data deletion request; or, when adding the normal hard disk storage mode to the memory, according to the KEY, first delete the data in the ordinary hard disk, and further delete the data in the memory; or, when adding the solid state hard disk storage mode to the memory, determine the data to be deleted according to the index information in the memory, according to the storage location of the data in the index information , delete data.
由此可见, 釆用本发明所述的分布式緩存系统数据存取的方法及装置, 针对不同的数据存储模式釆用不同的存取方式, 提升了数据的存取效率, 并提高了分布式緩存系统的性价比。 附图说明  It can be seen that the method and device for data access of the distributed cache system according to the present invention use different access modes for different data storage modes, thereby improving data access efficiency and improving distributed The cost performance of the cache system. DRAWINGS
图 1为本发明实现分布式緩存系统数据存取的方法实施例示意图; 图 2为本发明实现分布式緩存系统数据存取的装置实施例示意图。 具体实施方式 1 is a schematic diagram of an embodiment of a method for implementing data access in a distributed cache system according to the present invention; 2 is a schematic diagram of an embodiment of an apparatus for implementing data access in a distributed cache system according to the present invention. detailed description
本发明的基本思想是: 客户端向服务器节点发送数据存取请求, 服务 器节点根据数据存取请求获取要存取数据的存储模式, 然后根据存储模式 存取数据, 并向客户端返回存取结果。  The basic idea of the present invention is: the client sends a data access request to the server node, the server node acquires a storage mode to access the data according to the data access request, and then accesses the data according to the storage mode, and returns the access result to the client. .
下面通过附图与具体实施例来对本发明进行详细说明。  The invention will now be described in detail by means of the drawings and specific embodiments.
本发明提供了一种分布式緩存系统数据存取的方法, 如图 1 所示, 包 括如下步骤:  The present invention provides a method for data access of a distributed cache system, as shown in FIG. 1, including the following steps:
步骤 101、 客户端向服务器节点发送数据存取请求;  Step 101: The client sends a data access request to the server node.
客户端向服务器节点发送数据存取请求, 所述数据存取请求为: 数据 更新请求, 或数据读取请求, 或数据删除请求; 其中, 所述数据更新请求 为数据写入或替换,包含应用标识(ID ),以及所更新的数据的 KEY、 Value。 所述应用 ID用于标识业务应用系统, 本发明中的实施例按照应用 ID对应 的业务应用系统来划分相应业务应用数据的存储模式, 也可以釆用其他的 方法, 在此不——举例说明; 所述数据读取请求中包含应用 ID , 以及所读 取的数据的 KEY; 所述数据删除请求中包含应用 ID , 以及所删除的数据的 KEY。  The client sends a data access request to the server node, where the data access request is: a data update request, or a data read request, or a data delete request; wherein the data update request is data write or replace, including an application Identification (ID), and the KEY, Value of the updated data. The application ID is used to identify the service application system. The embodiment of the present invention divides the storage mode of the corresponding service application data according to the service application system corresponding to the application ID, and may also use other methods. The data read request includes an application ID and a KEY of the read data; the data deletion request includes an application ID, and a KEY of the deleted data.
步骤 102、服务器节点根据数据存取请求, 获取要存储的数据的存储模 式, 然后根据存储模式存取数据;  Step 102: The server node acquires a storage mode of the data to be stored according to the data access request, and then accesses the data according to the storage mode.
服务器节点读取数据存取请求中的应用 ID,根据本地配置的应用 ID与 存储模式的对应关系, 获取数据存取请求中应用 ID对应的存储模式, 也就 是要存取的数据对应的存储模式, 所述要存取的数据即为要更新、 读取或 删除的数据。  The server node reads the application ID in the data access request, and obtains the storage mode corresponding to the application ID in the data access request according to the corresponding relationship between the locally configured application ID and the storage mode, that is, the storage mode corresponding to the data to be accessed. The data to be accessed is the data to be updated, read or deleted.
所述根据存取模式存取数据包括:  The accessing data according to the access mode includes:
接收数据更新请求, 若要更新的数据为内存存储模式, 则根据数据更 新请求中的 KEY及 Value更新内存中的数据, 所述内存存储模式为数据的 存储及管理均在内存中, 所述更新具体为: 替换数据时, 根据数据更新请 求中的 KEY,查询内存中保存的数据,若内存中有数据的 KEY与数据更新 请求中的 KEY相符,可以确定内存中有该数据,用数据更新请求中的 Value 覆盖内存中相应 KEY数据的 Value, 若没有数据与数据更新请求中的 KEY 相符, 则内存中没有该数据, 更新失败; 写入数据时, 直接将数据写入内 存; 或者, 要更新的数据为内存加普通硬盘存储模式, 则根据数据更新请 求中数据的 KEY及 Value更新硬盘中数据, 然后, 确定内存中有该数据, 则更新内存中的数据, 所述确定内存中有该数据与内存存储模式的更新过 程中确定内存中有该数据的过程相同, 在此不再赘述; 所述更新与内存存 储模式的更新过程相同, 在此不再赘述; 所述内存加普通硬盘存储模式是 内存与硬盘独立管理所存储的数据的存储模式, 内存所存储的数据可以为 热点数据, 也就是经常被存取的数据; 或者, 要更新的数据为内存加固态 硬盘存储模式, 根据内存中保存的内存容量信息确定内存中是否有剩余空 间, 若内存容量信息显示内存中还有剩余空间, 则更新内存中的数据, 若 没有剩余空间, 则释放内存空间, 然后更新内存中的数据, 并更新移到固 态硬盘中的数据的存储位置, 所述更新内存中的数据与所述内存存储模式 中的更新相同, 在此不再赘述, 所述释放内存空间是通过最近最少使用 ( LRU ) 算法, 根据内存中保存的数据保存的时间记录, 将保存时间最早 的数据移到固态硬盘中, 所述内存加固态硬盘存储模式是一种索引信息保 存在内存中, 内存中有剩余空间, 内存存取数据, 内存中没有剩余空间, 则在固态硬盘中存取数据, 并通过内存中保存的索引信息管理内存及固态 硬盘中的数据, 所述固态硬盘数据的存取速度大于普通硬盘数据的存取速 度, 作为内存的扩展, 数据只保存在内存或固态硬盘中的一处, 所述索引 信息为内存根据内存及固态硬盘中数据的更新或删除操作、 实时更新的包 括数据的 KEY以及数据的存储位置的信息。 Receiving a data update request, if the data to be updated is in the memory storage mode, then according to the data The KEY and Value in the new request update the data in the memory, and the memory storage mode stores and manages the data in the memory, and the update is specifically: when replacing the data, querying the memory according to the KEY in the data update request The saved data, if the KEY of the data in the memory matches the KEY in the data update request, it can be determined that the data exists in the memory, and the Value of the corresponding KEY data in the memory is overwritten by the Value in the data update request, if there is no data and data update If the KEY in the request matches, the data does not exist in the memory, and the update fails. When the data is written, the data is directly written into the memory; or, if the data to be updated is the memory plus the normal hard disk storage mode, the data in the request is updated according to the data. KEY and Value update the data in the hard disk, and then determine that the data exists in the memory, and update the data in the memory, the process of determining that the data in the memory is the same as the process of determining the data in the memory during the update process of the memory storage mode, The description is not repeated here; the update is the same as the update process of the memory storage mode, and details are not described herein again; The memory plus normal hard disk storage mode is a storage mode of data stored independently by the memory and the hard disk, and the data stored in the memory may be hot data, that is, data that is frequently accessed; or, the data to be updated is memory plus solid state. The hard disk storage mode determines whether there is any remaining space in the memory according to the memory capacity information stored in the memory. If the memory capacity information indicates that there is remaining space in the memory, the data in the memory is updated, and if there is no remaining space, the memory space is released, and then Updating the data in the memory, and updating the storage location of the data moved to the SSD, the data in the update memory is the same as the update in the memory storage mode, and details are not described herein again. The least recently used (LRU) algorithm, according to the time record saved in the data saved in the memory, moves the earliest data to the solid state hard disk, and the memory plus solid state hard disk storage mode is an index information stored in the memory, the memory There is space left, memory access data, no memory The remaining space accesses the data in the solid state hard disk, and manages the data in the memory and the solid state hard disk through the index information stored in the memory, and the access speed of the solid state hard disk data is greater than the access speed of the ordinary hard disk data, as the memory Extended, the data is only saved in one place in the memory or SSD. The index information is the update or delete operation of the memory according to the memory and the SSD, and the package is updated in real time. The information of the KEY of the data and the storage location of the data.
或, 接收数据读取请求, 若要读取的数据为内存存储模式, 根据数据 读取请求中的 KEY, 读取内存中的数据, 所述读取数据包括: 根据数据读 取请求中的 KEY, 查询内存中数据的 KEY, 若与数据读取请求中的 KEY 相符, 则读取该数据, 若没有与数据读取请求中的 KEY相符的数据, 则没 有要读取的数据, 读取失败; 或者, 要读取的数据为内存加普通硬盘存储 模式, 根据数据读取请求中的 KEY, 先从内存读取数据, 若内存中没有要 读取的数据, 则从硬盘中读取数据, 同时将数据緩存到内存中, 所述读取 过程与内存存储模式的读取过程相同, 在此不再赘述; 或者, 要读取的数 据为内存加固态硬盘存储模式, 根据内存中的索引信息确定要读取的数据 是否存在, 若要读取的数据存在, 根据索引信息中数据的存储位置, 读取 数据, 若要读取的数据不存在, 则不进行读取操作, 向客户端返回数据不 存在的消息, 所述根据内存中索引信息确定要读取的数据是否存在包括: 将数据读取请求中的 KEY与索引信息中的 KEY比较, 若与所述数据读取 请求中的 KEY相符, 则要读取的数据存在。  Or, receiving a data read request, the data to be read is a memory storage mode, and reading the data in the memory according to the KEY in the data read request, the read data includes: according to the KEY in the data read request Query the KEY of the data in the memory. If the KEY in the data read request matches, the data is read. If there is no data matching the KEY in the data read request, there is no data to be read, and the read fails. Or, the data to be read is the memory plus normal hard disk storage mode. According to the KEY in the data read request, the data is read from the memory first. If there is no data to be read in the memory, the data is read from the hard disk. At the same time, the data is cached into the memory, and the reading process is the same as the reading process of the memory storage mode, and will not be described here; or, the data to be read is the memory plus solid state hard disk storage mode, according to the index information in the memory. Determine whether the data to be read exists, the data to be read exists, the data to be read according to the storage location of the data in the index information, the data to be read If there is no read operation, the message that the data does not exist is returned to the client, and determining whether the data to be read exists according to the index information in the memory includes: KEY in the data read request and KEY in the index information In comparison, if the KEY in the data read request matches, the data to be read exists.
或, 接收数据删除请求, 若要删除的数据为内存存储模式, 根据数据 删除请求中的 KEY, 删除内存中的数据, 所述删除包括: 根据数据删除请 求中的 KEY, 查询内存中的数据的 KEY, 若有与所述数据删除请求中的 KEY相符的, 则确定要删除的数据存在, 然后删除内存中的数据, 否则, 要删除的数据不存在, 删除失败。 或者, 要删除的数据为内存加普通硬盘 存储模式, 根据数据删除请求中的 KEY, 先删除硬盘中的数据, 然后删除 内存中的数据, 所述删除过程与内存存储模式的删除过程相同, 在此不再 赘述; 或者, 要删除的数据为内存加固态硬盘存储模式, 根据内存中的索 引信息确定要删除的数据是否存在, 若要删除的数据存在, 则根据索引信 息中数据的存储位置删除数据, 并删除该数据对应的索引信息, 若要删除 的数据不存在, 则不进行删除操作。 所述确定要删除的数据是否存在, 与 接收数据读取请求且要读取的数据为内存加固态硬盘存储模式时, 确定要 读取的数据是否存在的过程相同, 在此不再赘述。 Or, receiving the data deletion request, the data to be deleted is the memory storage mode, and the data in the memory is deleted according to the KEY in the data deletion request, where the deleting comprises: querying the data in the memory according to the KEY in the data deletion request KEY, if there is a KEY in the data deletion request, it is determined that the data to be deleted exists, and then the data in the memory is deleted. Otherwise, the data to be deleted does not exist, and the deletion fails. Alternatively, the data to be deleted is a memory plus normal hard disk storage mode. According to the KEY in the data deletion request, the data in the hard disk is deleted first, and then the data in the memory is deleted. The deletion process is the same as the deletion process of the memory storage mode. The data to be deleted is the memory plus SSD storage mode. According to the index information in the memory, it is determined whether the data to be deleted exists. If the deleted data exists, the data is deleted according to the storage location of the data in the index information. Data, and delete the index information corresponding to the data, to delete If the data does not exist, the deletion will not be performed. The process of determining whether the data to be deleted exists, and the process of receiving the data read request and the data to be read is the memory plus SSD storage mode, the process of determining whether the data to be read exists is the same, and details are not described herein again.
步骤 103、 服务器节点向客户端回复存取结果。  Step 103: The server node replies to the client with an access result.
所述存取结果包括: 接收数据更新请求时, 将已更新的消息返回给客 户端, 接收数据读取请求时, 将读取的数据返回给客户端, 若要读取的数 据不存在, 则向客户端返回数据不存在的消息; 接收数据删除请求时, 向 客户端返回数据已删除的消息, 若数据不存在, 则向客户端返回数据不存 在的消息。  The access result includes: when receiving the data update request, returning the updated message to the client, and when receiving the data read request, returning the read data to the client, if the data to be read does not exist, The message that the data does not exist is returned to the client; when the data deletion request is received, the message that the data has been deleted is returned to the client, and if the data does not exist, the message that the data does not exist is returned to the client.
基于上述方法, 本发明还提供了一种分布式緩存系统数据存取的装置, 如图 2所示, 该装置包括: 数据存取模块 201、 信息反馈模块 202;  Based on the above method, the present invention further provides a device for data access of a distributed cache system. As shown in FIG. 2, the device includes: a data access module 201, an information feedback module 202;
数据存取模块 201 , 用于接收客户端发送的数据存取请求,根据数据存 取请求获取要存取的数据的存取模式, 根据存取模式存取数据, 并将存取 结果发送给信息反馈模块 202;  The data access module 201 is configured to receive a data access request sent by the client, acquire an access mode of the data to be accessed according to the data access request, access the data according to the access mode, and send the access result to the information. Feedback module 202;
信息反馈模块 202, 用于将存取结果发送给客户端。  The information feedback module 202 is configured to send the access result to the client.
所述数据存取模块 201包括:存取模式单元 2011、数据更新单元 2012、 数据读取单元 2013以及数据删除单元 2014;  The data access module 201 includes: an access mode unit 2011, a data update unit 2012, a data reading unit 2013, and a data deletion unit 2014;
所述存取模式单元 2011 , 用于接收并读取数据存取请求中的应用 ID, 根据配置的应用 ID与存储模式的对应关系,获取要存取的数据的存储模式, 接收的数据存取请求为数据更新请求, 将获取的存储模式及数据更新请求 发送给数据更新单元 2012; 或, 接收的数据存取请求为数据读取请求, 将 所述数据读取请求及获取的存储模式发送给数据读取单元 2013 ; 或, 接收 的数据存取请求为数据删除请求, 将所述数据删除请求及获取的存储模式 发送给数据删除单元 2014。  The access mode unit 2011 is configured to receive and read an application ID in the data access request, acquire a storage mode of the data to be accessed according to the corresponding relationship between the configured application ID and the storage mode, and receive the data access. The request is a data update request, and the obtained storage mode and data update request is sent to the data update unit 2012; or the received data access request is a data read request, and the data read request and the acquired storage mode are sent to The data reading unit 2013; or, the received data access request is a data deletion request, and the data deletion request and the acquired storage mode are sent to the data deletion unit 2014.
数据更新单元 2012, 用于获取的存储模式为内存存储模式时, 根据数 据更新请求中的 KEY及 Value , 更新内存中的数据; 或者, 为内存加普通 硬盘存储模式时, 根据数据更新请求中数据的 KEY及 Value更新硬盘中数 据, 然后, 更新内存中的数据; 或者, 为内存加固态硬盘存储模式时, 确 定内存中有剩余空间, 更新内存中的数据, 否则, 释放内存空间, 然后更 新内存中的数据。 The data update unit 2012, when the storage mode for acquiring is the memory storage mode, according to the number Update the data in the memory according to the KEY and Value in the update request; or, when adding the normal hard disk storage mode to the memory, update the data in the hard disk according to the KEY and Value of the data in the data update request, and then update the data in the memory; or When adding the SSD storage mode to the memory, determine the remaining space in the memory, update the data in the memory, otherwise, release the memory space, and then update the data in the memory.
数据读取单元 2013 , 用于获取的存储模式为内存存储模式时, 根据数 据读取请求中的 KEY, 读取内存中的数据; 或者, 为内存加普通硬盘存储 模式时, 根据数据读取请求中的 KEY, 先从内存读取数据, 若内存中没有 要读取的数据, 则从硬盘中读取数据, 并緩存到内存中; 或者, 为内存加 固态硬盘存储模式时, 根据内存中索引信息确定要读取的数据存在, 然后 根据索引信息确定数据的存储位置, 读取数据。  The data reading unit 2013, when the storage mode for acquiring is the memory storage mode, reads the data in the memory according to the KEY in the data read request; or, when the memory is added to the normal hard disk storage mode, according to the data read request The KEY in the first reading data from the memory, if there is no data to be read in the memory, the data is read from the hard disk and cached into the memory; or, when the memory is added to the solid state hard disk storage mode, according to the index in the memory The information determines that the data to be read exists, and then determines the storage location of the data based on the index information, and reads the data.
所述数据删除单元 2014, 用于获取的存储模式为内存存储模式时, 根 据数据删除请求中的 KEY, 删除内存中的数据; 或者, 为内存加普通硬盘 存储模式时, 根据所述 KEY, 先删除普通硬盘中的数据, 进一步删除内存 中的数据; 或者, 为内存加固态硬盘存储模式时, 根据内存中的索引信息 确定要删除的数据存在, 根据索引信息中数据的存储位置, 删除数据, 并 删除该数据对应的索引信息。  The data deletion unit 2014, when the storage mode used for obtaining is the memory storage mode, deletes the data in the memory according to the KEY in the data deletion request; or, when the memory is added to the normal hard disk storage mode, according to the KEY, Delete the data in the normal hard disk, and further delete the data in the memory; or, when adding the SSD storage mode to the memory, determine the data to be deleted according to the index information in the memory, and delete the data according to the storage location of the data in the index information. And delete the index information corresponding to the data.
所述数据更新单元 2012具体用于, 根据内存中保存的内存容量信息, 确定内存中是否有剩余空间, 若没有剩余空间, 通过 LRU算法将内存中保 存时间最早的数据移到快速固态硬盘, 用以释放内存空间。  The data update unit 2012 is specifically configured to determine, according to the memory capacity information stored in the memory, whether there is any remaining space in the memory, and if there is no remaining space, move the data with the earliest storage time in the memory to the fast solid state hard disk by using the LRU algorithm. To free up memory space.
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围, 凡在本发明的精神和原则之内所作的任何修改、 等同替换和改进 等, 均应包含在本发明的保护范围之内。  The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included. Within the scope of protection of the present invention.

Claims

权利要求书 Claim
1、 一种分布式緩存系统数据存取的方法, 包括:  A method for data access of a distributed cache system, comprising:
服务器节点接收客户端发送的数据存取请求, 根据数据存取请求确定 所存取数据的存储模式, 根据存储模式存取数据, 并向客户端返回存取结 果。  The server node receives the data access request sent by the client, determines the storage mode of the accessed data according to the data access request, accesses the data according to the storage mode, and returns the access result to the client.
2、 根据权利要求 1所述的方法, 其中, 所述根据数据存取请求确定所 存取数据的存储模式包括:  2. The method according to claim 1, wherein the determining, according to the data access request, the storage mode of the accessed data comprises:
读取数据存取请求中的应用标识 ID,根据本地配置的应用 ID与存储模 式的对应关系, 获取所存取数据的存储模式。  The application identifier ID in the data access request is read, and the storage mode of the accessed data is obtained according to the correspondence between the locally configured application ID and the storage mode.
3、 根据权利要求 1或 2所述的方法, 其中, 接收的所述数据存取请求 为数据更新请求, 所述根据存储模式存取数据包括:  The method according to claim 1 or 2, wherein the received data access request is a data update request, and the accessing the data according to the storage mode comprises:
确定为内存存储模式, 根据数据更新请求中的键 KEY及值 Value, 更 新内存中的数据; 或,  Determined to be the memory storage mode, and update the data in the memory according to the key KEY and the value Value in the data update request; or,
确定为内存加普通硬盘存储模式, 根据数据更新请求中的 KEY 及 Value, 更新硬盘中的数据, 然后更新内存中的数据; 或,  Determine the memory plus normal hard disk storage mode, update the data in the hard disk according to the KEY and Value in the data update request, and then update the data in the memory; or,
确定为内存加固态硬盘模式, 确定内存中有剩余空间, 更新内存中的 数据, 否则, 释放内存空间, 然后更新内存中的数据。  Determine the memory plus SSD mode, determine the remaining space in the memory, update the data in the memory, otherwise, free up the memory space, and then update the data in the memory.
4、 根据权利要求 1或 2所述的方法, 其中, 接收的所述数据存取请求 为数据读取请求, 所述根据存储模式存取数据包括:  The method according to claim 1 or 2, wherein the received data access request is a data read request, and the accessing the data according to the storage mode comprises:
确定为内存存储模式, 根据数据读取请求中的 KEY, 读取内存中的数 据; 或,  Determined to be the memory storage mode, read the data in the memory according to the KEY in the data read request; or,
确定为内存加普通硬盘存储模式, 根据所述 KEY读取内存中的数据, 若内存中没有要读取的数据, 则从硬盘中读取数据; 或,  Determine to add the normal hard disk storage mode to the memory, read the data in the memory according to the KEY, and if there is no data to be read in the memory, read the data from the hard disk; or,
确定为内存加固态硬盘模式, 根据内存中的索引信息确定要读取的数 据存在, 然后根据索引信息确定数据的存储位置, 读取数据。 It is determined that the memory plus SSD mode determines the existence of the data to be read according to the index information in the memory, and then determines the storage location of the data according to the index information, and reads the data.
5、 根据权利要求 1或 2所述的方法, 其中, 接收的所述数据存取请求 为数据删除请求, 所述根据存储模式存取数据包括: The method according to claim 1 or 2, wherein the received data access request is a data deletion request, and the accessing the data according to the storage mode comprises:
确定为内存存储模式, 根据数据删除请求中的 KEY, 删除内存中的数 据; 或,  Determined to be in the memory storage mode, according to the KEY in the data deletion request, delete the data in the memory; or,
确定为内存加普通硬盘存储模式, 根据数据删除请求中的 KEY先删除 硬盘中的数据, 然后删除内存中的数据; 或,  Determine the memory plus normal hard disk storage mode, delete the data in the hard disk according to the KEY in the data deletion request, and then delete the data in the memory; or,
确定为内存加固态硬盘存储模式, 根据内存中的索引信息确定要删除 的数据存在, 根据索引信息中数据的存储位置, 删除数据。  Determine the memory plus SSD storage mode, determine the data to be deleted according to the index information in the memory, and delete the data according to the storage location of the data in the index information.
6、 一种分布式緩存系统数据存取的装置, 包括: 数据存取模块、 信息 反馈模块;  6. A device for data access of a distributed cache system, comprising: a data access module and an information feedback module;
数据存取模块, 设置为接收客户端发送的数据存取请求, 根据数据存 取请求获取要存取的数据的存储模式, 根据存储模式存取数据, 并将存取 结果发送给信息反馈模块;  a data access module, configured to receive a data access request sent by the client, obtain a storage mode of the data to be accessed according to the data access request, access the data according to the storage mode, and send the access result to the information feedback module;
信息反馈模块, 设置为将存取结果返回客户端。  The feedback module is set to return the access result to the client.
7、 根据权利要求 6所述的装置, 其中, 所述数据存取模块具体包括存 取模式单元、 数据更新单元、 数据读取单元以及数据删除单元;  The device according to claim 6, wherein the data access module comprises an access mode unit, a data update unit, a data reading unit, and a data deletion unit;
存取模式单元, 设置为读取数据存取请求中的应用 ID, 根据本地配置 的应用 ID与存储模式的对应关系, 获取所存取数据的存储模式, 接收的数 据存取请求为数据更新请求, 将获取的存储模式及数据更新请求发送给数 据更新单元; 接收的数据存取请求为数据读取请求, 将所述数据读取请求 及获取的存储模式发送给数据读取单元; 接收的数据存取请求为数据删除 请求, 将所述数据删除请求及获取的存储模式发送给数据删除单元。  The access mode unit is configured to read an application ID in the data access request, acquire a storage mode of the accessed data according to a mapping relationship between the locally configured application ID and the storage mode, and receive the data access request as a data update request. And sending the obtained storage mode and data update request to the data update unit; the received data access request is a data read request, and the data read request and the acquired storage mode are sent to the data reading unit; the received data The access request is a data deletion request, and the data deletion request and the acquired storage mode are sent to the data deletion unit.
8、 根据权利要求 7所述的装置, 其中, 所述数据更新单元, 设置为: 获取的存储模式为内存存储模式时, 根据数据更新请求中的 KEY 及 The device according to claim 7, wherein the data updating unit is configured to: when the acquired storage mode is the memory storage mode, according to the KEY in the data update request and
Value, 更新内存中的数据; 或, 为内存加普通硬盘存储模式时, 根据数据更新请求中数据的 KEY 及 Value, 更新硬盘中数据, 然后, 更新内存中的数据; 或, Value, update the data in memory; or, When the normal hard disk storage mode is added to the memory, the data in the hard disk is updated according to the KEY and Value of the data in the data update request, and then the data in the memory is updated; or,
为内存加固态硬盘存储模式时, 确定内存中有剩余空间, 更新内存中 的数据, 否则, 释放内存空间, 然后更新内存中的数据。  When adding the SSD storage mode to the memory, make sure there is free space in the memory, update the data in the memory, otherwise, free up the memory space, and then update the data in the memory.
9、 根据权利要求 7所述的装置, 其中, 所述数据读取单元, 设置为: 获取的存储模式为内存存储模式时, 根据数据读取请求中的 KEY, 读 取内存中的数据; 或,  The device according to claim 7, wherein the data reading unit is configured to: when the acquired storage mode is the memory storage mode, read the data in the memory according to the KEY in the data read request; or ,
为内存加普通硬盘存储模式时, 根据所述 KEY, 根据数据读取请求中 的 KEY, 先从内存读取数据, 若内存中没有要读取的数据, 则从硬盘中读 取数据, 并緩存到内存中; 或,  When the normal hard disk storage mode is added to the memory, according to the KEY, according to the KEY in the data read request, the data is first read from the memory, and if there is no data to be read in the memory, the data is read from the hard disk and cached. Into the memory; or,
为内存加固态硬盘存储模式时, 根据内存中索引信息确定要读取的数 据存在, 然后根据索引信息确定数据的存储位置, 读取数据。  When the SSD storage mode is added to the memory, the data to be read is determined according to the index information in the memory, and then the storage location of the data is determined according to the index information, and the data is read.
10、 根据权利要求 7所述的装置, 其中, 所述数据删除单元, 设置为: 获取的存储模式为内存存储模式时, 根据数据删除请求中的 KEY, 删 除内存中的数据; 或,  The device according to claim 7, wherein the data deleting unit is configured to: when the acquired storage mode is the memory storage mode, delete the data in the memory according to the KEY in the data deletion request; or
为内存加普通硬盘存储模式时, 根据所述 KEY, 先删除普通硬盘中的 数据, 进一步删除内存中的数据; 或,  When the normal hard disk storage mode is added to the memory, according to the KEY, the data in the ordinary hard disk is deleted first, and the data in the memory is further deleted; or
为内存加固态硬盘存储模式时, 根据内存中的索引信息确定要删除的 数据存在, 根据索引信息中数据的存储位置, 删除数据。  When the SSD storage mode is added to the memory, the data to be deleted is determined according to the index information in the memory, and the data is deleted according to the storage location of the data in the index information.
PCT/CN2011/077589 2011-03-23 2011-07-25 Distributed cache system data access method and device WO2012126229A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110070192.X 2011-03-23
CN201110070192.XA CN102694828B (en) 2011-03-23 2011-03-23 A kind of method of distributed cache system data access and device

Publications (1)

Publication Number Publication Date
WO2012126229A1 true WO2012126229A1 (en) 2012-09-27

Family

ID=46860114

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/077589 WO2012126229A1 (en) 2011-03-23 2011-07-25 Distributed cache system data access method and device

Country Status (2)

Country Link
CN (1) CN102694828B (en)
WO (1) WO2012126229A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933288A (en) * 2019-03-11 2019-06-25 北京安信易德科技有限公司 Travel timetable distributed storage method and device

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945207A (en) * 2012-10-26 2013-02-27 浪潮(北京)电子信息产业有限公司 Cache management method and system for block-level data
CN104572649B (en) 2013-10-11 2019-10-25 南京中兴新软件有限责任公司 The processing method of the data of distributed memory system, apparatus and system
CN103888545A (en) * 2014-04-14 2014-06-25 北京搜狐新媒体信息技术有限公司 Method and device for processing global data in distributed system
CN104883381B (en) * 2014-05-27 2018-09-04 陈杰 The data access method and system of distributed storage
CN105988721A (en) * 2015-02-10 2016-10-05 中兴通讯股份有限公司 Data caching method and apparatus for network disk client
CN105988899B (en) * 2015-03-05 2019-04-02 广州市动景计算机科技有限公司 The method and apparatus for realizing data buffer storage
CN105426125B (en) * 2015-11-09 2019-06-14 深圳市迪菲特科技股份有限公司 A kind of date storage method and device
CN105897832A (en) * 2015-12-01 2016-08-24 乐视网信息技术(北京)股份有限公司 Service data providing server, method and system
CN106790562A (en) * 2016-12-26 2017-05-31 中国建设银行股份有限公司 A kind of distributed cache system, method and device
CN108334460B (en) * 2017-05-25 2019-11-29 南京中兴新软件有限责任公司 Data cache method and device
CN107562385B (en) * 2017-09-13 2020-08-04 郑州云海信息技术有限公司 Method, device and equipment for reading data by distributed storage client

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030217081A1 (en) * 2002-05-14 2003-11-20 Ken White System and method of maintaining functional client side data cache coherence
CN1754155A (en) * 2003-01-17 2006-03-29 泰斯特网络公司 Method and system for use of storage caching with a distributed file system
US20070276919A1 (en) * 2006-05-12 2007-11-29 Daniel Buchmann Services for data access based on a data ownership directory in distributed system landscapes
US7925711B1 (en) * 2006-12-15 2011-04-12 The Research Foundation Of State University Of New York Centralized adaptive network memory engine

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7143264B2 (en) * 2002-10-10 2006-11-28 Intel Corporation Apparatus and method for performing data access in accordance with memory access patterns
CN100403246C (en) * 2005-06-30 2008-07-16 技嘉科技股份有限公司 Device for simulating rigid disk and method thereof
CN100541454C (en) * 2007-12-14 2009-09-16 东软集团股份有限公司 A kind of data cache method and system
CN101686209B (en) * 2008-09-24 2013-10-09 阿里巴巴集团控股有限公司 Method and device for storing message in message retransmission system
CN101867607A (en) * 2010-05-21 2010-10-20 北京无限立通通讯技术有限责任公司 Distributed data access method, device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030217081A1 (en) * 2002-05-14 2003-11-20 Ken White System and method of maintaining functional client side data cache coherence
CN1754155A (en) * 2003-01-17 2006-03-29 泰斯特网络公司 Method and system for use of storage caching with a distributed file system
US20070276919A1 (en) * 2006-05-12 2007-11-29 Daniel Buchmann Services for data access based on a data ownership directory in distributed system landscapes
US7925711B1 (en) * 2006-12-15 2011-04-12 The Research Foundation Of State University Of New York Centralized adaptive network memory engine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHOU XIAOBO ET AL.: "A Web Static Cache for Application Server", COMPUTER ENGINEERING AND APPLICATIONS, vol. 32, 11 November 2005 (2005-11-11), pages 97 - 99 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933288A (en) * 2019-03-11 2019-06-25 北京安信易德科技有限公司 Travel timetable distributed storage method and device

Also Published As

Publication number Publication date
CN102694828A (en) 2012-09-26
CN102694828B (en) 2016-03-30

Similar Documents

Publication Publication Date Title
WO2012126229A1 (en) Distributed cache system data access method and device
US10459649B2 (en) Host side deduplication
US20190179535A1 (en) Efficient space utilization in a flash system using snapshots
US9830101B2 (en) Managing data storage in a set of storage systems using usage counters
US11169745B1 (en) Exporting an address space in a thin-provisioned storage device
US20120317153A1 (en) Caching responses for scoped and non-scoped domain name system queries
US11436157B2 (en) Method and apparatus for accessing storage system
WO2014101108A1 (en) Caching method for distributed storage system, node and computer readable medium
JP2009026141A (en) Cache method and cache device
WO2014180232A1 (en) Method and device for responding to a request, and distributed file system
WO2013107029A1 (en) Data processing method, device and system based on block storage
CN104020961A (en) Distributed data storage method, device and system
US11314454B2 (en) Method and apparatus for managing storage device in storage system
US10241934B2 (en) Shared memory controller, shared memory module, and memory sharing system
CN108540510B (en) Cloud host creation method and device and cloud service system
WO2013091167A1 (en) Log storage method and system
CN109522283A (en) A kind of data de-duplication method and system
US11321021B2 (en) Method and apparatus of managing mapping relationship between storage identifier and start address of queue of storage device corresponding to the storage identifier
WO2014153931A1 (en) File storage method and device, access client and metadata server system
CN106020713A (en) File storage method based on buffer area
US9454479B2 (en) Processing read and write requests in a storage controller
JP2011242826A (en) File management system and file management program
CN103491124B (en) A kind of method that multimedia message data is handled and distributed cache system
WO2012171363A1 (en) Method and equipment for data operation in distributed cache system
WO2022083267A1 (en) Data processing method, apparatus, computing node, and computer readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11861795

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

Country of ref document: EP

Kind code of ref document: A1