WO2019109209A1 - 一种存储器数据替换方法、服务器节点和数据存储系统 - Google Patents

一种存储器数据替换方法、服务器节点和数据存储系统 Download PDF

Info

Publication number
WO2019109209A1
WO2019109209A1 PCT/CN2017/114449 CN2017114449W WO2019109209A1 WO 2019109209 A1 WO2019109209 A1 WO 2019109209A1 CN 2017114449 W CN2017114449 W CN 2017114449W WO 2019109209 A1 WO2019109209 A1 WO 2019109209A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
server node
read
type
memory
Prior art date
Application number
PCT/CN2017/114449
Other languages
English (en)
French (fr)
Inventor
刘卓钺
杨迎春
沈伟锋
曾重
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201780055457.4A priority Critical patent/CN110121874B/zh
Priority to PCT/CN2017/114449 priority patent/WO2019109209A1/zh
Publication of WO2019109209A1 publication Critical patent/WO2019109209A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Definitions

  • the present application relates to the field of computers, and in particular, to a memory data replacement method, a server node, and a data storage system.
  • the storage service caches data through memory to speed up write operations or subsequent read operations, reducing request latency.
  • the service loads the data from the persistent store into memory, and the data in memory remains in memory as a data cache after a single use. If there is a request to read the data already existing in the data cache, it is called a cache hit, and the result can be directly returned from the data cache without re-reading the data from the persistent storage, which greatly improves the reading speed.
  • the present application discloses a memory data replacement method, a server node, and a data storage system.
  • the data type of the data stored in the flash memory is referred to, and the data of the main type is preferentially replaced with the fast memory according to the data type, thereby retaining the data of the slave type.
  • the present application discloses a memory data replacement method applied to a data storage system including a client and a plurality of server nodes.
  • the method includes: a first server node of the plurality of server nodes receiving a read request, the first read request for reading the first data to be read, and detecting that the first data to be read is not in the fast memory of the first server node Afterwards, the first server node determines the data to be replaced in the data stored in the flash memory according to the data type of the data stored in the flash memory, and replaces the data to be replaced with the first data to be read.
  • the first server node is connected to a fast memory and a slow memory, and the fast memory is a cache of the slow memory.
  • the data providing the access operation to the client belongs to the main type of data
  • the data of the main type of the other server node belongs to the first server node in the backup of the first server node. From the type of data. That is, the data written by the client and capable of providing read operations to the client belongs to the main type of data, and is written by other servers.
  • a data that is capable of providing read operations to other servers for data consistency check by other servers belongs to the type of data.
  • a server node that stores a copy of its primary type is called a master node
  • a node that stores a copy of its slave type data is called a slave node.
  • the client accesses the data, it sends an access request to the master node.
  • the master node Before the master node returns data to the client, it needs to read the data copy of the primary type of the data at the primary node and the data copy of the slave type at the secondary node. Consistency check based on the primary type of data copy and the secondary type of data copy.
  • the present application distinguishes the data types in the fast memory, and the server node determines the data blocks to be replaced according to the data type, and may retain the slave type data in the fast memory according to the need, and increase the slave type.
  • the hit rate of the data in the flash memory thereby reducing the delay of the master node reading data from the slave node, increasing the overall performance of the system.
  • the data stored in the fast memory has a corresponding data type identifier.
  • the method further includes: determining, by the first server node, the data type of the first data to be read, and replacing the data to be replaced with the first data to be read, and setting and waiting for the first data according to the data type of the first data to be read. Read the data type identifier corresponding to the data.
  • one bit can be used to represent the data type of the data. If the data is a primary data type, the corresponding data type identifier is “0”. If the data is a slave type data, the corresponding data type identifier is “1”. . Using the data type identifier to mark the data type in the flash memory, the first server node can quickly determine the data type of the data, and determine the data to be replaced according to the data type.
  • the determining, by the first server node, the data type of the first data to be read includes: determining, by the first server node, the read request The data type of the data to be read. If the read request comes from the client, the first data to be read belongs to the data of the main type. If the read request comes from another server node, the first data to be read belongs to the data of the slave type.
  • the client When the client accesses the data, it sends a read request to the master node that copies the data of the primary type of the data. If the read request comes from the client, it indicates that the first data to be read is the main type of data on the node. Before returning the first data to be read to the client, the master node needs to send a read request to the slave node to read the data copy of the slave type, thereby performing data consistency check. If the read request comes from another server node, it means that the first data to be read is the data of the slave type in this node.
  • the determining, by the first server node, the data type of the first data to be read includes: the first server node is to be read according to the first Taking the key value of the data to calculate the server node to which the first data to be read belongs, if the calculation result is the first server node, the first data to be read belongs to the data of the main type, and if the calculation result is not the first server node, The first data to be read belongs to the data of the slave type.
  • the read request carries a key value of the first data to be read, and the key value is an index of the first data to be read.
  • the client may calculate the primary node of the data to be stored according to the key value of the data to be stored, and send the data to be stored to the primary node.
  • the first server node may also calculate a primary node of the first data to be read according to the key value of the first data to be read, and if the calculated primary node is the first server node, the first to be read Take the data as the primary type of data of the first server node. If the calculated master node is not the first server node, the first data to be read is the data of the slave type of the first server node.
  • the first server node node can determine the data type of the data to be stored when the write request is received.
  • the data to be stored is stored in different areas of the slow memory according to the data type of the data to be stored.
  • the slow memory of the first server node can be divided into a primary partition and a secondary partition, wherein the primary partition is used to store data of a primary type, and the secondary partition is used to store data of a secondary type.
  • the first server node can determine the data type of the first data to be read of the data according to the location where the data is stored in the slow memory.
  • the method further includes: the first server node receiving the first write request from the client, where the first write request is used
  • the first to-be-stored data is stored, the first to-be-stored data is written into the flash memory, and the data type identifier of the first to-be-stored data is set to be a main type.
  • the first server node may first write the first to-be-stored data into the flash memory. Because the first write request comes from the client, the first server node can determine that the data to be written is the main type of data.
  • the method further includes: the first server node sends a second write request to the second server node, where the second write request is used The first to-be-stored data is written to the second server node.
  • the second server node is a slave node of the first server node, and the first server node stores the backup of the data to be stored in the slave node of the first server node, thereby achieving the purpose of disaster tolerance.
  • the method further includes: receiving, by the first server node, a third write request, a third write request, from the third server node, And storing the third data to be stored, writing the third data to be stored into the fast memory, and setting the data type identifier of the third data to be stored as the slave type.
  • the third server node is a primary node of the first server node, and the third write request is used to store a backup of the primary type data of the third server node in the first server node.
  • the first server node can preferentially retain the type of data in the flash memory, thereby maximizing the hit rate of the type of data in the fast memory.
  • the first server node is stored in the fast memory according to the data type of the data stored in the flash memory Determining the data to be replaced in the data includes: the first server node determines the data to be replaced according to the historical access status and the data type of the data in the flash memory.
  • the data to be replaced is determined according to the data type and the historical access status of the data, and the delay of reading data from the slow memory and the network delay may be considered in a compromise.
  • the present application provides a readable medium comprising executing instructions that, when executed by a processor of a computing device, perform any of the possible implementations of the first aspect or the above first aspect The method in the way.
  • the present application provides a computing device, including: a processor, a memory, and a bus; a memory for storing execution instructions, a processor and a memory connected by a bus, and when the computing device is running, the processor performs execution of the memory storage
  • the instructions are to cause the computing device to perform the method of any of the possible implementations of the first aspect or the first aspect above.
  • the present application discloses a server node, the server node includes: a receiving unit, configured to receive a read request, and a determining unit, configured to: when the first data to be read is not in the fast memory of the server node, according to the fast The data type of the data stored in the memory determines the data to be replaced in the data stored in the flash memory, wherein the server node is connected with a fast memory and a slow memory, and the fast memory is a cache of the slow memory, and the data of the server node includes the main Type of data and type of data, the data provided by the server node to the client belongs to the main type of data, and the data of the main type of the other server node in the backup of the server node belongs to the type of data; the replacement unit is used for The first data to be read replaces the data to be replaced.
  • the data stored in the fast memory has a corresponding data type identifier; the server node further includes: a determining unit, configured to determine the first data to be read a data type; a setting unit, configured to set a data type identifier corresponding to the first data to be read according to a data type of the first data to be read.
  • the determining unit is configured to determine, according to the read request, a data type of the first data to be read, if the read request is from the client, Then, the first data to be read belongs to the data of the main type, and if the read request is from another server node, the first data to be read belongs to the data of the slave type.
  • the determining unit is configured to calculate, according to the key value of the first data to be read, the server to which the first data to be read data belongs The node, if the calculation result is the server node, the first data to be read belongs to the main type data of the server node, and if the calculation result is not the server node, the first data to be read belongs to the slave type data of the server node. .
  • the slow memory stores data of different data types at different locations; the determining unit is configured to use the first data to be read The data type of the first data to be read is determined at a location stored in the slow memory.
  • the receiving unit is further configured to receive a first write request from the client, where the first write request is used to store the first to-be-supplied
  • the server node further includes a writing unit, configured to write the first to-be-stored data into the flash memory, and the setting unit is further configured to set the data type identifier of the first to-be-stored data to be a main type.
  • the server node further includes: a sending unit, configured to send a second write request, a second write request, to the second server node For writing the first to-be-stored data to the second server node.
  • the receiving unit is further configured to receive a third write request from the third server node, where the third write request is used to store the first
  • the server node further includes a writing unit for writing the third to-be-stored data into the flash memory; the setting unit is further configured to: The data type identifier of the third data to be stored is set to the slave type.
  • the determining unit is configured to determine data to be replaced from data of a main type stored in the fast memory.
  • the determining unit is configured to determine the data to be replaced according to the historical access situation and the data type of the data in the fast memory. .
  • the fourth aspect is the device implementation manner corresponding to the method of the first aspect, and the description in the first aspect or any possible implementation manner of the first aspect corresponds to the fourth aspect or any possible implementation manner of the fourth aspect, This will not be repeated here.
  • the present application discloses a data storage system, where a system includes a client and a plurality of server nodes, wherein a first server node of the plurality of servers is connected with a fast memory and a slow memory, and the fast memory is a slow memory.
  • the first server section is configured to receive a read request, and when the first data to be read is not in the flash memory, determine the data to be replaced in the data stored in the flash memory according to the data type of the data stored in the flash memory, and The data to be replaced is replaced by the first data to be read, wherein the data of the first server node includes the data of the main type and the data of the slave type, and the data provided by the first server to the client belongs to the data of the main type, and the other server nodes The backup of the primary type of data in the server node belongs to the type of data.
  • the data stored in the fast memory has a corresponding data type identifier; the first server node is further configured to determine a data type of the first data to be read, and And setting a data type identifier corresponding to the first data to be read according to the data type of the first data to be read.
  • the first server node is configured to determine, according to the read request, a data type of the first data to be read, if the read request is from the client At the end, the first data to be read belongs to the data of the main type, and if the read request is from another server node, the first data to be read belongs to the data of the slave type.
  • the first server node is configured to calculate, according to the key value of the first data to be read, the first data to be read The server node, if the calculation result is a server node, the first data to be read belongs to the data of the main type, and if the calculation result is not the server node, the first data to be read belongs to the data of the slave type.
  • the slow memory stores data of different data types at different locations; the first server node is configured to read according to the first The data type of the first data to be read is determined by taking the location where the data is stored in the slow memory.
  • the first server node is further configured to receive a first write request from the client, where the first write request is used to store the first As soon as the data is to be stored, the first data to be stored is written into the flash memory, and the data type identifier of the first data to be stored is set as the main type.
  • the first server node is configured to send a second write request to the second server node of the multiple server nodes, and the second The write request is for writing the first to-be-stored data to the second server node.
  • the first server node is further configured to receive a third write request from the third server node of the multiple server nodes, The third write request is used to store the third to-be-stored data, write the third to-be-stored data into the flash memory, and set the data type identifier of the third to-be-stored data to the slave type.
  • the first server node is configured to determine data to be replaced from data of a main type stored in the flash memory.
  • the first server node is configured to determine, according to a historical access situation and a data type of the data in the fast memory. Replace the data.
  • the fifth aspect is the system implementation manner corresponding to the method of the first aspect, and the description in the first aspect or any possible implementation manner of the first aspect is applicable to any possible implementation manner of the fifth aspect or the fifth aspect, This will not be repeated here.
  • the first server node selects the data block to be replaced in the fast memory according to the data type, and can increase the proportion of the data of the type in the fast memory, when the other server node reads the first server node to save
  • the data of the slave type is used, it can have a large data hit rate, thereby reducing the waiting time of other server nodes and reducing the delay of the system read operation.
  • FIG. 1 is a schematic diagram showing the logical structure of a data storage system according to an embodiment of the present application
  • FIG. 2A is a schematic structural diagram of a server node according to an embodiment of the present application.
  • FIG. 2B is a schematic structural diagram of a server node according to an embodiment of the present application.
  • Figure 3 is a schematic diagram of a data access delay situation
  • FIG. 5 is a schematic flowchart of a method for replacing a memory data according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a data access delay according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram showing the logical structure of a server node according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a logical structure of a server node according to an embodiment of the present application.
  • a piece of client data has several copies in the data storage system.
  • the data provided to the client for access operations belongs to the main type of data.
  • the data of the main type of the other server node in the backup of the first server node belongs to the data of the slave type of the first server node. That is, the data written by the client, which can provide the read operation to the client belongs to the main type of data, is written by other servers, and can provide read operations to other servers, so that the data for other servers to perform data consistency check belongs to Type of data.
  • the server node that stores a copy of its primary type is called the primary node
  • the node that stores its copy of the data from the type is called the secondary node.
  • the client may be a client device or a terminal device, and may be a computing device loaded with client software.
  • the embodiment of the present application does not limit the specific implementation form of the client.
  • the data access speed of the memory usually cannot keep up with the speed of the processor, thereby affecting the execution efficiency of the computer.
  • multiple levels of memory may be set between the processor and the slow memory, and the access speed of the higher level memory is faster.
  • FIG. 1 is a schematic diagram of a data storage system architecture according to an embodiment of the present application.
  • the data storage system includes a client 101 and a plurality of server nodes, and three server nodes 103-1, 103-2, and 103-3 are exemplarily shown in the drawing.
  • Client 101 and a plurality of server nodes communicate over network 102.
  • Each server node is connected to a flash memory and a slow memory, wherein the flash memory is used as a cache for the slow memory.
  • the connection of the server node to the fast memory and the slow memory means that the first server node can establish a communication connection with the slow memory, but the embodiment of the present application does not limit the specific connection form between the server node and the fast memory and the slow memory, and the server node It can be connected to fast memory and slow memory in any form.
  • Server nodes can access fast and slow memory through connections.
  • the embodiment of the present application does not limit the specific implementation forms of the fast memory and the slow memory.
  • the slow memory and the fast memory are a relative concept for expressing that the slow memory access speed is slower than the fast memory access speed.
  • the slow memory may provide external storage for the user to provide a persistent storage server, and the external storage may also be auxiliary storage, and the storage medium may be magnetic medium (for example, floppy disk, hard disk, magnetic tape), optical medium (such as optical disk). Or a semiconductor medium (such as solid state disk (English name: solid state disk, abbreviation: SSD)).
  • the flash memory is any memory that has a faster access speed than the slow memory, and the flash memory can be a volatile memory or a non-volatile memory.
  • the fast memory can be the memory of the server node, and the memory generally becomes the main memory, which is a storage space that the processor can directly address, generally a random access memory (English name: Random-access memory, abbreviation: RAM), specific It can be static random access memory (English full name: Static Random Access Memory, abbreviated SRAM) or dynamic random access memory (English full name: Dynamic Random Access Memory, abbreviation: DRAM).
  • RAM Random-access memory
  • SRAM Static Random Access Memory
  • DRAM Dynamic Random Access Memory
  • the slow memory may be any type of memory
  • the fast memory may be any type of memory that is faster than the slow memory, and a faster memory may exist between the flash memory and the processor. This is not limited.
  • the slow memory access speed is less than the processing speed of the processor, and the fast memory can be used as a buffer for data exchange between the slow memory and the processor.
  • the server node wants to read data, if the data to be read is not found in the cache of a higher level than the flash memory, the server node first searches for the required data from the flash memory, and if found, reads it if If it is not found, it is found from the slow memory and the data to be read found in the slow memory is written into the flash memory. Because fast memory runs faster than slow memory, the role of fast memory is to help the hardware run faster.
  • the server node 103-1 is connected to the flash memory 104-1 and the slow memory 105-1.
  • the fast memory 104-1 may be the memory of the server node 103-1
  • the slow memory 105-1 may be the external storage of the server node 103-1.
  • the server node 103-1 When the server node 103-1 receives the write request, in order to speed up the write speed, the data to be stored is first written into the flash memory 104-1, and then the data in 104-1 is written into the slow memory 105-1.
  • the data to be read When server node 103-1 receives When the request is read, the data to be read is also first searched in the flash memory 104-1. If there is data to be read in the flash memory 104-1, the server node 103-1 directly reads the data in the flash memory 104-1. If there is no data to be read in the flash memory 104-1, the server node 103-1 searches for the data to be read in the slow memory 105-1, and writes the found data to be read into the flash memory. 104-1, and reading data in the flash memory 104-1.
  • server node 103-1 If the server node 103-1 writes the data to be read found in the slow memory 105-1 to the flash memory 104-1, there is not enough free space in the flash memory 104-1, the server node 103-1 It is necessary to determine the data to be replaced in the flash memory 104-1 and replace the data to be replaced with the data to be read.
  • the server node 103-1 may refer to the data type when determining the data to be replaced in the flash memory 104-1, for example, preferentially replacing the data of the main type with the fast memory 104-1, and preferentially retaining the data of the slave type.
  • the server nodes read the data of the slave type saved at the server node 103, there may be a large data hit rate, thereby reducing the waiting time of other server nodes, and generally reducing the read operation delay.
  • the network 102 can be the Internet, an intranet (English: intranet), a local area network (English name: localarea network, abbreviation: LAN), a wide area network (English full name: wide area network, abbreviation: WAN), a storage area network (English full name) :storage area network, abbreviation: SAN), etc., or any combination of the above networks.
  • an intranet English: intranet
  • a local area network English name: localarea network, abbreviation: LAN
  • a wide area network English full name: wide area network, abbreviation: WAN
  • a storage area network English full name:storage area network, abbreviation: SAN
  • the main memory type and the slave type data are stored in the slow memory.
  • the data of the main type held in the slow memory 105-1 is data that can provide a direct access operation to the client 101.
  • the primary type of data is transmitted by the client 101 over the network 102 to the server node 103-1 and is stored by the server node 103-1 in the slow memory 105-1.
  • the data of the slave type stored in the slow memory 105-1 is a backup of the master data of the other server node at the server node 103-1.
  • the server node 103-2 may store the main type of data stored in the slow memory 105-2 at the slow memory 105-1 and the server of the server node 103-1. Data backup is performed in the slow memory 105-3 of the node 103-3.
  • the server node 103-1 can store the data of the main type held in the slow memory 105-1 in the slow memory 105-2 of the server node 103-2 and the slow memory 105-3 of the server node 103-3. Make a backup.
  • the client 101 needs to read the main type of data stored in the slow memory of the server node 103-1
  • the client 101 sends a read request to the server node 103-1
  • the server node 103-1 receives the client 101.
  • the data to be read is read from the flash memory 104-1 or 105-1, and a read request is sent to the server nodes 103-2 and 103-3 to read the data to be read at the server node 103.
  • -2 and data backup of server node 103-3 are examples of server node 103-3.
  • the server node 103-1 After the reading is successful, the server node 103-1 performs consistency check on the three pieces of data. If the three pieces of data are the same, the data to be read is returned to the client 101. If the three pieces of data are different, the server node 103- 1 Data recovery can be performed and the recovered data is returned to the client 101. For example, the first server node can use error correction and correction when data is read by Error Correction and Correction (ECC). When data is written, the first server node generates an ECC signature based on the data. If an error is found in the primary type of data copy and the data copy consistency check of the type, the ECC algorithm is used to correct the detected error.
  • the ECC algorithm may be a BCH code or a low density parity check code (English name: Low Density Parity Check Code, abbreviation: LDPC).
  • each server node may have one or more slave nodes.
  • the server node 103-1 has two slave nodes 103-2 and 103-3, but the embodiment of the present application does not limit the server. The number of slave nodes of the node.
  • the backup of the data of the main type of the other server nodes stored in the slow storage 105-1 is the server node. 103-1 from the type data.
  • the data of the slave type stored in 105-1 is transmitted to the server node 103-1 by the other server node, and is stored in the slow memory 105-1 by the server node 103-1.
  • a read request is sent to the server node 103-1 to read the backup data (slave type data) stored in the slow memory 105-1.
  • FIGS. 2A and 2B are schematic diagrams showing the structure of a server 103 according to an embodiment of the present application.
  • the server 103 includes a processor 201 that is coupled to the system memory 205.
  • the processor 201 can be a central processing unit (CPU), an image processing unit (GPU), a field programmable gate array (English name: Field Programmable Gate Array, abbreviation: FPGA), or a digital signal processor ( English: digital signal processor, DSP) and other calculation logic or a combination of any of the above calculation logic.
  • the processor 201 can be a single core processor or a multi-core processor.
  • the processor 201 further includes data replacement logic 210, which may be a specific hardware circuit or a firmware module integrated in the processor 201. If the data replacement logic 210 is a specific hardware circuit, the data replacement logic 210 performs the method of the embodiment of the present application. If the data replacement logic 210 is a firmware module, the processor 210 executes the firmware code in the data replacement logic 210 to implement the present application. The technical solution of the embodiment.
  • the data replacement logic 210 includes: (1) logic for receiving a read request (circuit/firmware code); (2) logic for detecting whether the data to be read is in the flash memory (circuit/firmware code) (3) Determining logic (circuit/firmware code) of data to be replaced in data stored in the flash memory according to data type of data stored in the flash memory; (4) logic for replacing data to be replaced with data to be read (circuit /firmware code).
  • the bus 209 is used to transfer information between the components of the server 103.
  • the bus 209 can use a wired connection or a wireless connection. This application does not limit this.
  • the bus 209 is also connected to an auxiliary memory 202, an input/output interface 203, and a communication interface 204.
  • the secondary storage 202 is also generally referred to as external storage, and the storage medium of the secondary storage 202 may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, an optical disk), or a semiconductor medium or the like.
  • the auxiliary storage 202 may further include a remote memory separate from the processor 201, such as a network disk accessed through the communication interface 204 and the network 102 (including a network file system (English name: Network File System, abbreviation: NFS) network or fleet file system).
  • the slow memory may include a secondary memory 202 for storing a copy of the data.
  • the input/output interface 203 is connected to an input/output device for receiving input information and outputting an operation result.
  • the input/output device can be a mouse, a keyboard, a display, or an optical drive.
  • Communication interface 204 enables communication with other devices or networks 102 using transceivers such as, but not limited to, transceivers, which may be interconnected with network 102 in a wired or wireless form.
  • system memory 205 can include software such as operating system 208 (eg, Darwin, RTXC, LINUX, UNIX, OS X, WINDOWS, or embedded operating system (eg, Vxworks)), application 207, and data.
  • operating system 208 eg, Darwin, RTXC, LINUX, UNIX, OS X, WINDOWS, or embedded operating system (eg, Vxworks)
  • application 207 eg, Vxworks
  • Replace module 206 and the like.
  • the processor 201 executes the data replacement module 206 to implement the technical solution of the embodiment of the present application.
  • the data replacement module 206 includes: (1) code for receiving a read request; (2) code for detecting whether data to be read is in the flash memory; (3) data type for data stored according to the flash memory In fast storage A code for determining data to be replaced among data stored in the device; (4) a code for replacing data to be replaced with data to be read.
  • the flash memory may include a system memory 205 for acting as a cache of the auxiliary memory 202.
  • Figures 2A and 2B are merely examples of servers 103, which may include more or fewer components than those shown in Figures 2A and 2B, or have different component configurations. Meanwhile, the various components shown in FIGS. 2A and 2B can be implemented in hardware, software, or a combination of hardware and software.
  • the server nodes are slave nodes of other server nodes, and the data stored in the memory of the server node is similar, and a large proportion of the data is the same.
  • the master node In the process of the master node reading each data copy, the master node sends a read request to multiple slave nodes, and respectively reads the data copies stored on each slave node. Multiple data copies of the same data are the same. If the fast memory of each server node adopts the same data replacement policy and does not distinguish the data types, the data cached in the fast memory will also have a large proportion of data. identical.
  • the server node 103-2 and the server node 103-3 are slave nodes of the server node 103-1, that is, the data of the main type of the server node 103-1 will be at the server node 103-2 and the server node 103-3.
  • a backup of the data is stored in the memory.
  • the server node 103-1 sequentially searches for the data to be read in the flash memory 104-1 and the slow memory 105-1, if in the flash memory 104-1. If the data to be read is found, a hit occurs, and the data to be read can be directly read from the flash memory 104-1.
  • the server node 103-1 needs to read the data to be read from the slow memory 105-1. At the same time, the server node 103-1 needs to send a read request to its own slave node server node 103-2 and server node 103-3 to read the data backup of the data to be read at the server node 103-2 and the server node 103-3. .
  • a read flow similar to server node 103-1 will be experienced in server node 103-2 and server node 103-3.
  • the server node 103-2 and the server node 103-3 return the read backup of the data to be read back to the server node 103-1.
  • the server node 103-1 and the received data perform consistency check of the data.
  • the server node 103-1, the server node 103-2, and the server node 103-3 are slave nodes to each other, the data stored in the flash memory 104-1, the flash memory 104-2, and the flash memory 104-3 are similar. If the server node 103-1, the server node 103-2, and the server node 103-3 adopt the same data replacement policy, and the data replacement policy does not distinguish between the primary type data and the slave type data, then the data reading process In the middle, the fast memory 104-1, the fast memory 104-2, and the fast memory 104-3 have a high probability of being hit at the same time or missing.
  • the latency of client access requests is an important metric. The lower the latency of access requests, the better the service performance.
  • the client's read request latency mainly includes three aspects: the read request and the network transmission delay of the data, the processing logic delay of the server node, the storage device delay (read from the slow memory or directly from the fast memory). The processing logic delay can be ignored compared to the network delay and the storage device delay.
  • the storage device delay is mainly the delay in reading data from the slow memory when data loss occurs in the flash memory.
  • the main delay of the access request is the network delay and the latency of reading the slow memory.
  • T cache is the delay of the server node reading data from the fast memory
  • T IO is the delay of the server node reading data from the slow memory
  • T net is the one-way network delay between the two server nodes.
  • the delay required by the client 101 to read data is at least:
  • T cache +T IO is the delay of the server node 103-1 reading the data to be read from the slow memory 105-1.
  • 2T net +T cache +T IO is the delay required for the server node 103-1 to read the backup of the data to be read from the server node 103-2 and the server node 103-3, respectively.
  • the delay required by the client 101 to read data is at least:
  • the T cache is a delay for the server node 103-1 to read the data to be read from the flash memory 104-1.
  • 2T net +T cache is the delay required for the server node 103-1 to read the backup of the data to be read from the server node 103-2 and the server node 103-3, respectively.
  • the embodiment of the present application provides a data replacement method for a memory, when selecting data to be replaced in the fast memory of the first server node, referring to the data type of the data stored in the flash memory, according to the data type.
  • the main type of data is preferentially replaced by the fast memory, thus retaining the data of the slave type.
  • method 500 includes:
  • S501 The first server node receives the read request.
  • the read request may be a read request from a client, or may be a read request from another server node.
  • the read request is used to read the data to be read.
  • the read request is used to read the data of the primary type of the first server node. If it is a read request from another server node, the read request is used to read the data of the slave type of the first server node.
  • S502 The first server node detects that the data to be read is not in the fast memory of the first server node.
  • the first server node is connected to a fast memory and a slow memory, and the fast memory is a cache of the slow memory.
  • the connection between the first server node and the fast memory and the slow memory means that the first server node can establish a communication connection with the slow memory, but the embodiment of the present application does not limit the connection form between the first server node and the fast memory and the slow memory.
  • the first server node can be linked to the fast memory and the slow memory in any form.
  • the first server node After receiving the read request, the first server node first searches for the data to be read in the flash memory. If the data to be read is in the fast memory of the first server node, the first server node can read from the fast memory. Read the data. If the data to be read is not in the fast memory of the first server node, the first server node needs to read the data to be read from the slow memory of the first server node, and write the data to be read to the first server node. In the fast memory.
  • the first server node determines the data to be replaced in the data stored in the fast memory according to the data type of the data stored in the flash memory.
  • the first server node can read from the slow memory The data is read and the data to be read is directly stored in the flash memory.
  • the first server node needs to determine the data to be replaced in the flash memory.
  • the data stored in the flash memory has a corresponding data type identifier, and the data type represents a data type for representing the data. For example, one bit can be used to represent the data type of the data. If the data is a primary data type, the corresponding data type identifier is “0”. If the data is a slave type data, the corresponding data type identifier is “1”. .
  • the first server node may determine the data type of the data according to the data type identifier corresponding to the data, and select the data to be replaced from the fast memory according to the data type of the data.
  • the first server node may determine the data to be replaced from the data of the main type stored in the flash memory. That is, the first server node preferentially saves the type of data in the flash memory, thereby increasing the hit rate of the slave type data in the flash memory, thereby reducing the delay of the master node accessing data of the first server node.
  • the first server node may also select the data to be replaced according to the case and data type in which the data stored in the flash memory is accessed. For example, the first server node can select the data to be replaced according to the popularity of the data and the data type.
  • the heat of the data can be the frequency at which the data is accessed within a certain time or the time from when the last data was accessed.
  • the first server node can select the data to be replaced according to the replacement coefficient P1. Specifically, the first server node selects the data with the smallest replacement coefficient P1 as the data to be replaced.
  • the first server node can select the data to be replaced according to the replacement coefficient P2. Specifically, the first server node selects the data with the largest replacement coefficient P2 as the data to be replaced.
  • the first server node node can also collect the delay T cache of the server node reading data from the fast memory, the delay T IO of the server node reading the data from the slow memory, and the one-way network delay between the two server nodes. T net . And according to T cache , T IO , T net and data type to select the data to be replaced. Specifically, the first server node calculates the replacement coefficient P3 according to the T cache , T IO , T net and the data type.
  • the first server node can select the data to be replaced according to the replacement coefficient P3. Specifically, the first server node selects the data with the smallest replacement coefficient P3 as the data to be replaced.
  • the present application does not limit the specific manner of selecting data to be replaced, and only needs to determine the data type when the first server node selects the data to be replaced, and selects the data to be replaced according to the data type. It is only necessary to replace the fast memory from the data type, and the main data type is easier to replace the fast memory, so as to reduce the data access delay.
  • the first server node node may also select the data to be replaced in combination with the data type and the least recently used (Least Recently Used, LRU) or Least Frequently Used (LFU) algorithm. .
  • the server node 103-1 when the server node 103-1 receives the read request from the client 101, the server node 103-1 searches its own memory for the data of the main type corresponding to the read request, and sends the data to the server node 103-2. And the server node 103-3 reads the data of the slave type corresponding to the read request.
  • the data of the slave type Since the data of the slave type is preferentially retained in the flash memory, the data of the main type has a large missing rate in the flash memory 104-1, and the server node 103-1 has a large probability to go to the slow memory 105-1.
  • the delay in which the server node 103-1 reads the main type of data from the slow memory 105-1 is T cache + T IO .
  • the server node 103-1 reads the delay of the type data from the fast memory of the server node 103-2 and the server node 103-3 to 2T net + T cache .
  • the server node 103-1 reads the delay of the primary type data and the slave type data. for:
  • T MAX(T cache +T IO ,2T net +T cache )
  • the master node reads the main type of data and reads the slave type data with similar delays, avoiding the waiting of the master node, and rationally utilizing the fast memory.
  • S504 The first server node replaces the data to be replaced with the data to be read.
  • the data to be replaced in the flash memory is replaced with the data to be read.
  • the first server node further determines a data type of the data to be read, and sets a data type identifier corresponding to the data to be read according to the data type of the data to be read. For example, one bit is used as the data type identifier, the data type identifier is “0” for the main type, and the data type identifier is “1” for the slave type. Then, the first server node determines that the data to be read is the main type of data, and sets the new data class identifier corresponding to the data to be read to “0”. If the first server node determines that the data to be read is a slave type data, Then, the first server node sets the data type identifier corresponding to the data to be read to “1”.
  • the first server node may determine the data type of the data to be read according to the read request. If the read request is from the client, the data to be read belongs to the data of the main type, and if the read request is from another server node, the data to be read belongs to Type of data.
  • the first server node may further calculate a primary node to which the data to be read belongs according to the key value of the data to be read. If the calculation result is the first server node, the data to be read belongs to the primary type of data, and if the calculation result is not the first The server node, the data to be read belongs to the data of the slave type.
  • the slow memory stores data of different data types at different locations, that is, the data of the main type and the location of the data of the slave type are stored in the slow memory.
  • the first server node can determine the data type of the data to be read according to the location of the data to be read stored in the slow memory.
  • the first server node After the first server node receives the first write request from the client, the first server node first writes the data to be stored of the first write request to the fast memory of the first server node, and sets the data type of the data to be stored to Main type. For example, one bit is used as the data type identifier, the data type identifier is “0” for the main type, and the data type identifier is “1” for the slave type. Then, the first server node sets the new data class identifier corresponding to the data to be stored to “0”.
  • the first server node When the first server node writes the data to be stored of the first write request to the fast memory of the first server node, if the fast memory of the first server node holds the same data key value as the data to be stored of the first write request Data, that is, the historical version of the data to be stored in which the first write request is stored in the fast memory of the first server node, and the first server node replaces the data to be stored in the flash memory with the data to be stored using the data to be stored of the first write request.
  • the data If there is no data in the fast memory of the first server node that is the same as the data key to be stored of the first write request, that is, the first write request does not exist in the fast memory of the first server node.
  • the historical version of the stored data the first server node determines the data to be replaced from the flash memory, and replaces the data to be replaced with the data to be stored. The selection process of the data to be replaced has been described above, and will not be described herein.
  • the first server node After receiving the first write request, the first server node further sends a second write request to the second server node, where the second write request is used to write the data to be stored into the second server node. Thereby completing the data backup of the data to be stored.
  • the second server node is a slave node of the first server node.
  • the first server node After the first server node receives the third write request from its third server node, the first server node first writes the data to be stored of the third write request to the fast memory of the first server node, and stores the data to be stored.
  • the data type is set to the slave type. For example, one bit is used as the data type identifier, the data type identifier is “0” for the main type, and the data type identifier is “1” for the slave type. Then, the first server node sets the new data class identifier corresponding to the data to be stored to “1”.
  • the third server node is the primary node of the first server node.
  • the first server node when the first server node writes the data to be stored of the third write request to the flash memory of the first server node, if the data key to be stored with the third write request is saved in the flash memory of the first server node
  • the data of the same value that is, the historical version of the data to be stored in which the third write request is stored in the fast memory of the first server node
  • the first server node replaces the data to be stored in the flash memory with the data to be stored of the third write request. Data with the same key value.
  • the first server node determines the data to be replaced from the flash memory and replaces the data to be replaced with the data to be stored. The selection process of the data to be replaced has been described above, and will not be described herein.
  • FIG. 7 is a schematic diagram of a logical structure of a server node 700 according to an embodiment of the present application.
  • the server node 700 is applied to a data storage system, where the data storage system includes a client and a plurality of server nodes 700, as shown in FIG.
  • the node 700 includes a receiving unit 702, a determining unit 704, and a replacing unit 706.
  • the receiving unit 702 is configured to receive a read request.
  • the receiving unit 702 is configured to perform step S501 of FIG.
  • the determining unit 704 is configured to determine data to be replaced in the data stored in the fast memory according to the data type of the data stored in the fast memory when the data to be read is not in the fast memory of the server node, wherein the server node is connected quickly Memory and slow memory.
  • the fast memory is a cache of slow memory.
  • the data of the server node includes data of the main type and data of the slave type.
  • the data provided to the client belongs to the data of the main type, and the main type of the other server node.
  • the backup of the data in the server node belongs to the type of data.
  • the determining unit 704 is configured to perform step S503 in FIG.
  • the replacing unit 706 is configured to replace the data to be replaced with the data to be read.
  • the replacement unit 706 is configured to perform step S504 in FIG.
  • the data stored in the flash memory has a corresponding data type identifier.
  • the server node 700 further includes: a determining unit 708, configured to determine a data type of the data to be read; and a setting unit 710, The data type identifier corresponding to the data to be read is set according to the data type of the data to be read.
  • the determining unit 708 is configured to determine, according to the read request, a data type of the data to be read. If the read request is from the client, the data to be read belongs to the data of the primary type, and if the read request is from another server node, the read request is to be read. Take data that belongs to the type of data.
  • the determining unit 708 is configured to calculate, according to the key value of the data to be read, a server node to which the data to be read belongs, and if the calculation result is a server node, the data to be read belongs to the main type of data, and if the calculation result is not the server Node, the data to be read belongs to the data of the slave type.
  • the slow memory stores data of different data types at different locations
  • the determining unit 708 is configured to determine, according to the location where the data to be read is stored in the slow memory, the data type of the data to be read.
  • the receiving unit 702 is further configured to receive a first write request from the client.
  • the server node 700 further includes a writing unit 712, configured to write the to-be-stored data of the first write request into the flash memory, and the setting unit 710 It is also used to set the data type identifier of the data to be stored of the first write request as the main type.
  • the server node 700 may further include a sending unit 714, configured to send a second write request to the second server node, where the second write request is used to write the data to be stored to the second server node.
  • a sending unit 714 configured to send a second write request to the second server node, where the second write request is used to write the data to be stored to the second server node.
  • the receiving unit 702 is further configured to receive a third write request from the third server node.
  • the server node 700 further includes a writing unit 712, configured to write the data to be stored of the third write request into the flash memory, and set
  • the unit 710 is further configured to set the data type identifier of the data to be stored of the third write request as a slave type.
  • the determining unit 704 is configured to determine data to be replaced from data of a main type stored in the fast memory.
  • the determining unit 704 is configured to determine data to be replaced according to historical access conditions and data types of data in the flash memory.
  • the receiving unit 702 and the sending unit 714 may be implemented by the processor 201 and the communication interface 204 in FIG. 2A, or by the processor 201, the communication interface 204 and the system memory 205 in FIG. 2B.
  • the data replacement module 206 is implemented.
  • the determining unit 704, the replacing unit 706, the determining unit 708, the setting unit 710 and the writing unit 712 may be specifically implemented by the data replacement logic 210 in the processor 201 in FIG. 2A, or by FIG. 2B.
  • the processor 201 in the system 201 and the data replacement module 206 in the system memory 205 are implemented.
  • the data replacement module 206 may include a receiving unit 704, a replacing unit 706, and a replacing unit 706.
  • the data replacement module 206 may further include a receiving unit 702, a determining unit 708, a setting unit 710, a writing unit 712, and a sending unit 714.
  • the embodiment of the present application is an apparatus embodiment of the first server node corresponding to the method embodiment of FIG. 5, and the feature description of the embodiment of FIG. 5 is applicable to the embodiment of the present application, and details are not described herein again.

