WO2020037625A1 - Distributed storage system and data read-write method therefor, and storage terminal and storage medium - Google Patents

Distributed storage system and data read-write method therefor, and storage terminal and storage medium Download PDF

Info

Publication number
WO2020037625A1
WO2020037625A1 PCT/CN2018/102027 CN2018102027W WO2020037625A1 WO 2020037625 A1 WO2020037625 A1 WO 2020037625A1 CN 2018102027 W CN2018102027 W CN 2018102027W WO 2020037625 A1 WO2020037625 A1 WO 2020037625A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
read request
storage node
storage
client
Prior art date
Application number
PCT/CN2018/102027
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 袁振南
Priority to CN201880002511.3A priority Critical patent/CN109691065B/en
Priority to PCT/CN2018/102027 priority patent/WO2020037625A1/en
Publication of WO2020037625A1 publication Critical patent/WO2020037625A1/en

Links

Images

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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Definitions

  • the present application relates to the field of information technology, and in particular, to a distributed storage system and a data read / write method, a storage terminal, and a storage medium.
  • PacificA can also be called a prototype system.
  • the framework is simple, practical, provides strong consistency, and can be adapted to different replication strategies.
  • Blockchain Communications Software (Blockchain Messenger, BCM) relies on a back-end distributed storage system to store massive data such as accounts and contacts.
  • BCM Blockchain Communications Software
  • the back-end distributed storage system uses PacificA to replicate The protocol manages multiple copies of the same data.
  • all read and write operations are initiated from the Leader node (master replica node).
  • the read capacity of the data will not be improved as more data replicas are added, so its read scalability is poor.
  • the technical problem mainly solved by this application is to provide a distributed storage system and a method for reading and writing data, a storage terminal, and a storage medium to improve the read expansion capability of the distributed storage system.
  • the distributed storage system includes a client and a storage terminal, where the storage terminal includes a first storage node, at least two second storage nodes, and at least two read request coordination modules, and the read request coordination module is set corresponding to the second storage node,
  • the first storage node is used to store data
  • at least two second storage nodes are used to store data copies.
  • the data read and write method includes: the client generates multiple data read requests, and the multiple data read requests include the first data read Request and the second data read request; the client sends the first data read request to the first storage node and the second data request to the read request coordination module; the first storage node obtains the first data request, and according to the first data request, The first data is obtained from the stored data; the read request coordination module obtains the second data read request, and obtains the second data from the data stored by the second storage node according to the second data request; the first storage node sends the first data to Client; the read request coordination module sends the second data to the client.
  • a distributed storage system including a client and a storage terminal, where the storage terminal includes a first storage node, at least two first storage nodes, Two storage nodes and at least two read request coordination modules.
  • the read request coordination module is set corresponding to the second storage node.
  • the first storage node is used to store data
  • the at least two second storage nodes are used to store a copy of the data.
  • the multiple data read requests include a first data read request and a second data read request; the client is configured to send the first data read request to the first storage node and the second data read request to the read request coordination module.
  • the first storage node is used to obtain the first data request, and obtains the first data from the stored data according to the first data request, and sends the first data to the client;
  • the read request coordination module is used to obtain the second A data read request, and obtain the second data from the data stored by the second storage node according to the second data request, and copy the second data To the client.
  • the distributed storage system includes a client and a storage terminal.
  • the storage terminal includes a first storage node.
  • At least two second storage nodes and at least two read request coordination modules, the read request coordination modules are set corresponding to the second storage node, the first storage node is used to store data, and the at least two second storage nodes are used to store data
  • the copy and data read and write method includes: the first storage node obtains the first data read request from the client, and obtains the first data from the stored data according to the first data request, and sends the first data to the client; the read request The coordination module obtains the second data read request from the client, obtains the second data from the data stored by the second storage node according to the second data request, and sends the second data to the client.
  • the storage terminal includes a first storage node for storing data, and the first storage node obtains a first data read request from a client. And obtaining the first data from the stored data according to the first data read request and sending the first data to the client; at least two second storage nodes for storing a copy of the data; a read request coordination module, Configured to obtain a second data read request from a client, obtain second data from data stored by a second storage node according to the second data request, and send the second data to the client.
  • a storage terminal which includes: a storage module for storing data; a transceiver module for receiving data read requests from a client; a processing module , Used to obtain the requested data from the data stored in the storage module according to the data read request; the transceiver module further sends the requested data to the client.
  • Another technical solution adopted in the present application is to provide a storage medium on which program data is stored, and when the program data is executed, the steps in the foregoing method are implemented.
  • the distributed storage system in the embodiment of the present application includes a client and a storage terminal.
  • the storage terminal includes a first storage node, at least two second storage nodes, and at least two read nodes.
  • the request coordination module, the read request coordination module is set corresponding to the second storage node, wherein the first storage node is used to store data, at least two second storage nodes are used to store a copy of the data, and the distributed storage system data read and write method
  • the method includes: the client generates multiple data read requests, and the multiple data read requests include a first data read request and a second data read request; the client sends a first data read request to the first storage node and sends a first data read request to the read request coordination module.
  • the present application divides multiple data read requests generated by the client into a first data read request and a second data read request, and sends the first data read request to the first storage node to retrieve the data from the first storage.
  • the node obtains the first data and sends a second data read request to the read request coordination module to obtain the second data from the second storage node through the read request coordination module. Therefore, the second storage node of the present application can communicate with the first storage
  • the nodes jointly process multiple data read requests from the client, so that multiple data read requests generated by the client can be evenly distributed across the entire storage node cluster of the distributed storage system, thereby improving the read expansion capability of the distributed storage system.
  • FIG. 1 is a schematic structural diagram of an embodiment of a distributed storage system of the present application
  • FIG. 2 is a structural block diagram of the distributed storage system of the embodiment of FIG. 1;
  • FIG. 3 is a schematic structural diagram of an embodiment of a data reading and writing method of a distributed storage system according to the present application
  • FIG. 4 is a schematic flowchart of step S203 in the data reading and writing method of the distributed storage system in the embodiment of FIG. 3;
  • FIG. 4 is a schematic flowchart of step S203 in the data reading and writing method of the distributed storage system in the embodiment of FIG. 3;
  • step S203 is another schematic flowchart of step S203 in the data reading and writing method of the distributed storage system in the embodiment of FIG. 3;
  • FIG. 6 is a detailed flowchart of step S402 in the data reading and writing method of the distributed storage system in the embodiment of FIG. 5; FIG.
  • FIG. 7 is a schematic structural diagram of another embodiment of a data reading and writing method for a distributed storage system of the present application.
  • FIG. 8 is a schematic structural diagram of another embodiment of a distributed storage system of the present application.
  • FIG. 9 is a schematic structural diagram of an embodiment of a storage terminal according to the present application.
  • FIG. 10 is a schematic structural diagram of another embodiment of a storage terminal according to the present application.
  • FIG. 11 is a schematic structural diagram of an embodiment of a storage medium of the present application.
  • the mainstream data replication protocol is the PacificA replication protocol, which can reduce the cost of coordination and thereby improve the efficiency of reaching consensus.
  • PacificA's replica data uses a master-slave framework to ensure data consistency. Multiple copies of the data are stored in a master replica node and multiple slave replica nodes. Data is read and written by the leader node. This data processing method is simple and can always be read from the leader node. Consistent data. Obviously, in this kind of system, as long as the Leader node is alive, the Follower node is in a warm-up state. Therefore, data read scalability is poor, and resources cannot be used well.
  • FIG. 1 is a schematic structural diagram of an embodiment of the distributed storage system of the present application
  • FIG. 2 is a schematic diagram of the distributed storage system of the embodiment of FIG. Structure diagram.
  • the distributed storage system 101 of the present application includes a client 102 and a storage terminal 103, where the storage terminal 103 includes a first storage node 104, at least two second storage nodes 105, and at least two read request coordination modules 106, and read request coordination
  • the module 106 is provided corresponding to the second storage node 105, wherein the first storage node 104 is used to store data, and at least two second storage nodes 105 are used to store a copy of the data.
  • the data stored by the first storage node 104 in this embodiment may be original data written by the client 102 or a copy of the original data, which is not specifically limited.
  • the distributed storage system 101 in this embodiment may use the PacificA storage framework.
  • the storage terminal 103 in this embodiment is used as a storage cluster, and is mainly responsible for reading and updating system data, and ensuring data reliability by using multiple copies. And availability; the distributed storage system 101 in this embodiment may further include a configuration management cluster, which is mainly responsible for maintaining replica information, such as the participating nodes of the replica, the master replica node, and the version number of the current replica.
  • the differences between the distributed storage system 101 of the present application and the traditional distributed storage system based on the PacificA storage framework include at least: the data storage point 103 of this embodiment is provided with a read request coordination module 106 and the read request coordination module 106 may be connected to the first storage node.
  • 104 (Leader node) jointly processes multiple data read requests generated by the client 102. Therefore, in this way, multiple data read requests can be processed in a balanced manner through the Leader node and the Follower node, which can not only ensure the consistency of the read data It can improve the read scalability of data and make reasonable use of resources.
  • This application further proposes a data reading and writing method for a distributed storage system.
  • the method of this implementation is used to implement data reading of the distributed storage system 101 of the foregoing embodiment.
  • the data reading and writing method of this embodiment It includes the following steps:
  • Step S301 The client 102 generates multiple data read requests, and the multiple data read requests include a first data read request and a second data read request.
  • the client 102 in this embodiment may divide a plurality of data read requests into a first data read request and a second data read request according to a preset percentage x.
  • the preset percentage x in this embodiment is a ratio of the number of first data read requests to the total number of multiple data read requests.
  • the preset percentage x in this embodiment satisfies the following formula:
  • p is the probability that the second storage node 105 is set in the second storage node set
  • n is the sum of the number of the first storage nodes 104 and the number of the second storage nodes 105, and n is greater than or equal to three.
  • the second storage node set is a majority formed by the read request coordination module 106 selecting a plurality of second storage nodes 105 according to P after receiving the second data read request.
  • Majority is used for data copy management. It can adjust the number of write copies and read copies according to the actual situation, so that the data can achieve a balance between reliability and performance.
  • p in this embodiment satisfies the following formula:
  • n in this embodiment is equal to 3, that is, the storage terminal 103 includes one first storage node 104 and two second storage nodes 105. It can be known from the above formula that when n is equal to 3, p is equal to 1, that is, the probability that each second storage node 105 is set in the second storage node set is 1, so both the second storage nodes 105 are reading requests.
  • Step S302 The client 102 sends a first data read request to the first storage node 104 and sends a second data request to the read request coordination module 106.
  • the second data read request sent by the client 102 is managed by the read request coordination module 106, so that multiple second storage nodes 105 can process multiple second data read requests in a balanced manner.
  • Step S303 the first storage node 104 obtains the first data request, and obtains the first data from the stored data according to the first data request; the read request coordination module 106 obtains the second data read request, and retrieves the second data request from the first Acquire the second data from the data stored by the two storage nodes 105.
  • the method shown in FIG. 4 is used in this application to implement the method for the first storage node 104 to obtain the first data request, and to obtain the first data from the stored data according to the first data request.
  • the method in this embodiment includes steps S401-S404:
  • Step S401 The first storage node 104 obtains a first data read request, and obtains first identification information of the first data from the first data read request.
  • Step S402 The first storage node 104 determines whether the first identification information matches the second identification information in the cache list of the first storage node, and if yes, proceeds to step S403, and if not, proceeds to step S404.
  • each storage node of the storage terminal 103 in this embodiment is provided with a prepare list, and the prepare list is used to cache at least the identification information of the data stored in the storage node.
  • Step S403 The first storage node 104 obtains the first data corresponding to the first identification information, and sends the first data corresponding to the first identification information to the client 102.
  • the first identification information and the second identification information are successfully matched, it can further determine whether the first data corresponding to the first identification information stored by the first storage node 104 is missing. If the first data is not missing, , The first data is sent to the client 102; if the first data is missing, the first identification information can be further matched with the third identification information stored by the first storage node 104, and operations such as data loss are not described herein. .
  • Step S404 The first storage node 104 sets the version number corresponding to the first data to zero, and sends the zeroed version number to the client 102.
  • the version number of the first data may be set to zero.
  • the method shown in FIG. 5 is used to implement the method for the read request coordination module 103 to obtain the second data read request, and to obtain the second data from the data stored by the second storage node 105 according to the second data request.
  • the method in this embodiment includes steps S501-S505:
  • Step S501 The read request coordination module 106 obtains a second data read request, obtains a second storage node set, and sends the second data read request to the second storage node 105 in the second storage node set.
  • the second storage node set is not repeated here.
  • Step S502 The second storage node 105 receives the second data read request, obtains a version number corresponding to the second data according to the second data request, and sends the version number to the read request coordination module 106.
  • Step S503 The read request coordination module 106 receives the version numbers sent by all the second storage nodes 105, and obtains the maximum value of the multiple version numbers.
  • the data enters the first storage node 104 for processing.
  • the first storage node 104 first assigns a version number to the data, and then inserts the data into the prepare list.
  • the data on the prepare list is arranged in order according to the version number, and then The data carrying the version number is sent to the second storage node 105, and the second storage node 105 also inserts the data into the prepare list.
  • the version number is incremented. Therefore, the second data corresponding to the largest version number is the latest second data.
  • Step S504 The read request coordination module 106 determines whether the second data corresponding to the maximum value is missing. If so, the process proceeds to step S505; if not, the process returns to step S501.
  • the data update will be incomplete due to system power failure or data transmission problems, resulting in data loss. Therefore, you should determine whether the data is missing before obtaining the data.
  • Step S505 The read request coordination module 106 sends the second data corresponding to the maximum value to the client 102.
  • Step S304 The first storage node 104 sends the first data to the client 102, and the read request coordination module 106 sends the second data to the client 102.
  • the read request coordination module may also be provided on each storage node of the storage terminal. When processing the read data request, only the read request coordination module set corresponding to the second storage node is selected to take effect.
  • the client 102 of the distributed storage system 101 in this embodiment divides the generated multiple data read requests into a first data read request and a second data read request, and sends the first data read request to the first A storage node 104 to obtain the first data from the first storage node 104 and send a second data read request to the read request coordination module 106 to obtain the second data from the second storage node 105 through the read request coordination module 106, Therefore, the second storage node 105 in this embodiment can co-process multiple data read requests from the client 102 with the first storage node 104, so that multiple data read requests generated by the client 102 can be evenly distributed in the distributed storage system. In the entire storage node cluster of 101, the read expansion capability of the distributed storage system 101 can be improved.
  • the method shown in FIG. 6 may be used in this application to implement the method for the second storage node 105 to obtain the version number corresponding to the second data according to the second data request.
  • the method in this embodiment includes the following steps:
  • Step S601 The second storage node 105 obtains the first identification information of the second data from the second data read request.
  • Step S602 The second storage node 105 determines whether the first identification information matches the second identification information in the cache list of the second storage node, and if yes, proceeds to step S603.
  • Step S603 The second storage node 105 obtains a version number corresponding to the first identification information from the cache list, and sends the version number corresponding to the first identification information to the read request coordination module 106.
  • Step S604 The second storage node 105 determines whether the first identification information matches the third identification information stored by the second storage node 105, and if yes, proceeds to step S605, and if not, proceeds to step S606.
  • Each storage node in this embodiment is equivalent to a server, which includes a cache list and disk storage space.
  • the data can be further queried from the disk storage space.
  • Step S605 The second storage node 105 obtains a version number corresponding to the first identification information, and sends the version number corresponding to the first identification information to the read request coordination module 106.
  • Step S606 The second storage node 105 sets the version number of the second data to zero, and sends the zeroed version number to the read request coordination module 106.
  • This application further proposes a data reading and writing method for a distributed storage system in another embodiment.
  • the method in this embodiment is used to implement data writing in the distributed storage system in the foregoing embodiment.
  • the method in this embodiment includes the following specific steps:
  • Step S701 The client 102 generates a data write request.
  • Step S702 The client 102 sends a data write request to the first storage node 104.
  • the data write requests of the distributed storage system 101 in this embodiment are all processed at the first storage node 104.
  • Step S703 The first storage node 104 receives the data write request, obtains the third data according to the data read request, and sends the third data to the second storage node 105.
  • Step S704 The second storage node 105 receives and saves the third data.
  • the second storage node 105 and the first storage node 104 in this embodiment can jointly process multiple data read requests from the client 102, so that the multiple data read requests generated by the client 102 can be evenly distributed in the distribution.
  • the read expansion capability of the distributed storage system 101 can be improved.
  • the second storage node 105 shares the data read request, so that the first storage node 104 has more resources to process the write request, the throughput of the entire cluster data writing of the distributed storage system 101 can be improved.
  • the data reading and writing method of this embodiment includes: a first storage node 104 obtaining a first data read request from a client 102, and according to the first data Request to obtain the first data from the stored data, and send the first data to the client 102; the read request coordination module 106 obtains the second data read request from the client 102, and according to the second data request from the second storage The second data is acquired from the data stored by the node 105, and the second data is sent to the client 102.
  • this embodiment uses the second storage node 105 and the first storage node 104 to jointly process multiple data read requests from the client 102, so that multiple data read requests generated by the client 102 can be evenly distributed in the distribution.
  • the read expansion capability of the distributed storage system 101 can be improved
  • the distributed storage system 801 in this embodiment includes a client 802 and a storage terminal 803.
  • the storage terminal 803 includes a first storage node 804, at least Two second storage nodes 805 and at least two read request coordination modules 806.
  • the read request coordination module 806 is set corresponding to the second storage node 805.
  • the first storage node 804 is used for storing data, and the at least two second storage nodes 805 are used for For storing a copy of the data;
  • the client 802 is configured to generate multiple data read requests, and the multiple data read requests include a first data read request and a second data read request;
  • the client 802 is configured to send a first to the first storage node 804 A data read request and a second data request to the read request coordination module 806;
  • the first storage node 804 is configured to obtain the first data request, and obtain the first data from the stored data according to the first data request, and send the first data Sent to the client 802;
  • the read request coordination module 806 is configured to obtain a second data read request, and from the data stored in the second storage node 805 according to the second data request A second data fetch, and the second data transmission to the client 802.
  • the client 802 of the distributed storage system 801 in this embodiment divides the generated multiple data read requests into a first data read request and a second data read request, and sends the first data read request to the first A storage node 804 to obtain the first data from the first storage node 804 and send a second data read request to the read request coordination module 806 to obtain the second data from the second storage node 805 through the read request coordination module 806, Therefore, the second storage node 805 in this embodiment can co-process multiple data read requests from the client 802 with the first storage node 804, so that multiple data read requests generated by the client 802 can be evenly distributed in the distributed storage system. In the entire storage node cluster of 801, the read expansion capability of the distributed storage system 801 can be improved.
  • the distributed storage system 801 in this embodiment may use the data reading and writing method in the foregoing method embodiment to read and write data, and details are not described herein.
  • FIG. 9 is a schematic structural diagram of an embodiment of a storage terminal according to the present application.
  • the storage terminal 901 in this embodiment includes a first storage node 902, at least two second storage nodes 903, and a read request coordination module 904.
  • the first storage node 902 is configured to store data, and the first storage node 902 obtains the first storage node from the client.
  • a data read request and obtains the first data from the stored data according to the first data read request, and sends the first data to the client;
  • the second storage node 903 is used to store a copy of the data;
  • the read request coordination module 904 is used
  • a second data read request is obtained from the client, and the second data is obtained from the data stored by the second storage node 903 according to the second data request, and the second data is sent to the client.
  • the second storage node 903 of the storage terminal 901 in this embodiment can co-process the data read request of the client with the first storage node 902, so that multiple data read requests generated by the client can be evenly distributed on the storage terminal.
  • the read expansion capability of the terminal 901 can be stored.
  • FIG. 10 is a schematic structural diagram of another embodiment of a storage terminal of the present application.
  • the storage terminal 1001 in this embodiment includes a storage module 1002, a transceiver module 1003, and a processing module 1004.
  • the storage module 1002 is configured to store data;
  • the transceiver module 1003 is configured to receive a data read request from a client;
  • the processing module 1004 is configured to read data Request to obtain the requested data from the data stored in the storage module 1002; the transceiver module 1003 further sends the requested data to the client.
  • this embodiment enables multiple data read requests generated by a client to be evenly distributed throughout the entire storage node cluster of the storage terminal 1001, thereby improving the read expansion capability of the storage terminal 1001.
  • FIG. 11 is a schematic structural diagram of an embodiment of the storage medium of the present application.
  • the storage medium 1101 of this embodiment is used to store the related data 1102 and program data 1103 of the foregoing embodiment, where the related data 1102 includes at least the above-mentioned read request and write request, and the program data 1103 can be executed by the method in the above method embodiment.
  • the related data 1102 and the program data 1103 have been described in detail in the foregoing method embodiments, and are not described herein again.
  • the device 1101 with a storage function in this embodiment may be, but is not limited to, a U disk, an SD card, a PD optical drive, a mobile hard disk, a large-capacity floppy drive, a flash memory, a multimedia memory card, a server, and the like.
  • the distributed storage system in the embodiment of the present application includes a client and a storage terminal, where the storage terminal includes a first storage node, at least two second storage nodes, and at least two read request coordination modules, and read request coordination
  • the module is set corresponding to a second storage node, where the first storage node is used to store data, and at least two second storage nodes are used to store a copy of the data.
  • the distributed storage system data read and write method includes: the client generates multiple Data read request, the multiple data read requests include a first data read request and a second data read request; the client sends a first data read request to a first storage node and a second data request to a read request coordination module; the first storage The node obtains the first data request, and obtains the first data from the stored data according to the first data request; the read request coordination module obtains the second data read request, and obtains from the data stored by the second storage node according to the second data request.
  • the present application divides multiple data read requests generated by the client into a first data read request and a second data read request, and sends the first data read request to the first storage node to retrieve the data from the first storage.
  • the node obtains the first data and sends a second data read request to the read request coordination module to obtain the second data from the second storage node through the read request coordination module. Therefore, the second storage node of the present application can communicate with the first storage
  • the nodes jointly process multiple data read requests from the client, so that multiple data read requests generated by the client can be evenly distributed across the entire storage node cluster of the distributed storage system, thereby improving the read expansion capability of the distributed storage system.
  • this application also provides a storage device that stores program data.
  • the program data can be executed to implement the method of the above embodiment, and the storage device may be, for example, a U disk, an optical disk, a server, or the like. That is, the present application may be embodied in the form of a software product, which includes several instructions for causing a smart terminal to perform all or part of the steps of the methods described in the embodiments.
  • first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as “first” and “second” may explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality” is at least two, for example, two, three, etc., unless it is specifically and specifically defined otherwise.
  • Any process or method description in a flowchart or otherwise described herein can be understood as a module, fragment, or portion of code that includes one or more executable instructions for implementing a particular logical function or step of a process
  • the scope of the preferred embodiments of this application includes additional implementations in which the functions may be performed out of the order shown or discussed, including performing the functions in a substantially simultaneous manner or in the reverse order according to the functions involved, which should It is understood by those skilled in the art to which the embodiments of the present application pertain.
  • Logic and / or steps represented in a flowchart or otherwise described herein, for example, a sequenced list of executable instructions that may be considered to implement a logical function, may be embodied in any computer-readable medium, For use by, or in combination with, an instruction execution system, device, or device (which may be a personal computer, server, network device, or other system that can take instructions from the instruction execution system, device, or device and execute instructions) While using.
  • a "computer-readable medium" may be any device that can contain, store, communicate, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.
  • computer-readable media include the following: electrical connections (electronic devices) with one or more wirings, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disk read-only memory (CDROM).
  • the computer-readable medium may even be paper or other suitable medium on which the program can be printed, because, for example, by optically scanning the paper or other medium, followed by editing, interpretation, or other suitable Processing to obtain the program electronically and then store it in computer memory.

