Data processing system and method
By setting up memory pools between distributed computing nodes and using CXL or UB protocols, data is directly stored and retrieved in the memory pool, unnecessary data exchange problems caused by limited memory space are solved, and computing efficiency and Shuffle performance are improved.
Patent Information
- Application Number
- CN202310492750.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-04
- Publication Date
- 2024-11-05
AI Technical Summary
In distributed computing, due to the limited memory storage space of the computing node, unnecessary data exchange between memory and hard disk, resulting in wasted resources.
By setting up a memory pool between compute nodes, using Computation Quick Link (CXL) or Unified Bus (UB) protocols, data is stored and retrieved directly into the memory pool, avoiding multiple exchanges of data between local memory and hard disks. , improve data processing efficiency.
Reduce resource waste, improve data acquisition efficiency and computing process speed, especially improve Shuffle performance during the MapReduce process.
Smart Images

Figure CN118897727A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing system and method. Background Art
[0002] Distributed computing is a science that divides engineering data that requires a lot of calculations into small pieces, and then uses multiple computing nodes to calculate the results separately, and then unifies the results to draw data conclusions. Furthermore, since each computing node can only process part of the task data, when a certain stage needs to rely on all the calculation results of the previous stage, all the calculation results of the previous stage need to be reintegrated.
[0003] However, due to the limited storage space of the computing node's memory, there will be multiple data exchanges between the memory and the hard disk during the reintegration operation. For example, the first computing node is used to generate data, and the second computing node is used to read the data in the first computing node. However, due to the limited storage space of the local memory of the first computing node, the first computing node needs to write the generated data from the local memory of the first computing node to the hard disk of the first computing node; correspondingly, due to the limited storage space of the local memory of the second computing node, the second computing node needs to write the data read from the hard disk of the first computing node from the local memory of the second computing node to the hard disk of the second computing node; and before processing the data, the second computing node needs to first read the data from the hard disk of the second computing node into the local memory of the second computing node.
[0004] Thus, in distributed computing, there is unnecessary data exchange between the memory and the hard disk in a computing node. Summary of the invention
[0005] The present application provides a data processing system and method for solving the problem of unnecessary data exchange between memory and hard disk in a computing node due to limited storage space of memory in distributed computing, so as to reduce resource waste.
[0006] In the first aspect, the present application provides a data processing system, comprising: a first computing node, comprising a first processor, the first processor is connected to a memory pool through a communication bus of the first computing node; a second computing node, comprising a second processor, the second processor is connected to the memory pool through a communication bus of the second computing node; the first processor is used to generate M data, and according to a protocol corresponding to the communication bus, the M data are stored in the memory pool via a cache of the first processor; the second processor is used to obtain N data from the memory pool to the cache of the second processor according to a protocol corresponding to the communication bus, and process the N data, wherein the M data include N data, and M and N are both positive integers. The storage space of the memory pool is larger than the storage space of the local memory of the first computing node. In one possible implementation, the communication bus is a compute express link (CXL) bus or a unified bus (UB).
[0007] In the above technical solution, it is prevented that the first computing node writes M data into the local memory of the first computing node, and due to the limited storage space of the local memory of the first computing node, the M data are swapped in and out between the local memory of the first computing node and the hard disk; and / or it is prevented that the second computing node reads N data into the local memory of the second computing node, and due to the limited storage space of the local memory of the second computing node, the N data are swapped in and out between the local memory of the second computing node and the hard disk, which helps to reduce resource waste. In addition, in the existing distributed computing process, the first processor includes multiple processor cores, and the M data generated by the multiple processor cores are respectively stored in the memory space corresponding to each processor core. Therefore, when the second processor needs to obtain the N data it needs, it needs to obtain N times. In the present application, since the M data will be written into the memory pool at the same time, the second processor can obtain the N data it needs at one time, which helps to improve the efficiency of data acquisition.
[0008] In a possible implementation, the first processor is specifically used to generate M data in the process of executing the Map task, and to store the M data in the memory pool in the process of executing the Shuffle task; the second processor obtains the N data required to execute the Reduce task from the memory pool in the process of executing the Reduce task. In the above technical solution, a data interaction method in MapReduce is provided, which helps to improve the performance of the global Shuffle and thus accelerate the calculation process.
[0009] In a possible implementation, the first computing node also includes a local memory, the local memory of the first computing node is also connected to the communication bus of the first computing node, and the local memory of the first computing node is used to store metadata of M data; when the second processor obtains N data from the memory pool to the cache of the second processor, it is specifically used to: obtain the metadata of the N data from the local memory of the first computing node, and then obtain the N data from the memory pool according to the metadata of the N data. The metadata of each data may include but is not limited to one or more of the following: the address of the data in the storage space, the data length, and the backup information of the data.
[0010] In a possible implementation, the M data include the first data, and the first processor is used to write the first data to the target address in the memory pool through the protocol corresponding to the communication bus, and write the target address to the local memory of the first computing node; the second processor is used to obtain the target address from the local memory of the first computing node, and read the first data from the target address in the memory pool through the protocol corresponding to the communication bus. In the above technical solution, the first computing node stores the target address in the local memory of the first computing node, which helps to improve the speed of data processing, and the storage space occupied by the target address is small and will not cause storage pressure on the local memory of the first computing node.
[0011] The data processing system can be a storage-computing integrated architecture or a storage-computing separated architecture.
[0012] When the data processing system is a storage-computing integrated architecture:
[0013] In one example, the memory pool is the first extended memory in the first computing node, the first computing node also includes a first switch, the first processor, the first extended memory and the first switch are all connected to the communication bus of the first computing node; the second computing node includes a second switch, the second processor and the second switch are connected to the communication bus of the second computing node; the second switch is connected to the first switch, and the second processor can be connected to the first extended memory through the first switch and the second switch. In the above technical solution, each computing node (or the processor in each computing node) manages its own extended memory, decouples the extended memory of each computing node from each other, and improves the stability of system operation.
[0014] In another example, the memory pool includes a first extended memory in a first computing node and a second extended memory in a second computing node; the first computing node also includes a first switch, and the first processor, the first extended memory and the first switch are all connected to the communication bus of the first computing node; the second computing node also includes a second switch, and the second processor, the second extended memory and the second switch are all connected to the communication bus of the second computing node; the second switch is connected to the first switch, and the second processor is connected to the first extended memory through the first switch and the second switch, and the first processor is connected to the second extended memory through the first switch and the second switch. In the above technical solution, the extended memory of each computing node is formed into a memory pool, which helps to expand the storage space of the memory pool.
[0015] In a possible implementation, before writing the first data to the target address in the extended memory through the protocol corresponding to the communication bus, the first processor is further configured to determine the address of the storage space in the memory pool where no data is written based on the record of storing data in the memory pool, and then determine the target address based on the address of the storage space in the memory pool where no data is written. In this way, the first processor determines the position in the memory pool where the first data is written.
[0016] When the data processing system is a storage-computing separation architecture:
[0017] In a possible implementation, the memory pool is a storage node; the first computing node includes a first switch, and the first processor and the first switch are both connected to the communication bus of the first computing node; the second computing node includes a second switch, and the second processor and the second switch are both connected to the communication bus of the second computing node; the storage node is connected to the first computing node through the first switch, and the storage node is connected to the second computing node through the second switch. In this way, setting a separate storage node as a memory pool decouples computing and storage, which helps to improve computing performance and storage performance.
[0018] In one example, the system also includes a management node, which is used to manage the memory pool; before the first processor writes the first data to the target address in the memory pool through the protocol corresponding to the communication bus, it is also used to: send an address request to the management node; and receive the target address from the management node in response to the address request. The storage-computing separation architecture can be applied to scenarios with a large number of storage nodes (such as high performance computing, HPC). In the above technical solution, the management node has strong computing power and network input / output (IO) capabilities, and transfers the interaction between the computing node and the storage node to the interaction between the computing node and the management node, which helps to reduce the hardware cost of the storage node and improve the access efficiency of the computing node.
[0019] In another example, the storage node is used to manage the memory pool; before the first processor writes the first data to the target address in the memory pool through the protocol corresponding to the communication bus, it is also used to: send an address request to the storage node; and receive the target address from the storage node in response to the address request. In the above technical solution, the storage node manages its own memory pool, which is suitable for scenarios with a small number of storage nodes and helps to reduce hardware deployment costs.
[0020] In a possible implementation, the first processor is also used to determine that the first data cannot be stored in the memory pool; when it is determined that there is storage space for storing the first data in the local memory of the first computing node, the first data is written to the local memory of the first computing node; and / or, when it is determined that there is no storage space for storing the first data in the local memory of the first computing node, the first data is written to the hard disk of the first computing node. It can be understood that since the storage space of the memory pool is larger than the storage space of the local memory of the first computing node, the first processor and the second processor transfer data based on the memory pool, which helps to reduce unnecessary data exchange; further, since the access latency of the local memory of the first computing node is lower than the access latency of the hard disk of the first computing node, when the first processor determines that there is not enough storage space in the memory pool to store the first data, the first processor preferentially stores the first data in the local memory of the first computing node, which helps to reduce the access latency.
[0021] In a second aspect, the present application provides a data processing method, which is applicable to a data processing system including a first computing node and a second computing node; the first computing node includes a first processor, and the first processor is connected to a memory pool through a communication bus of the first computing node; the second computing node includes a second processor, and the second processor is connected to the memory pool through a communication bus of the second computing node; the method includes: the first processor generates M data, and according to a protocol corresponding to the communication bus, the M data is stored in the memory pool via a cache of the first processor; the second processor obtains N data from the memory pool to the cache of the second processor according to a protocol corresponding to the communication bus, and processes the N data, wherein the M data include N data, and M and N are both positive integers. Wherein, the storage space of the memory pool is larger than the storage space of the local memory of the first computing node.
[0022] In a possible implementation, the protocol corresponding to the communication bus is the CXL protocol or the UB protocol.
[0023] In a possible implementation, the first processor generates M data, and stores the M data in the memory pool through the cache of the first processor according to the protocol corresponding to the communication bus. Specifically, the first processor generates M data in the process of executing the Map task; the first processor stores the M data in the memory pool according to the protocol corresponding to the communication bus in the process of executing the Shuffle task. The second processor obtains N data from the memory pool to the cache of the second processor according to the protocol corresponding to the communication bus, and processes the N data. Specifically, the second processor obtains N data required to execute the Reduce task from the memory pool according to the protocol corresponding to the communication bus, and processes the N data.
[0024] In a possible implementation, the first computing node also includes a local memory, the local memory of the first computing node is also connected to the communication bus of the first computing node, and the local memory of the first computing node is used to store metadata of M data; when the second processor obtains N data from the memory pool to the cache of the second processor, it can be specifically obtained by obtaining metadata of the N data from the local memory of the first computing node, and obtaining N data from the memory pool according to the metadata of the N data. The metadata of each data may include but is not limited to one or more of the following: the address of the data in the storage space, the data length, and the backup information of the data.
[0025] In one possible implementation, the first computing node writes the first data to the target address in the extended memory through the protocol corresponding to the communication bus, and writes the target address to the local memory of the first computing node; the second computing node obtains the target address from the local memory of the first computing node, and reads the first data from the target address in the extended memory through the protocol corresponding to the communication bus.
[0026] The data processing system can be a storage-computing integrated architecture or a storage-computing separated architecture.
[0027] When the data processing system is a storage-computing integrated architecture:
[0028] In one example, the memory pool is a first extended memory in a first computing node; in another example, the memory pool includes the first extended memory in the first computing node and the second extended memory in the second computing node. Before the first computing node writes the first data to the target address in the memory pool through the protocol corresponding to the communication bus, the first computing node also determines the address of the storage space in the memory pool where the data is not written according to the record of storing data in the memory pool; the first computing node determines the target address according to the address of the storage space in the memory pool where the data is not written.
[0029] When the data processing system is a storage-computing separation architecture:
[0030] In one example, the system further includes a management node and a storage node, the storage node is a memory pool, and the management node is used to manage the memory pool; before the first computing node writes the first data to the target address in the extended memory through the protocol corresponding to the communication bus, the first computing node also sends an address request to the management node; the first computing node receives the target address from the management node in response to the address request. In another example, the system further includes a storage node, the storage node is a memory pool, and the storage node is used to manage the memory pool; before the first computing node writes the first data to the target address in the extended memory through the protocol corresponding to the communication bus, the first computing node also sends an address request to the storage node; the first computing node receives the target address from the storage node in response to the address request.
[0031] In one possible implementation, the first processor may also determine that the first data cannot be stored in the memory pool; upon determining that there is storage space for storing the first data in the local memory of the first computing node, write the first data to the local memory of the first computing node; and / or, upon determining that there is no storage space for storing the first data in the local memory of the first computing node, write the first data to the hard disk of the first computing node.
[0032] In a third aspect, the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by a device, a method for a first computing node in any possible implementation of the second aspect is implemented; or, when the computer program or instruction is executed by a device, a method for a second computing node in any possible implementation of the second aspect is implemented.
[0033] In a fourth aspect, the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a device, the method of the first computing node in any possible implementation of the second aspect above is implemented; or, when the computer program or instructions are executed by a device, the method of the second computing node in any possible implementation of the second aspect above is implemented.
[0034] In a fifth aspect, the present application provides a device, comprising a processor, the processor being connected to a memory, the memory being used to store a computer program, and the processor being used to execute the computer program stored in the memory, so that the device implements the method of the first computing node in any possible implementation of the second aspect above, or, so that the device implements the method of the second computing node in any possible implementation of the second aspect above.
[0035] The technical effects that can be achieved in any of the second to fifth aspects mentioned above can refer to the description of the beneficial effects in the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of a host transmitting data to a device via a PCIe protocol provided in this application;
[0037] Figure 2 It is a flow chart of MapReduce;
[0038] Figure 3 A schematic diagram of a distributed computing architecture;
[0039] Figure 4 It is a schematic diagram of data flow;
[0040] Figure 5a A schematic diagram of a storage-computing integrated architecture provided as an example for this application;
[0041] Figure 5b A schematic diagram of the first storage-computing separation architecture provided as an example for this application;
[0042] Figure 5c A schematic diagram of a second storage-computing separation architecture provided as an example for this application;
[0043] Figure 6 A flowchart of a data processing method provided as an example for this application;
[0044] Figure 7 A schematic diagram of data flow provided for this application. DETAILED DESCRIPTION
[0045] In order to better explain the embodiments of the present application, the relevant terms or technologies in the present application are first explained:
[0046] 1. High-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIe) protocol, which belongs to high-speed serial point-to-point dual-channel high-bandwidth transmission. Figure 1The schematic diagram is a host transmitting data to a device via the PCIe protocol. Specifically, the central processing unit (CPU) in the host needs to first write the data to the host's local memory, and then set a flag, where the flag is used to notify the device that the host has written the data to the host's local memory. Accordingly, the device queries the flag, and determines based on the flag that the host has written the data to the host's local memory, and then the device reads the data from the host's local memory and stores the read data in the device's local memory. The way the device transmits data to the host via the PCIe protocol is similar to the way the host transmits data to the device via the PCIe protocol, and will not be repeated here.
[0047] 2. Compute Express Link (CXL) protocol. The CXL protocol is a new protocol based on the PCIe protocol and optimized for cache and memory. The CXL protocol runs on the PCIe physical layer.
[0048] The CXL protocol can be divided into the following three protocols:
[0049] CXL.io protocol is an enumeration configuration protocol, which is mainly used for device discovery and enumeration, error reporting, etc.
[0050] The CXL.cache protocol enables devices to solve memory consistency and access host memory with low latency. Specifically, the CXL.cache protocol mainly provides the ability to quickly access host memory by maintaining cache consistency on the device side. This protocol allows devices to participate in the consistent cache protocol of the CPU in the host. Devices can directly use host memory and the host's local cache, and the host can also obtain data from the device's cache without using memory as an intermediary.
[0051] The CXL.mem protocol allows the host to access device memory as if it were its own local memory. In the CXL.mem protocol, the CPU sends requests to the device, and the device responds to the CPU. The requests sent by the CPU are divided into requests with data and requests without data. Correspondingly, the responses sent by the device are also divided into responses with data and responses without data.
[0052] 3. The unified bus (UB) protocol is a communication bus protocol developed by Huawei. It is used to provide high-performance interconnection in data centers, making the interconnection of data centers like a computer.
[0053] 4. Spark is a general-purpose computing engine designed specifically for large-scale data processing. The core idea of Spark is to reduce the disk and network input / output (IO) overhead through a resilient distributed dataset (RDD) that can be operated in parallel and has a fault-tolerant mechanism. Among them, RDD is a parallel data structure that allows users to explicitly store data on the hard disk or in memory and control the partitioning of data. Spark task submission has four stages: (1) Constructing a directed acyclic graph (DAG): The job submitted by the user is converted into a series of RDDs, and a DAG is constructed through the dependencies between RDDs, and then the DAG is submitted to the scheduling system. Among them, the scheduling system includes a DAG scheduler and a task scheduler. (2) The DAG scheduler divides the DAG into stages and sends the tasks generated in the stage to the task scheduler in the form of a task set. (3) The task scheduler schedules tasks to executors based on resource conditions. (4) Executors receive tasks and pass them to the thread pool for execution.
[0054] 5. MapReduce (Map-Reduce): It is used to process parallel operations of large-scale data sets. MapReduce actually defines the Map function interface and the Reduce function interface. The Map function is used to transform the input data into intermediate results, and the Reduce function is used to transform the intermediate results into the final results. Therefore, users can simply specify the Map function and the Reduce function through parameters to calculate the data.
[0055] like Figure 2 The following is a flow chart of MapReduce, which can be divided into the following five stages:
[0056] (1) Input stage: Obtain data, split the data into slices, and use the obtained slices as input for the Map stage.
[0057] (2) Map stage: The slices from the Input stage are mapped through a Map task to obtain multiple intermediate results, where the Map task is implemented through a Map function.
[0058] (3) Shuffle stage: The intermediate results output by the Map stage are used as the input of the Reduce stage. Specifically, in the Shuffle stage, multiple intermediate results of a Map stage can be distributed to multiple Reduce stages, and intermediate results of multiple Map stages can be input to the same Reduce stage.
[0059] (4) Reduce phase: Merge the data from the Shuffle to get the final result.
[0060] (5) Output stage: Output the final result to the specified directory.
[0061] Based on the above explanations about professional terms or technologies, the embodiments of the present application are explained as follows.
[0062] like Figure 3 A schematic diagram of a distributed computing architecture, including one or more computing nodes 200 ( Figure 3 Two computing nodes 200 are shown in the figure, but are not limited to two computing nodes 200), and the two computing nodes 200 can communicate with each other. The computing node 200 is a device with both computing and storage capabilities, such as a server, a desktop computer, etc. Exemplarily, an advanced RISC machine (ARM) server or an X86 server can be used as the computing node 200 here.
[0063] In hardware, such as Figure 3 As shown, the computing node 200 at least includes a processor 201, a memory 202, a switch 203, and a hard disk 204. The processor 201, the memory 202, the switch 203, and the hard disk 204 are all located on the PCIe communication bus of the computing node 200, that is, any two modules of the processor 201, the memory 202, the switch 203, and the hard disk 204 can be connected through the PCIe communication bus of the computing node 200.
[0064] Specifically, the processor 201 is a central processing unit (CPU), which is used to process data access requests from outside the computing node 200, and is also used to process requests generated inside the computing node 200. Exemplarily, when the processor 201 receives a write data request, it temporarily stores the data in the write data request in the memory 202. When the total amount of data in the memory 202 reaches a certain threshold, the processor 201 sends the data stored in the memory 202 to the hard disk 204 for persistent storage. In addition, the processor 201 is also used to calculate or process data, such as metadata management, virtualized storage space, and address translation. Figure 3 Only one processor 201 is shown in the figure. In actual applications, there are often multiple processors 201, and one processor 201 has one or more processor cores. In this application, the number of processors and the number of processor cores are not limited.
[0065] Memory 202 refers to an internal memory that directly exchanges data with the processor. It can read and write data at any time, and the speed is very fast. It serves as a temporary data storage for the operating system or other running programs. Memory includes at least two types of memory. For example, memory can be either random access memory or read-only memory (ROM). Among them, random access memory is dynamic random access memory (DRAM), storage class memory (SCM), static random access memory (SRAM), etc. Read-only memory can be programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), etc. In addition, memory 202 can also be a dual in-line memory module or a dual-line memory module (DIMM), that is, a module composed of DRAM, and can also be a solid state disk (SSD). In actual applications, multiple memories 202 and different types of memories 202 can be configured in the computing node 200. The present application does not limit the number and type of memory 202. In addition, the memory 202 can be configured to have a power-saving function. The power-saving function means that when the system loses power and then powers on again, the data stored in the memory 202 will not be lost. Among them, the memory with the power-saving function is called a non-volatile memory. The memory 202 can be considered as the local memory of the computing node 200.
[0066] The hard disk 204 is used to provide storage resources, such as storing data, and can be a disk or other types of storage media, such as a solid state hard disk or a shingled magnetic recording hard disk.
[0067] The switch 203 is used to communicate with other computing nodes 200. The switch 203 may specifically be a switch (network interface card, NIC) in a remote direct memory access (RDMA) protocol.
[0068] In distributed computing (such as the above-mentioned MapReduce), there is a large amount of data exchange. For example, the distributed computing involves a first computing node and a second computing node. The first computing node and the second computing node can be the above-mentioned Figure 3 Two computing nodes 200 are shown in the architectural diagram of distributed computing.
[0069] See also Figure 4 A flow chart of MapReduce is shown as an example:
[0070] The first computing node includes Map task a, Map task b, Reduce task a and Reduce task b; the second computing node includes Reduce task c.
[0071] In the Map phase, Map task a generates data a to data c, and writes data a to data c to the local memory of the first computing node (referred to as the first local memory), and Map task b generates data d to data f, and writes data d to data f to the first local memory. Furthermore, due to the limited storage space of the first local memory, Map task a then writes data a to data c from the first local memory to the hard disk of the first computing node (referred to as the first hard disk), and Map task b then writes data d to data f from the first local memory to the first hard disk.
[0072] In the Reduce stage, Reduce task a needs to read data a and data d from the first hard disk to the first local memory, and process data a and data d; Reduce task b needs to read data b and data e from the first hard disk to the first local memory, and then process data b and data e; Reduce task c needs to read data c and data f from the first hard disk to the local memory of the second computing node (referred to as the second local memory). Since the storage space of the second local memory is limited, Reduce task c needs to store data c and data f in the second local memory to the hard disk of the second computing node (referred to as the second hard disk). When the second computing node needs to process data c and data f, it reads data c and data f from the second hard disk to the second local memory and processes data c and data f.
[0073] It can be understood that Map task a, Map task b, Reduce task a and Reduce task b are tasks running on the processor of the first computing node (referred to as the first processor), and the first processor here can be one or more. In the Map stage, taking Map task a writing data a as an example, Map task a (i.e., the first processor) can directly write data a into the first local memory. For example, the first local memory is DRAM, and Map task a can directly write data a into DRAM via double data rate (DDR). Further, Map task a can write instructions into the first local memory, which are used to instruct the first local memory to write data a into the first hard disk via the PCIe bus in the first computing node. In the Reduce stage, taking Reduce task a reading data a as an example, Reduce task a (i.e., the first processor) can read data a from the first hard disk to the first local memory based on the PCIe communication bus in the first computing node, and then Reduce task a reads data a from the first local memory. For example, the first local memory is DRAM, and Reduce task a can directly read data a from DRAM via DDR.
[0074] Similarly, Reduce task c is a task running on the processor of the second computing node (referred to as the second processor). In the Reduce stage, taking Reduce task c reading data c as an example, Reduce task c (i.e., the second processor) can read data c from the first hard disk to the second local memory based on RDMA, and then write data c from the second local memory to the second hard disk based on the PCIe communication bus in the second computing node. Subsequently, Reduce task c reads data c from the second hard disk to the second local memory based on the PCIe communication bus in the second computing node, and then reads data c from the second local memory. Exemplarily, the second local memory is DRAM, and Reduce task c can read data c directly from DRAM through DDR.
[0075] In the above Figure 4 In the example shown, the flow directions of data a, data b, data d, and data e are all "first local memory→first hard disk→first local memory", and the flow directions of data c and data f are all "first local memory→first hard disk→second local memory→second hard disk→second local memory". It can be seen that in distributed computing, due to the limited storage space of memory, there may be unnecessary data exchange between the memory and the hard disk in a certain computing node, resulting in the problem of resource waste.
[0076] In order to solve the problem of resource waste in the above distributed computing, Figure 5a to Figure 5cThree architecture diagrams are provided for example in this application:
[0077] Figure 5a The schematic diagram of the architecture of a data processing system provided by the present application is an exemplary embodiment. The data processing system may be a schematic diagram of an architecture of storage and computing integration, including one or more computing nodes 200 ( Figure 5a Two computing nodes 200 are shown in the figure, but the present application is not limited to two computing nodes 200). The two computing nodes 200 are connected through a communication bus between the two computing nodes 200, that is, the two computing nodes 200 communicate with each other through the protocol corresponding to the communication bus.
[0078] In the present application, the communication bus is, for example, a compute express link (CXL) protocol bus, and correspondingly, the protocol corresponding to the communication bus is, for example, the CXL protocol; or, the communication bus is, for example, a unified bus (UB), and correspondingly, the protocol corresponding to the communication bus is, for example, the UB protocol.
[0079] In terms of hardware, the computing node 200 includes at least a processor 201, a memory 202, a switch 203, and a hard disk 204. The processor 201, the memory 202, the switch 203, and the hard disk 204 are all connected to a communication bus of the computing node 200. For details, see Figure 3 Described in the relevant embodiments. In addition, the computing node 200 also includes an extended memory 205, and the extended memory 205 can be inserted into the computing node 200 by means of a plug-in card, that is, the extended memory 205 is also connected to the communication bus of the computing node 200, and the processor 201 can access the extended memory 205 based on the protocol corresponding to the communication bus. The storage space of the extended memory 205 is larger than the storage space of the memory 202 (that is, the local memory of the computing node 200). Further, when the communication bus is a CXL protocol bus, the extended memory 205 is, for example, a CXL memory expander.
[0080] Furthermore, the switches 203 of the two computing nodes 200 are connected to each other so that the two computing nodes 200 can communicate with each other through the protocol corresponding to the communication bus between the two computing nodes 200. The processor 201 in any computing node 200 can access the extended memory 205 in another computing node 200 through the two switches 203. For example, the processor 201 in the left computing node 200 can access the extended memory 205 in the right computing node 200 through the switch 203 in the left computing node 200 and the switch 203 in the right computing node 200 in turn. Similarly, the processor 201 in the right computing node 200 can access the extended memory 205 in the left computing node 200 through the switch 203 in the right computing node 200 and the switch 203 in the left computing node 200 in turn.
[0081] In the embodiment of the present application, the extended memory 205 in any computing node 200 can be used as a memory pool of the data processing system. For example, the extended memory 205 in the left computing node 200 is used as a memory pool of the data processing system, and the processor 201 in the left computing node 200 can write data to the memory pool, and the processor 201 in the right computing node 200 can read the data from the memory pool.
[0082] In addition, in another possible manner, for any computing node 200, the extended memory 205 of other computing nodes 200 can also be used as the extended memory 205 of the computing node 200. For example Figure 5a In the figure, the computing node 200 on the left can access two extended memories 205 (its local extended memory 205 and the local extended memory 205 of the computing node 200 on the right) through the protocol corresponding to the communication bus inside the computing node 200 and / or through the protocol corresponding to the communication bus between the two computing nodes 200. In the embodiment of the present application, the extended memories 205 of multiple computing nodes 200 in the data processing system can be combined into a memory pool of the data processing system.
[0083] Figure 5b The schematic diagram of the architecture of a data processing system provided by the present application is exemplary. The data processing system may be a schematic diagram of an architecture with storage and computing separation, including a computing node 200 ( Figure 5b Two computing nodes 200 are shown in FIG. 2 , but are not limited to two computing nodes 200 ) and a storage node 300 ( Figure 5b Two storage nodes 300 are shown in the figure, but are not limited to two storage nodes 300). Two computing nodes 200, two storage nodes 300, or any computing node 200 and any storage node 300 can communicate with each other based on the protocol corresponding to the communication bus between the two.
[0084] In terms of hardware, the computing node 200 includes at least a processor 201, a memory 202, a switch 203, and a hard disk 204. The processor 201, the memory 202, the switch 203, and the hard disk 204 are all connected to a communication bus of the computing node 200. For details, see Figure 3 Described in the relevant embodiments.
[0085] The storage node 300 includes at least a controller 301, a hard disk 302 and a switch 303, and the controller 301, the hard disk 302 and the switch 303 are all connected to the communication bus of the storage node 300. The controller 301 is used to write data to the hard disk 302 or read data from the hard disk 302 according to the read / write data request sent by the computing node 200. In the process of reading and writing data, the controller 301 needs to convert the address carried in the read / write data request into an address that can be recognized by the hard disk. It can be seen that the controller 301 also has some simple computing functions. The switch 303 is used for the storage node 300 to communicate with other storage nodes 300, or for the storage node 300 to communicate with the computing node 200.
[0086] Further, the switch 203 in the computing node 200 is not only used for the computing node 200 to communicate with other computing nodes 200, but also used for the computing node 200 to communicate with the storage node 300. Specifically, the switch 203 in the computing node 200 is connected to the switch 303 in the storage node 300, and the processor 201 in the computing node 200 can access the hard disk 302 in the storage node 300 through the switch 203 in the computing node 200 and the switch 303 in the storage node 300.
[0087] It can be understood that the processor 201 in the computing node 200 can access the hard disk 302 in the storage node 300 based on the protocol corresponding to the communication bus between the computing node 200 and the storage node 300, that is, the hard disk 302 is an extended memory for the computing node 200, and the storage space of the hard disk 302 (that is, the extended memory) is larger than the storage space of the memory 202 (that is, the local memory of the computing node 200).
[0088] In the embodiment of the present application, the hard disk 302 in the storage node 300 may be used as a memory pool of the data processing system.
[0089] Figure 5b The schematic diagram of the architecture of another data processing system provided by the present application is a schematic diagram of the architecture of the data processing system, which can be a schematic diagram of the architecture of storage and computing separation, including a computing node 200 ( Figure 5c Two computing nodes 200 are shown in FIG. 2 , but are not limited to two computing nodes 200 ), storage nodes 300 ( Figure 5cTwo storage nodes 300 are shown in FIG. 1 , but are not limited to two storage nodes 300 ), and a management node 400 ( Figure 5c One management node 400 is shown in the figure, but it is not limited to one management node 400).
[0090] Two computing nodes 200, two storage nodes 300, or a computing node 200 and a storage node 300, or a computing node 200 and a management node 400, or a storage node 300 and a management node 400 can communicate with each other based on the protocol corresponding to the communication bus between them.
[0091] The description of the computing node 200 and the storage node 300 can be found in the above Figure 5b Described in the relevant embodiments.
[0092] The management node 400 is used to uniformly manage the storage space in the storage node 300 (specifically, the storage space of the hard disk 302), and the metadata corresponding to the data stored in the storage space. The metadata corresponding to the data may include the address of the data in the storage space, the data length, the backup information of the data, etc.
[0093] The management node 400 includes a processor 401, a memory 402, and a switch 403. The processor 401, the memory 402, and the switch 403 are all connected to a communication bus of the management node 400. The communication bus here can be a PCIe communication bus or a communication bus that complies with the CXL protocol (or UB protocol). The description of the processor 401, the memory 402, and the switch 403 can be found in the above Figure 3 Description of the related embodiments.
[0094] For the convenience of description, this application may Figure 5b The storage and computing separation architecture shown is denoted as storage separation architecture 1. Figure 5c The storage-computing separation architecture shown is recorded as storage separation architecture 2. It can be understood that storage separation architecture 2 adds a management node 400 compared to storage separation architecture 1, and storage separation architecture 2 is suitable for scenarios with a large number of computing nodes 200 and / or storage nodes 300 (such as high performance computing (HPC) scenarios).
[0095] In the embodiment of the present application, the hard disk 302 in the storage node 300 may be used as a memory pool of the data processing system.
[0096] Figure 6 A data processing method is provided as an example in the present application. The data processing method can be applied to Figure 5a to Figure 5c In the architecture shown, the details are as follows:
[0097] When this data processing method is applied to Figure 5a In the architecture shown, the data processing method includes a first computing node and a second computing node, and the first computing node and the second computing node can be respectively Figure 5a Two computing nodes 200 in.
[0098] When this data processing method is applied to Figure 5b In the architecture shown, the data processing method includes a first computing node, a second computing node and a storage node. The first computing node and the second computing node can be respectively Figure 5b The two computing nodes 200 in the storage node can be Figure 5b Any storage node 300 in .
[0099] When this data processing method is applied to Figure 5c In the architecture shown, the data processing method includes a first computing node, a second computing node, a storage node, and a management node. The first computing node and the second computing node can be respectively Figure 5c The two computing nodes 200 in the storage node can be Figure 5c Any storage node 300 in the management node can be Figure 5c The management node 400 in.
[0100] In this application, the processor, local memory, hard disk, extended memory, and switch in the first computing node may be referred to as the first processor, the first local memory, the first hard disk, the first extended memory, and the first switch; the processor, local memory, hard disk, extended memory, and switch in the second computing node may be referred to as the second processor, the second local memory, the second hard disk, the second extended memory, and the second switch.
[0101] Reference Figure 6 The flowchart shown explains:
[0102] Step 601: The first processor generates M data, where M is an integer greater than or equal to 1.
[0103] In a possible implementation, the first processor includes one or more Map tasks. When the first processor generates M data, specifically, the first processor generates a data set in the process of executing a certain Map task, and then divides the data set into M data according to the total number M of Reduce tasks in the data processing system.
[0104] See also Figure 7Another flow chart of MapReduce is shown as an example: Map task a and Map task b, as well as Reduce task a and Reduce task b are run on the first processor, and Reduce task c is run on the second processor. Furthermore, the first processor generates data set 1 in the process of executing Map task a, and then divides the generated data set 1 into three parts (i.e., data a to data c) according to the total number of Reduce tasks 3, wherein data a to data c are the data read by Reduce tasks a to Reduce tasks c respectively; the first processor generates data set 2 in the process of executing Map task b, and divides the generated data set 2 into three parts (i.e., data d to data f), wherein data d to data f are the data read by Reduce tasks a to Reduce tasks c respectively.
[0105] Step 602: The first processor stores M data into a memory pool via a cache of the first processor according to a protocol corresponding to the communication bus.
[0106] In a possible implementation, the first processor stores M data in a cache of the first processor during execution of the Shuffle task, and then stores the M data in the cache of the first processor in a memory pool.
[0107] In a possible implementation, the first processor first determines a target address in the memory pool for storing the first data for one of the M data (referred to as the first data). Based on different storage architectures, the first processor determines the target address in different ways:
[0108] In the storage-computing integrated architecture:
[0109] The memory pool is a first extended memory in the first computing node; or, the memory pool includes a first extended memory in the first computing node and a second extended memory in the second computing node.
[0110] The first processor can be used to manage the memory pool, that is, the first processor maintains a record of data stored in the memory pool (recorded as the first record), wherein the first record is used to indicate which address segments in the memory pool are already occupied (i.e., data has been stored) and which address segments are not occupied (i.e., no data is stored). It can be understood that the unoccupied address segments are the remaining storage space in the memory pool. Optionally, the first record is also used to indicate the identifier of the data stored in the occupied address segments.
[0111] In one possible manner, the first record includes multiple address segments and usage of the multiple address segments. The usage of the address segments can be occupied or unoccupied. For example, the first record includes address segments 1 to 6, wherein address segments 1 to 5 are occupied, and address segment 6 is unoccupied.
[0112] Optionally, when the address segment is already occupied, the first record may also include an identifier of the data stored in the address segment. In combination with the above example, the first record also includes identifiers of data 1 to data 5 corresponding to address segments 1 to 5, that is, data 1 is stored in address segment 1, data 2 is stored in address segment 2, and so on.
[0113] In yet another possible manner, the first record includes a correspondence between an address segment and a data identifier of data stored in the address segment, that is, the address not recorded in the first record has not been occupied.
[0114] For example, the first record includes address segments 1 to 5, and identifiers of data 1 to 5 corresponding to address segments 1 to 5, that is, data 1 is stored in address segment 1, data 2 is stored in address segment 2, and so on.
[0115] Furthermore, the address segment can be specifically identified by the start address and the end address, and the length from the start address to the end address in the address segment is the length of the data in the address segment. For example, data 1 is stored in address segment 1, the start address of address segment 1 is A1, the end address is A2, and the length from A1 to A2 is L, then the length of data 1 is L.
[0116] Alternatively, the address segment can be specifically identified by the starting address and the address length, where the address length is the length of the data in the address segment. For example, data 1 is stored in address segment 1, the starting address of address segment 1 is A1, the address length is L, that is, the length of data 1 is L, and A1 to A1+L are used to store data 1.
[0117] The target address may specifically be a starting address in an address segment (recorded as a target address segment) used to store the first data, and the target address is determined by the first processor according to the first record.
[0118] In one possible manner, the first processor determines the address of the remaining storage space in the memory pool according to the first record, that is, determines the address segment where no data is stored; the first processor determines the target address according to the address segment where no data is stored, and then determines the target address segment according to the target address and the length of the first data. Optionally, after determining the target address and the target address segment, the first processor updates the first record of the first processor.
[0119] Optionally, the first record may be stored in a cache of the first processor, or in a first local memory. Optionally, after determining the target address and / or target address segment, the first processor generates update information for the first record, and updates the first record according to the update information.
[0120] In storage separation architecture 1:
[0121] The memory pool is a storage node (such as a hard disk in a storage node). The storage node can be used to manage the memory pool, that is, a first record is maintained in the storage node. For the description of the first record, please refer to the relevant description in the above-mentioned storage and computing integrated architecture. The first record can be saved in the cache of the storage node, or saved in the local memory of the storage node.
[0122] The first processor may request the target address from the storage node, as described below in two possible ways:
[0123] In one possible manner, the first processor sends an address request to the storage node, and optionally, the address request includes the length of the first data. Accordingly, the storage node receives the address request from the first processor, and in response to the address request, determines the address of the remaining storage space in the memory pool according to the first record, that is, determines the address segment where no data is stored, and the storage node then determines the target address according to the address segment where no data is stored. For the specific determination method, please refer to the relevant description in the above-mentioned storage-computing integrated architecture. After determining the target address, the storage node may send an address response to the first processor, and the address response includes the target address. Optionally, the first processor receives the address response from the storage node, obtains the target address from the address response, and determines the target address segment according to the target address and the length of the first data; or, the storage node determines the target address segment according to the target address and the length of the first data, and sends an address response to the first processor, and the address response includes the target address segment.
[0124] In another possible embodiment, a second record is maintained in the first processor, and the second record includes a record of the first processor storing data in the memory pool. Optionally, the second record includes multiple address segments, and the data stored in the multiple address segments are all written to the memory pool by the first processor. In addition, the second record may also include data identifiers of data stored in multiple address segments. For example, the second record includes address segment 1 and address segment 2, and identifiers of data 1 and data 2 corresponding to address segment 1 and address segment 2, respectively. It can be understood that data 1 is written by the first processor to address segment 1, and data 2 is written by the first processor to address segment 2. Optionally, the second record can be stored in the cache of the first processor, or in the first local memory.
[0125] The first processor can determine the address of the remaining storage space in the memory pool that has not been written by the first processor based on the second record, and then determine the address requested from the storage node from the address of the remaining storage space that has not been written by the first processor. The first processor sends an address request to the storage node, and the address request includes the address requested by the first processor to the storage node. Correspondingly, the storage node determines whether the address requested by the first processor has been occupied by other computing nodes based on the first record:
[0126] If the storage node determines, based on the first record, that the address requested by the first processor is not occupied by other computing nodes, it sends an address response to the first processor, which can be used to indicate that the first processor can use the requested address. It can be understood that the address requested by the first processor is the target address.
[0127] If the storage node determines, based on the first record, that the address requested by the first processor has been occupied by other computing nodes, it sends an address response to the first processor, and the address response is used to indicate that the first processor cannot use the address it requested. Further, the storage node can determine the target address based on the first record and send the target address to the first processor, and the address response may include the target address; or, after receiving the address response, the first processor determines that the address it requested has been occupied by other computing nodes, and then determines a new address based on the first record and requests the new address from the storage node, until the first processor requests the target address.
[0128] In addition, when the first processor determines that the address it requested has been occupied by other computing nodes, it can update the second record. In this way, the second record includes not only the record of the first processor storing data in the memory pool, but also the record of other computing nodes storing data in the memory pool.
[0129] Optionally, after determining the target address, the first processor updates the second record of the first processor according to the target address and the length of the first data; or, after determining the target address segment, the first processor updates the second record of the first processor according to the target address segment. For specific update methods, please refer to the relevant instructions in the above-mentioned storage-computing integrated architecture. Optionally, after determining the target address, the storage node updates the first record of the storage node according to the target address and the length of the first data; or, after determining the target address segment, the storage node updates the first record of the storage node according to the target address segment. For specific update methods, please refer to the relevant instructions in the above-mentioned storage-computing integrated architecture.
[0130] In addition, in the storage separation architecture 1, not only the first processor can maintain the second record, but other computing nodes can also maintain their own records of storing data in the memory pool. Furthermore, when determining the target address, the first processor can also broadcast an address request in the system according to the second record, and the address request includes the address requested by the first processor. Correspondingly, other computing nodes in the system can receive the address request, and determine whether the address requested by the first processor has been occupied by themselves according to the records maintained in their respective computing nodes. If so, an address response is sent to the first processor, and the address response is used to indicate that the first processor cannot use the address it requested. When the first processor does not receive an address response, the address requested in the address request is determined as the target address. When the first processor receives an address response sent by one or more other computing nodes, it re-determines a new request address and broadcasts the address request again until the target address is determined.
[0131] Or in other examples, other computing nodes in the system may also send an address response to the first processor after determining that the address requested by the first processor is not occupied by themselves, and the address response is used to indicate that the address requested by the first processor is not occupied by the initiator of the address response. Further, when the first processor determines that it has received address responses sent by all other computing nodes in the system, it determines the address requested in the address request as the target address. When the first processor determines that it has not received address responses sent by all other computing nodes in the system, it re-determines a new request address and broadcasts the address request again until the target address is determined.
[0132] In addition, the first processor may also periodically synchronize the first record from the storage node, or, after generating M data (or the first data), synchronize the first record from the storage node, so that the first processor may determine the target address according to the first record. After determining the target address, the first processor sends the target address (or the identifier of the target address and the first data) to the storage node, and the storage node updates the first record.
[0133] Of course, there may be other implementations, and this application will not give examples one by one.
[0134] Combination Figure 5bThe structural diagram of the computing node shown in the figure includes not only the first processor but also the first switch. After generating the first data, the first processor can send an address request to the storage node through the first switch, and the first processor receives an address response from the storage node through the first switch, and determines the target address (or target address segment) according to the address response. Alternatively, after generating the first data, the first processor can send an address request to other computing nodes through the first switch, and the first processor receives an address response from other computing nodes through the first switch, and determines the target address (or target address segment) according to the address response.
[0135] In storage separation architecture 2:
[0136] The memory pool is a storage node (such as a hard disk in a storage node), and the management node can be used to manage the memory pool, that is, a first record is maintained in the management node. For the description of the first record, please refer to the relevant description in the above-mentioned storage and computing integrated architecture. The first record can be saved in the cache of the management node, or saved in the local memory of the management node.
[0137] The first processor may request the target address from the management node, or the first processor may request the first record from the management node and determine the target address based on the first record. For specific implementation methods, please refer to the description in the above storage separation architecture 1, and "storage node" may be replaced with "management node" for understanding.
[0138] The management node may also update the first record after determining the target address or after receiving the target address (or the target address and the identifier of the first data) from the first processor. The specific implementation method may refer to the description in the above-mentioned storage separation architecture 1, and "storage node" may be replaced with "management node" for understanding.
[0139] Combination Figure 5c The schematic diagram of the structure of the computing node shown in the figure includes not only the first processor but also the first switch. After generating the first data, the first processor can send an address request to the management node through the first switch, and the first processor receives an address response from the management node through the first switch, and determines the target address (or target address segment) according to the address response.
[0140] It can be understood that the management node has strong computing power and network IO capabilities. Compared with the above-mentioned storage separation architecture 1, the storage separation architecture 2 transfers the interaction between the computing node and the storage node to the interaction between the computing node and the management node, which helps to reduce the hardware cost of the storage node and improve the access efficiency of the computing node.
[0141] After determining the target address, the first processor may store the first data to the target address of the memory pool via the cache of the first processor according to the protocol corresponding to the communication bus. In a specific implementation, the first processor first writes the first data and the target address to the cache of the first processor, and then, based on the protocol corresponding to the communication bus, the first processor writes the first data in the cache of the first processor to the target address in the memory pool. Specifically, the first processor uses the target address as the starting address and writes the first data to the memory pool, that is, writes the first data to the target address segment. Further, when the protocol corresponding to the communication bus is the CXL protocol, the first processor may write the first data in the cache of the first processor to the target address in the memory pool based on the store memory semantics. Optionally, after storing the first data in the memory pool via the cache of the first processor, the first processor may also write the target address to the first local memory. In one possible manner, the first processor writes metadata corresponding to the first data to the first local memory, and the metadata corresponding to the first data may include the target address, the length of the first data, the backup information of the first data, etc.
[0142] In a possible implementation, after writing the M data into the memory pool, the first processor may also merge the M data, such as performing an aggregation operation on the M data, thereby helping to reduce the storage space occupied by the M data in the memory pool.
[0143] Step 603: The second processor obtains N data from the memory pool to the cache of the second processor according to the protocol corresponding to the communication bus, wherein the M data include N data, and N is a positive integer.
[0144] In a possible implementation, the second processor may include one or more Reduce tasks. When the second processor obtains N data from the memory pool, specifically, when the second processor executes a Reduce task, it obtains N data required to execute the Reduce task from the memory pool.
[0145] Furthermore, when the protocol corresponding to the communication bus is the CXL protocol, the second processor may read N data from the memory pool into the cache of the second processor based on load memory semantics.
[0146] In a possible implementation, before the second processor obtains N data from the memory pool to the cache of the second processor, it first obtains the target address of each data in the N data from the first local memory through the protocol corresponding to the communication bus, as described below using the first data in the N data as an example:
[0147] In one possible manner, the second processor polls the local memory of each computing node, and after querying the target address of the first data from the first local memory, stops accessing the local memories of other subsequent computing nodes. For example, the data processing system includes 10 computing nodes, among which the second processor first queries the local memories of 5 computing nodes and fails to obtain the target address of the first data. Subsequently, when the second processor queries the local memory of the 6th computing node (i.e., the first computing node), it obtains the target address of the first data, and then stops querying the local memories of the remaining 4 computing nodes.
[0148] In another possible manner, the second processor accesses the first record or the second record to determine the target address of the first data. Specifically:
[0149] In the storage and computing integrated architecture, the second processor can access the first record and read the target address of the first data from the first record.
[0150] In the storage separation architecture 1, the second processor can access the first record in the storage node and determine the target address of the first data from the first record, or the second processor can access the second record (or the first record) in the first computing node and determine the target address of the first data from the second record (or the first record). Alternatively, the second processor sends a query request to the storage node, and the query request includes an identifier of the first data. Accordingly, the storage node queries the first record according to the identifier of the first data in the query request, determines the target address of the first data, and sends a query response to the second processor, and the query response includes the target address of the first data. Accordingly, the second processor receives the query response and obtains the target address of the first data from the query response.
[0151] In the storage separation architecture 2, the second processor can access the first record in the management node and determine the target address of the first data from the first record, or the second processor can access the second record (or the first record) in the first computing node and determine the target address of the first data from the second record (or the first record). Alternatively, the second processor sends a query request to the management node, and the query request includes an identifier of the first data. Accordingly, the management node queries the first record according to the identifier of the first data in the query request, determines the target address of the first data, and sends a query response to the second processor, and the query response includes the target address of the first data. Accordingly, the second processor receives the query response and obtains the target address of the first data from the query response.
[0152] Step 604: The second processor processes the N data.
[0153] In a possible implementation, the second processor obtains N data from the memory pool during the process of executing the Reduce task and then performs computation on the N data. Figure 7 In the example, when executing Reduce task c, the second processor reads data c and data f from the memory pool and performs computation on data c and data f.
[0154] It should also be added that in the above step 601, the first processor also generates MN data to be read by the first processor. Specifically, a Reduce task is also run in the first processor, and the Reduce task can be used to read the MN data and process the MN data. Figure 7 In the example, Reduce task a and Reduce task b are also running in the first processor. During Reduce task a, the first processor also reads data a and data d from the memory pool and performs computation on data a and data d. During Reduce task b, the first processor also reads data b and data e from the memory pool and performs computation on data b and data e. The specific implementation of the first processor reading data from the memory pool and processing the data can be found in the description of steps 603 and 604 above.
[0155] In the above technical solution, the first processor writes M data into the memory pool, and the second processor reads N data from the memory pool, wherein the storage space of the memory pool is larger than the storage space of the first local memory, and the storage space of the memory pool is larger than the storage space of the second local memory. This avoids the problem of unnecessary resource waste, such as the first processor writing M data into the first local memory, and the first local memory having limited storage space, causing M data to be swapped in and out between the first local memory and the hard disk, and / or the second processor reading N data into the second local memory, causing N data to be swapped in and out between the second local memory and the hard disk.
[0156] Furthermore, the first processor stores the M data generated by the multiple processor cores in the first processor in the memory pool. Correspondingly, the second processor can obtain the N data it needs from the memory pool at one time. Compared with the existing distributed computing process, the present application does not need to obtain N data N times from the memory space corresponding to the multiple processor cores respectively. This helps to improve the efficiency of data acquisition. Moreover, the first processor stores M data in the memory pool via the cache of the first processor through the CXL bus or the UB bus. Compared with the first processor first storing the M data in the first local memory via the cache of the first processor and then storing the M data in the first local memory to the memory pool, the process of data writing is reduced once, which helps to improve the efficiency of the first processor writing data to the memory pool; similarly, the second processor directly obtains N data from the memory pool to the cache of the second processor through the CXL bus or the UB bus. Compared with the second processor first reading N data from the memory pool to the second local memory and then reading N data in the second local memory to the cache, the process of data reading is reduced once, which helps to improve the efficiency of the second processor reading data from the memory pool. Furthermore, in MapReduce, it helps to improve the processing efficiency of the Shuffle process.
[0157] The benefits of this application are described below from different perspectives:
[0158] (1) Scenario benefits
[0159] For scenarios such as big data computing (such as gene sequencing and weather forecasting), based on the memory pool, the data in the node can be written directly to the memory pool via the cache, without having to be written to the local memory through the cache, then written to the hard disk through the local memory, and then written to the local memory through the hard disk. This helps to avoid unnecessary swapping of data between the memory and the hard disk, helps to improve the performance of the global shuffle of data in MapReduce, and effectively accelerates the computing process.
[0160] For scenarios such as single-node computing (memory databases, big data computing, graph computing), based on the memory pool, the data in the node can be written directly to the memory pool via the cache, without having to write it to the local memory through the cache, then write it to the hard disk through the local memory, and then write it to the local memory through the hard disk, which helps to improve computing efficiency.
[0161] (2) Network IO revenue
[0162] The transmission speed of ultra-low latency communication protocols (such as CXL protocol or UB protocol) is higher than the transmission speed of RDMA. This application uses ultra-low latency communication protocols and memory pools to improve the execution efficiency when reading and writing data in big data scenarios.
[0163] (3) Storage income
[0164] Since the memory pool can be installed in the computing node by plugging and unplugging, or as a separate storage node, the memory pool is scalable, which helps to achieve business expansion / contraction in seconds and rapid recovery from downtime. Furthermore, the memory pool also helps to reduce data copies between nodes. It is explained that in the existing solution, for example, there are 4 storage nodes, each with 4TB, then the total storage space is 16TB, and each storage node needs to store a copy of the data, which takes up a total of 4TB. In this application, it can be considered that 4 storage nodes form a memory pool, the storage space of the memory pool is 16TB, and the memory pool stores a copy of the data, which only takes up 1TB.
[0165] (4) Cost-benefit
[0166] The decoupling of processors and memory pools helps to achieve flexible allocation between processors and memory pools.
[0167] In addition, the first processor may also determine that there is not enough storage space in the memory pool to store the first data, and then store the first data in the first local memory. When the second processor needs to read the first data, the second processor may read the first data from the first local memory to the second local memory. For specific implementation, see Figure 4 Described in the relevant embodiments.
[0168] Furthermore, there are multiple implementations for the first processor to determine that there is insufficient storage space in the memory pool to store the first data:
[0169] In the storage-computing integrated architecture:
[0170] The first processor stores a first record, and the first processor determines that there is not enough storage space in the memory pool to store the first data according to the first record. For example, the first processor determines that the length of the remaining storage space in the memory pool is less than the length of the first data according to the first record.
[0171] In storage separation architecture 1:
[0172] In one possible manner, the first processor sends an address request to the storage node, and the address request includes the length of the first data. Accordingly, the storage node determines that there is not enough storage space in the memory pool to store the first data according to the first record, for example, the storage node determines that the length of the remaining storage space in the memory pool is less than the length of the first data according to the first record. Further, the storage node sends an address response to the first processor, and the address response can be used to indicate that there is not enough storage space in the current memory pool to store the first data.
[0173] In another possible manner, when the storage node determines according to the first record that the length of the remaining storage space in the memory pool is less than a preset length, the storage node sends a broadcast message indicating that there is not enough storage space in the current memory pool to store other data. Accordingly, the first processor determines that there is no need to request the target address from the storage node.
[0174] In storage separation architecture 2:
[0175] In one possible manner, the first processor sends an address request to the management node, and the address request includes the length of the first data. Accordingly, the management node determines that there is not enough storage space in the memory pool to store the first data according to the first record, for example, the management node determines that the length of the remaining storage space in the memory pool is less than the length of the first data according to the first record. Further, the management node sends an address response to the first processor, and the address response can be used to indicate that there is not enough storage space in the current memory pool to store the first data.
[0176] In another possible manner, when the management node determines according to the first record that the length of the remaining storage space in the memory pool is less than a preset length, the management node sends a broadcast message indicating that there is not enough storage space in the current memory pool to store other data. Accordingly, the first processor determines that there is no need to request the target address from the storage node.
[0177] In addition, the first processor may also determine that there is not enough storage space in the first local memory to store the first data, so the first data is stored in the first hard disk. When the second processor needs to read the first data, the second processor reads the first data from the first hard disk to the second local memory. For specific implementation, see Figure 4 Described in the relevant embodiments. Further, when the first processor determines that there is not enough storage space in the first local memory to store the first data, specifically, the first processor maintains a record of the data stored in the first local memory (recorded as the third record), wherein the third record is used to indicate which address segments in the first local memory are already occupied (i.e., data has been stored) and which address segments are not occupied (i.e., no data is stored). It can be understood that the unoccupied address segments are the remaining storage space in the first local memory. Optionally, the third record is also used to indicate the identifier of the data stored in the occupied address segments. The specific implementation of the third record can be found in the description of the first record above. Further, the first processor determines, based on the third record, that there is not enough storage space in the first local memory to store the first data. For example, the first processor determines, based on the third record, that the length of the remaining storage space in the first local memory is less than the length of the first data.
[0178] It can be understood that after generating data, the first processor can write the data based on the following priorities: memory pool, first local memory, first hard disk. Since the storage space of the memory pool is larger than the storage space of the first local memory, the first processor and the second processor can transfer data based on the memory pool, which helps to reduce unnecessary data exchange; further, since the access latency of the first local memory is lower than the access latency of the first hard disk, when the first processor determines that there is not enough storage space in the memory pool to store the first data, the first processor will preferentially store the first data in the first local memory, which helps to reduce the access latency.
[0179] Based on the same inventive concept as above, the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by a device, the above Figure 6 The method of the first computing node in the related method embodiment, or the method of implementing the above Figure 6 A method for a second computing node in a related method embodiment.
[0180] Based on the same inventive concept as above, the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a computing device, the above Figure 6 The method of the first computing node in the related method embodiment, or the method of implementing the above Figure 6 A method for a second computing node in a related method embodiment.
[0181] Based on the same inventive concept as above, the present application provides a computing device, including a processor, the processor is connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the computing device can achieve the above Figure 6 The method of the first computing node in the related method embodiment, or the method of implementing the above Figure 6 A method for a second computing node in a related method embodiment.
[0182] In the present application, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can be represented by: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can be represented by: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In the text description of the present application, the character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in the formula of the present application, the character " / " indicates that the previous and next associated objects are in a "division" relationship.
[0183] It is understood that the various numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic.
[0184] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of protection of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data processing system, characterized in that: include: A first computing node including a first processor, the first processor being connected to a memory pool via a communication bus of the first computing node; a second computing node, comprising a second processor, the second processor being connected to the memory pool via a communication bus of the second computing node; The first processor is used to generate M data, and store the M data into the memory pool via the cache of the first processor according to the protocol corresponding to the communication bus; The second processor is used to obtain N data from the memory pool to the cache of the second processor according to the protocol corresponding to the communication bus, and process the N data, wherein the M data include the N data, and M and N are both positive integers.
2. The system according to claim 1, characterized in that The communication bus is a Computing Express Link CXL bus or a Unified Bus UB.
3. The system according to claim 1, characterized in that The first processor is specifically configured to generate the M data in a process of executing a Map task, and to store the M data in the memory pool in a process of executing a Shuffle task; During the process of executing the Reduce task, the second processor obtains the N data required to execute the Reduce task from the memory pool.
4. The system according to claim 1, characterized in that The memory pool is a storage node; The first computing node includes a first switch, and the first processor and the first switch are both connected to a communication bus of the first computing node; The second computing node includes a second switch, and the second processor and the second switch are both connected to a communication bus of the second computing node; The storage node is connected to the first computing node via the first switch, and the storage node is connected to the second computing node via the second switch.
5. The system according to claim 1, wherein: The memory pool is a first extended memory in the first computing node, the first computing node further includes a first switch, and the first processor, the first extended memory and the first switch are all connected to a communication bus of the first computing node; The second computing node includes a second switch, and the second processor and the second switch are connected to a communication bus of the second computing node; The second switch is connected to the first switch, and the second processor is connected to the first extended memory through the first switch and the second switch.
6. The system according to claim 1, wherein: The memory pool includes a first extended memory in the first computing node and a second extended memory in the second computing node; The first computing node also includes a first switch, and the first processor, the first extended memory and the first switch are all connected to a communication bus of the first computing node; The second computing node also includes a second switch, and the second processor, the second extended memory and the second switch are all connected to a communication bus of the second computing node; The second switch is connected to the first switch, the second processor is connected to the first extended memory through the first switch and the second switch, and the first processor is connected to the second extended memory through the first switch and the second switch.
7. The system according to any one of claims 1 to 6, characterized in that: The first computing node further includes a local memory, the local memory is also connected to the communication bus of the first computing node, and the local memory is used to store metadata of the M data; When the second processor obtains the N data from the memory pool to the cache of the second processor, it is specifically used to: obtain metadata of the N data from the local memory of the first computing node, and obtain the N data from the memory pool according to the metadata of the N data.
8. A data processing method, characterized in that: Applicable to a data processing system comprising a first computing node and a second computing node; the first computing node comprises a first processor, and the first processor is connected to a memory pool through a communication bus of the first computing node; The second computing node includes a second processor, the second processor being connected to the memory pool via a communication bus of the second computing node; The method comprises: The first processor generates M data, and stores the M data into the memory pool via the cache of the first processor according to a protocol corresponding to the communication bus; The second processor obtains N data from the memory pool to the cache of the second processor according to the protocol corresponding to the communication bus, and processes the N data, wherein the M data include the N data, and M and N are both positive integers.
9. The method according to claim 8, characterized in that The communication bus is a Computing Express Link CXL bus or a Unified Bus UB.
10. The method according to claim 8, characterized in that The first processor generates M data, and stores the M data into the memory pool via the cache of the first processor according to a protocol corresponding to the communication bus, including: The first processor generates the M data in the process of executing the mapping task; The first processor stores the M data into the memory pool according to a protocol corresponding to the communication bus during the execution of the shuffle task; The second processor obtains N data from the memory pool to the cache of the second processor according to the protocol corresponding to the communication bus, and processes the N data, including: During the process of executing the Reduce task, the second processor obtains the N data required to execute the Reduce task from the memory pool according to the protocol corresponding to the communication bus, and processes the N data.
11. The method according to any one of claims 8 to 10, characterized in that: The first computing node further includes a local memory, the local memory is also connected to the communication bus of the first computing node, and the local memory is used to store metadata of the M data; The second processor obtains the N data from the memory pool to a cache of the second processor, comprising: The second processor obtains metadata of the N data from the local memory of the first computing node, and obtains the N data from the memory pool according to the metadata of the N data.