Landscapes

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

Abstract

本申请实施例提供了一种存储器数据替换方法、服务器节点和数据存储系统。该方法应用于数据存储系统,该数据存储系统包含客户端和多个服务器节点。该方法包括:多个服务器节点中的第一服务器节点接收读请求,当检测到待读取数据不在第一服务器节点的快速存储器中后,第一服务器节点根据快速存储器中存储的数据的数据类型在快速存储器中存储的数据中确定待替换数据,并使用待读取数据替换待替换数据。其中,第一服务器节点连接有快速存储器和慢速存储器,快速存储器为慢速存储器的缓存。可以通过本方法增加从类型的数据在快速存储器中的比例,从而减少了其他服务器节点读取从类型的数据的等待时间,达到减少系统读操作时延的目的。

Description

一种存储器数据替换方法、服务器节点和数据存储系统 技术领域
本申请涉及计算机领域,尤其涉及一种存储器数据替换方法、服务器节点和数据存储系统。
背景技术
当前存储服务需要对外提供可扩展的服务能力,因此主流的存储服务都是以分布式系统的形式存在。在分布式存储服务中,为了保证系统的可靠性,数据通常使用多副本形式,数据分片做成多个完全相同的副本分别在同的服务节点上进行存储。
在使用数据副本时,为了保证数据的一致性,对于某个数据的写入和修改、读取等作,需要设定一致性策略,客户端对存储服务的读写必须遵循这样的策略,才能保证相应的数据一致性。目前主流的存储服务一般由服务器节点来保证数据的一致性。对于一次读操作,客户端的将读请求发送给保存有待读取数据副本的一个服务器节点,该服务器节点将请求解析后,再将该请求发送给保存有该待读取数据副本的其他服务器节点,分别读取数据后,将数据返回给第一个服务器节点进行数据一致性确认,并将满足一致性的结果返回给客户端。
存储服务通过内存来缓存数据,以加速写操作或后续的读操作,降低请求时延。在读取数据时,服务会将数据从持久化存储加载到内存中,内存中的数据在单次使用后,仍然会保留在内存中作为数据缓存。如果后续有请求读取已经存在于数据缓存中的数据,则称为缓存命中,可以直接从数据缓存中返回结果,而不用再次从持久化存储中读取数据,大大提升了读取速度。
发明内容
有鉴于此,本申请公开了一种存储器数据替换方法、服务器节点和数据存储系统。在选择服务器节点的快速存储器中被替换的数据时,会参照该快速存储器中保存的数据的数据类型,根据数据类型优先将主类型的数据替换出快速存储器,从而保留从类型的数据。
第一方面,本申请公开了一种应用于数据存储系统的存储器数据替换方法,该数据存储系统包含客户端和多个服务器节点。该方法包括:多个服务器节点中的第一服务器节点接收读请求,第一读请求用于读取第一待读取数据,当检测到第一待读取数据不在第一服务器节点的快速存储器中后,第一服务器节点根据快速存储器中存储的数据的数据类型在快速存储器中存储的数据中确定待替换数据,并使用第一待读取数据替换待替换数据。其中,第一服务器节点连接有快速存储器和慢速存储器,快速存储器为慢速存储器的缓存。对于第一服务器,向客户端提供访问操作(例如,可供客户端读取)的数据属于主类型的数据,其他服务器节点的主类型的数据在该第一服务器节点的备份属于第一服务器节点的从类型的数据。即由客户端写入,能够向客户端提供读操作的数据属于主类型的数据,由其他服务器写入,能 够向其他服务器提供读操作,以供其他服务器进行数据一致性校验的数据属于从类型的数据。
在数据存储系统中,对于一份客户端数据,存储其主类型的数据副本的服务器节点称为主节点,存储其从类型的数据副本的节点称为从节点。客户端在访问数据时,会向主节点发送访问请求,主节点向客户端返回数据之前,需要读取该数据在主节点的主类型的数据副本和在从节点的从类型的数据副本,并根据主类型的数据副本和从类型的数据副本进行一致性校验。与主节点从本地读取主类型的数据副本相比,主节点从从节点读取从类型的数据副本时,会多出主节点与从节点之间的网络延时。本申请在进行数据替换时,对快速存储器中的数据类型进行进行区分,服务器节点根据数据类型确定待替换的数据块,可以根据需要优先的在快速存储器中保留从类型的数据,增加从类型的数据在快速存储器中的命中率,从而减少了主节点从从节点读取数据的延时,增加了系统的总体性能。
根据第一方面,在第一方面第一种可能的实现方式中,该快速存储器中存储的数据拥有对应的数据类型标识。该方法还包括:第一服务器节点判断第一待读取数据的数据类型,并在使用第一待读取数据替换待替换数据后,根据第一待读取数据的数据类型设置与第一待读取数据对应的数据类型标识。
例如,可以使用一个比特位来表征数据的数据类型,如果数据为主数据类型,则对应的数据类型标识为“0”,如果数据为从类型的数据,则对应的数据类型标识为“1”。使用数据类型标识标记在快速存储器中的数据类型,可以供第一服务器节点快速的确定数据的数据类型,并根据数据类型确定待替换数据。
根据第一方面第一种可能的实现方式,在第一方面第二种可能的实现方式中,第一服务器节点判断第一待读取数据的数据类型包括:第一服务器节点根据读请求判断第一待读取数据的数据类型,如果读请求来自客户端,则第一待读取数据属于主类型的数据,如果读请求来自其他服务器节点,则第一待读取数据属于从类型的数据。
客户端在访问数据时,会向存储数据的主类型的数据副本的主节点发送读请求。如果读请求来自客户端,则说明第一待读取数据在本节点上是主类型的数据。主节点在向客户端返回第一待读取数据之前,需要向从节点发送读请求,以读取从类型的数据副本,从而进行数据的一致性校验。如果读请求来自其他服务器节点,则说明第一待读取数据在本节点是从类型的数据。
根据第一方面第一种可能的实现方式,在第一方面第三种可能的实现方式中,第一服务器节点判断第一待读取数据的数据类型包括:第一服务器节点根据第一待读取数据的键值计算第一待读取数据数据所属的服务器节点,如果计算结果为第一服务器节点,则第一待读取数据属于主类型的数据,如果计算结果不是第一服务器节点,则第一待读取数据属于从类型的数据。
读请求中携带有第一待读取数据的键值,该键值为第一待读取数据的索引。客户端在存储数据时,可以根据待存储数据的键值计算待存储数据的主节点,并将待存储数据发送给主节点。第一服务器节点接收到读请求后,也可以根据第一待读取数据的键值计算第一待读取数据的主节点,如果计算的主节点为该第一服务器节点,则第一待读取数据为第一服务器节点的主类型的数据。如果计算的主节点不是该第一服务器节点,则第一待读取数据为第一服务器节点的从类型的数据。
根据第一方面第一种可能的实现方式,在第一方面第四种可能的实现方式中,慢速存储器存储不同数据类型的数据于不同的位置。第一服务器节点第一服务器节点判断第一待读取数据的数据类型包括:第一服务器节点根据第一待读取数据在慢速存储器中存储的位置判断第一待读取数据的数据类型。
第一服务器节点节点可以在接收到的写请求时,判断待存储数据的数据类型。当第一服务器节点将待存储数据写入慢速存储器时,会根据待存储数据的数据类型,将待存储数据存储在慢速存储器的不同区域。例如,第一服务器节点的慢速存储器可以分为主分区和从分区,其中主分区用于存储主类型的数据,从分区用于存储从类型的数据。第一服务器节点可以根据数据在慢速存储器中存储的位置判断数据的第一待读取数据的数据类型。
根据第一方面以上任一种可能的实现方式,在第一方面第五种可能的实现方式中,该方法还包括:第一服务器节点接收来自客户端的第一写请求,第一写请求用于存储第一待存储数据,将第一待存储数据写入快速存储器,并将第一待存储数据的数据类型标识设置为主类型。
因为快速存储器的存储速度快于慢速存储器,第一服务器节点接收到第一写请求后,可以先把第一待存储数据写入快速存储器。因为第一写请求来自客户端,第一服务器节点可以判断待写入数据为主类型的数据。
根据第一方面第五种可能的实现方式,在第一方面第六种可能的实现方式中,该方法还包括:第一服务器节点向第二服务器节点发送第二写请求,第二写请求用于将第一待存储数据写入第二服务器节点。
其中,第二服务器节点为第一服务器节点的从节点,第一服务器节点将待存储数据的备份存储在第一服务器节点的从节点中,从而达到容灾的目的。
根据第一方面以上任一种可能的实现方式,在第一方面第七种可能的实现方式中,该方法还包括:第一服务器节点从第三服务器节点接收第三写请求,第三写请求用于存储第三待存储数据,将第三待存储数据写入快速存储器,并将第三待存储数据的数据类型标识设置为从类型。
其中,第三服务器节点为第一服务器节点的主节点,第三写请求用于将第三服务器节点的主类型的数据的备份存储于第一服务器节点。
根据第一方面或第一方面以上任一种可能的实现方式,在第一方面第八种可能的实现方式中,第一服务器节点根据快速存储器中存储的数据的数据类型在快速存储器中存储的数据中确定待替换数据包括:第一服务器节点从快速存储器中存储的主类型的数据中确定待替换数据。
第一服务器节点可以优先的将从类型的数据保留在快速存储器中,从而最大化的提高从类型的数据在快速存储器中的命中率。
根据第一方面或第一方面以上任一种可能的实现方式,在第一方面第九种可能的实现方式中,第一服务器节点根据快速存储器中存储的数据的数据类型在快速存储器中存储的数据中确定待替换数据包括:第一服务器节点根据快速存储器中数据的历史访问情况和数据类型确定待替换数据。
第一服务器节点在选择待替换数据时,根据数据类型和数据的历史访问情况来确定待替换数据,可以折中的考虑从慢速存储器读取数据的时延和网络时延。
第二方面,本申请提供了一种可读介质,包括执行指令,当计算设备的处理器执行该执行指令时,该计算设备执行以上第一方面或以上第一方面的任一种可能的实现方式中的方法。
第三方面,本申请提供了一种计算设备,包括:处理器、存储器和总线;存储器用于存储执行指令,处理器与存储器通过总线连接,当计算设备运行时,处理器执行存储器存储的执行指令,以使计算设备执行以上第一方面或以上第一方面的任一种可能的实现方式中的方法。
第四方面,本申请公开了一种服务器节点,该服务器节点包括:接收单元,用于接收读请求;确定单元,用于在第一待读取数据不在服务器节点的快速存储器中时,根据快速存储器中存储的数据的数据类型在快速存储器中存储的数据中确定待替换数据,其中,服务器节点连接有快速存储器和慢速存储器,快速存储器为慢速存储器的缓存,该服务器节点的数据包括主类型的数据和从类型的数据,该服务器节点向客户端提供访问的数据属于主类型的数据,其他服务器节点的主类型的数据在服务器节点的备份属于从类型的数据;替换单元,用于使用第一待读取数据替换待替换数据。
根据第四方面,在第四方面第一种可能的实现方式中,快速存储器中存储的数据拥有对应的数据类型标识;该服务器节点还包括:判断单元,用于判断第一待读取数据的数据类型;设置单元,用于根据第一待读取数据的数据类型设置与第一待读取数据对应的数据类型标识。
根据第四方面第一种可能的实现方式,在第四方面第二种可能的实现方式中,判断单元用于根据读请求判断第一待读取数据的数据类型,如果读请求来自客户端,则第一待读取数据属于主类型的数据,如果读请求来自其他服务器节点,则第一待读取数据属于从类型的数据。
根据第四方面第一种可能的实现方式,在第四方面第三种可能的实现方式中,判断单元用于根据第一待读取数据的键值计算第一待读取数据数据所属的服务器节点,如果计算结果为该服务器节点,则第一待读取数据属于该服务器节点的主类型数据,如果计算结果不是该服务器节点,则第一待读取数据属于该服务器节点的从类型数据。。
根据第四方面第一种可能的实现方式,在第四方面第四种可能的实现方式中,慢速存储器存储不同数据类型的数据于不同的位置;判断单元用于根据第一待读取数据在慢速存储器中存储的位置判断第一待读取数据的数据类型。
根据第四方面以上任一种可能的实现方式,在第四方面第五种可能的实现方式中,接收单元还用于接收来自客户端的第一写请求,第一写请求用于存储第一待存储数据;服务器节点还包括写入单元,用于将第一待存储数据写入快速存储器;设置单元还用于将第一待存储数据的数据类型标识设置为主类型。
根据第四方面第五种可能的实现方式,在第四方面第六种可能的实现方式中,该服务器节点还包括发送单元,用于向第二服务器节点发送第二写请求,第二写请求用于将第一待存储数据写入第二服务器节点。
根据第四方面以上任一种可能的实现方式,在第四方面第七种可能的实现方式中,接收单元还用于从第三服务器节点接收第三写请求,第三写请求用于存储第三待存储数据;该服务器节点还包括写入单元,用于将第三待存储数据写入快速存储器;设置单元还用于 将第三待存储数据的数据类型标识设置为从类型。
根据第四方面或第四方面以上任一种可能的实现方式,在第四方面第八种可能的实现方式中,确定单元用于从快速存储器中存储的主类型的数据中确定待替换数据。
根据第四方面或第四方面以上任一种可能的实现方式,在第四方面第九种可能的实现方式中,确定单元用于根据快速存储器中数据的历史访问情况和数据类型确定待替换数据。
第四方面为第一方面方法对应的装置实现方式,第一方面或第一方面任一种可能的实现方式中的描述对应适用于第四方面或第四方面任一种可能的实现方式,在此不再赘述。
第五方面,本申请公开了一种数据存储系统,系统包含客户端和多个服务器节点,其中,多个服务器中的第一服务器节点连接有快速存储器和慢速存储器,快速存储器为慢速存储器的缓存;第一服务器节用于接收读请求,在第一待读取数据不在快速存储器中时,根据快速存储器中存储的数据的数据类型在快速存储器中存储的数据中确定待替换数据,并使用第一待读取数据替换待替换数据,其中,第一服务器节点的数据包括主类型的数据和从类型的数据,第一服务器向客户端提供访问的数据属于主类型的数据,其他服务器节点的主类型的数据在服务器节点的备份属于从类型的数据。
根据第五方面,在第五方面第一种可能的实现方式中,快速存储器中存储的数据拥有对应的数据类型标识;第一服务器节点还用于判断第一待读取数据的数据类型,并根据第一待读取数据的数据类型设置与第一待读取数据对应的数据类型标识。
根据第五方面第一种可能的实现方式,在第五方面第二种可能的实现方式中,第一服务器节点用于根据读请求判断第一待读取数据的数据类型,如果读请求来自客户端,则第一待读取数据属于主类型的数据,如果读请求来自其他服务器节点,则第一待读取数据属于从类型的数据。
根据第五方面第一种可能的实现方式,在第五方面第三种可能的实现方式中,第一服务器节点用于根据第一待读取数据的键值计算第一待读取数据数据所属的服务器节点,如果计算结果为服务器节点,则第一待读取数据属于主类型的数据,如果计算结果不是服务器节点,则第一待读取数据属于从类型的数据。
根据第五方面第一种可能的实现方式,在第五方面第四种可能的实现方式中,慢速存储器存储不同数据类型的数据于不同的位置;第一服务器节点用于根据第一待读取数据在慢速存储器中存储的位置判断第一待读取数据的数据类型。
根据第五方面以上任一种可能的实现方式,在第五方面第五种可能的实现方式中,第一服务器节点还用于收来自客户端的第一写请求,第一写请求用于存储第一待存储数据,将第一待存储数据写入快速存储器,并将第一待存储数据的数据类型标识设置为主类型。
根据第五方面第五种可能的实现方式,在第五方面第六种可能的实现方式中,第一服务器节点用于向多个服务器节点中的第二服务器节点发送第二写请求,第二写请求用于将第一待存储数据写入第二服务器节点。
根据第五方面以上任一种可能的实现方式,在第五方面第七种可能的实现方式中,第一服务器节点还用于从多个服务器节点中的第三服务器节点接收第三写请求,第三写请求用于存储第三待存储数据,将第三待存储数据写入快速存储器,并将第三待存储数据的数据类型标识设置为从类型。
根据第五方面或第五方面以上任一种可能的实现方式,在第五方面第八种可能的实现 方式中,第一服务器节点用于从快速存储器中存储的主类型的数据中确定待替换数据。
根据第五方面或第五方面以上任一种可能的实现方式,在第五方面第九种可能的实现方式中,第一服务器节点用于根据快速存储器中数据的历史访问情况和数据类型确定待替换数据。
第五方面为第一方面方法对应的系统实现方式,第一方面或第一方面任一种可能的实现方式中的描述对应适用于第五方面或第五方面任一种可能的实现方式,在此不再赘述。
根据本申请公开的技术方案,第一服务器节点根据数据类型在快速存储器中选择待替换数据块,可以增加从类型的数据在快速存储器中的比例,当其他服务器节点读取第一服务器节点处保存的从类型的数据时,可以有较大的数据命中率,从而减少了其他服务器节点的等待时间,达到减少系统读操作时延的目的。
附图说明
图1为依据本申请一实施例的数据存储系统的逻辑结构示意图;
图2A为依据本申请一实施例的服务器节点的组织结构示意图;
图2B为依据本申请一实施例的服务器节点的组织结构示意图;
图3为一种数据访问延时情况的示意图;
图4为一种数据访问延时情况的示意图;
图5为依据本申请一实施例的存储器数据替换方法的流程示意图;
图6为依据本申请一实施例的数据访问延时情况的示意图;
图7为依据本申请一实施例的服务器节点的逻辑结构示意图;
图8为依据本申请一实施例的服务器节点的逻辑结构示意图。
具体实施方式
下面将结合附图,对本申请实施例进行描述。
本申请实施例采用术语第一和第二等来区分各个对象,但各个“第一”和“第二”之间不具有逻辑或时序上的依赖关系。
在本申请实施例中,一份客户端数据在数据存储系统中有若干个副本,对于第一服务器,向客户端提供访问操作(例如,可供客户端读取)的数据属于主类型的数据,其他服务器节点的主类型的数据在该第一服务器节点的备份属于第一服务器节点的从类型的数据。即由客户端写入,能够向客户端提供读操作的数据属于主类型的数据,由其他服务器写入,能够向其他服务器提供读操作,以供其他服务器进行数据一致性校验的数据属于从类型的数据。对于一份客户端数据,存储其主类型的数据副本的服务器节点称为主节点,存储其从类型的数据副本的节点称为从节点。
在本申请实施例中,客户端可以为一个客户端装置(client device)或者终端设备(terminal device),具体可以为一台装载了客户端软件的计算设备。本申请实施例不对客户端的具体实现形式进行限定。
由于处理器的运算速度愈来愈快,存储器的数据存取速度通常无法跟上处理器的速度,从而影响计算机的执行效率。在本申请实施例中,在处理器与慢速存储器之间可以设置多个级别的存储器,越高级别的存储器的存取速度越快。处理器在进行数据读取的时候,会按照级别从高到低的顺序在不同存储器中依次查找,直至查找到待读取数据。
图1为依据本申请一实施例的数据存储系统架构的示意图。如图1所示,数据存储系统包括客户端101和多个服务器节点,图中示例性的示出三个服务器节点103-1,103-2和103-3。客户端101和多个服务器节点通过网络102进行通信。
每个服务器节点连接有快速存储器和慢速存储器,其中,快速存储器用于充当慢速存储器的缓存。服务器节点连接有快速存储器和慢速存储器是指第一服务器节点与慢速存储器可建立通信连接,但本申请实施例不限定服务器节点与快速存储器和慢速存储器之间具体的连接形式,服务器节点可以采用任意形式与快速存储器和慢速存储器连接。服务器节点可以通过连接访问快速存储器和慢速存储器。
其中,本申请实施例不限定快速存储器和慢速存储器的具体实现形式,慢速存储器和快速存储器是一个相对的概念,用于表达慢速存储器的存取速度慢于快速存储器的存取速度。例如,慢速存储器可以为向用户提供持久化存储服务器的外存,外存一般也成为辅助存储器,其存储介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如光盘)、或者半导体介质(例如固态硬盘(英文全称:solid state disk,缩写:SSD))等。快速存储器为存取速度快于慢速存储器的任意存储器,快速存储器可以为易失性存储器或者非易失性存储器。例如,快速存储器可以为服务器节点的内存,内存一般也成为主存储器,是处理器可以直接寻址的存储空间,一般为随机存取存储器(英文全称:Random-access memory,缩写:RAM),具体可以为静态随机存取存储器(英文全称:Static Random Access Memory,缩写SRAM)或者动态随机存取存储器(英文全称:Dynamic Random Access Memory,缩写:DRAM)。
应理解,慢速存储器可以为任意类型的存储器,而快速存储器可以为存取速度快于慢速存储器的任意类型的存储器,快速存储器与处理器之间还可以存在更快速度的存储器,本申请对此不进行限定。
慢速存储器的存取速度小于处理器的处理速度,可以使用快速存储器充当慢速存储器与处理器进行数据交换的缓冲区。当服务器节点要读取数据时,如果在比快速存储器更高级别的缓存中没有找到待读取数据,则服务器节点会首先从快速存储器中查找需要的数据,如果找到了则进行读取,如果找不到的话则从慢速存储器中找,并把在慢速存储器中找到的待读取数据写入快速存储器中。由于快速存储器的运行速度比慢速存储器快,故快速存储器的作用就是帮助硬件更快地运行。
以服务器节点103-1进行举例,服务器节点103-1连接有快速存储器104-1和慢速存储器105-1。其中,快速存储器104-1可以为服务器节点103-1的内存,慢速存储器105-1可以为服务器节点103-1的外存。其中,服务器节点103-1与快速存储器104-1之间还可以有多级缓存,为了描述的方便,在本申请实施例中,不针对服务器节点103-1与快速存储器之间的缓存进行描述。
当服务器节点103-1接收到写请求后,为了加快写入速度,会先把待存储数据写入快速存储器104-1,然后再将104-1中的数据写入慢速存储器105-1。当服务器节点103-1接收到 读请求时,也首先在快速存储器104-1中查找待读取数据,如果快速存储器104-1中存在待读取数据,则服务器节点103-1直接在快速存储器104-1中进行数据的读取;如果快速存储器104-1中不存在待读取数据,则服务器节点103-1会在慢速存储器105-1中查找待读取数据,并将查找到的待读取数据写入快速存储器104-1,并在快速存储器104-1中进行数据的读取。如果服务器节点103-1将在慢速存储器105-1中查找到的待读取数据写入快速存储器104-1时,快速存储器104-1中已经没有足够的空闲空间,则服务器节点103-1需要在快速存储器104-1中确定待替换数据,并使用待读取数据替换待替换数据。
其中,服务器节点103-1在快速存储器104-1中确定待替换数据时,可以参照数据类型,例如,优先将主类型的数据替换出快速存储器104-1,优先保留从类型的数据。当其他服务器节点读取服务器节点103处保存的从类型的数据时,可以有较大的数据命中率,从而减少其他服务器节点的等待时间,总体达到减少读操作时延的目的。
其中,网络102可以是因特网,内联网(英文:intranet),局域网(英文全称:localarea network,缩写:LAN),广域网络(英文全称:wide area network,缩写:WAN),存储区域网络(英文全称:storage area network,缩写:SAN)等,或者以上网络的任意组合。
其中,慢速存储器中保存有主类型的数据和从类型的数据。
以慢速存储器105-1进行举例说明,慢速存储器105-1中保存的主类型的数据为可以向客户端101提供直接的访问操作的数据。主类型的数据由客户端101通过网络102发送至服务器节点103-1,并由服务器节点103-1存储于慢速存储器105-1。慢速存储器105-1中存储的从类型的数据为其他服务器节点的主数据在服务器节点103-1的备份。
例如,为了容灾(disaster tolerance或disaster recovery)的需要,服务器节点103-2可以将慢速存储器105-2中存储的主类型的数据在服务器节点103-1的慢速存储器105-1和服务器节点103-3的慢速存储器105-3中进行数据备份。
同理,服务器节点103-1可以将慢速存储器105-1中保存的主类型的数据在服务器节点103-2的慢速存储器105-2和服务器节点103-3的慢速存储器105-3中进行备份。当客户端101需要读取在服务器节点103-1的慢速存储器存储的主类型的数据时,客户端101会向服务器节点103-1发送读请求,服务器节点103-1接收到客户端101发送的读请求后,会从快速存储器104-1或105-1中读取待读取数据,并向服务器节点103-2和103-3发送读请求,以读取待读取数据在服务器节点103-2和服务器节点103-3的数据备份。读取成功后,服务器节点103-1会对三份数据进行一致性校验,如果三份数据相同,则将待读取数据返回给客户端101,如果三份数据不同,则服务器节点103-1可以进行数据恢复,并将恢复的数据返回给客户端101。例如,第一服务器节点可以使用校验纠错(英文全称:Error Checking and Correction,缩写:ECC)数据读取时的差错检测和修正。当数据写入的时候,第一服务器节点根据数据生成ECC签名。如果主类型的数据副本和从类型的数据副本一致性校验时发现了错误,就使用ECC算法来修正检测到的错误。ECC算法可以为BCH编码或低密度奇偶校验码(英文全称:Low Density Parity Check Code,缩写:LDPC)编码等。
应理解,每一个服务器节点可以有一个或者多个从节点,本申请实施例以服务器节点103-1有103-2和103-3两个从节点进行举例,但本申请实施例并不限定服务器节点的从节点个数。
慢速存储器105-1中存储的其他服务器节点的主类型的数据的备份即为服务器节点 103-1的从类型数据。105-1中保存的从类型的数据由其他服务器节点发送给服务器节点103-1,并由服务器节点103-1存储于慢速存储器105-1。在其他服务器节点需要一致性校验等操作时,会向服务器节点103-1发送读请求以读取在慢速存储器105-1中存储的备份数据(从类型的数据)。
图2A和图2B为依据本申请一实施例的服务器103的结构示意图。
如图2A所示,服务器103包括处理器201,处理器201与系统内存205连接。处理器201可以为中央处理器(CPU),图像处理器(英文:graphics processing unit,GPU),现场可编程门阵列(英文全称:Field Programmable Gate Array,缩写:FPGA),或数字信号处理器(英文:digital signal processor,DSP)等计算逻辑或以上任意计算逻辑的组合。处理器201可以为单核处理器或多核处理器。
在本申请的一个实施例中,处理器201还包括数据替换逻辑210,数据替换逻辑210可以为具体的硬件电路或集成在处理器201中的固件模块。如果数据替换逻辑210为具体的硬件电路,则数据替换逻辑210执行本申请实施例的方法,如果数据替换逻辑210为固件模块,则处理器210执行数据替换逻辑210中的固件代码来实现本申请实施例的技术方案。数据替换逻辑210包括:(1)用于接收读请求的逻辑(电路/固件代码);(2)用于检测待读取数据是否在快速存储器中的逻辑(电路/固件代码)(3)用于根据快速存储器中存储的数据的数据类型在快速存储器中存储的数据中确定待替换数据的逻辑(电路/固件代码);(4)用于使用待读取数据替换待替换数据的逻辑(电路/固件代码)。
总线209用于在服务器103的各部件之间传递信息,总线209可以使用有线的连接方式或采用无线的连接方式,本申请并不对此进行限定。总线209还连接有辅助存储器202,输入/输出接口203和通信接口204。
辅助存储器202一般也称为外存,辅助存储器202的存储介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如光盘)、或者半导体介质等。在一些实施例中,辅助存储器202还可能进一步包括与处理器201分离的远程存储器,例如通过通信接口204和网络102进行访问的网盘(包括网络文件系统(英文全称:Network File System,缩写:NFS)等网络或机群文件系统)。在本申请实施例中,慢速存储器可以包括辅助存储器202,用于存储数据副本。
输入/输出接口203连接有输入/输出设备,用于接收输入的信息,输出操作结果。输入/输出设备可以为鼠标、键盘、显示器、或者光驱等。
通信接口204使用例如但不限于收发器一类的收发装置,来实现与其他设备或网络102之间的通信,通信接口204可以通过有线或者无线的形式与网络102互连。
本申请实施例的一些特征可以由处理器201执行系统内存205中的软件代码来完成/支持。如图2B所示,系统内存205可以包括一些软件,例如,操作系统208(例如Darwin、RTXC、LINUX、UNIX、OS X、WINDOWS或嵌入式操作系统(例如Vxworks)),应用程序207,和数据替换模块206等。
在本申请的一个实施例中,处理器201执行数据替换模块206来实现本申请实施例的技术方案。数据替换模块206包括:(1)用于接收读请求的代码;(2)用于检测待读取数据是否在快速存储器中的代码;(3)用于根据快速存储器中存储的数据的数据类型在快速存储 器中存储的数据中确定待替换数据的代码;(4)用于使用待读取数据替换待替换数据的代码。
在本申请实施例中,快速存储器可以包括系统内存205,用于充当辅助存储器202的缓存。
此外,图2A和图2B仅仅是服务器103的示例,服务器103可能包含相比于图2A和图2B展示的更多或者更少的组件,或者有不同的组件配置方式。同时,图2A和图2B中展示的各种组件可以用硬件、软件或者硬件与软件的结合方式实施。
在存储系统中,服务器节点互为其他服务器节点的从节点,服务器节点的存储器中存储的数据比较类似,有很大比例的数据都是相同的。在主节点读取各个数据副本的过程中,主节点会将读请求发送到多个从节点,分别读取各个从节点上存储的数据副本。同一个数据的多个数据副本是相同的,如果每个服务器节点的快速存储器采用的数据替换策略相同且不对数据类型进行区分,则在快速存储器中缓存的数据也会有很大比例的数据是相同的。
举例而言,如果服务器节点103-2和服务器节点103-3是服务器节点103-1的从节点,即服务器节点103-1的主类型的数据会在服务器节点103-2和服务器节点103-3的存储器中存储有数据备份。则当客户端101向服务器节点103-1发送读请求后,服务器节点103-1会依次在快速存储器104-1和慢速存储器105-1中查找待读取数据,如果在快速存储器104-1中发现了待读取数据,则发生了命中,可以直接从快速存储器104-1中读取待读取数据,如果在快速存储器104-1中未发现待读取数据,则发生了未命中,服务器节点103-1需要去慢速存储器105-1中读取待读取数据。同时,服务器节点103-1需要向自己的从节点服务器节点103-2和服务器节点103-3发送读请求,以读取待读取数据在服务器节点103-2和服务器节点103-3的数据备份。在服务器节点103-2和服务器节点103-3中会经历与服务器节点103-1类似的读取流程。在读取成功后,服务器节点103-2和服务器节点103-3将读取到的待读取数据的备份返回给服务器节点103-1。服务器节点103-1和接收到的数据进行数据的一致性校验。
因为服务器节点103-1,服务器节点103-2和服务器节点103-3互为从节点,快速存储器104-1,快速存储器104-2和快速存储器104-3中存储的数据比较类似。如果服务器节点103-1,服务器节点103-2和服务器节点103-3采用相同的数据替换策略,且数据替换策略没有对主类型的数据和从类型的数据进行区分,则在数据读取的过程中,快速存储器104-1,快速存储器104-2和快速存储器104-3有很大的概率会同时发生命中或者未命中。
对于存储服务,客户端访问请求的时延是一个重要的指标,访问请求的时延越低,服务性能越好。客户端的读请求时延主要包括三个方面:读请求及数据的网络传输时延、服务器节点的处理逻辑时延、存储设备时延(从慢速存储器读取或者从快速存储器直接读取)。其中,处理逻辑时延相比于网络时延和存储设备时延,可以忽略。存储设备时延主要为当快速存储器发生数据未命中,从慢速存储器中读取数据的时延。访问请求的主要时延为网络时延和读取慢速存储器的时延。
当快速存储器104-1,快速存储器104-2和快速存储器104-3同时发生未命中时,读 取的流程如图3所示。
其中,Tcache为服务器节点从快速存储器读取数据的时延,TIO为服务器节点从慢速存储器中读取数据的时延,Tnet为两个服务器节点之间的单向网络时延。除去客户端与服务器节点103-1之间的固定网络传输时延和服务器节点的处理逻辑时延等其他时延,客户端101读取数据至少需要的时延为:
T=MAX(Tcache+TIO,2Tnet+Tcache+TIO)=2Tnet+Tcache+TIO
其中,Tcache+TIO为服务器节点103-1从慢速存储器105-1读取待读取数据的时延。2Tnet+Tcache+TIO为服务器节点103-1从服务器节点103-2和服务器节点103-3处分别读取到待读取数据的备份需要的时延。
当快速存储器104-1,快速存储器104-2和快速存储器104-3同时发生未命中时,读取的流程如图4所示。
除去客户端与服务器节点103-1之间的固定网络传输时延和服务器节点的处理逻辑时延等其他时延,客户端101读取数据至少需要的时延为:
T=MAX(Tcache,2Tnet+Tcache)=2Tnet+Tcache
其中,Tcache为服务器节点103-1从快速存储器104-1读取待读取数据的时延。2Tnet+Tcache为服务器节点103-1从服务器节点103-2和服务器节点103-3处分别读取到待读取数据的备份需要的时延。
可以看出,上面两种场景中,因为主节点从自己的从节点读取数据需要通过网络进行两次传输(读请求和返回数据),然后才能进行结果一致性处理。同时,由于产生时延的主要组成部分为Tnet和TIO,因此这网络时延决定了系统整体时延T是由对从节点的访问时延决定的。在上面两种情况下,即使服务器节点103-1已经成功的读取到待读取数据,服务器节点103-1仍然需要等待2Tnet时延后,才可以进行数据的一致性校验。
有鉴于此,本申请实施例提供了一种存储器的数据替换方法,在选择第一服务器节点的快速存储器中被替换的数据时,会参照该快速存储器中保存的数据的数据类型,根据数据类型优先将主类型的数据替换出快速存储器,从而保留从类型的数据。当其他服务器节点读取第一服务器节点处保存的从类型的数据时,可以有较大的数据命中率,从而减少了其他服务器节点的等待时间,总体达到减少读操作时延的目的。如图5所示,方法500包括:
S501:第一服务器节点接收读请求。
在本申请实施例中,该读请求可以为来自客户端的读请求,也可以为来自其他服务器节点的读请求。读请求用于读取待读取数据。
如果是来自客户端的读请求,则该读请求用于读取第一服务器节点的主类型的数据。如果是来自其他服务器节点的读请求,则该读请求用于读取第一服务器节点的从类型的数据。
S502:第一服务器节点检测到待读取数据不在第一服务器节点的快速存储器中。
第一服务器节点连接有快速存储器和慢速存储器,快速存储器为慢速存储器的缓存。第一服务器节点与快速存储器和慢速存储器连接是指第一服务器节点与慢速存储器可建立通信连接,但本申请实施例不限定第一服务器节点与快速存储器和慢速存储器之间的连接形式,第一服务器节点可以采用任意形式与快速存储器和慢速存储器链接。
第一服务器节点接收到读请求后,会首先在快速存储器中查找待读取数据,如果待读取数据在第一服务器节点的快速存储器中,则第一服务器节点可以从快速存储器中读取待读取数据。如果待读取数据不在第一服务器节点的快速存储器中,则第一服务器节点需要从第一服务器节点的慢速存储器中读取待读取数据,并将待读取数据写入第一服务器节点的快速存储器中。
S503:第一服务器节点根据快速存储器中存储的数据的数据类型在快速存储器中存储的数据中确定待替换数据。
如果待读取数据不在第一服务器节点的快速存储器中,但第一服务器节点的快速存储器仍然有剩余的存储空间,且足以存储待读取数据,则第一服务器节点可以从慢速存储器中读取待读取数据,并将待读取数据直接存储于快速存储器中。
如果待读取数据不在第一服务器节点的快速存储器中,且第一服务器节点剩余的存储空间不足以存储器待读取数据,则第一服务器节点需要在快速存储器中确定待替换数据。
在本申请实施例中,快速存储器中存储的数据拥有对应的数据类型标识,该数据类型表示用于表示数据的数据类型。例如,可以使用一个比特位来表征数据的数据类型,如果数据为主数据类型,则对应的数据类型标识为“0”,如果数据为从类型的数据,则对应的数据类型标识为“1”。
第一服务器节点可以根据数据对应的数据类型标识来确定数据的数据类型,并根据数据的数据类型从快速存储器中选择待替换数据。
在本申请实施例中,第一服务器节点可以从快速存储器中存储的主类型的数据中确定待替换数据。即,第一服务器节点优先将从类型的数据保存在快速存储器中,从而增大从类型的数据在快速存储器的命中率,以此来减少第一服务器节点的主节点访问数据的时延。
第一服务器节点还可以根据快速存储器中存储的数据被访问的情况和数据类型来选择待替换数据。例如,第一服务器节点可以根据数据的热度(popularity)和数据类型来选择待替换数据。数据的热度可以为数据在一定时间内被访问的频率或离上次数据被访问时的时长。
第一服务器节点可以统计快速存储器中存储的每一份数据在一定时间内被访问的次数C,并根据数据被访问的次数和数据类型来选择待替换数据。具体的,第一服务器节点根据数据被访问的次数和数据类型计算替换系数P1。其中,对于主类型的数据P1=a1*C;对于从类型的数据P1=b1*C。其中,a1和b1均为大于0的变量或常量,且b1与a1的比值大于1。即
Figure PCTCN2017114449-appb-000001
第一服务器节点可以根据替换系数P1来选择待替换数据。具体的,第一服务器节点选择替换系数P1最小的数据作为待替换数据。
第一服务器节点还可以统计快速存储器中存储的每一份数据距上次被访问的时长T,并根据数据距上次被访问的时长T和数据类型来选择待替换数据。具体的,第一服务器节点根据数据距上次被访问的时长T和数据类型计算替换系数P2。其中,对于主类型的数据P2=a2*T;对于从类型的数据P2=b2*T。其中,a2和b2均为大于0的变量或常量,且a2与b2的比值大于1。即
Figure PCTCN2017114449-appb-000002
第一服务器节点可以根据替换系数P2来选择待替换数据。具体的,第一服务器节点选择替换系数P2最大的数据作为待替换数据。
第一服务器节点节点还可以收集服务器节点从快速存储器读取数据的时延Tcache,服务器节点从慢速存储器中读取数据的时延TIO,两个服务器节点之间的单向网络时延Tnet。并根据Tcache,TIO,Tnet与数据类型来选择待替换数据。具体的,第一服务器节点根据Tcache,TIO,Tnet与数据类型计算替换系数P3。
Figure PCTCN2017114449-appb-000003
其中,
Figure PCTCN2017114449-appb-000004
第一服务器节点可以根据替换系数P3选择待替换数据。具体的,第一服务器节点选择替换系数P3最小的数据作为待替换数据。
应理解,本申请不限定选择待替换数据的具体方式,只需要第一服务器节点在选择待替换数据时,会判断数据类型,并根据数据类型进行待替换数据的选择。只需要从数据类型更难被替换出快速存储器,主数据类型更容易替换出快速存储器,就可以达到减小数据访问时延的目的。例如,第一服务器节点节点还可以结合数据类型与最近最少使用到的(英文全称:Least Recently Used,缩写:LRU)或最不经常使用(Least Frequently Used,缩写:LFU)算法来选择待替换数据。
如图6所示,当服务器节点103-1接收到客户端101的读请求后,服务器节点103-1会去自己的存储器中查找读请求对应的主类型的数据,并向服务器节点103-2和服务器节点103-3读取读请求对应的从类型的数据。
因为快速存储器中优先保留有从类型的数据,则主类型的数据在快速存储器104-1中有较大的缺失率,服务器节点103-1有较大的概率需要去慢速存储器105-1中读取主类型的数据。服务器节点103-1从慢速存储器105-1中读取主类型的数据的时延为Tcache +TIO。快速存储器104-2和快速存储器104-3中有较大概率保存有读请求对应的从类型的数据,即从类型的数据在快速存储器104-2和快速存储器104-3中有较大的命中率。服务器节点103-1从服务器节点103-2和服务器节点103-3的快速存储器中读取从类型的数据的时延为2Tnet+Tcache
除去客户端与服务器节点103-1之间的固定网络传输时延和服务器节点的处理逻辑时延等其他时延,服务器节点103-1读取到主类型的数据和从类型的数据的时延为:
T=MAX(Tcache+TIO,2Tnet+Tcache)
如果TIO与2Tnet在同一个量级,则主节点读取主类型的数据和读取从类型的数据的时延相近,避免了主节点的等待,合理的利用了快速存储器。
S504:第一服务器节点使用待读取数据替换待替换数据。
第一服务器节点从慢速存储器中读出待读取数据后,将快速存储器中的待替换数据替换为待读取数据。
进一步的,第一服务器节点还判断待读取数据的数据类型,并根据待读取数据的数据类型设置与待读取数据对应的数据类型标识。例如,使用一个比特位来作为数据类型标识,数据类型标识为“0”表示主类型,数据类型标识为“1”表示从类型。则第一服务器节点判断待读取数据为主类型的数据,则将待读取数据对应的数据类新标识置为“0”,如果第一服务器节点判断待读取数据为从类型的数据,则第一服务器节点将待读取数据对应的数据类型标识置为“1”。
第一服务器节点可以根据读请求判断待读取数据的数据类型,如果读请求来自客户端,则待读取数据属于主类型的数据,如果读请求来自其他服务器节点,则待读取数据属于从类型的数据。
第一服务器节点还可以根据待读取数据的键值计算待读取数据所属的主节点,如果计算结果为第一服务器节点,则待读取数据属于主类型的数据,如果计算结果不是第一服务器节点,则待读取数据属于从类型的数据。
可选的,慢速存储器存储不同数据类型的数据于不同的位置,即主类型的数据和从类型的数据在慢速存储器中的存储的位置不同。第一服务器节点可以根据待读取数据在慢速存储器中存储的位置判断待读取数据的数据类型。
当第一服务器节点接收到来自客户端的第一写请求后,第一服务器节点首先将第一写请求的待存储数据写入第一服务器节点的快速存储器,并将待存储数据的数据类型设置为主类型。例如,使用一个比特位来作为数据类型标识,数据类型标识为“0”表示主类型,数据类型标识为“1”表示从类型。则第一服务器节点将待存储数据对应的数据类新标识设置为“0”。
当第一服务器节点向第一服务器节点的快速存储器中写入第一写请求的待存储数据时,如果第一服务器节点的快速存储器中保存有与第一写请求的待存储数据键值相同的数据,即第一服务器节点的快速存储器中保存有第一写请求的待存储数据的历史版本,则第一服务器节点使用第一写请求的待存储数据替换快速存储器中与待存储数据键值相同的数据。如果第一服务器节点的快速存储器中不存在与第一写请求的待存储数据键值相同的数据,即第一服务器节点的快速存储器中不存在第一写请求的待存 储数据的历史版本,则第一服务器节点从快速存储器中确定待替换数据,并使用待存储数据替换待替换数据。待替换数据的选择过程在上已有描述,在此不再赘述。
第一服务器节点接收到第一写请求后,还向第二服务器节点发送第二写请求,第二写请求用于将待存储数据写入第二服务器节点。从而完成对待存储数据的数据备份。其中,第二服务器节点为第一服务器节点的从节点。
当第一服务器节点接收到来自其第三服务器节点的第三写请求后,第一服务器节点首先将第三写请求的待存储数据写入第一服务器节点的快速存储器,并将待存储数据的数据类型设置为从类型。例如,使用一个比特位来作为数据类型标识,数据类型标识为“0”表示主类型,数据类型标识为“1”表示从类型。则第一服务器节点将待存储数据对应的数据类新标识设置为“1”。其中,第三服务器节点为第一服务器节点的主节点。
同理,当第一服务器节点向第一服务器节点的快速存储器中写入第三写请求的待存储数据时,如果第一服务器节点的快速存储器中保存有与第三写请求的待存储数据键值相同的数据,即第一服务器节点的快速存储器中保存有第三写请求的待存储数据的历史版本,则第一服务器节点使用第三写请求的待存储数据替换快速存储器中与待存储数据键值相同的数据。如果第一服务器节点的快速存储器中不存在与第三写请求的待存储数据键值相同的数据,即第一服务器节点的快速存储器中不存在第三写请求的待存储数据的历史版本,则第一服务器节点从快速存储器中确定待替换数据,并使用待存储数据替换待替换数据。待替换数据的选择过程在上已有描述,在此不再赘述。
图7为依据本申请一实施例的一种服务器节点700的逻辑结构示意图,服务器节点700应用于数据存储系统,该数据存储系统包括客户端和多个服务器节点700,如图7所示,服务器节点700包括接收单元702,确定单元704和替换单元706。
接收单元702,用于接收读请求。例如,接收单元702用于执行图5的步骤S501。
确定单元704,用于在待读取数据不在服务器节点的快速存储器中时,根据快速存储器中存储的数据的数据类型在快速存储器中存储的数据中确定待替换数据,其中,服务器节点连接有快速存储器和慢速存储器,快速存储器为慢速存储器的缓存,该服务器节点的数据包括主类型的数据和从类型的数据,向客户端提供访问的数据属于主类型的数据,其他服务器节点的主类型的数据在服务器节点的备份属于从类型的数据。例如,确定单元704用于执行图5中的步骤S503。
替换单元706,用于使用待读取数据替换待替换数据。例如,替换单元706用于执行图5中的步骤S504。
可选的,该快速存储器中存储的数据拥有对应的数据类型标识,如图8所示,服务器节点700还包括:判断单元708,用于判断待读取数据的数据类型;设置单元710,用于根据待读取数据的数据类型设置与待读取数据对应的数据类型标识。
可选的,判断单元708用于根据读请求判断待读取数据的数据类型,如果读请求来自客户端,则待读取数据属于主类型的数据,如果读请求来自其他服务器节点,则待读取数据属于从类型的数据。
可选的,判断单元708用于根据待读取数据的键值计算待读取数据所属的服务器节点,如果计算结果为服务器节点,则待读取数据属于主类型的数据,如果计算结果不是服务器 节点,则待读取数据属于从类型的数据。
可选的,慢速存储器存储不同数据类型的数据于不同的位置,判断单元708用于根据待读取数据在慢速存储器中存储的位置判断待读取数据的数据类型。
接收单元702还用于收来自客户端的第一写请求,如图8所示,服务器节点700还包括写入单元712,用于将第一写请求的待存储数据写入快速存储器,设置单元710还用于将第一写请求的待存储数据的数据类型标识设置为主类型。
如图8所示,服务器节点700还可以包括发送单元714,用于向第二服务器节点发送第二写请求,第二写请求用于将待存储数据写入第二服务器节点。
接收单元702还用于从第三服务器节点接收第三写请求,如图8所示,服务器节点700还包括写入单元712,用于将第三写请求的待存储数据写入快速存储器,设置单元710还用于将第三写请求的待存储数据的数据类型标识设置为从类型。
可选的,确定单元704用于从快速存储器中存储的主类型的数据中确定待替换数据。
可选的,确定单元704用于根据快速存储器中数据的历史访问情况和数据类型确定待替换数据。
在本申请实施例中,接收单元702和发送单元714可以具体由图2A中的处理器201与通信接口204来实现,,或者由图2B中的处理器201,通信接口204和系统内存205中的数据替换模块206来实现。
在本申请实施例中,确定单元704,替换单元706,判断单元708,设置单元710和写入单元712可以具体由图2A中的处理器201中的数据替换逻辑210来实现,或者由图2B中的处理器201和系统内存205中的数据替换模块206来实现。
本申请实施例中,数据替换模块206可以包含接收单元704,替换单元706,替换单元706。
在本申请实施例中,数据替换模块206还可以包含接收单元702,判断单元708,设置单元710,写入单元712和发送单元714。
本申请实施例为图5方法实施例对应的第一服务器节点的装置实施例,图5实施例部分的特征描述适用于本申请实施例,在此不再赘述。
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者替换其中部分技术特征;而这些修改或者替换,并不使相应技术方案脱离权利要求的保护范围。