Landscapes

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

Abstract

Disclosed are a distributed storage system and a data read-write method therefor, and a storage terminal and a storage medium. The data read-write method for the distributed storage system comprises: a client generating multiple data read requests, wherein the multiple data read requests comprise a first data read request and a second data read request (S301); the client sending the first data read request to a first storage node and sending the second data read request to a read request coordination module (S302); the first storage node acquiring the first data read request and acquiring first data from stored data according to the first data read request; and the read request coordination module acquiring the second data read request and acquiring second data from data stored in a second storage node according to the second data read request (S303); the first storage node sending the first data to the client; and the read request coordination module sending the second data to the client (S304). In this way, a read expansion capability of the distributed storage system can be improved.

Description

分布式存储系统及其数据读写方法、存储终端及存储介质Distributed storage system and data reading and writing method, storage terminal and storage medium 【技术领域】[Technical Field]
本申请涉及信息技术领域,特别是涉及一种分布式存储系统及其数据读写方法、存储终端及存储介质。The present application relates to the field of information technology, and in particular, to a distributed storage system and a data read / write method, a storage terminal, and a storage medium.
【背景技术】【Background technique】
随着信息量的急剧增长,大规模的分布式存储系统变得越来越重要。为此,微软为大规模分布式存储系统开发了一个通用复制框架PacificA,PacificA也可称之为一个原型系统。该框架简单,实用,提供强一致性,并且可以适配不同的复制策略。With the rapid increase in the amount of information, large-scale distributed storage systems have become increasingly important. To this end, Microsoft developed a general replication framework PacificA for large-scale distributed storage systems. PacificA can also be called a prototype system. The framework is simple, practical, provides strong consistency, and can be adapted to different replication strategies.
本申请的发明人在长期的研发工作中发现,区块链通讯软件(BlockchainMessenger,BCM)依赖后端的分布式存储系统来存储账户、通讯录等海量数据,目前后端分布式存储系统采用PacificA复制协议管理同一个数据的多个数据副本。在PacificA复制协议中,所有的读写操作都从Leader节点(主副本节点)发起,数据的读能力不会随着更多数据副本的加入而得到提升,因此其读扩展性较差。The inventor of this application has found in long-term research and development that Blockchain Communications Software (Blockchain Messenger, BCM) relies on a back-end distributed storage system to store massive data such as accounts and contacts. Currently, the back-end distributed storage system uses PacificA to replicate The protocol manages multiple copies of the same data. In the PacificA replication protocol, all read and write operations are initiated from the Leader node (master replica node). The read capacity of the data will not be improved as more data replicas are added, so its read scalability is poor.
【发明内容】[Summary of the Invention]
本申请主要解决的技术问题是提供一种分布式存储系统及其数据读写方法、存储终端及存储介质,以提升分布式存储系统的读扩展能力。The technical problem mainly solved by this application is to provide a distributed storage system and a method for reading and writing data, a storage terminal, and a storage medium to improve the read expansion capability of the distributed storage system.
为解决上述技术问题,本申请采用的一个技术方案是:提供一种分布式存储系统的数据读写方法。该分布式存储系统包括客户端及存储终端,其中,存储终端包括第一存储节点、至少两个第二存储节点及至少两个读请求协调模块,读请求协调模块与第二存储节点对应设置,其中,第一存储节点用于存储数据,至少两个第二存储节点用于存储数据的副本,数据读写方法包括:客户端生成多个数据读请求,多个数据读请求包括第一数据读请求和第二数据读请求;客户端向第一存储节点发送第一数据读请求及向读请求协调模块发送第二数据请求;第一存储节点获取第一数据请求,并根据第一数据请求从存储的数据中获取第一数据;读请求协调模块获取第二数据读请求,并根据第二数据请求从第二存储节点存储的数据中获取第二数据;第一存储节点将第一数据发送至客户 端;读请求协调模块将第二数据发送至客户端。In order to solve the above technical problems, a technical solution adopted in the present application is to provide a data reading and writing method for a distributed storage system. The distributed storage system includes a client and a storage terminal, where the storage terminal includes a first storage node, at least two second storage nodes, and at least two read request coordination modules, and the read request coordination module is set corresponding to the second storage node, The first storage node is used to store data, and at least two second storage nodes are used to store data copies. The data read and write method includes: the client generates multiple data read requests, and the multiple data read requests include the first data read Request and the second data read request; the client sends the first data read request to the first storage node and the second data request to the read request coordination module; the first storage node obtains the first data request, and according to the first data request, The first data is obtained from the stored data; the read request coordination module obtains the second data read request, and obtains the second data from the data stored by the second storage node according to the second data request; the first storage node sends the first data to Client; the read request coordination module sends the second data to the client.
为解决上述技术问题,本申请采用的另一个技术方案是:提供一种分布式存储系统,该分布式存储系统包括客户端及存储终端,其中,存储终端包括第一存储节点、至少两个第二存储节点及至少两个读请求协调模块,读请求协调模块与第二存储节点对应设置,第一存储节点用于存储数据,至少两个第二存储节点用于存储数据的副本;客户端用于生成多个数据读请求,多个数据读请求包括第一数据读请求和第二数据读请求;客户端用于向第一存储节点发送第一数据读请求及向读请求协调模块发送第二数据请求;第一存储节点用于获取第一数据请求,并根据第一数据请求从存储的数据中获取第一数据,且将第一数据发送至客户端;读请求协调模块用于获取第二数据读请求,并根据第二数据请求从第二存储节点存储的数据中获取第二数据,且将第二数据发送至客户端。In order to solve the above technical problem, another technical solution adopted in the present application is to provide a distributed storage system including a client and a storage terminal, where the storage terminal includes a first storage node, at least two first storage nodes, Two storage nodes and at least two read request coordination modules. The read request coordination module is set corresponding to the second storage node. The first storage node is used to store data, and the at least two second storage nodes are used to store a copy of the data. For generating multiple data read requests, the multiple data read requests include a first data read request and a second data read request; the client is configured to send the first data read request to the first storage node and the second data read request to the read request coordination module. Data request; the first storage node is used to obtain the first data request, and obtains the first data from the stored data according to the first data request, and sends the first data to the client; the read request coordination module is used to obtain the second A data read request, and obtain the second data from the data stored by the second storage node according to the second data request, and copy the second data To the client.
为解决上述技术问题,本申请采用的又一个技术方案是:提供一种分布式存储系统的数据读写方法,该分布式存储系统包括客户端及存储终端,其中,存储终端包括第一存储节点、至少两个第二存储节点及至少两个读请求协调模块,读请求协调模块与第二存储节点对应设置,第一存储节点用于存储数据,至少两个第二存储节点用于存储数据的副本,数据读写方法包括:第一存储节点从客户端获取第一数据读请求,并根据第一数据请求从存储的数据中获取第一数据,且将第一数据发送至客户端;读请求协调模块从客户端获取第二数据读请求,并根据第二数据请求从第二存储节点存储的数据中获取第二数据,且将第二数据发送至客户端。In order to solve the above technical problem, another technical solution adopted in the present application is to provide a data reading and writing method for a distributed storage system. The distributed storage system includes a client and a storage terminal. The storage terminal includes a first storage node. At least two second storage nodes and at least two read request coordination modules, the read request coordination modules are set corresponding to the second storage node, the first storage node is used to store data, and the at least two second storage nodes are used to store data The copy and data read and write method includes: the first storage node obtains the first data read request from the client, and obtains the first data from the stored data according to the first data request, and sends the first data to the client; the read request The coordination module obtains the second data read request from the client, obtains the second data from the data stored by the second storage node according to the second data request, and sends the second data to the client.
为解决上述技术问题,本申请采用的再一个技术方案是:提供一种存储终端,该存储终端包括:第一存储节点,用于存储数据,第一存储节点从客户端获取第一数据读请求,并根据第一数据读请求从存储的数据中获取第一数据,且将第一数据发送至所述客户端;至少两个第二存储节点,用于存储数据的副本;读请求协调模块,用于从客户端获取第二数据读请求,并根据第二数据请求从第二存储节点存储的数据中获取第二数据,且将第二数据发送至客户端。In order to solve the above technical problem, another technical solution adopted in the present application is to provide a storage terminal. The storage terminal includes a first storage node for storing data, and the first storage node obtains a first data read request from a client. And obtaining the first data from the stored data according to the first data read request and sending the first data to the client; at least two second storage nodes for storing a copy of the data; a read request coordination module, Configured to obtain a second data read request from a client, obtain second data from data stored by a second storage node according to the second data request, and send the second data to the client.
为解决上述技术问题,本申请采用的再一个技术方案是:提供一种存储终端,该存储终端包括:存储模块,用于存储数据;收发模块,用于从客户端接收数据读请求;处理模块,用于根据数据读请求从存储模块存储的数据中获取被请求的数据;收发模块进一步将被请求的数据发送至客户端。In order to solve the above technical problem, another technical solution adopted in the present application is to provide a storage terminal, which includes: a storage module for storing data; a transceiver module for receiving data read requests from a client; a processing module , Used to obtain the requested data from the data stored in the storage module according to the data read request; the transceiver module further sends the requested data to the client.
为解决上述技术问题,本申请采用的再一个技术方案是:提供一种存储介质,其上存储有程序数据,该程序数据被执行时实现上述方法中的步骤。In order to solve the above technical problem, another technical solution adopted in the present application is to provide a storage medium on which program data is stored, and when the program data is executed, the steps in the foregoing method are implemented.
本申请的有益效果是:区别于现有技术,本申请实施例分布式存储系统包括客户端及存储终端,其中,存储终端包括第一存储节点、至少两个第二存储节点及至少两个读请求协调模块,读请求协调模块与第二存储节点对应设置,其中,第一存储节点用于存储数据,至少两个第二存储节点用于存储数据的副本,该分布式存储系统数据读写方法包括:客户端生成多个数据读请求,多个数据读请求包括第一数据读请求和第二数据读请求;客户端向第一存储节点发送第一数据读请求及向读请求协调模块发送第二数据请求;第一存储节点获取第一数据请求,并根据第一数据请求从存储的数据中获取第一数据;读请求协调模块获取第二数据读请求,并根据第二数据请求从第二存储节点存储的数据中获取第二数据;第一存储节点将第一数据发送至客户端;读请求协调模块将第二数据发送至客户端。通过这种方式,本申请将客户端生成的多个数据读请求分为第一数据读请求及第二数据读请求,并将第一数据读请求发送至第一存储节点,以从第一存储节点获取第一数据,同时将第二数据读请求发送至读请求协调模块,以通过读请求协调模块从第二存储节点获取第二数据,因此,本申请的第二存储节点能够与第一存储节点共同处理客户端的多个数据读请求,使客户端生成的多个数据读请求可以均衡地分布在分布式存储系统的整个存储节点集群中,从而能够提升分布式存储系统的读扩展能力。The beneficial effect of the present application is that, unlike the prior art, the distributed storage system in the embodiment of the present application includes a client and a storage terminal. The storage terminal includes a first storage node, at least two second storage nodes, and at least two read nodes. The request coordination module, the read request coordination module is set corresponding to the second storage node, wherein the first storage node is used to store data, at least two second storage nodes are used to store a copy of the data, and the distributed storage system data read and write method The method includes: the client generates multiple data read requests, and the multiple data read requests include a first data read request and a second data read request; the client sends a first data read request to the first storage node and sends a first data read request to the read request coordination module. Two data requests; the first storage node obtains the first data request and obtains the first data from the stored data according to the first data request; the read request coordination module obtains the second data read request and retrieves the second data request from the second data request The second data is obtained from the data stored by the storage node; the first storage node sends the first data to the client; the read request A second transfer module transmits data to the client. In this way, the present application divides multiple data read requests generated by the client into a first data read request and a second data read request, and sends the first data read request to the first storage node to retrieve the data from the first storage. The node obtains the first data and sends a second data read request to the read request coordination module to obtain the second data from the second storage node through the read request coordination module. Therefore, the second storage node of the present application can communicate with the first storage The nodes jointly process multiple data read requests from the client, so that multiple data read requests generated by the client can be evenly distributed across the entire storage node cluster of the distributed storage system, thereby improving the read expansion capability of the distributed storage system.
【附图说明】[Brief Description of the Drawings]
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some of the present application. For those of ordinary skill in the art, other embodiments may be obtained based on these drawings without paying creative labor.
图1是本申请分布式存储系统一实施例的结构示意图;FIG. 1 is a schematic structural diagram of an embodiment of a distributed storage system of the present application;
图2是图1实施例分布式存储系统的结构框图;FIG. 2 is a structural block diagram of the distributed storage system of the embodiment of FIG. 1; FIG.
图3是本申请分布式存储系统的数据读写方法一实施例的结构示意图;3 is a schematic structural diagram of an embodiment of a data reading and writing method of a distributed storage system according to the present application;
图4是图3实施例分布式存储系统的数据读写方法中步骤S203的一具体流程示意图;FIG. 4 is a schematic flowchart of step S203 in the data reading and writing method of the distributed storage system in the embodiment of FIG. 3; FIG.
图5是图3实施例分布式存储系统的数据读写方法中步骤S203的另一具体 流程示意图;5 is another schematic flowchart of step S203 in the data reading and writing method of the distributed storage system in the embodiment of FIG. 3;
图6是图5实施例分布式存储系统的数据读写方法中步骤S402的具体流程示意图;FIG. 6 is a detailed flowchart of step S402 in the data reading and writing method of the distributed storage system in the embodiment of FIG. 5; FIG.
图7是本申请分布式存储系统的数据读写方法另一实施例的结构示意图;7 is a schematic structural diagram of another embodiment of a data reading and writing method for a distributed storage system of the present application;
图8是本申请分布式存储系统另一实施例的结构示意图;8 is a schematic structural diagram of another embodiment of a distributed storage system of the present application;
图9是本申请存储终端一实施例的结构示意图;9 is a schematic structural diagram of an embodiment of a storage terminal according to the present application;
图10是本申请存储终端另一实施例的结构示意图;10 is a schematic structural diagram of another embodiment of a storage terminal according to the present application;
图11是本申请存储介质一实施例的结构示意图。FIG. 11 is a schematic structural diagram of an embodiment of a storage medium of the present application.
【具体实施方式】【detailed description】
下面结合附图和实施例,对本申请作进一步的详细描述。特别指出的是,以下实施例仅用于说明本申请,但不对本申请的范围进行限定。同样的,以下实施例仅为本申请的部分实施例而非全部实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。The following describes the present application in detail with reference to the accompanying drawings and embodiments. It is particularly pointed out that the following examples are only used to illustrate the present application, but not to limit the scope of the present application. Similarly, the following embodiments are only some of the embodiments of the present application, but not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
在分布式存储系统中,主流的数据复制协议是PacificA复制协议,它能够减少协调的开销,从而提升达成共识的效率。PacificA的副本数据采用主从式框架,以保证数据一致性。数据的多个副本存储于一个主副本(Leader)节点和多个从副本(Follower)节点,数据的读写都由Leader节点处理,这种数据处理方式简单,且从Leader节点始终可以读取到一致性较好的数据。显然,在这类系统中,只要Leader节点存活,Follower节点就处于一种温备状态,因此,数据读扩展性较差,且资源不能被很好地利用。In a distributed storage system, the mainstream data replication protocol is the PacificA replication protocol, which can reduce the cost of coordination and thereby improve the efficiency of reaching consensus. PacificA's replica data uses a master-slave framework to ensure data consistency. Multiple copies of the data are stored in a master replica node and multiple slave replica nodes. Data is read and written by the leader node. This data processing method is simple and can always be read from the leader node. Consistent data. Obviously, in this kind of system, as long as the Leader node is alive, the Follower node is in a warm-up state. Therefore, data read scalability is poor, and resources cannot be used well.
为解决上述问题,本申请首先提出一种分布式存储系统,如图1所示,图1是本申请分布式存储系统一实施例的结构示意图;图2是图1实施例分布式存储系统的结构框图。本申请分布式存储系统101包括:客户端102及存储终端103,其中,存储终端103包括第一存储节点104、至少两个第二存储节点105及至少两个读请求协调模块106,读请求协调模块106与第二存储节点105对应设置,其中,第一存储节点104用于存储数据,至少两个第二存储节点105用于存储数据的副本。In order to solve the above problems, the present application first proposes a distributed storage system. As shown in FIG. 1, FIG. 1 is a schematic structural diagram of an embodiment of the distributed storage system of the present application; FIG. 2 is a schematic diagram of the distributed storage system of the embodiment of FIG. Structure diagram. The distributed storage system 101 of the present application includes a client 102 and a storage terminal 103, where the storage terminal 103 includes a first storage node 104, at least two second storage nodes 105, and at least two read request coordination modules 106, and read request coordination The module 106 is provided corresponding to the second storage node 105, wherein the first storage node 104 is used to store data, and at least two second storage nodes 105 are used to store a copy of the data.
其中,本实施例的第一存储节点104存储的数据可以是客户端102写入的原数据或者该原数据的副本,具体不做限定。The data stored by the first storage node 104 in this embodiment may be original data written by the client 102 or a copy of the original data, which is not specifically limited.
在一个应用场景中,本实施例分布式存储系统101可采用PacificA存储框 架,本实施例的存储终端103作为存储集群,主要负责系统数据的读取和更新,通过使用多副本方式保证数据可靠性和可用性;本实施例分布式存储系统101可进一步包括配置管理集群,主要负责维护副本信息,如副本的参与节点,主副本节点,当前副本的版本号等。In an application scenario, the distributed storage system 101 in this embodiment may use the PacificA storage framework. The storage terminal 103 in this embodiment is used as a storage cluster, and is mainly responsible for reading and updating system data, and ensuring data reliability by using multiple copies. And availability; the distributed storage system 101 in this embodiment may further include a configuration management cluster, which is mainly responsible for maintaining replica information, such as the participating nodes of the replica, the master replica node, and the version number of the current replica.
本申请分布式存储系统101与传统的基于PacificA存储框架的分布式存储系统的区别至少包括:本实施例的数据存储点103设置有读请求协调模块106读请求协调模块106可以与第一存储节点104(Leader节点)共同处理客户端102生成的多个数据读请求,因此,通过这种方式,多个数据读请求可以均衡的通过Leader节点与Follower节点进行处理,不仅能够保证读取数据的一致性,而且能够提升数据读扩展性,使资源合理利用。The differences between the distributed storage system 101 of the present application and the traditional distributed storage system based on the PacificA storage framework include at least: the data storage point 103 of this embodiment is provided with a read request coordination module 106 and the read request coordination module 106 may be connected to the first storage node. 104 (Leader node) jointly processes multiple data read requests generated by the client 102. Therefore, in this way, multiple data read requests can be processed in a balanced manner through the Leader node and the Follower node, which can not only ensure the consistency of the read data It can improve the read scalability of data and make reasonable use of resources.
本申请进一步提出一种分布式存储系统的数据读写方法,如图3所示,本实施的方法用于实现上述实施例分布式存储系统101的数据读取,本实施例的数据读写方法具体包括以下步骤:This application further proposes a data reading and writing method for a distributed storage system. As shown in FIG. 3, the method of this implementation is used to implement data reading of the distributed storage system 101 of the foregoing embodiment. The data reading and writing method of this embodiment It includes the following steps:
步骤S301:客户端102生成多个数据读请求,多个数据读请求包括第一数据读请求和第二数据读请求。Step S301: The client 102 generates multiple data read requests, and the multiple data read requests include a first data read request and a second data read request.
可选地,本实施例的客户端102可以按照预设百分比x将多个数据读请求划分为第一数据读请求及第二数据读请求。具体地,本实施例的预设百分比x为第一数据读请求的数量与多个数据读请求的总数量之比。Optionally, the client 102 in this embodiment may divide a plurality of data read requests into a first data read request and a second data read request according to a preset percentage x. Specifically, the preset percentage x in this embodiment is a ratio of the number of first data read requests to the total number of multiple data read requests.
可选地,本实施例的预设百分比x满足下述公式:Optionally, the preset percentage x in this embodiment satisfies the following formula:
Figure PCTCN2018102027-appb-000001
Figure PCTCN2018102027-appb-000001
其中,p为第二存储节点105设置在第二存储节点集合中的概率,n为第一存储节点104的数量与第二存储节点105的数量之和,且n大于或等于3。Among them, p is the probability that the second storage node 105 is set in the second storage node set, n is the sum of the number of the first storage nodes 104 and the number of the second storage nodes 105, and n is greater than or equal to three.
其中,第二存储节点集合是读请求协调模块106接收第二数据读请求之后根据P选择多个第二存储节点105组成的多数派。多数派用于数据副本管理,其可以根据实际情况调整写副本数及读副本数,使数据在可靠性和性能之间取得平衡。The second storage node set is a majority formed by the read request coordination module 106 selecting a plurality of second storage nodes 105 according to P after receiving the second data read request. Majority is used for data copy management. It can adjust the number of write copies and read copies according to the actual situation, so that the data can achieve a balance between reliability and performance.
可选地,本实施例的p满足下述公式:Optionally, p in this embodiment satisfies the following formula:
Figure PCTCN2018102027-appb-000002
Figure PCTCN2018102027-appb-000002
如图2所示,本实施例的n等于3,即存储终端103包括一个第一存储节点104和两个第二存储节点105。由上述公式可知,n等于3时,p等于1,也就是说,每个第二存储节点105设置在第二存储节点集合中的概率为1,因此,两个第二存储节点105均在读请求协调模块106形成的第二存储节点集合中。As shown in FIG. 2, n in this embodiment is equal to 3, that is, the storage terminal 103 includes one first storage node 104 and two second storage nodes 105. It can be known from the above formula that when n is equal to 3, p is equal to 1, that is, the probability that each second storage node 105 is set in the second storage node set is 1, so both the second storage nodes 105 are reading requests. The second storage node set formed by the coordination module 106.
步骤S302:客户端102向第一存储节点104发送第一数据读请求及向读请求协调模块106发送第二数据请求。Step S302: The client 102 sends a first data read request to the first storage node 104 and sends a second data request to the read request coordination module 106.
本实施例通过读请求协调模块106对客户端102发送的第二数据读请求进行管理,以使多个第二存储节点105能够均衡的处理多个第二数据读请求。In this embodiment, the second data read request sent by the client 102 is managed by the read request coordination module 106, so that multiple second storage nodes 105 can process multiple second data read requests in a balanced manner.
步骤S303:第一存储节点104获取第一数据请求,并根据第一数据请求从存储的数据中获取第一数据;读请求协调模块106获取第二数据读请求,并根据第二数据请求从第二存储节点105存储的数据中获取第二数据。Step S303: the first storage node 104 obtains the first data request, and obtains the first data from the stored data according to the first data request; the read request coordination module 106 obtains the second data read request, and retrieves the second data request from the first Acquire the second data from the data stored by the two storage nodes 105.
可选地,本申请采用如图4所示的方法实现上述第一存储节点104获取第一数据请求,并根据第一数据请求从存储的数据中获取第一数据的方法。具体地,本实施例的方法包括步骤S401-S404:Optionally, the method shown in FIG. 4 is used in this application to implement the method for the first storage node 104 to obtain the first data request, and to obtain the first data from the stored data according to the first data request. Specifically, the method in this embodiment includes steps S401-S404:
步骤S401:第一存储节点104获取第一数据读请求,并从第一数据读请求中获取第一数据的第一识别信息。Step S401: The first storage node 104 obtains a first data read request, and obtains first identification information of the first data from the first data read request.
步骤S402:第一存储节点104判断第一识别信息是否与第一存储节点的缓存列表中的第二识别信息匹配,若是,则进入步骤S403,若否,则进入步骤S404。Step S402: The first storage node 104 determines whether the first identification information matches the second identification information in the cache list of the first storage node, and if yes, proceeds to step S403, and if not, proceeds to step S404.
在上述应用场景中,本实施例的存储终端103的每个存储节点均设置有prepare list,prepare list用于至少缓存存储于存储节点的数据的识别信息。In the above application scenario, each storage node of the storage terminal 103 in this embodiment is provided with a prepare list, and the prepare list is used to cache at least the identification information of the data stored in the storage node.
步骤S403:第一存储节点104获取与第一识别信息对应的第一数据,并将与第一识别信息对应的第一数据发送至客户端102。Step S403: The first storage node 104 obtains the first data corresponding to the first identification information, and sends the first data corresponding to the first identification information to the client 102.
当然,本实施例在第一识别信息与第二识别信息匹配成功后,还可以进一步判断第一存储节点104存储的与第一识别信息对应的第一数据是否缺失,若该第一数据没有缺失,则将该第一数据发送至客户端102;若该第一数据缺失,则可以进一步将第一识别信息与第一存储节点104存储的第三识别信息匹配及 数据缺失等操作,这里不赘述。Of course, in this embodiment, after the first identification information and the second identification information are successfully matched, it can further determine whether the first data corresponding to the first identification information stored by the first storage node 104 is missing. If the first data is not missing, , The first data is sent to the client 102; if the first data is missing, the first identification information can be further matched with the third identification information stored by the first storage node 104, and operations such as data loss are not described herein. .
步骤S404:第一存储节点104将与第一数据对应的版本号设置为零,且将置零后的版本号发送至客户端102。Step S404: The first storage node 104 sets the version number corresponding to the first data to zero, and sends the zeroed version number to the client 102.
当第一存储节点104的缓存列表中没有第一数据或者第一数据缺失时,可以将该第一数据的版本号置零。When there is no first data in the cache list of the first storage node 104 or the first data is missing, the version number of the first data may be set to zero.
可选地,本申请采用如图5所示的方法实现上述读请求协调模块103获取第二数据读请求,并根据第二数据请求从第二存储节点105存储的数据中获取第二数据的方法。具体地,本实施例的方法包括步骤S501-S505:Optionally, in the present application, the method shown in FIG. 5 is used to implement the method for the read request coordination module 103 to obtain the second data read request, and to obtain the second data from the data stored by the second storage node 105 according to the second data request. . Specifically, the method in this embodiment includes steps S501-S505:
步骤S501:读请求协调模块106获取第二数据读请求,并获取第二存储节点集合,且向第二存储节点集合中的第二存储节点105发送第二数据读请求。Step S501: The read request coordination module 106 obtains a second data read request, obtains a second storage node set, and sends the second data read request to the second storage node 105 in the second storage node set.
关于第二存储节点集合这里不赘述。The second storage node set is not repeated here.
步骤S502:第二存储节点105接收第二数据读请求,并根据第二数据请求获取与第二数据对应的版本号,且将版本号发送至读请求协调模块106。Step S502: The second storage node 105 receives the second data read request, obtains a version number corresponding to the second data according to the second data request, and sends the version number to the read request coordination module 106.
步骤S503:读请求协调模块106接收所有第二存储节点105发送的版本号,并获取多个版本号的最大值。Step S503: The read request coordination module 106 receives the version numbers sent by all the second storage nodes 105, and obtains the maximum value of the multiple version numbers.
客户端102更新数据时,数据进入第一存储节点104处理,第一存储节点104先为该数据分配版本号,接着将该数据插入prepare list,prepare list上的数据按照版本号有序排列,然后将携带版本号的数据发送至第二存储节点105,第二存储节点105同样将该数据插入到prepare list。数据每更新一次,版本号增加一次。因此,与最大版本号对应的第二数据为最新的第二数据。When the client 102 updates the data, the data enters the first storage node 104 for processing. The first storage node 104 first assigns a version number to the data, and then inserts the data into the prepare list. The data on the prepare list is arranged in order according to the version number, and then The data carrying the version number is sent to the second storage node 105, and the second storage node 105 also inserts the data into the prepare list. Each time the data is updated, the version number is incremented. Therefore, the second data corresponding to the largest version number is the latest second data.
步骤S504:读请求协调模块106判断与最大值对应的第二数据是否缺失,若是,则进入步骤S505,若否,则返回步骤S501。Step S504: The read request coordination module 106 determines whether the second data corresponding to the maximum value is missing. If so, the process proceeds to step S505; if not, the process returns to step S501.
需要注意的是,返回步骤S501时,不需要重新接收第二数据读请求。It should be noted that when returning to step S501, it is not necessary to receive the second data read request again.
在数据更新过程中会因为系统断电或数据传输等问题造成数据更新不完整,造成数据缺失,因此在获取数据之前应先判断数据是否缺失。During the data update process, the data update will be incomplete due to system power failure or data transmission problems, resulting in data loss. Therefore, you should determine whether the data is missing before obtaining the data.
步骤S505:读请求协调模块106将与最大值对应的第二数据发送至客户端102。Step S505: The read request coordination module 106 sends the second data corresponding to the maximum value to the client 102.
步骤S304:第一存储节点104将第一数据发送至客户端102,读请求协调模块106将第二数据发送至客户端102。Step S304: The first storage node 104 sends the first data to the client 102, and the read request coordination module 106 sends the second data to the client 102.
在其它实施例中,读请求协调模块还可以设置在存储终端的每个存储节点上,在处理读数据请求时只选择与第二存储节点对应设置的读请求协调模块生 效。In other embodiments, the read request coordination module may also be provided on each storage node of the storage terminal. When processing the read data request, only the read request coordination module set corresponding to the second storage node is selected to take effect.
区别于现有技术,本实施例分布式存储系统101的客户端102将生成的多个数据读请求分为第一数据读请求及第二数据读请求,并将第一数据读请求发送至第一存储节点104,以从第一存储节点104获取第一数据,同时将第二数据读请求发送至读请求协调模块106,以通过读请求协调模块106从第二存储节点105获取第二数据,因此,本实施例的第二存储节点105能够与第一存储节点104共同处理客户端102的多个数据读请求,使客户端102生成的多个数据读请求可以均衡地分布在分布式存储系统101的整个存储节点集群中,从而能够提升分布式存储系统101的读扩展能力。Different from the prior art, the client 102 of the distributed storage system 101 in this embodiment divides the generated multiple data read requests into a first data read request and a second data read request, and sends the first data read request to the first A storage node 104 to obtain the first data from the first storage node 104 and send a second data read request to the read request coordination module 106 to obtain the second data from the second storage node 105 through the read request coordination module 106, Therefore, the second storage node 105 in this embodiment can co-process multiple data read requests from the client 102 with the first storage node 104, so that multiple data read requests generated by the client 102 can be evenly distributed in the distributed storage system. In the entire storage node cluster of 101, the read expansion capability of the distributed storage system 101 can be improved.
可选地,本申请可采用如图6所示的方法实现上述第二存储节点105根据第二数据请求获取与第二数据对应的版本号的方法。具体地,本实施例的方法包括以下步骤:Optionally, the method shown in FIG. 6 may be used in this application to implement the method for the second storage node 105 to obtain the version number corresponding to the second data according to the second data request. Specifically, the method in this embodiment includes the following steps:
步骤S601:第二存储节点105从第二数据读请求中获取第二数据的第一识别信息。Step S601: The second storage node 105 obtains the first identification information of the second data from the second data read request.
步骤S602:第二存储节点105判断第一识别信息是否与第二存储节点的缓存列表中的第二识别信息是否匹配,若是,则进入步骤S603。Step S602: The second storage node 105 determines whether the first identification information matches the second identification information in the cache list of the second storage node, and if yes, proceeds to step S603.
步骤S603:第二存储节点105从缓存列表获取与第一识别信息对应的版本号,并将与第一识别信息对应的版本号发送至读请求协调模块106。Step S603: The second storage node 105 obtains a version number corresponding to the first identification information from the cache list, and sends the version number corresponding to the first identification information to the read request coordination module 106.
进一步地,第一识别信息与第二存储节点的缓存列表中的第二识别信息不匹配,则进入步骤S604-S606。Further, if the first identification information does not match the second identification information in the cache list of the second storage node, the process proceeds to steps S604-S606.
步骤S604:第二存储节点105判断第一识别信息是否与第二存储节点105存储的第三识别信息进行匹配,若是,则进入步骤S605,若否,则进入步骤S606。Step S604: The second storage node 105 determines whether the first identification information matches the third identification information stored by the second storage node 105, and if yes, proceeds to step S605, and if not, proceeds to step S606.
其中,本实施例的每个存储节点相当于一个服务器,其包括缓存列表及磁盘存储空间,当存储节点的缓存列表中没有所需要的数据,可以进一步从磁盘存储空间中查询该数据。Each storage node in this embodiment is equivalent to a server, which includes a cache list and disk storage space. When the required data is not in the cache list of the storage node, the data can be further queried from the disk storage space.
步骤S605:第二存储节点105获取与第一识别信息对应的版本号,并将与第一识别信息对应的版本号发送至读请求协调模块106。Step S605: The second storage node 105 obtains a version number corresponding to the first identification information, and sends the version number corresponding to the first identification information to the read request coordination module 106.
步骤S606:第二存储节点105将第二数据的版本号设置为零,且将置零后的版本号发送至读请求协调模块106。Step S606: The second storage node 105 sets the version number of the second data to zero, and sends the zeroed version number to the read request coordination module 106.
本申请进一步提出另一实施例的一种分布式存储系统的数据读写方法,如图7所示,本实施例的方法用于实现上述实施例分布式存储系统的数据写入, 具体地,本实施例的方法包括以下具体步骤:This application further proposes a data reading and writing method for a distributed storage system in another embodiment. As shown in FIG. 7, the method in this embodiment is used to implement data writing in the distributed storage system in the foregoing embodiment. Specifically, The method in this embodiment includes the following specific steps:
步骤S701:客户端102生成数据写请求。Step S701: The client 102 generates a data write request.
步骤S702:客户端102向第一存储节点104发送数据写请求。Step S702: The client 102 sends a data write request to the first storage node 104.
本实施例分布式存储系统101的数据写请求均在第一存储节点104进行处理。The data write requests of the distributed storage system 101 in this embodiment are all processed at the first storage node 104.
步骤S703:第一存储节点104接收数据写请求,并根据数据读请求获取第三数据,且将第三数据发送至第二存储节点105。Step S703: The first storage node 104 receives the data write request, obtains the third data according to the data read request, and sends the third data to the second storage node 105.
步骤S704:第二存储节点105接收并保存第三数据。Step S704: The second storage node 105 receives and saves the third data.
由上述分析可知,本实施例的第二存储节点105能够与第一存储节点104共同处理客户端102的多个数据读请求,使客户端102生成的多个数据读请求可以均衡地分布在分布式存储系统101的整个存储节点集群中,从而能够提升分布式存储系统101的读扩展能力。同时,因为第二存储节点105分担数据读请求,以使第一存储节点104留有更多资源来处理写请求,能够提升了分布式存储系统101的整个集群数据写入的吞吐量。From the above analysis, it can be known that the second storage node 105 and the first storage node 104 in this embodiment can jointly process multiple data read requests from the client 102, so that the multiple data read requests generated by the client 102 can be evenly distributed in the distribution. In the entire storage node cluster of the distributed storage system 101, the read expansion capability of the distributed storage system 101 can be improved. At the same time, because the second storage node 105 shares the data read request, so that the first storage node 104 has more resources to process the write request, the throughput of the entire cluster data writing of the distributed storage system 101 can be improved.
本申请进一步提出又一实施例的分布式存储系统的数据读写方法,本实施例的数据读写方法包括:第一存储节点104从客户端102获取第一数据读请求,并根据第一数据请求从存储的数据中获取第一数据,且将第一数据发送至所述客户端102;读请求协调模块106从客户端102获取第二数据读请求,并根据第二数据请求从第二存储节点105存储的数据中获取第二数据,且将第二数据发送至客户端102。This application further proposes a data reading and writing method of a distributed storage system according to another embodiment. The data reading and writing method of this embodiment includes: a first storage node 104 obtaining a first data read request from a client 102, and according to the first data Request to obtain the first data from the stored data, and send the first data to the client 102; the read request coordination module 106 obtains the second data read request from the client 102, and according to the second data request from the second storage The second data is acquired from the data stored by the node 105, and the second data is sent to the client 102.
区别于现有技术,本实施例通过第二存储节点105与第一存储节点104共同处理客户端102的多个数据读请求,使客户端102生成的多个数据读请求可以均衡地分布在分布式存储系统101的整个存储节点集群中,能够提升分布式存储系统101的读扩展能力Different from the prior art, this embodiment uses the second storage node 105 and the first storage node 104 to jointly process multiple data read requests from the client 102, so that multiple data read requests generated by the client 102 can be evenly distributed in the distribution. In the entire storage node cluster of the embedded storage system 101, the read expansion capability of the distributed storage system 101 can be improved
本申请进一步提出另一实施例的分布式存储系统,如图8所示,本实施例分布式存储系统801包括客户端802及存储终端803,其中,存储终端803包括第一存储节点804、至少两个第二存储节点805及至少两个读请求协调模块806,读请求协调模块806与第二存储节点805对应设置,第一存储节点804用于存储数据,至少两个第二存储节点805用于存储数据的副本;客户端802用于生成多个数据读请求,多个数据读请求包括第一数据读请求和第二数据读请求;客户端802用于向第一存储节点804发送第一数据读请求及向读请求协调模块 806发送第二数据请求;第一存储节点804用于获取第一数据请求,并根据第一数据请求从存储的数据中获取第一数据,且将第一数据发送至客户端802;读请求协调模块806用于获取第二数据读请求,并根据第二数据请求从第二存储节点805存储的数据中获取第二数据,且将第二数据发送至客户端802。This application further proposes a distributed storage system according to another embodiment. As shown in FIG. 8, the distributed storage system 801 in this embodiment includes a client 802 and a storage terminal 803. The storage terminal 803 includes a first storage node 804, at least Two second storage nodes 805 and at least two read request coordination modules 806. The read request coordination module 806 is set corresponding to the second storage node 805. The first storage node 804 is used for storing data, and the at least two second storage nodes 805 are used for For storing a copy of the data; the client 802 is configured to generate multiple data read requests, and the multiple data read requests include a first data read request and a second data read request; the client 802 is configured to send a first to the first storage node 804 A data read request and a second data request to the read request coordination module 806; the first storage node 804 is configured to obtain the first data request, and obtain the first data from the stored data according to the first data request, and send the first data Sent to the client 802; the read request coordination module 806 is configured to obtain a second data read request, and from the data stored in the second storage node 805 according to the second data request A second data fetch, and the second data transmission to the client 802.
区别于现有技术,本实施例分布式存储系统801的客户端802将生成的多个数据读请求分为第一数据读请求及第二数据读请求,并将第一数据读请求发送至第一存储节点804,以从第一存储节点804获取第一数据,同时将第二数据读请求发送至读请求协调模块806,以通过读请求协调模块806从第二存储节点805获取第二数据,因此,本实施例的第二存储节点805能够与第一存储节点804共同处理客户端802的多个数据读请求,使客户端802生成的多个数据读请求可以均衡地分布在分布式存储系统801的整个存储节点集群中,从而能够提升分布式存储系统801的读扩展能力。Different from the prior art, the client 802 of the distributed storage system 801 in this embodiment divides the generated multiple data read requests into a first data read request and a second data read request, and sends the first data read request to the first A storage node 804 to obtain the first data from the first storage node 804 and send a second data read request to the read request coordination module 806 to obtain the second data from the second storage node 805 through the read request coordination module 806, Therefore, the second storage node 805 in this embodiment can co-process multiple data read requests from the client 802 with the first storage node 804, so that multiple data read requests generated by the client 802 can be evenly distributed in the distributed storage system. In the entire storage node cluster of 801, the read expansion capability of the distributed storage system 801 can be improved.
当然,本实施例分布式存储系统801可以采用上述方法实施例中的数据读写方法进行数据的读写,这里不赘述。Of course, the distributed storage system 801 in this embodiment may use the data reading and writing method in the foregoing method embodiment to read and write data, and details are not described herein.
本申请进一步提出一种存储终端,如图9所示,图9是本申请存储终端一实施例的结构示意图。本实施例存储终端901包括第一存储节点902、至少两个第二存储节点903及读请求协调模块904,其中,第一存储节点902用于存储数据,第一存储节点902从客户端获取第一数据读请求,并根据第一数据读请求从存储的数据中获取第一数据,且将第一数据发送至客户端;第二存储节点903用于存储数据的副本;读请求协调模块904用于从客户端获取第二数据读请求,并根据第二数据请求从第二存储节点903存储的数据中获取第二数据,且将第二数据发送至客户端。This application further proposes a storage terminal. As shown in FIG. 9, FIG. 9 is a schematic structural diagram of an embodiment of a storage terminal according to the present application. The storage terminal 901 in this embodiment includes a first storage node 902, at least two second storage nodes 903, and a read request coordination module 904. The first storage node 902 is configured to store data, and the first storage node 902 obtains the first storage node from the client. A data read request, and obtains the first data from the stored data according to the first data read request, and sends the first data to the client; the second storage node 903 is used to store a copy of the data; the read request coordination module 904 is used A second data read request is obtained from the client, and the second data is obtained from the data stored by the second storage node 903 according to the second data request, and the second data is sent to the client.
区别于现有技术,本实施例存储终端901的第二存储节点903能够与第一存储节点902共同处理客户端的数据读请求,使客户端生成的多个数据读请求可以均衡地分布在存储终端901的整个存储节点集群中,从而能够存储终端901的读扩展能力。Different from the prior art, the second storage node 903 of the storage terminal 901 in this embodiment can co-process the data read request of the client with the first storage node 902, so that multiple data read requests generated by the client can be evenly distributed on the storage terminal. In the entire storage node cluster of 901, the read expansion capability of the terminal 901 can be stored.
本申请进一步提出一种存储终端,如图10所示,图10是本申请存储终端另一实施例的结构示意图。本实施例存储终端1001包括存储模块1002、收发模块1003及处理模块1004,其中,存储模块1002用于存储数据;收发模块1003用于从客户端接收数据读请求;处理模块1004用于根据数据读请求从存储模块1002存储的数据中获取被请求的数据;收发模块1003进一步将被请求的数据发 送至客户端。This application further proposes a storage terminal. As shown in FIG. 10, FIG. 10 is a schematic structural diagram of another embodiment of a storage terminal of the present application. The storage terminal 1001 in this embodiment includes a storage module 1002, a transceiver module 1003, and a processing module 1004. The storage module 1002 is configured to store data; the transceiver module 1003 is configured to receive a data read request from a client; the processing module 1004 is configured to read data Request to obtain the requested data from the data stored in the storage module 1002; the transceiver module 1003 further sends the requested data to the client.
区别于现有技术,本实施例使客户端生成的多个数据读请求可以均衡地分布在存储终端1001的整个存储节点集群中,从而能够提升存储终端1001的读扩展能力。Different from the prior art, this embodiment enables multiple data read requests generated by a client to be evenly distributed throughout the entire storage node cluster of the storage terminal 1001, thereby improving the read expansion capability of the storage terminal 1001.
本申请进一步提出一种存储介质,如图11所示,图11是本申请存储介质一实施例的结构示意图。本实施例存储介质1101用于存储上述实施例的相关数据1102及程序数据1103,其中,相关数据1102至少包括上述读请求及写请求等,程序数据1103能够被执行以上述方法实施例的方法。相关数据1102及程序数据1103已在上述方法实施例中进行了详细的叙述,这里不赘述。This application further proposes a storage medium. As shown in FIG. 11, FIG. 11 is a schematic structural diagram of an embodiment of the storage medium of the present application. The storage medium 1101 of this embodiment is used to store the related data 1102 and program data 1103 of the foregoing embodiment, where the related data 1102 includes at least the above-mentioned read request and write request, and the program data 1103 can be executed by the method in the above method embodiment. The related data 1102 and the program data 1103 have been described in detail in the foregoing method embodiments, and are not described herein again.
本实施例具有存储功能的装置1101可以是但不局限于U盘、SD卡、PD光驱、移动硬盘、大容量软驱、闪存、多媒体记忆卡、服务器等。The device 1101 with a storage function in this embodiment may be, but is not limited to, a U disk, an SD card, a PD optical drive, a mobile hard disk, a large-capacity floppy drive, a flash memory, a multimedia memory card, a server, and the like.
区别于现有技术,本申请实施例分布式存储系统包括客户端及存储终端,其中,存储终端包括第一存储节点、至少两个第二存储节点及至少两个读请求协调模块,读请求协调模块与第二存储节点对应设置,其中,第一存储节点用于存储数据,至少两个第二存储节点用于存储数据的副本,该分布式存储系统数据读写方法包括:客户端生成多个数据读请求,多个数据读请求包括第一数据读请求和第二数据读请求;客户端向第一存储节点发送第一数据读请求及向读请求协调模块发送第二数据请求;第一存储节点获取第一数据请求,并根据第一数据请求从存储的数据中获取第一数据;读请求协调模块获取第二数据读请求,并根据第二数据请求从第二存储节点存储的数据中获取第二数据;第一存储节点将第一数据发送至客户端;读请求协调模块将第二数据发送至客户端。通过这种方式,本申请将客户端生成的多个数据读请求分为第一数据读请求及第二数据读请求,并将第一数据读请求发送至第一存储节点,以从第一存储节点获取第一数据,同时将第二数据读请求发送至读请求协调模块,以通过读请求协调模块从第二存储节点获取第二数据,因此,本申请的第二存储节点能够与第一存储节点共同处理客户端的多个数据读请求,使客户端生成的多个数据读请求可以均衡地分布在分布式存储系统的整个存储节点集群中,从而能够提升分布式存储系统的读扩展能力。Different from the prior art, the distributed storage system in the embodiment of the present application includes a client and a storage terminal, where the storage terminal includes a first storage node, at least two second storage nodes, and at least two read request coordination modules, and read request coordination The module is set corresponding to a second storage node, where the first storage node is used to store data, and at least two second storage nodes are used to store a copy of the data. The distributed storage system data read and write method includes: the client generates multiple Data read request, the multiple data read requests include a first data read request and a second data read request; the client sends a first data read request to a first storage node and a second data request to a read request coordination module; the first storage The node obtains the first data request, and obtains the first data from the stored data according to the first data request; the read request coordination module obtains the second data read request, and obtains from the data stored by the second storage node according to the second data request. The second data; the first storage node sends the first data to the client; the read request coordination module sends the second data To the client. In this way, the present application divides multiple data read requests generated by the client into a first data read request and a second data read request, and sends the first data read request to the first storage node to retrieve the data from the first storage. The node obtains the first data and sends a second data read request to the read request coordination module to obtain the second data from the second storage node through the read request coordination module. Therefore, the second storage node of the present application can communicate with the first storage The nodes jointly process multiple data read requests from the client, so that multiple data read requests generated by the client can be evenly distributed across the entire storage node cluster of the distributed storage system, thereby improving the read expansion capability of the distributed storage system.
另外,上述功能如果以软件功能的形式实现并作为独立产品销售或使用时,可存储在一个移动终端可读取存储介质中,即,本申请还提供一种存储有程序数据的存储装置,所述程序数据能够被执行以实现上述实施例的方法,该存储 装置可以为如U盘、光盘、服务器等。也就是说,本申请可以以软件产品的形式体现出来,其包括若干指令用以使得一台智能终端执行各个实施例所述方法的全部或部分步骤。In addition, if the above functions are implemented in the form of software functions and sold or used as independent products, they can be stored in a mobile terminal readable storage medium, that is, this application also provides a storage device that stores program data. The program data can be executed to implement the method of the above embodiment, and the storage device may be, for example, a U disk, an optical disk, a server, or the like. That is, the present application may be embodied in the form of a software product, which includes several instructions for causing a smart terminal to perform all or part of the steps of the methods described in the embodiments.
在本申请的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of the present application, the description with reference to the terms “one embodiment”, “some embodiments”, “examples”, “specific examples”, or “some examples” and the like means specific features described in conjunction with the embodiments or examples , Structure, material, or characteristic is included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms are not necessarily directed to the same embodiment or example. Moreover, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. In addition, without any contradiction, those skilled in the art may combine and combine different embodiments or examples and features of the different embodiments or examples described in this specification.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality" is at least two, for example, two, three, etc., unless it is specifically and specifically defined otherwise.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any process or method description in a flowchart or otherwise described herein can be understood as a module, fragment, or portion of code that includes one or more executable instructions for implementing a particular logical function or step of a process And, the scope of the preferred embodiments of this application includes additional implementations in which the functions may be performed out of the order shown or discussed, including performing the functions in a substantially simultaneous manner or in the reverse order according to the functions involved, which should It is understood by those skilled in the art to which the embodiments of the present application pertain.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(可以是个人计算机,服务器,网络设备或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上 打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。Logic and / or steps represented in a flowchart or otherwise described herein, for example, a sequenced list of executable instructions that may be considered to implement a logical function, may be embodied in any computer-readable medium, For use by, or in combination with, an instruction execution system, device, or device (which may be a personal computer, server, network device, or other system that can take instructions from the instruction execution system, device, or device and execute instructions) While using. For the purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connections (electronic devices) with one or more wirings, portable computer disk cartridges (magnetic devices), random access memory (RAM), Read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program can be printed, because, for example, by optically scanning the paper or other medium, followed by editing, interpretation, or other suitable Processing to obtain the program electronically and then store it in computer memory.
以上所述仅为本申请的实施方式,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only an implementation of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the description and drawings of the present application, or directly or indirectly applied to other related technologies The fields are equally included in the patent protection scope of this application.

