Data processing method, computer equipment, readable storage medium and program product
By selecting the communication method according to the node location of the data copy in the hybrid flash distributed system, using shared memory or network communication, the problem of large network bandwidth occupation is solved, and the system's read and write performance and resource utilization are improved.
Patent Information
- Application Number
- CN202411139182.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2025-01-03
AI Technical Summary
In hybrid flash distributed systems, data communication between processes mainly relies on network communication, resulting in a large network bandwidth occupancy, affecting the read and write performance of the system.
In the hybrid flash distributed system, the most suitable communication method is determined based on the node location where the data replica is located. If the replica is on the local node, shared memory communication is used, and if it is on other nodes, network communication is used, thereby reducing the network bandwidth usage.
It effectively reduces network bandwidth pressure, improves the read and write performance of hybrid flash distributed systems, reduces CPU consumption, and improves resource utilization.
Smart Images

Figure CN119248177A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] A hybrid flash distributed system is a system that combines a hybrid storage architecture (for example, a storage solution that combines HDD (Hard Disk Drive) and SSD (Solid State Drive)) with distributed system characteristics.
[0003] In a hybrid flash distributed system, SSDC (Solid State Disk Cache) is usually used to improve IO (Input / Output) read and write performance. However, data communication between processes in a hybrid flash distributed storage system that supports SSDC is done through network communication, which occupies a large amount of network bandwidth and puts a lot of pressure on the network bandwidth. Summary of the invention
[0004] Based on this, it is necessary to provide a data processing method, computer equipment, computer-readable storage medium and computer program product that can reduce the pressure on network bandwidth in response to the above technical problems.
[0005] In a first aspect, the present application provides a data processing method, which is applied to a hybrid flash distributed system, and the method includes:
[0006] When the first process reads and writes data, it determines the target node where the target copy is located, and determines the target communication mode according to the target node;
[0007] The first process uses the target communication mode to perform data reading and writing interaction with the second process to complete the reading and writing operations of the data to be processed.
[0008] By adopting the data processing method provided by the embodiment of the present disclosure, in a mixed-flash distributed system, processes can determine the most suitable communication method for communication based on the location of the node where the replica is located, which can reduce the occupation of network bandwidth when processes in the mixed-flash distributed system communicate only using network communication methods, thereby reducing network bandwidth pressure and improving the read and write performance of the mixed-flash distributed system.
[0009] In one embodiment, determining a target node where a target replica is located, and determining a target communication mode according to the target node, includes:
[0010] In a case where the target node where the target copy is located is a local node of the first process, determining the target communication mode to be a communication mode based on shared memory; or,
[0011] In the case where the target node where the target copy is located is other nodes, the target communication mode is determined to be a network-based communication mode.
[0012] In this way, when reading and writing data in the hybrid flash distributed system, for local read and write requests, processes can use shared memory to communicate and transmit, which can effectively reduce the occupancy of network bandwidth and improve the read and write performance of the hybrid flash distributed system.
[0013] In one embodiment, the read and write operations include write operations, the target communication mode is a communication mode based on shared memory, and the first process uses the target communication mode to perform data read and write interaction with the second process to complete the read and write operations of the data to be processed, including:
[0014] The first process writes the to-be-processed data to a target location of the shared memory, and sends a data write request to the second process based on the target location;
[0015] The second process obtains the target location from the data write request, obtains the data to be processed from the target location of the shared memory, and stores the data to be processed in the solid state drive cache and the mechanical hard disk.
[0016] By adopting the data processing method provided by the embodiment of the present disclosure, when writing data in a hybrid flash distributed system, a shared memory-based communication method can be used for the copy of the local node to realize communication between processes, and a network-based communication method can be used for the copy of other nodes to realize communication between processes, which can effectively reduce the occupancy of network bandwidth.
[0017] In one embodiment, the read and write operation includes a read operation, the target communication mode is a communication mode based on shared memory, and the first process uses the target communication mode to perform data read and write interaction with the second process to complete the read and write operation of the data to be processed, including:
[0018] The first process determines a target location in the shared memory, and sends a data read request to the second process based on the target location;
[0019] The second process, in response to the data read request, obtains the to-be-processed data from the cache area of the solid-state drive, writes the to-be-processed data to a target location of the shared memory, and feeds back a target response indicating completion of the data read request to the first process;
[0020] The first process obtains the to-be-processed data from a target location in the shared memory in response to the target response.
[0021] By adopting the data processing method provided by the embodiment of the present disclosure, when reading data in a hybrid distributed system, a shared memory-based communication method can be used for the copy of the local node to realize communication between processes, which can effectively reduce the occupancy of network bandwidth.
[0022] In one of the embodiments, determining the target node where the target replica is located includes:
[0023] Determining an initial copy from a plurality of copies corresponding to the data to be processed;
[0024] In the case that the initial replica does not satisfy the load balancing condition, determining the load data corresponding to each of the replicas;
[0025] A target replica is determined from the multiple replicas according to the load data of each replica, and a node where the target replica is located is used as a target node.
[0026] By adopting the data processing method provided by the embodiment of the present disclosure, when reading data in a hybrid flash distributed system, for the replica with the highest probability of hitting the data initially determined, it can be determined whether to read data from the replica based on the load of the disk and node where the replica is located, so as to ensure that data can be read preferentially from the replica with less load pressure, thereby improving the data hit rate and data reading efficiency.
[0027] In one of the embodiments, the load balancing condition includes: the number of replica disk tokens is greater than 0 and there is no queued task on the node where the replica is located.
[0028] By adopting the data processing method provided by the embodiment of the present disclosure, it is possible to determine whether to read data from the initial copy by setting the load balancing condition, so as to ensure that data can be read preferentially from the copy with less load pressure, thereby improving the data hit rate and data reading efficiency.
[0029] In one embodiment, determining the load data corresponding to each of the replicas includes:
[0030] For any of the replicas, determine the disk load of the disk where the replica is located, and determine the node load of the node where the replica is located;
[0031] The load data corresponding to the replica is determined according to the disk load and the node load.
[0032] The data processing method provided by the embodiment of the present disclosure selects the replica to be read based on the node load and the disk load, which can improve the IO read and write efficiency while achieving cluster load balancing, that is, improve the IO read and write performance in the hybrid flash distributed system.
[0033] In a second aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any of the above data processing methods when executing the computer program.
[0034] In a third aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements any of the above data processing methods when executed by a processor.
[0035] In a fourth aspect, the present application also provides a computer program product, including a computer program, which implements any of the above data processing methods when executed by a processor.
[0036] In the above-mentioned data processing method, computer device, computer-readable storage medium and computer program product, in a mixed-flash distributed system, when the first process reads and writes data, it can first determine the target node where the target copy is located, determine the target communication mode according to the target node, and use the target communication mode to interact with the second process to read and write data, so as to complete the read and write operations of the data to be processed. Using the data processing method, computer device, computer-readable storage medium and computer program product provided by the embodiments of the present disclosure, in a mixed-flash distributed system, processes can determine the most suitable communication mode for communication based on the location of the node where the copy is located, which can reduce the occupation of network bandwidth by only using network communication mode for communication between processes in the mixed-flash distributed system, thereby reducing the pressure on network bandwidth and improving the read and write performance of the mixed-flash distributed system. Moreover, since the shared memory communication mode reduces the data copying on the network twice compared with the network communication mode, it can also reduce CPU consumption and improve resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0038] FIG1 is a schematic flow chart of a data processing method in one embodiment;
[0039] FIG2 is a schematic diagram of selecting a communication method for reading data in one embodiment;
[0040] FIG3 is a schematic diagram of selecting a communication mode for writing data in one embodiment;
[0041] FIG4 is a schematic flow chart of step 104 in a data processing method in one embodiment;
[0042] FIG5 is a schematic diagram of writing data in a data processing method according to an embodiment;
[0043] FIG6 is a schematic flow chart of step 104 in a data processing method in one embodiment;
[0044] FIG7 is a schematic diagram of reading data in a data processing method according to an embodiment;
[0045] FIG8 is a schematic diagram of reading data in a data processing method according to an embodiment;
[0046] FIG9 is a schematic flow chart of step 602 in a data processing method according to an embodiment;
[0047] FIG10 is a schematic diagram of a flow chart of determining a replica in a data processing method according to an embodiment;
[0048] FIG11 is a flow chart of step 604 in a data processing method according to an embodiment;
[0049] FIG12a is a schematic diagram of a data processing method in one embodiment;
[0050] FIG12 b is a schematic diagram of a data processing method in one embodiment;
[0051] FIG13a is a schematic diagram of a data processing method in one embodiment;
[0052] FIG13b is a schematic diagram of a data processing method in one embodiment;
[0053] FIG. 14 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] In one embodiment, as shown in FIG1 , a data processing method is provided, which is applied to a hybrid flash distributed system. In this embodiment, the method includes the following steps 102 to 104, wherein:
[0056] Step 102: When reading and writing data, the first process determines the target node where the target copy is located, and determines the target communication mode according to the target node.
[0057] In the embodiment of the present disclosure, the first process may be a user state process, and the second process may be a user state process or a kernel state process. When the first process reads and writes data, it may first determine the target replica where the pending data to be read and written is located, and use the node where the target replica is located as the target node.
[0058] Exemplarily, when writing data, multiple copies corresponding to the data to be processed are all used as target copies; when reading data, a target copy can be determined from the multiple copies corresponding to the data to be processed.
[0059] In an exemplary embodiment, determining a target node where a target replica is located, and determining a target communication mode according to the target node may include:
[0060] When the target node where the target copy is located is the local node of the first process, the target communication mode is determined to be a communication mode based on shared memory; or, when the target node where the target copy is located is other nodes, the target communication mode is determined to be a communication mode based on the network.
[0061] In the disclosed embodiment, when writing data, as shown in FIG. 2 , the copies corresponding to the data to be processed include a first copy, a second copy, and a third copy, wherein the node where the first copy is located is the local node of the first process, and the first process and the second process are processes in the same node. Therefore, when writing data to the first copy, a communication method based on shared memory can be adopted between the first process and the second process; if the nodes where the second copy and the third copy are located are other nodes, when writing data to the second copy and the third copy, the first process and the second process in the other nodes adopt a network-based communication method.
[0062] When reading data, as shown in Figure 3, if the target copy is the first copy and its node is the local node of the first process, the first process and the second process are processes in the same node, so when reading data from the first copy, a shared memory-based communication method can be used between the first process and the second process; or, if the target copy is the second copy or the third copy and its node is other nodes, the first process and the second process are processes in different nodes, so when reading data from the first copy, a network-based communication method can be used between the first process and the second process.
[0063] In this way, when reading and writing data in the hybrid flash distributed system, for local read and write requests, processes can use shared memory to communicate and transmit, which can effectively reduce the occupancy of network bandwidth and improve the read and write performance of the hybrid flash distributed system.
[0064] Step 104: the first process uses the target communication mode to perform data reading and writing interaction with the second process to complete the reading and writing operations of the data to be processed.
[0065] In the disclosed embodiment, after determining the target communication mode, the first process may use the target communication mode to perform data reading and writing interaction with the second process, thereby completing the reading and writing operations of the data to be processed.
[0066] In the above data processing method, in a mixed-flash distributed system, when the first process reads and writes data, it can first determine the target node where the target replica is located, determine the target communication method according to the target node, and use the target communication method to interact with the second process to read and write data, so as to complete the read and write operations of the data to be processed. Using the data processing method provided by the embodiment of the present disclosure, in a mixed-flash distributed system, processes can determine the most suitable communication method for communication based on the location of the node where the replica is located, which can reduce the occupation of network bandwidth when only the network communication method is used for communication between processes in the mixed-flash distributed system, thereby reducing the pressure on network bandwidth and improving the read and write performance of the mixed-flash distributed system.
[0067] In an exemplary embodiment, the read and write operations include write operations, and the target communication mode is a communication mode based on shared memory. As shown in FIG. 4 , in step 104, the first process uses the target communication mode to perform data read and write interaction with the second process to complete the read and write operations of the data to be processed, including the following steps 402 to 404, wherein:
[0068] Step 402, the first process writes the data to be processed to the target location of the shared memory, and sends a data write request to the second process based on the target location;
[0069] In step 404, the second process obtains the target location from the data write request, obtains the data to be processed from the target location of the shared memory, and stores the data to be processed in the solid state drive cache and the mechanical hard disk.
[0070] In the embodiment of the present disclosure, during a write operation, for the replicas in the local node, the first process can use a shared memory-based communication method to transmit data with the second process, and for the replicas in other nodes, the first process can use a network-based communication method to transmit data with the second process to complete the writing of the data to be processed to each replica.
[0071] For the local node, as shown in FIG5 , the first process can write the data to be processed to the target location of the shared memory, and send a write request to the second process, and the write request carries the target location. After receiving the write request, the second process can obtain the target location from the write request, and obtain the data to be processed from the target location of the shared memory in response to the write request, and write the data to be processed into the solid state drive cache SSDC and the mechanical hard disk HDD.
[0072] Exemplarily, the process of writing the data to be processed into the solid-state drive cache SSDC and the mechanical hard disk HDD may include: the first process allocates a number of storage nodes of replicas to the current data to be processed through a hash algorithm or other allocation method to ensure the balance of storage space among all storage nodes in the hybrid flash distributed system, wherein the number of replicas is the number of data that needs to be saved simultaneously when the hybrid flash distributed system stores data; the replica number is the number of each replica of the current data to be stored, and the object creation instruction sent by the first process to each storage node includes the number of replicas and the replica number of the replica to be created. In response to obtaining the object creation instruction sent by the first process, the second process in the storage node creates a replica object according to the obtained replica number, and creates a replica sub-object in the replica object according to the obtained number of replicas.
[0073] In an embodiment of the present disclosure, the first process can be set to a fixed copy mode, that is, the number of copies is fixed. When the first process obtains each data to be processed, storage nodes are allocated to the current data to be processed with the same number of copies; or, the first process can also be set to a non-fixed copy mode, that is, the number of copies is not fixed. When the first process obtains each data to be processed, storage nodes are allocated to the current data to be processed with different numbers of copies according to different copy requirements of different data to be processed. The number of copies of different data to be stored can be determined by the importance of the current data to be processed, and the importance is positively correlated with the number of copies; wherein the importance of the data to be processed can be determined according to the data type and / or data source (i.e., the data sender) of the data to be processed.
[0074] Exemplarily, taking the storage of the data B to be processed in a three-copy mode as an example, the copy numbers are 1, 2, and 3 respectively, and the storage node C, storage node D and storage node E are assigned to the data B to be processed for copy storage through the above-mentioned hash algorithm, thereby sending the number of copies (i.e. 3) and copy number 1 to storage node C, the number of copies (i.e. 3) and copy number 2 to storage node D, and the number of copies (i.e. 3) and copy number 3 to storage node E.
[0075] After obtaining the object creation instruction, the second process in the storage node creates a replica object according to the replica number; wherein the replica object, that is, the object used to perform replica storage, is also a discrete unit in the storage node for managing data; in the embodiment of the present disclosure, the mixed flash distributed system stores copies of the data to be processed in the form of object storage; the replica sub-object is a sub-unit in the replica object, and each replica sub-object is used to store a part of the data to be processed corresponding to the current replica object, that is, the sub-data to be processed, and the sub-data to be processed stored in all replica sub-objects constitute the complete data to be processed; in the embodiment of the present disclosure, the number of replica sub-objects is the same as the number of replicas, and the storage node creates the above number of replica sub-objects in the current replica object according to the obtained number of replicas.
[0076] Still taking the above example, for the data to be processed B, after the storage node C obtains the number of copies (i.e., 3) and the copy number (i.e., copy number 1), it creates a copy object with copy number 1, and creates 3 copy sub-objects in the copy object, i.e., copy sub-object 1, copy sub-object 2, and copy sub-object 3. After obtaining the data to be processed, the first process splits the data to be processed to split the data to be processed into multiple sub-data to be processed; wherein the number of sub-data to be processed is the same as the number of copies; the first process can split the data to be processed in equal proportions according to the data size of the data to be processed, or can divide the continuous data with strong correlation into the same data to be processed according to the correlation between the data in the data to be processed. In the embodiment of the present disclosure, the splitting method of the data to be processed is not specifically limited; the first process sends the complete data to be processed to each copy object. For the copy object of the local node, the data to be processed can be sent by a shared memory communication method, and for the copy objects of other nodes, the data to be processed can be sent by a network communication method.
[0077] After the second process of the storage node receives the write request sent by the first process, if the storage node is the local node of the first process, the second process can obtain the data to be processed sent by the first process from the shared memory, and after obtaining the data to be processed, store the sub-data to be processed and the replica sub-object in sequence in a one-to-one matching manner, and number each replica sub-object in sequence. For example, before the second process of storage node C obtains the data to be processed B, it has created replica object 1. Therefore, when storing the data to be processed B through replica object 1, the data to be processed B1 is stored through replica sub-object 1, the data to be processed B2 is stored through replica sub-object 2, and the data to be processed B3 is stored through replica sub-object 3; obviously, a replica object (i.e., replica object 1) includes the complete data to be processed (i.e., data to be processed B), and each replica sub-object in a replica object carries different sub-data to be processed.
[0078] The second process in the storage node determines the target replica sub-object in each replica sub-object according to the replica number, stores the to-be-processed sub-data in the target replica sub-object in the SSD cache, and stores the to-be-processed sub-data in the non-target replica sub-object in the mechanical hard disk.
[0079] After the second process in the storage node stores the data to be processed in the replica object, it can compare the number of the replica sub-object (i.e., the replica sub-number) with the number of the replica object (i.e., the replica number) in each replica sub-object, and take the replica sub-object corresponding to the replica sub-number that is the same as the current replica number as the target replica sub-object; taking the above example as an example, for the data to be processed B, the second process in the storage node C takes replica sub-object 1 in replica object 1 as the target replica sub-object, and replica sub-object 1 stores the sub-data B1 to be processed; the second process in the storage node D takes replica sub-object 2 in replica object 2 as the target replica sub-object, and replica sub-object 2 stores the sub-data B2 to be processed; the second process in the storage node E takes replica sub-object 3 in replica object 3 as the target replica sub-object, and replica sub-object 3 stores the sub-data B3 to be processed.
[0080] After obtaining the target to-be-processed sub-data in the target replica sub-object, the second process in the storage node stores it in the solid-state drive cache SSDC, and directly stores the to-be-processed sub-data in other replica sub-objects (i.e., non-target replica sub-objects) except the target replica sub-object in the mechanical hard disk; taking the aforementioned example, for the data to be processed B, the second process in the storage node C stores the to-be-processed sub-data B1 in replica sub-object 1 of replica object 1 in SSDC, and stores the to-be-processed sub-data B2 in replica sub-object 2 of replica object 1, and the to-be-processed sub-data B3 in replica sub-object 3 of replica object 1 directly in the mechanical hard disk; in particular, the second process in the storage node can also copy the target to-be-processed sub-data in SSDC and store it in the mechanical hard disk through methods such as data flushing, so as to store the complete data to be processed B in the mechanical hard disk.
[0081] Obviously, in the above technical scheme, not only the copy storage of the data to be processed is realized, that is, the complete data to be processed is stored through multiple storage nodes respectively, and data backup is realized; at the same time, only a part of the data to be processed, that is, the sub-data to be processed, is retained in the SSDC of each storage node, and the sub-data to be processed in the SSDC of each storage node is different. At the same time, the sub-data to be processed in the SSDC of each storage node together constitute the complete above-mentioned data to be processed, so that the first process can read the complete stored data through the SSDC of multiple storage nodes, thereby improving the reading efficiency of the stored data. At the same time, the SSDC of each storage node does not include duplicate data, thereby avoiding the waste of SSDC resources in the mixed-flash distributed system.
[0082] Specifically, the storage node can also store all the pending data stored in the replica object in the SSDC first, and then use SSDC to copy and store the above-mentioned pending data in the mechanical hard disk by using data flushing and other methods. In the SSDC, only the target pending sub-data in the target replica sub-object is retained, and the pending sub-data in the non-target replica sub-object is deleted; while ensuring that the SSDC of the storage node does not include duplicate data and avoids the waste of cached SSDC in the hybrid flash distributed storage system, asynchronous storage of data is realized, thereby improving data storage efficiency.
[0083] By adopting the data processing method provided by the embodiment of the present disclosure, when data is written in a mixed-flash distributed system, a shared memory-based communication method can be used for the replica of the local node to realize communication between processes, and a network-based communication method can be used for the replicas of other nodes to realize communication between processes, which can effectively reduce the occupancy of network bandwidth, and store each to-be-processed sub-data of the to-be-processed data one by one in the storage node through the replica sub-objects of each replica object, store the to-be-processed sub-data in the target replica sub-object in the SSDC, and store the to-be-processed sub-data in the non-target replica sub-object in the mechanical hard disk. Since the SSDC of each storage node does not include duplicate data, the waste of SSDC resources in the mixed-flash distributed system is avoided, and the first process can read the complete to-be-processed data through the SSDCs of multiple storage nodes, thereby improving the reading efficiency of the to-be-processed data, that is, effectively improving the IO read and write performance.
[0084] In an exemplary embodiment, the read and write operation includes a read operation, and the target communication mode is a communication mode based on a shared memory. Referring to the method shown in FIG. 6 , in step 104, the first process uses the target communication mode to perform data read and write interaction with the second process to complete the read and write operation of the data to be processed, which may include the following steps 602 to 606, wherein:
[0085] Step 602, the first process determines a target location in the shared memory, and sends a data read request to the second process based on the target location;
[0086] Step 604: In response to the data read request, the second process obtains the data to be processed from the SSD cache, writes the data to be processed to the target location of the shared memory, and feeds back a target response indicating completion of the data read request to the first process;
[0087] Step 606: The first process obtains the data to be processed from the target location of the shared memory in response to the target response.
[0088] In the embodiment of the present disclosure, during the read operation, the replica to be read is first determined. If it is determined that the replica to be read is a replica in the local node, the first process can use a shared memory-based communication method to transmit data with the second process. If it is determined that the replica to be read is a replica in the local node, the first process can use a network-based communication method to transmit data with the second process to complete the reading of the data to be processed from each replica.
[0089] For the local node, as shown in FIG7 , the first process can allocate a specified page memory in the shared memory to store the data to be processed this time, and then send a data read request to the second process using the specified page memory as the target location. After receiving the data read request, the second process can obtain the target location from the data read request, obtain the data to be processed from the solid-state drive cache, write the data to be processed to the target location of the shared memory, that is, the specified page memory, and feedback the target response to the first process after completing the data writing, so as to notify the first process to complete the read operation through the target response. After receiving the target response, the first process can respond to the target response, obtain the data to be processed from the specified page memory of the shared memory, and complete the data reading this time.
[0090] By adopting the data processing method provided by the embodiment of the present disclosure, when reading data in a hybrid distributed system, a shared memory-based communication method can be used for the copy of the local node to realize communication between processes, which can effectively reduce the occupancy of network bandwidth.
[0091] In one example, the first process can respond to the acquired data read instruction to obtain multiple target storage nodes that match the data read instruction and the target replica objects in each target storage node; obtain the target replica sub-objects that match the replica number of the current target replica object through the target replica objects in each storage node; the first process determines the local node from each storage node, determines the specified page memory in the shared memory, sends the data read instruction to the local node based on the specified page memory, and sends the data read instruction to other storage nodes through the network.
[0092] The second process of the local node obtains the matching stored data from the corresponding SSDC through the target replica sub-object of the storage node, and stores it in the specified page memory of the shared memory; the first process reads the stored data from the specified page memory of the shared memory, and after receiving the stored data sent by other storage nodes through network communication, it splices the stored data to obtain the spliced data to be processed, and can respond to data reading instructions based on the data to be processed.
[0093] Specifically, still taking the aforementioned example, when the first process determines, based on the data reading instruction, that the data to be read is data B, it determines that data B is stored in replica object 1 of storage node C, replica object 2 of storage node E, and replica object 2 of storage node F; then, based on the above replica numbers, replica sub-object 1 is determined in replica object 1, replica sub-object 2 is determined in replica object 2, and replica sub-object 3 is determined in replica object 3.
[0094] Assuming that storage node C is the local node of the first process, and storage node D and storage node E are other nodes, the first process can respectively determine the specified page memory in the shared memory, and send a first data read request including the specified page memory to storage node C, and send a second data read request to storage node D and storage node E.
[0095] The second process of storage node C obtains the stored data B1 from SSDC through replica sub-object 1, stores it in the specified page memory 1 of the shared memory, and sends a read completion response to the first process; the second process of storage node D obtains the stored data B2 from SSDC through replica sub-object 2, and the second process of storage node E obtains the stored data B3 from SSDC through replica sub-object 3, and sends the stored data B2 and stored data B3 to the first process through network communication respectively.
[0096] In response to the read completion response, the first process obtains the stored data B1 from the specified page memory 1, receives the stored data B2 and the stored data B3 through network communication, and finally splices the stored data B1, the stored data B2, and the stored data B3 to obtain the complete data B, and then responds to the above data read instruction based on the data B.
[0097] In this way, the complete data to be processed can be obtained from the SSDC of multiple storage nodes, which improves the reading efficiency of the stored data. At the same time, the SSDC of each storage node does not include duplicate data, avoiding the waste of SSDC resources in the mixed-flash distributed system. In the data reading process, a shared memory-based communication method is adopted for the local node, and a network-based communication method is adopted for other nodes, which can reduce the occupancy of network bandwidth and improve the IO read and write performance of the mixed-flash distributed system.
[0098] In an example, as shown in Figure 8, the first process can determine a copy to be read for the data to be processed, and determine whether the copy is a copy of the local node. If the copy is a copy of a non-local node, data transmission can be performed in a network-based manner to obtain the data to be processed from copies of other nodes; if the copy is a copy of the local node, data transmission can be performed with the second process based on a shared memory-based manner, that is, the first process can allocate a specified page memory in the shared memory, and notify the second process to store the data to be processed read from the copy in the specified page memory of the shared memory, and then the first process can obtain the data to be processed from the specified page memory; if reading the data to be processed from the copy of the local node fails, other copies can be replaced, and data transmission can be performed in a network-based manner to obtain the data to be processed from copies of other nodes.
[0099] In an exemplary embodiment, as shown in FIG. 9 , in step 602, determining the target node where the target replica is located may include the following steps 902 to 906, wherein:
[0100] Step 902, determining an initial copy from multiple copies corresponding to the data to be processed;
[0101] Step 904, when the initial replica does not meet the load balancing condition, determine the load data corresponding to each replica;
[0102] Step 906: determine a target replica from multiple replicas according to the load data of each replica, and use the node where the target replica is located as the target node.
[0103] In the disclosed embodiment, an initial replica can be determined from multiple replicas corresponding to the data to be processed, wherein the initial replica is a replica storing all or part of the data to be processed in the SSDC. After determining the initial replica, it can be determined whether the initial replica meets the load balancing condition, wherein the load balancing condition is a condition for measuring the load pressure of the disk and node where the replica is located.
[0104] In an exemplary embodiment, the load balancing condition includes: the number of replica disk tokens is greater than 0 and there is no queued task on the node where the replica is located.
[0105] In the embodiment of the present disclosure, as shown in Figure 10, after determining the initial replica, the disk token number of the disk where the initial replica is located can be determined. The disk token number is the remaining token number of the disk, which is used to characterize the maximum number of read and write requests that the disk can currently process, and whether the disk token number is greater than 0 is determined. When the disk token number is less than or equal to 0, it is determined that the replica does not meet the load balancing condition; when the disk token number is greater than 0, it is continued to determine whether there is currently a queued task at the node where the replica is located, and when the node currently has a queued task, it is determined that the replica does not meet the load balancing condition, or, when the node currently has no queued task, it is determined that the replica meets the load balancing condition.
[0106] When it is determined that the initial copy meets the load balancing conditions, it can be further determined whether the initial copy is a copy of the local node. If so, data can be transmitted with the second process in a shared memory-based manner, and all or part of the data to be processed can be read from the copy of the local node. The specific process can be referred to the relevant description of the aforementioned embodiment, and the data reading process will not be repeated in the present disclosed embodiment.
[0107] If it is determined that the initial copy does not meet the load balancing conditions, then based on the disk load and node load, the copy with smaller disk load and node load can be further determined as the target copy from the copies corresponding to the data to be processed, and the node where the target copy is located can be used as the target node to determine whether the target copy is a copy in the local node of the first process. If so, a shared memory-based method is used to transmit data with the local second process, and all or part of the data to be processed is read from the SSDC based on the copy of the local node.
[0108] By adopting the data processing method provided by the embodiment of the present disclosure, when reading data in a hybrid flash distributed system, for the replica with the highest probability of hitting the data initially determined, it can be determined whether to read data from the replica based on the load of the disk and node where the replica is located, so as to ensure that data can be read preferentially from the replica with less load pressure, thereby improving the data hit rate and data reading efficiency.
[0109] In an exemplary embodiment, as shown in FIG. 11 , in step 604, determining the load data corresponding to each replica may include the following steps 1102 to 1104, wherein:
[0110] Step 1102, for any replica, determining the disk load of the disk where the replica is located, and determining the node load of the node where the replica is located;
[0111] Step 1104, determine the load data corresponding to the replica according to the disk load and the node load.
[0112] In the disclosed embodiment, the disk load of the disk where the replica is located can be determined based on the number of disk tokens of the disk where the replica is located and the total number of tokens of the disk. The disk load is positively correlated with the number of disk tokens and negatively correlated with the total number of tokens. The node load of the node where the replica is located can be determined based on the number of currently queued tasks of the node where the replica is located. The node load is positively correlated with the number of currently queued tasks of the node. By taking a weighted difference between the disk load and the node load, the load data corresponding to the replica can be obtained, and the load data can be used to reflect the load pressure of the node and the disk where the replica is located. Exemplarily, the process of determining the load data corresponding to the replica based on the disk load and the node load can refer to formula (1).
[0113] Formula (I)
[0114] Among them, among them, Indicates the load data corresponding to the replica; Indicates the number of disk tokens; Indicates the total number of tokens on the disk; Indicates disk weight; Indicates the number of tasks queued by the node; represents a multiplication factor; Represents the node weight.
[0115] Calculated It is the comprehensive load weight of the node and disk of the replica. The larger the load data is, the smaller the load pressure of the node and disk is. By comparing the load data of each replica, the replica with the smallest load pressure is selected as the target replica.
[0116] In the disclosed embodiment, the initial copy to be read is selected, and then the data transmission method is selected based on whether the initial copy is a copy in the local node. Taking into account the load balance in the cluster, the pressure of the entire cluster can be balanced, and the pressure of each node can be balanced as much as possible, and the cluster performance will not be reduced due to hot nodes or hot disks. Especially for large-block read IO, because the number of pages carried is relatively large, it is highly likely that not all of them will hit the SSDC, and it is still necessary to read the back-end disk. In this way, the performance of the IO will depend on the IO read performance of the back-end disk, so the node load and disk load are a necessary consideration.
[0117] The data processing method provided by the embodiment of the present disclosure selects the replica to be read based on the node load and the disk load, which can improve the IO read and write efficiency while achieving cluster load balancing, that is, improve the IO read and write performance in the hybrid flash distributed system.
[0118] In one example, when reading and writing data for a replica in a local node, a ringbuffer can be used to implement the transmission of request instructions and responses between processes. This includes: a first process writes a data read and write request into a first ring buffer; a second process reads the read and write request from the first ring buffer, obtains a receipt message corresponding to the read and write request, and writes the receipt message into a second ring buffer; the first process reads the receipt message from the second ring buffer and processes it, as shown in Figures 5 and 7.
[0119] The first process does not share the first ring buffer and the second ring buffer with other processes. The data processing method provided by the embodiment of the present disclosure implements a lock-free mechanism in the communication process, and each process exclusively occupies a different ring buffer for processing by binding the process to the shared memory.
[0120] Using the data processing method provided by the embodiment of the present disclosure, when IO is written, the multiple copies written are generally located in three different nodes. If a certain copy is on the node where the current IO is located, then the copy will be preferentially transmitted through the ringbuffer + shared memory with the second process for data transmission to finally complete the data landing on the disk. The copies of other nodes still use the network to transmit data. When the IO is written locally, the first process first notifies the second process of the message through the ringbuffer technology. The receiving module in the second process reads the page from the specified location in the shared memory of the two processes, writes it to the SSDC cache disk, and then uses the ringbuffer to respond to the result of this write, as shown in Figure 5.
[0121] When reading IO, first select the copy of the data to be read that is most likely to reside in the SSDC, in the hope of hitting the data in the SSDC, without having to read the HDD data disk. Then determine whether the selected copy is in the local node. If it is in the local node, use the ringbuffer + shared memory transmission method to obtain the data read by the second process; if the selected copy is not in the local node, then the network data transmission is still used. Similarly, if the local read fails, then the data source must be changed to read another copy. Because it is not in the same node, the network can only be used for data transmission. The IO local read process refers to Figure 7. The first process allocates a specified page memory in the shared memory to store the page data read this time, and then notifies the second process through the ringbuffer protocol to put the page read this time in the specified location of the shared memory; the second process goes to the SSDC cache disk to read the data to be read this time. If it hits, the data is copied to the specified location in the shared memory, and then responds to the ringbuffer to notify the first process that the read is complete. At this time, the first process gets the expected data from these specified pages in the shared memory.
[0122] Figures 12a and 12b respectively show the data copying process corresponding to reading data and writing data when the data transmission method of network communication is adopted, and Figures 13a and 13b respectively show the data copying process corresponding to reading data and writing data when the data transmission method of shared memory is adopted. It can be clearly seen that when the data transmission method of shared memory is adopted, the number of data copies corresponding to reading data and writing data is lower than that of the data transmission method of network communication. That is, by adopting the data processing method provided by the embodiment of the present disclosure, by adjusting the data transmission method between the read and write local copy and the backend process, the two data copies in the network transmission can be changed to only need to pass the control structure to notify the page data location in the shared memory, reducing the two data copies on the network, reducing CPU consumption, reducing the pressure on network bandwidth, and thus improving the read and write performance of the mixed flash distributed system, providing users with a better experience.
[0123] At the same time, the embodiment of the present disclosure considers load balancing including node CPU and memory pressure, disk pressure, etc. as a necessary condition for selecting replica reads, rather than a single quick elimination selection method. This can balance the pressure of each node in the cluster, avoid reducing cluster performance due to the emergence of hot nodes or hot disks, and further improve the system IO read and write performance.
[0124] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0125] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG14. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a data processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0126] Those skilled in the art will understand that the structure shown in FIG. 14 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0127] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0128] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0129] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0130] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0131] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0132] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0133] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data processing method, characterized in that: Applied in a hybrid flash distributed system, the method includes: When the first process reads and writes data, it determines the target node where the target copy is located, and determines the target communication mode according to the target node; The first process uses the target communication mode to perform data reading and writing interaction with the second process to complete the reading and writing operations of the data to be processed.
2. The method according to claim 1, characterized in that: Determining a target node where the target replica is located, and determining a target communication mode according to the target node, including: In a case where the target node where the target copy is located is a local node of the first process, determining the target communication mode to be a communication mode based on shared memory; or, In the case where the target node where the target copy is located is other nodes, the target communication mode is determined to be a network-based communication mode.
3. The method according to claim 2, characterized in that The read and write operations include write operations, the target communication mode is a communication mode based on shared memory, the first process uses the target communication mode to perform data read and write interaction with the second process to complete the read and write operations of the data to be processed, including: The first process writes the data to be processed into a target location of the shared memory, and sends a data write request to the second process based on the target location; The second process obtains the target location from the data write request, obtains the data to be processed from the target location of the shared memory, and stores the data to be processed in the solid state drive cache and the mechanical hard disk.
4. The method according to claim 2, characterized in that: The read and write operations include a read operation, the target communication mode is a communication mode based on a shared memory, the first process uses the target communication mode to perform data read and write interaction with the second process to complete the read and write operations of the data to be processed, including: The first process determines a target location in the shared memory, and sends a data read request to the second process based on the target location; The second process, in response to the data read request, obtains the to-be-processed data from the SSD cache, writes the to-be-processed data to a target location of the shared memory, and feeds back a target response indicating completion of the data read request to the first process; The first process obtains the to-be-processed data from a target location in the shared memory in response to the target response.
5. The method according to claim 4, characterized in that The step of determining the target node where the target replica is located includes: Determining an initial copy from a plurality of copies corresponding to the data to be processed; In the case that the initial replica does not satisfy the load balancing condition, determining the load data corresponding to each of the replicas; A target replica is determined from the multiple replicas according to the load data of each replica, and a node where the target replica is located is used as a target node.
6. The method according to claim 5, characterized in that The load balancing conditions include: the number of replica disk tokens is greater than 0 and there is no queued task on the node where the replica is located.
7. The method according to claim 5 or 6, characterized in that: The determining the load data corresponding to each of the replicas includes: For any of the replicas, determine the disk load of the disk where the replica is located, and determine the node load of the node where the replica is located; The load data corresponding to the replica is determined according to the disk load and the node load.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