Claims (32)

  1. 一种存储器数据替换方法,其特征在于,数据存储系统包含客户端和多个服务器节点,所述方法包括:
    第一服务器节点接收读请求,所述读请求用于读取第一待读取数据;
    第一服务器节点检测到所述第一待读取数据不在所述第一服务器节点的快速存储器中,所述第一服务器节点连接有所述快速存储器和慢速存储器,所述快速存储器为所述慢速存储器的缓存;
    所述第一服务器节点根据所述快速存储器中存储的数据的数据类型在所述快速存储器中存储的数据中确定待替换数据,其中,所述第一服务器节点的数据包括主类型的数据和从类型的数据,所述第一服务器向所述客户端提供访问的数据属于所述主类型的数据,其他服务器节点的主类型的数据在所述第一服务器节点的备份属于所述从类型的数据;
    所述第一服务器节点使用所述第一待读取数据替换所述待替换数据。
  2. 根据权利要求1所述的方法,其特征在于,所述快速存储器中存储的数据拥有对应的数据类型标识;
    所述方法还包括:
    所述第一服务器节点判断所述第一待读取数据的数据类型;
    所述第一服务器节点根据所述待第一读取数据的数据类型设置与所述第一待读取数据对应的数据类型标识。
  3. 根据权利要求2所述的方法,其特征在于,所述第一服务器节点判断所述第一待读取数据的数据类型包括:
    所述第一服务器节点根据所述读请求判断所述第一待读取数据的数据类型,如果所述读请求来自所述客户端,则所述第一待读取数据属于主类型的数据,如果所述读请求来自其他服务器节点,则所述第一待读取数据属于从类型的数据。
  4. 根据权利要求2所述的方法,其特征在于,所述第一服务器节点判断所述第一待读取数据的数据类型包括:
    所述第一服务器节点根据所述第一待读取数据的键值计算所述第一待读取数据所属的服务器节点,如果计算结果为所述第一服务器节点,则所述第一待读取数据属于主类型的数据,如果计算结果不是所述第一服务器节点,则所述第一待读取数据属于从类型的数据。
  5. 根据权利要求2所述的方法,其特征在于,所述慢速存储器存储不同数据类型的数据于不同的位置;
    所述第一服务器节点判断所述第一待读取数据的数据类型包括:
    所述第一服务器节点根据所述第一待读取数据在所述慢速存储器中存储的位置判断所述第一待读取数据的数据类型。
  6. 根据权利要求2-5任一项所述的方法,其特征在于,所述方法还包括:
    所述第一服务器节点接收来所述自客户端的第一写请求,所述第一写请求用于存储第一待存储数据;
    所述第一服务器节点将所述第一待存储数据写入所述快速存储器,并将所述第一待存储数据的数据类型标识设置为所述主类型。
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:
    所述第一服务器节点向第二服务器节点发送第二写请求,所述第二写请求用于将所述第一待存储数据写入所述第二服务器节点。
  8. 根据权利要求2-7任一项所述的方法,其特征在于,所述方法还包括:
    所述第一服务器节点从第三服务器节点接收第三写请求,所述第三写请求用于存储第三待存储数据;
    所述第一服务器节点将所述第三待存储数据写入所述快速存储器,并将所述第三待存储数据的数据类型标识设置为所述从类型。
  9. 根据权利要求1-8任一项所述的方法,其特征在于,
    所述第一服务器节点从所述快速存储器中存储的主类型的数据中确定所述待替换数据。
  10. 根据权利要求1-8任一项所述的方法,其特征在于
    所述第一服务器节点根据快速存储器中数据的历史访问情况和数据类型确定所述待替换数据。
  11. 一种服务器节点,其特征在于,所述服务器节点包括:
    接收单元,用于接收读请求,所述读请求用于第一待读取数据的读取;
    确定单元,用于在所述第一待读取数据不在所述服务器节点的快速存储器中时,根据所述快速存储器中存储的数据的数据类型在所述快速存储器中存储的数据中确定待替换数据,其中,所述服务器节点连接有所述快速存储器和慢速存储器,所述快速存储器为所述慢速存储器的缓存,所述服务器节点的数据包括主类型的数据和从类型的数据,所述服务器节点向客户端提供访问的数据属于所述主类型的数据,其他服务器节点的主类型的数据在所述服务器节点的备份属于所述从类型的数据;
    替换单元,用于使用所述第一待读取数据替换所述待替换数据。
  12. 根据权利要求11所述的服务器节点,其特征在于,所述快速存储器中存储的数据拥有对应的数据类型标识;
    所述服务器节点还包括:
    判断单元,用于判断所述第一待读取数据的数据类型;
    设置单元,用于根据所述第一待读取数据的数据类型设置与所述第一待读取数据对应的数据类型标识。
  13. 根据权利要求12所述的服务器节点,其特征在于,所述判断单元用于根据所述读请求判断所述第一待读取数据的数据类型,如果所述读请求来自所述客户端,则所述第一待读取数据属于主类型的数据,如果所述读请求来自其他服务器节点,则所述第一待读取数据属于从类型的数据。
  14. 根据权利要求12所述的服务器节点,其特征在于,所述判断单元用于根据所述第一待读取数据的键值计算所述第一待读取数据所属的服务器节点,如果计算结果为所述服务器节点,则所述第一待读取数据属于主类型的数据,如果计算结果不是所述服务器节点,则所述第一待读取数据属于从类型的数据。
  15. 根据权利要求12所述的服务器节点,其特征在于,所述慢速存储器存储不同数据类型的数据于不同的位置;
    所述判断单元用于根据所述第一待读取数据在所述慢速存储器中存储的位置判断所述第一待读取数据的数据类型。
  16. 根据权利要求12-15任一项所述的服务器节点,其特征在于,所述接收单元还用于收来所述自客户端的第一写请求,所述第一写请求用于存储第一待存储数据;
    所述服务器节点还包括写入单元,用于将所述第一待存储数据写入所述快速存储器;
    所述设置单元还用于将所述第一待存储数据的数据类型标识设置为所述主类型。
  17. 根据权利要求16所述的服务器节点,其特征在于,所述服务器节点还包括发送单元,用于向第二服务器节点发送第二写请求,所述第二写请求用于将所述第一待存储数据写入所述第二服务器节点。
  18. 根据权利要求12-17任一项所述的服务器节点,其特征在于,所述接收单元还用于从第三服务器节点接收第三写请求,所述第三写请求用于存储第三待存储数据;
    所述服务器节点还包括写入单元,用于将所述第三待存储数据写入所述快速存储器;
    所述设置单元还用于将所述第三待存储数据的数据类型标识设置为所述从类型。
  19. 根据权利要求11-18任一项所述的服务器节点,其特征在于,所述确定单元从所述快速存储器中存储的主类型的数据中确定所述待替换数据。
  20. 根据权利要求11-18任一项所述的服务器节点,其特征在于,所述确定单元根据快速存储器中数据的历史访问情况和数据类型确定所述待替换数据。
  21. 一种数据存储系统,其特征在于,所述系统包含客户端和多个服务器节点,其中,所述多个服务器中的第一服务器节点连接有快速存储器和慢速存储器,所述快速存储器为所述慢速存储器的缓存;
    所述第一服务器节点用于接收读请求,所述读请求用于第一待读取数据的读取,其 中,在所述第一待读取数据不在所述快速存储器中时,所述第一服务器节点根据所述快速存储器中存储的数据的数据类型在所述快速存储器中存储的数据中确定待替换数据,并使用所述第一待读取数据替换所述待替换数据,其中,所述第一服务器节点的数据包括主类型的数据和从类型的数据,所述第一服务器向所述客户端提供访问的数据属于所述主类型的数据,其他服务器节点的主类型的数据在所述第一服务器节点的备份属于所述从类型的数据。
  22. 根据权利要求21所述的系统,其特征在于,所述快速存储器中存储的数据拥有对应的数据类型标识;
    所述第一服务器节点还用于判断所述第一待读取数据的数据类型,并根据所述第一待读取数据的数据类型设置与所述第一待读取数据对应的数据类型标识。
  23. 根据权利要求22所述的系统,其特征在于,所述第一服务器节点用于根据所述读请求判断所述第一待读取数据的数据类型,如果所述读请求来自所述客户端,则所述第一待读取数据属于主类型的数据,如果所述读请求来自其他服务器节点,则所述第一待读取数据属于从类型的数据。
  24. 根据权利要求22所述的系统,其特征在于,所述第一服务器节点用于根据所述第一待读取数据的键值计算所述第一待读取数据所属的服务器节点,如果计算结果为所述服务器节点,则所述第一待读取数据属于主类型的数据,如果计算结果不是所述服务器节点,则所述第一待读取数据属于从类型的数据。
  25. 根据权利要求22所述的系统,其特征在于,所述慢速存储器存储不同数据类型的数据于不同的位置;
    所述第一服务器节点用于根据所述第一待读取数据在所述慢速存储器中存储的位置判断所述第一待读取数据的数据类型。
  26. 根据权利要求22-25任一项所述的系统,其特征在于,所述第一服务器节点还用于收来所述自客户端的第一写请求,所述第一写请求用于存储第一待存储数据,所述第一服务器节点将所述第一待存储数据写入所述快速存储器,并将所述第一待存储数据的数据类型标识设置为所述主类型。
  27. 根据权利要求26所述的系统,其特征在于,所述第一服务器节点用于向所述多个服务器节点中的第二服务器节点发送第二写请求,所述第二写请求用于将所述第一待存储数据写入所述第二服务器节点。
  28. 根据权利要求22-27任一项所述的系统,其特征在于,所述第一服务器节点还用于从所述多个服务器节点中的第三服务器节点接收第三写请求,所述第三写请求用于存储第三待存储数据,所述第一服务器节点将所述第三待存储数据写入所述快速存储器,并将所述第三待存储数据的数据类型标识设置为所述从类型。
  29. 根据权利要求21-28任一项所述的系统,其特征在于,所述第一服务器节点从所述快速存储器中存储的主类型的数据中确定所述待替换数据。
  30. 根据权利要求21-28任一项所述的系统,其特征在于,所述第一服务器节点根据快速存储器中数据的历史访问情况和数据类型确定所述待替换数据。
  31. 一种可读介质,其特征在于,包括执行指令,当计算设备的处理器执行所述执行指令时,所述计算设备执行权利要求1-10任一项所述的方法。
  32. 一种计算设备,其特征在于,包括:处理器、存储器和总线;
    所述存储器用于存储执行指令,所述处理器与所述存储器通过所述总线连接,当所述计算设备运行时,所述处理器执行所述存储器存储的所述执行指令,以使所述计算设备执行权利要求1-10任一项所述的方法。