Claims (16)

  1. 一种分布式存储系统的数据读写方法,其特征在于,所述分布式存储系统包括客户端及存储终端,其中,所述存储终端包括第一存储节点、至少两个第二存储节点及至少两个读请求协调模块,所述读请求协调模块与所述第二存储节点对应设置,其中,所述第一存储节点用于存储数据,至少两个所述第二存储节点用于存储所述数据的副本,所述数据读写方法包括:A data reading and writing method for a distributed storage system, characterized in that the distributed storage system includes a client and a storage terminal, wherein the storage terminal includes a first storage node, at least two second storage nodes, and at least Two read request coordination modules, which are set corresponding to the second storage node, wherein the first storage node is used to store data and at least two of the second storage nodes are used to store the A copy of the data, the data reading and writing method comprising:
    所述客户端生成多个数据读请求,多个所述数据读请求包括第一数据读请求和第二数据读请求;The client generates multiple data read requests, and the multiple data read requests include a first data read request and a second data read request;
    所述客户端向所述第一存储节点发送所述第一数据读请求及向所述读请求协调模块发送所述第二数据请求;Sending, by the client, the first data read request to the first storage node and sending the second data request to the read request coordination module;
    所述第一存储节点获取所述第一数据请求,并根据所述第一数据请求从存储的数据中获取第一数据;所述读请求协调模块获取所述第二数据读请求,并根据所述第二数据请求从所述第二存储节点存储的数据中获取第二数据;The first storage node obtains the first data request, and obtains the first data from the stored data according to the first data request; the read request coordination module obtains the second data read request, and The second data request acquires second data from data stored by the second storage node;
    所述第一存储节点将所述第一数据发送至所述客户端;所述读请求协调模块将所述第二数据发送至所述客户端。The first storage node sends the first data to the client; the read request coordination module sends the second data to the client.
  2. 根据权利要求1所述的数据读写方法,其特征在于,所述读请求协调模块获取所述第二数据读请求,并根据所述第二数据请求从所述第二存储节点存储的数据中获取第二数据包括:The data reading and writing method according to claim 1, wherein the read request coordination module obtains the second data read request, and from the data stored in the second storage node according to the second data request Obtaining the second data includes:
    所述读请求协调模块获取所述第二数据读请求,并获取第二存储节点集合,且向所述第二存储节点集合中的所有第二存储节点发送所述第二数据读请求;The read request coordination module obtains the second data read request, obtains a second storage node set, and sends the second data read request to all second storage nodes in the second storage node set;
    所述第二存储节点接收所述第二数据读请求,并根据所述第二数据请求获取与所述第二数据对应的版本号,且将所述版本号发送至所述读请求协调模块;Receiving, by the second storage node, the second data read request, obtaining a version number corresponding to the second data according to the second data request, and sending the version number to the read request coordination module;
    所述读请求协调模块接收所述所有第二存储节点发送的版本号,并获取多个所述版本号的最大值;The read request coordination module receives the version numbers sent by all the second storage nodes, and obtains a maximum value of the plurality of version numbers;
    所述读请求协调模块判断与所述最大值对应的第二数据是否缺失;The read request coordination module determines whether the second data corresponding to the maximum value is missing;
    若否,则所述读请求协调模块将与所述最大值对应的第二数据发送至所述客户端。If not, the read request coordination module sends second data corresponding to the maximum value to the client.
  3. 根据权利要求2所述的数据读写方法,其特征在于,若与所述最大值对应的第二数据缺失,则返回所述读请求协调模块向所述第二存储节点集合中的所有第二存储节点发送所述第二数据读请求的步骤。The method for reading and writing data according to claim 2, wherein if the second data corresponding to the maximum value is missing, the read request coordination module returns all the second data in the second storage node set to the second storage node set. The step of the storage node sending the second data read request.
  4. 根据权利要求2所述的数据读写方法,其特征在于,所述第二存储节点根据所述第二数据请求获取与所述第二数据对应的版本号包括:The method for reading and writing data according to claim 2, wherein the obtaining, by the second storage node, a version number corresponding to the second data according to the second data request comprises:
    所述第二存储节点从所述第二数据读请求中获取所述第二数据的第一识别信息;Acquiring, by the second storage node, first identification information of the second data from the second data read request;
    判断所述第一识别信息是否与第二存储节点的缓存列表中的第二识别信息是否匹配;Determining whether the first identification information matches the second identification information in the cache list of the second storage node;
    若是,则所述第二存储节点从所述缓存列表获取与所述第一识别信息对应的版本号,并将与所述第一识别信息对应的版本号发送至所述读请求协调模块。If yes, the second storage node obtains a version number corresponding to the first identification information from the cache list, and sends a version number corresponding to the first identification information to the read request coordination module.
  5. 根据权利要求4所述的数据读写方法,其特征在于,若所述第一识别信息与所述第二存储节点的缓存列表中的第二识别信息不匹配,则判断所述第一识别信息是否与所述第二存储节点所存储的第三识别信息匹配;The data reading and writing method according to claim 4, wherein if the first identification information does not match the second identification information in the cache list of the second storage node, determining the first identification information Whether it matches the third identification information stored by the second storage node;
    若是,则所述第二存储节点获取与所述第一识别信息对应的版本号,并将与所述第一识别信息对应的版本号发送至所述读请求协调模块。If yes, the second storage node obtains a version number corresponding to the first identification information, and sends a version number corresponding to the first identification information to the read request coordination module.
  6. 根据权利要求5所述的数据读写方法,其特征在于,若所述所述第一识别信息与所述第二存储节点所存储的第三识别信息不匹配,则所述第二存储节点将所述第二数据对应的版本号设置为零,且将置零后的版本号发送至所述读请求协调模块。The data reading and writing method according to claim 5, wherein if the first identification information does not match the third identification information stored by the second storage node, the second storage node will The version number corresponding to the second data is set to zero, and the version number after the zeroing is sent to the read request coordination module.
  7. 根据权利要求2所述的数据读写方法,其特征在于,所述第一数据读请求的数量与多个所述数据读请求的总数量之比为预设百分比。The data read / write method according to claim 2, wherein a ratio of the number of the first data read requests to a total number of the plurality of data read requests is a preset percentage.
  8. 根据权利要求7所述的数据读写方法,其特征在于,所述预设百分比满足公式:The data reading and writing method according to claim 7, wherein the preset percentage satisfies a formula:
    Figure PCTCN2018102027-appb-100001
    其中,x为所述预设百分比,所述p为所述第二存储节点设置在所述第二存储节点集合中的概率,所述n为所述第一存储节点的数量与所述第二存储节点的数量之和,且所述n大于等于3。
    Figure PCTCN2018102027-appb-100001
    Where x is the preset percentage, p is the probability that the second storage node is set in the second storage node set, and n is the number of the first storage node and the second The sum of the number of storage nodes, and n is greater than or equal to three.
  9. 根据权利要求8所述的数据读写方法,其特征在于,所述p满足公式:The data read / write method according to claim 8, wherein the p satisfies a formula:
    Figure PCTCN2018102027-appb-100002
    Figure PCTCN2018102027-appb-100002
  10. 根据权利要求1所述的数据读写方法,其特征在于,所述第一存储节点获取所述第一数据读请求,并根据所述第一数据请求从存储的数据中获取第一数据包括:The method for reading and writing data according to claim 1, wherein the acquiring the first data read request by the first storage node, and acquiring the first data from the stored data according to the first data request comprises:
    所述第一存储节点获取所述第一数据读请求,并从所述第一数据读请求中获取所述第一数据的第一识别信息;Acquiring, by the first storage node, the first data read request, and acquiring first identification information of the first data from the first data read request;
    所述第一存储节点判断所述第一识别信息是否与所述第一存储节点的缓存列表中的第二识别信息匹配;Determining, by the first storage node, whether the first identification information matches second identification information in a cache list of the first storage node;
    若是,则所述第一存储节点获取与所述第一识别信息对应的第一数据,并将与所述第一识别信息对应的第一数据发送至所述客户端。If yes, the first storage node acquires first data corresponding to the first identification information, and sends the first data corresponding to the first identification information to the client.
  11. 根据权利要求1所述的数据读写方法,其特征在于,所述数据读写方法进一步包括:The method for reading and writing data according to claim 1, wherein the method for reading and writing data further comprises:
    所述客户端生成数据写请求;The client generates a data write request;
    所述客户端向所述第一存储节点发送所述数据写请求;Sending, by the client, the data write request to the first storage node;
    所述第一存储节点接收所述数据写请求,并根据所述数据写请求获取第三数据,且将所述第三数据发送至所述第二存储节点;Receiving, by the first storage node, the data write request, obtaining third data according to the data write request, and sending the third data to the second storage node;
    所述第二存储节点接收并保存所述第三数据。The second storage node receives and saves the third data.
  12. 一种分布式存储系统,其特征在于,所述分布式存储系统包括客户端及存储终端,其中,所述存储终端包括第一存储节点、至少两个第二存储节点及至少两个读请求协调模块,所述读请求协调模块与所述第二存储节点对应设置,所述第一存储节点用于存储数据,至少两个所述第二存储节点用于存储所述数据的副本;A distributed storage system, characterized in that the distributed storage system includes a client and a storage terminal, wherein the storage terminal includes a first storage node, at least two second storage nodes, and at least two read request coordinations. A module, the read request coordination module is set corresponding to the second storage node, the first storage node is used to store data, and at least two of the second storage nodes are used to store a copy of the data;
    所述客户端用于生成多个数据读请求,多个所述数据读请求包括第一数据读请求和第二数据读请求;所述客户端用于向所述第一存储节点发送所述第一数据读请求及向所述读请求协调模块发送所述第二数据请求;The client is configured to generate multiple data read requests, and the multiple data read requests include a first data read request and a second data read request; the client is configured to send the first data read request to the first storage node. A data read request and sending the second data request to the read request coordination module;
    所述第一存储节点用于获取所述第一数据请求,并根据所述第一数据请求从存储的数据中获取第一数据,且将所述第一数据发送至所述客户端;The first storage node is configured to obtain the first data request, obtain the first data from the stored data according to the first data request, and send the first data to the client;
    所述读请求协调模块用于获取所述第二数据读请求,并根据所述第二数据请求从所述第二存储节点存储的数据中获取第二数据,且将所述第二数据发送至所述客户端。The read request coordination module is configured to obtain the second data read request, and obtain second data from data stored in the second storage node according to the second data request, and send the second data to The client.
  13. 一种分布式存储系统的数据读写方法,其特征在于,所述分布式存储系统包括客户端及存储终端,其中,所述存储终端包括第一存储节点、至少两个 第二存储节点及至少两个读请求协调模块,所述读请求协调模块与所述第二存储节点对应设置,所述第一存储节点用于存储数据,至少两个所述第二存储节点用于存储所述数据的副本,所述数据读写方法包括:A data reading and writing method for a distributed storage system, characterized in that the distributed storage system includes a client and a storage terminal, wherein the storage terminal includes a first storage node, at least two second storage nodes, and at least Two read request coordination modules, which are set corresponding to the second storage node, the first storage node is used to store data, and at least two of the second storage nodes are used to store the data A copy, the data reading and writing method includes:
    所述第一存储节点从所述客户端获取所述第一数据读请求,并根据所述第一数据请求从存储的数据中获取第一数据,且将所述第一数据发送至所述客户端;所述读请求协调模块从所述客户端获取所述第二数据读请求,并根据所述第二数据请求从所述第二存储节点存储的数据中获取第二数据,且将所述第二数据发送至所述客户端。The first storage node obtains the first data read request from the client, obtains the first data from the stored data according to the first data request, and sends the first data to the client The read request coordination module obtains the second data read request from the client, and obtains the second data from the data stored by the second storage node according to the second data request, and The second data is sent to the client.
  14. 一种存储终端,其特征在于,所述存储终端包括:A storage terminal, characterized in that the storage terminal includes:
    第一存储节点,用于存储数据,所述第一存储节点从客户端获取第一数据读请求,并根据所述第一数据读请求从存储的数据中获取第一数据,且将所述第一数据发送至所述客户端;A first storage node for storing data, the first storage node obtaining a first data read request from a client, and obtaining the first data from the stored data according to the first data read request, and Sending data to the client;
    至少两个第二存储节点,用于存储所述数据的副本;At least two second storage nodes for storing a copy of the data;
    读请求协调模块,用于从所述客户端获取第二数据读请求,并根据所述第二数据请求从所述第二存储节点存储的数据中获取第二数据,且将所述第二数据发送至所述客户端。The read request coordination module is configured to obtain a second data read request from the client, obtain second data from data stored in the second storage node according to the second data request, and convert the second data To the client.
  15. 一种存储终端,其特征在于,所述存储终端包括:A storage terminal, characterized in that the storage terminal includes:
    存储模块,用于存储数据;Storage module for storing data;
    收发模块,用于从客户端接收数据读请求;A transceiver module for receiving a data read request from a client;
    处理模块,用于根据所述数据读请求从所述存储模块存储的数据中获取被请求的数据;A processing module, configured to obtain requested data from data stored in the storage module according to the data read request;
    所述收发模块进一步将所述被请求的数据发送至所述客户端。The transceiver module further sends the requested data to the client.
  16. 一种存储介质,其上存储有程序数据,其特征在于,所述程序数据被执行时实现权利要求1-11、13任一项所述方法中的步骤。A storage medium having program data stored thereon, characterized in that when the program data is executed, the steps in the method according to any one of claims 1-11, 13 are implemented.
PCT/CN2018/102027 2018-08-23 2018-08-23 Distributed storage system and data read-write method therefor, and storage terminal and storage medium WO2020037625A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880002511.3A CN109691065B (en) 2018-08-23 2018-08-23 Distributed storage system and data read-write method thereof, storage terminal and storage medium
PCT/CN2018/102027 WO2020037625A1 (en) 2018-08-23 2018-08-23 Distributed storage system and data read-write method therefor, and storage terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/102027 WO2020037625A1 (en) 2018-08-23 2018-08-23 Distributed storage system and data read-write method therefor, and storage terminal and storage medium

Publications (1)

Publication Number Publication Date
WO2020037625A1 true WO2020037625A1 (en) 2020-02-27

Family

ID=66190472

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/102027 WO2020037625A1 (en) 2018-08-23 2018-08-23 Distributed storage system and data read-write method therefor, and storage terminal and storage medium

Country Status (2)

Country Link
CN (1) CN109691065B (en)
WO (1) WO2020037625A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113204536A (en) * 2021-05-27 2021-08-03 济南浪潮数据技术有限公司 Read-write optimization method and device for distributed storage system
CN113254415A (en) * 2021-05-19 2021-08-13 浪潮商用机器有限公司 Method and device for processing read request of distributed file system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112347335A (en) * 2020-10-30 2021-02-09 银盛支付服务股份有限公司 Method, system, computer equipment and storage medium for efficient retrieval of Elasticissearch

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103635887A (en) * 2013-09-23 2014-03-12 华为技术有限公司 Data caching method and storage system
CN104580428A (en) * 2014-12-27 2015-04-29 北京奇虎科技有限公司 Data routing method, data management device and distributed storage system
CN105468302A (en) * 2015-11-23 2016-04-06 华为技术有限公司 Data processing method, apparatus and system
CN108228750A (en) * 2017-12-21 2018-06-29 浪潮软件股份有限公司 A kind of distributed data base and its method that data are managed

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9361311B2 (en) * 2005-01-12 2016-06-07 Wandisco, Inc. Distributed file system using consensus nodes
US8117153B2 (en) * 2006-03-28 2012-02-14 Oracle America, Inc. Systems and methods for a distributed cache
US8438364B2 (en) * 2010-12-30 2013-05-07 Facebook Inc. Distributed cache for graph data
CN103248656B (en) * 2012-02-10 2017-04-19 联想(北京)有限公司 Method for achieving data reading and writing as well as DSF (distributed file system) and client side
CN106850856A (en) * 2017-03-28 2017-06-13 南京卓盛云信息科技有限公司 A kind of distributed memory system and its synchronization caching method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103635887A (en) * 2013-09-23 2014-03-12 华为技术有限公司 Data caching method and storage system
CN104580428A (en) * 2014-12-27 2015-04-29 北京奇虎科技有限公司 Data routing method, data management device and distributed storage system
CN105468302A (en) * 2015-11-23 2016-04-06 华为技术有限公司 Data processing method, apparatus and system
CN108228750A (en) * 2017-12-21 2018-06-29 浪潮软件股份有限公司 A kind of distributed data base and its method that data are managed

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254415A (en) * 2021-05-19 2021-08-13 浪潮商用机器有限公司 Method and device for processing read request of distributed file system
CN113254415B (en) * 2021-05-19 2022-11-04 浪潮商用机器有限公司 Method and device for processing read request of distributed file system
CN113204536A (en) * 2021-05-27 2021-08-03 济南浪潮数据技术有限公司 Read-write optimization method and device for distributed storage system