PCT/CN2017/114449 2017-12-04 2017-12-04 一种存储器数据替换方法、服务器节点和数据存储系统 WO2019109209A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201780055457.4A CN110121874B (zh) 2017-12-04 2017-12-04 一种存储器数据替换方法、服务器节点和数据存储系统
PCT/CN2017/114449 WO2019109209A1 (zh) 2017-12-04 2017-12-04 一种存储器数据替换方法、服务器节点和数据存储系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/114449 WO2019109209A1 (zh) 2017-12-04 2017-12-04 一种存储器数据替换方法、服务器节点和数据存储系统

Publications (1)

Publication Number Publication Date
WO2019109209A1 true WO2019109209A1 (zh) 2019-06-13

Family

ID=66750712

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/114449 WO2019109209A1 (zh) 2017-12-04 2017-12-04 一种存储器数据替换方法、服务器节点和数据存储系统

Country Status (2)

Country Link
CN (1) CN110121874B (zh)
WO (1) WO2019109209A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552441A (zh) * 2020-04-29 2020-08-18 重庆紫光华山智安科技有限公司 数据存储方法和装置、主节点及分布式系统

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113750521B (zh) * 2020-06-01 2024-03-22 上海莉莉丝科技股份有限公司 数据存储系统及方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6633891B1 (en) * 1998-11-24 2003-10-14 Oracle International Corporation Managing replacement of data in a cache on a node based on caches of other nodes
CN104283913A (zh) * 2013-07-04 2015-01-14 高宏亮 网络存储系统以及网络存储方法
CN105872040A (zh) * 2016-03-30 2016-08-17 华中科技大学 一种利用网关节点缓存优化分布式块存储写性能的方法
CN107092525A (zh) * 2016-02-18 2017-08-25 深圳市深信服电子科技有限公司 数据缓存方法和装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6457040B1 (en) * 1998-01-16 2002-09-24 Kabushiki Kaisha Toshiba Method and system for a distributed network computing system for providing application services
US6018483A (en) * 1998-12-10 2000-01-25 Siemens Aktiengesellschaft Distributed block redundancy for memory devices

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6633891B1 (en) * 1998-11-24 2003-10-14 Oracle International Corporation Managing replacement of data in a cache on a node based on caches of other nodes
CN104283913A (zh) * 2013-07-04 2015-01-14 高宏亮 网络存储系统以及网络存储方法
CN107092525A (zh) * 2016-02-18 2017-08-25 深圳市深信服电子科技有限公司 数据缓存方法和装置
CN105872040A (zh) * 2016-03-30 2016-08-17 华中科技大学 一种利用网关节点缓存优化分布式块存储写性能的方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552441A (zh) * 2020-04-29 2020-08-18 重庆紫光华山智安科技有限公司 数据存储方法和装置、主节点及分布式系统