Also Published As

Publication number Publication date
CN109691065B (en) 2021-11-09
CN109691065A (en) 2019-04-26

Similar Documents

Publication Publication Date Title
WO2017084563A1 (en) Distributed system-based file reading method and device
CN110502507B (en) Management system, method, equipment and storage medium of distributed database
US11593016B2 (en) Serializing execution of replication operations
US7693882B2 (en) Replicating data across the nodes in a cluster environment
US11296940B2 (en) Centralized configuration data in a distributed file system
US10542073B2 (en) File transfer to a distributed file system
CN109547512B (en) NoSQL-based distributed Session management method and device
US10366106B2 (en) Quorum-based replication of data records
WO2020037625A1 (en) Distributed storage system and data read-write method therefor, and storage terminal and storage medium
TW200525390A (en) Method, system, and program for data synchronization
WO2018137327A1 (en) Data transmission method for host and standby devices, control node, and database system
JP2016513306A (en) Data storage method, data storage device, and storage device
WO2023207492A1 (en) Data processing method and apparatus, device, and readable storage medium
KR20090062106A (en) Lazy replication system and method for balanced i/os between file read/write and replication
JP2023541298A (en) Transaction processing methods, systems, devices, equipment, and programs
US8019729B2 (en) System and method for updating file
CN113010549A (en) Data processing method based on remote multi-active system, related equipment and storage medium
KR101601877B1 (en) Apparatus and method for client's participating in data storage of distributed file system
CN112148206A (en) Data reading and writing method and device, electronic equipment and medium
CN113297234B (en) Data processing method, device, equipment and computer readable storage medium
WO2023207529A1 (en) Data processing method and apparatus, device, medium, and product
US11216204B2 (en) Degraded redundant metadata, DRuM, technique
CN109992447B (en) Data copying method, device and storage medium
JP6376626B2 (en) Data storage method, data storage device, and storage device
US20220138177A1 (en) Fault tolerance for transaction mirroring

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

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

Country of ref document: EP

Kind code of ref document: A1