Also Published As

Publication number Publication date
CN110121874A (zh) 2019-08-13
CN110121874B (zh) 2021-06-01

Similar Documents

Publication Publication Date Title
US9442955B1 (en) Managing delete operations in files of file systems
US10831741B2 (en) Log-shipping data replication with early log record fetching
US9311333B1 (en) Managing files of file systems
WO2019001521A1 (zh) 数据存储方法、存储设备、客户端及系统
US20170004082A1 (en) Methods for host-side caching and application consistent writeback restore and devices thereof
CN112988680B (zh) 数据加速方法、缓存单元、电子设备及存储介质
WO2019137321A1 (zh) 数据处理方法、装置及计算设备
US20200183596A1 (en) Restorable memory allocator
JP2017126334A (ja) 記憶装置及びその動作方法並びにシステム
CN113015967A (zh) 辅助存储服务器高速缓存
CN112799595A (zh) 数据处理方法、设备及存储介质
WO2023197404A1 (zh) 一种基于分布式数据库的对象存储方法及装置
JP5893028B2 (ja) キャッシングに対応したストレージ装置上における効率的なシーケンシャルロギングのためのシステム及び方法
WO2019109209A1 (zh) 一种存储器数据替换方法、服务器节点和数据存储系统
WO2018153202A1 (zh) 数据缓存方法及装置
TWI484335B (zh) Cached data processing method, processing system, and means
US20050198438A1 (en) Shared-memory multiprocessor
CN110968530A (zh) 一种基于非易失性内存的键值存储系统和内存访问方法
WO2019000423A1 (zh) 一种数据存储方法及设备
CN116560562A (zh) 一种读、写数据方法及装置
US11436256B2 (en) Information processing apparatus and information processing system
US7725660B2 (en) Directory for multi-node coherent bus
US7669013B2 (en) Directory for multi-node coherent bus
US9323671B1 (en) Managing enhanced write caching
US10949359B2 (en) Optimizing cache performance with probabilistic model

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

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

Country of ref document: EP

Kind code of ref document: A1