Data storage method, and device and computer-readable storage medium
By allocating special storage space and partitioning storage for the shuffle data of the Spark computing engine in the storage system, the problem of shuffle data occupying computing resources and server failure causing application deactivation is solved, and storage resource utilization and data security are improved.
Patent Information
- Application Number
- PCT/CN2024/077499
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-22
- Filing Date
- 2024-02-19
- Publication Date
- 2024-08-29
AI Technical Summary
In the Spark computing engine, shuffle data is stored in the local file of the node where the map task is located, resulting in a waste of computing resources, and when any server in the storage system fails, multiple applications will not be able to run normally.
By allocating dedicated storage space to each application in the storage system and partitioning the data storage across multiple servers, this ensures that the data is only affected by some servers and that storage resources are released in a timely manner when the application ends.
It reduces the usage of computing resources by shuffle data, avoids large-scale application outage caused by a single server failure, and improves the utilization efficiency of storage resources and the security of data storage.
Smart Images

Figure CN2024077499_29082024_PF_FP_ABST
Abstract
Description
Data storage method, device and computer-readable storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on February 22, 2023, with application number CN202310152784.9 and invention name “A method, device and computer-readable storage medium for data storage”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of communications, and more particularly, to a data storage method, device, and computer-readable storage medium. Background Art
[0003] Spark is a general-purpose computing engine for large-scale data processing. Its job execution can be divided into the map phase and the reduce phase. After the map phase is completed, shuffle data is generated as intermediate data for the map and reduce phases. In the native Spark computing engine, shuffle data is generated by the map task (maptask) in the map phase and written to local files. In the reduce phase, the reduce task (reducetask) extracts the shuffle data from the node where the maptask is located and processes it. When processing large amounts of data in Spark, because the shuffle data is stored in the local files of the map node, the computing resources occupied by the shuffle data will become a performance bottleneck and significantly waste the node's computing resources.
[0004] To prevent shuffle data from occupying the computing resources of the map node, technicians proposed using remote shuffle service (RSS) to store the shuffle data generated by maptask in a dedicated cluster with weaker computing power but strong storage capacity. Maptask and reducetask read and write shuffle data through the network to achieve storage and computing separation of the spark computing engine. In the process of storage and computing separation of the spark computing engine, in order to make full use of the storage resources of different devices and avoid uneven utilization of storage resources, load balancing is usually used to partition the shuffle data generated by the application and evenly store it on all servers in the storage system. Therefore, when any server in the storage system fails, a large number of applications with storage and computing separation will be forced to stop working.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a data storage method, device, and computer-readable storage medium for resolving the problem in RSS technology where a failure of a remote storage server may cause multiple applications to fail to operate normally.
[0007] A first aspect of an embodiment of the present application provides a method for data storage, including: obtaining a storage space creation request sent by a first node after a first application is created, where the first node is a server connected to a storage system in a communicative manner; generating a correspondence between the first application and a first storage space, where the first storage space includes storage resources of at least N servers, and the storage system includes at least N+1 servers, where N is a positive integer greater than 1; obtaining first data sent by the first node, where the first data is intermediate data generated when the first application is running; and writing the first data into the first storage space according to the correspondence between the first application and the first storage space.
[0008] In an embodiment of the present application, a storage space creation request sent by a first application after creation is obtained, a correspondence between the first application and the first storage space is generated, and the obtained first data is written into the first storage space based on the correspondence between the first application and the first storage space, wherein the first data is intermediate data generated by the first application, the first storage space includes the storage resources of N servers, the N servers are included in a storage system, and the storage system includes the storage resources of at least N+1 servers. By dividing the storage space for the application, the intermediate data is only affected by the N servers in the storage system, thereby reducing the scope of the impact on the intermediate data of the first application.
[0009] In a possible implementation of the first aspect, the method further includes: obtaining a first application end-of-run signal sent by the first node when the first application ends running; and deleting the correspondence between the first application and the first storage space and the first data stored in the first storage space.
[0010] In the embodiment of the present application, when the first application ends running, a signal sent by the first node that the first application has ended running is obtained, and the correspondence between the first application and the first storage space and the first data stored in the first storage space is deleted. After the first application ends running, the storage resources allocated for the intermediate data of the first application are released in a timely manner. This improves the utilization efficiency of storage resources in the storage system.
[0011] In a possible implementation of the first aspect, before generating the correspondence between the first application and the first storage space, the method also includes: obtaining a list of allocatable storage resources of the storage system, the list of allocatable storage resources including allocatable storage resources in the storage system; selecting the storage resources of the first server as the first storage space, the first server being included in the storage system, and the storage resources of the first server being the storage resources in the list of allocatable storage resources.
[0012] In an embodiment of the present application, a list of allocatable storage resources of a storage system is obtained, and storage resources of a first server are selected as first storage space based on the list of allocatable storage resources. The list of allocatable storage resources includes all the allocatable storage resources of the storage system, the first server is included in the storage system, and the storage resources of the first server are the storage resources in the list of allocatable storage resources. By obtaining the list of allocatable storage resources of the storage system, allocating storage resources according to a certain rule based on the distribution of storage resources shown in the list, or randomly allocating storage resources to intermediate data generated by the first application, more possibilities are provided for the rational use of storage resources.
[0013] In one possible implementation of the first aspect, the first server is the server with the most allocatable storage resources in the list of allocatable storage resources. In this embodiment of the present application, the first server is the server with the most allocatable storage resources in the list of allocatable storage resources. By allocating the server with the most storage resources in the list of allocatable storage resources to the first storage space, as few servers as possible are used to provide storage services for the intermediate data of the first application, the number of storage devices occupied by the intermediate data of the first application is reduced, and the situation in which the normal operation of multiple applications is affected simultaneously when one server fails is avoided.
[0014] In a possible implementation of the first aspect, the request to create a storage space includes first information, the first information indicates that the storage space capacity required by the first application is a first capacity, and the capacity of the first storage space is greater than or equal to the first capacity. In an embodiment of the present application, the request to create a storage space includes first information, the first information is used to indicate that the storage space capacity required by the first application is a first capacity, wherein the capacity of the first storage space is greater than or equal to the first capacity. By limiting the capacity of the first storage space, unnecessary waste of storage resources is avoided when allocating storage resources to the first application, so that technical personnel can limit the capacity of the first storage space within a reasonable range when performing configuration.
[0015] In a possible implementation of the first aspect, the first information includes a classification rule for intermediate data, the classification rule for intermediate data includes that the storage space capacity required for the first type of intermediate data of the first application is a first sub-capacity, the storage space capacity required for the second type of intermediate data of the first application is a second sub-capacity, the first capacity is the sum of the first sub-capacity and the second sub-capacity, and the first storage space includes a first sub-storage space and a second sub-storage space; the selecting of the storage resources of the first server as the first storage space includes: selecting the storage resources of the first server as the first sub-storage space, the capacity of the first sub-storage space being greater than or equal to the first sub-capacity; selecting the storage resources of the second server as the second sub-storage space, the capacity of the second sub-storage space being greater than or equal to the second sub-capacity.
[0016] In an embodiment of the present application, the first information may include classification rules for intermediate data, and the classification rules for intermediate data include that the storage space required for the first type of intermediate data of the first application is the first sub-capacity, the storage space required for the second type of intermediate data of the first application is the second sub-capacity, the first capacity is the sum of the first sub-capacity and the second sub-capacity, and the first storage space includes the first sub-storage space and the second sub-storage space. Selecting the storage resources of the first server as the first storage space is specifically: selecting the storage resources of the first server as the first sub-storage space, and the storage resources of the second server as the second sub-storage space. Among them, the capacity of the first sub-storage space is greater than or equal to the first sub-capacity, and the capacity of the second sub-storage space is greater than or equal to the second sub-capacity. In the storage space creation request, by carrying the classification rules of intermediate data, different types of intermediate data are classified and stored, thereby improving the storage efficiency of the computing device.
[0017] In a possible implementation of the first aspect, the correspondence between the first application and the first storage space includes a correspondence between the first type of intermediate data and the first sub-storage and a correspondence between the second type of intermediate data and the second sub-storage.
[0018] In a possible implementation of the first aspect, there is a mapping relationship between the first storage space and the second storage space; after obtaining the first data sent by the first node, the method further includes: writing the first data into the second storage space according to the corresponding relationship between the first application and the first storage space and the mapping relationship between the first storage space and the second storage space. In an embodiment of the present application, since there is a mapping relationship between the first storage space and the second storage space, after obtaining the first data sent by the first node, the first data is written into the second storage space according to the corresponding relationship between the first application and the first storage space and the mapping relationship between the first storage space and the second storage space. When there is a mapping relationship between the first storage space and the second storage space, after obtaining the first data, the first data is written into the second storage space according to the corresponding relationship between the first data and the first storage space and the mapping relationship between the first storage space and the second storage space as a backup of the first data in the first storage space, thereby improving the security of data storage in the storage system.
[0019] A second aspect of an embodiment of the present application provides a data storage device, including:
[0020] an acquiring unit, configured to acquire a storage space creation request sent by a first node after the first application is created, wherein the first node is a server connected to the storage system in a communicable manner;
[0021] a generating unit, configured to generate a correspondence between the first application and a first storage space, the first storage space including storage resources of at least N servers, the storage system including at least N+1 servers, where N is a positive integer greater than 1;
[0022] The acquiring unit is further configured to acquire first data sent by the first node, where the first data is intermediate data generated when the first application is running;
[0023] A reading and writing unit is configured to write the first data into the first storage space according to a correspondence between the first application and the first storage space.
[0024] In a possible implementation of the second aspect, the acquiring unit is further configured to acquire a first application end-of-run signal sent by the first node when the first application ends running;
[0025] The device further includes a deleting unit configured to delete the correspondence between the first application and the first storage space and the first data stored in the first storage space.
[0026] In a possible implementation of the second aspect, the acquiring unit is further configured to acquire a list of allocatable storage resources in the storage system, where the list of allocatable storage resources includes allocatable storage resources in the storage system;
[0027] The device further includes a selection unit configured to select storage resources of a first server as the first storage space, the first server being included in the storage system, and the storage resources of the first server being storage resources in the list of allocatable storage resources.
[0028] In a possible implementation of the second aspect, the first server is a server with the most allocatable storage resources in the list of allocatable storage resources.
[0029] In a possible implementation of the second aspect, the storage space creation request includes first information, where the first information indicates that the storage space capacity required by the first application is a first capacity, and the capacity of the first storage space is greater than or equal to the first capacity.
[0030] In a possible implementation of the second aspect, the first information includes a classification rule for intermediate data, the classification rule for intermediate data including: a storage space capacity required for a first type of intermediate data of the first application is a first sub-capacity, a storage space capacity required for a second type of intermediate data of the first application is a second sub-capacity, the first capacity is a sum of the first sub-capacity and the second sub-capacity, and the first storage space includes a first sub-storage space and a second sub-storage space;
[0031] The selection unit is specifically configured to:
[0032] Selecting a storage resource of the first server as the first sub-storage space, where the capacity of the first sub-storage space is greater than or equal to the first sub-capacity;
[0033] The storage resources of the second server are selected as the second sub-storage space, and the capacity of the second sub-storage space is greater than or equal to the second sub-capacity.
[0034] In a possible implementation of the second aspect, the correspondence between the first application and the first storage space includes a correspondence between the first type of intermediate data and the first sub-storage and a correspondence between the second type of intermediate data and the second sub-storage.
[0035] In a possible implementation of the second aspect, a mapping relationship exists between the first storage space and the second storage space;
[0036] The reading and writing unit is further configured to write the first data into the second storage space according to a correspondence between the first application and the first storage space and a mapping relationship between the first storage space and the second storage space.
[0037] A third aspect of an embodiment of the present application provides a data storage device, including a processor and a memory, wherein the memory is used to store instructions, and the processor is used to execute the instructions. When the processor executes the instructions, the method described in the first aspect or any possible implementation method of the first aspect is executed.
[0038] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, including a program, which, when executed on a computer, enables the computer to execute the method described in the aforementioned first aspect or any possible implementation of the first aspect.
[0039] A fifth aspect of the embodiments of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect or any possible implementation of the first aspect.
[0040] A sixth aspect of an embodiment of the present application provides a computing device cluster, which includes at least one computing device, each computing device includes a processor and a memory, and the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster performs any possible method as in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] FIG1 is a schematic diagram of the structure of a MapReduce service cluster provided in an embodiment of the present application;
[0042] FIG2 is a flow chart of a method for storing data provided by an embodiment of the present application;
[0043] FIG3 is a schematic diagram of a distribution of diskpools provided in an embodiment of the present application;
[0044] FIG4 is a schematic diagram of a distribution of a first storage space provided in an embodiment of the present application;
[0045] FIG5 is another flow chart of a method for storing data provided in an embodiment of the present application;
[0046] FIG6 is a schematic diagram of a distribution of a first storage space provided in an embodiment of the present application;
[0047] FIG7 is a schematic structural diagram of a data storage device provided in an embodiment of the present application;
[0048] FIG8 is another structural diagram of a data storage device provided in an embodiment of the present application;
[0049] FIG9 is a schematic diagram of a structure of a computing device cluster provided in an embodiment of the present application;
[0050] FIG10 is another structural diagram of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation methods of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0052] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same properties when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0053] Spark is a general-purpose computing framework for processing large-scale data. Its job process can be divided into the map phase and the reduce phase. In native Spark, during the execution of a Spark app, in the map phase, the maptask generates shuffle data and writes the shuffle data to local files for use in the reduce phase. In the reduce phase, the reducetask obtains the shuffle data from the node where the maptask is located and processes the data on the node where the reducetask is located. During the execution of the Spark app, there are large amounts of data reading, writing, and storage requirements. The process of storing shuffle data in the local file of the node where the maptask is located is an input / output (IO)-light computation process. In the computation and processing of large amounts of data, storing shuffle data on the node where the maptask is located significantly wastes the computing resources of that node.
[0054] To reduce the computational resources consumed by shuffle data on the maptask node, researchers proposed placing the shuffle service in a dedicated cluster with abundant storage resources but less computational power. Maptask and reducetask would read and write shuffle data to this cluster over the network, thus achieving storage and computation separation for the Spark app. Specifically, this could be achieved by storing shuffle data in the memory of the device hosting the RSS server, on the server's local disk, or by writing shuffle data to DFS.
[0055] During the Spark computing engine's storage and computation separation process, to fully utilize the storage resources of different devices and avoid uneven storage resource utilization, load balancing is typically used to partition the shuffle data generated by the application and evenly store it across all servers in the storage system. Therefore, if any server in the storage system fails, a large number of applications using storage and computation separation will be forced to stop functioning.
[0056] To solve this problem, this application proposes that when a spark app is created, a storage space creation request is sent to the storage cluster, triggering the storage cluster to allocate corresponding storage space for the spark app. When the maptask of the spark app generates intermediate data, the shuffle data generated by the maptask is written to the corresponding storage space based on the correspondence between the spark app stored in the storage cluster and the corresponding storage space, for use by reducetask.
[0057] To facilitate understanding of the solution, we first introduce the specific application scenario of the embodiment of the present application. MapReduce is deployed in a server cluster composed of multiple servers, wherein each of the multiple servers includes a computing unit (executor) and a service unit (worker), wherein the workers form a read-write cache unit (memarts store) across servers, wherein any worker among the multiple workers is selected as a management unit (master), triggering the master to create multiple disk pools (diskpool) before the spark app runs. Each diskpool includes multiple sub-storage units (plog) with a capacity of 128MB. Please refer to Figure 1, which is a structural diagram of the MapReduce service cluster provided in the embodiment of the present application.
[0058] The MapReduce service cluster includes at least two servers. For example, the at least two servers include server 1 and server 2. Server 1 includes executor 1 and worker 1; server 2 includes executor 2 and worker 2. Worker 1 and worker 2 form a memarts store, and worker 1 is randomly selected from worker 1 and worker 2 as the master of the memarts store. The memarts pool integrates and manages the storage resources of multiple servers, providing storage resource support for the memarts store. The memarts pool generates diskpools across servers, where each diskpool contains at least two plogs.
[0059] After Spark app1 is created on server 1, it sends a storage space creation request to the master through executor1. The storage space creation request instructs the creation of a container with a capacity of A. The master forwards the storage space creation request to the memarts pool, and the memarts pool creates a container1 for storing the shuffle data of spark app1. Among them, container1 includes a specific plog, which means that the shuffle data of spark app1 can only be stored in this specific plog. After the creation is completed, spark app1 reads and writes the shuffle data in the specific plog through executor1 and the master. When Spark app1 ends, it sends a storage space deletion request to the master through the executor, deletes the correspondence between the specific plog in container1 and spark app1, as well as the shuffle data stored in the specific plog, and releases the plog for use by other spark apps.
[0060] Based on the above structure and ideas, the following will take the specific implementation of RSS technology as memarts store as an example, and introduce the data storage method provided by the embodiment of this application in combination with the accompanying drawings. Please refer to Figure 2, which is a flow chart of the data storage method provided by the embodiment of this application.
[0061] 201. Obtain a storage space creation request sent by a first application after creation;
[0062] After the first application is created on the first node, it sends a storage space creation request to the master of the memarts store. The request carries first information indicating that the capacity of the first storage space required by the first application is the first capacity. The first node can be any server communicatively connected to the storage system. Specifically, the first node can be any server in the storage system or any server outside the storage system communicatively connected to the storage system, without limitation.
[0063] In an embodiment of the present application, the storage space creation request includes first information, which is used to indicate that the storage space capacity required by the first application is the first capacity, wherein the capacity of the first storage space is greater than or equal to the first capacity. By limiting the capacity of the first storage space, unnecessary waste of storage resources when allocating storage resources to the first application is avoided, allowing technicians to limit the capacity of the first storage space to a reasonable range during configuration.
[0064] Exemplarily, the storage system is located in a server cluster and a MapReduce system is deployed. After the first application is created on the first node, a storage space creation request is sent to the memarts store in the MapReduce system. Specifically, a storage space creation request is sent to the master in the memarts store. The storage space creation request carries the identity of the first application and the first information.
[0065] Exemplarily, the first information may be a first capacity, where the first capacity is the shuffle data storage capacity of the first application configured by the user through an interactive interface during the first application creation phase.
[0066] It is understandable that the description of the application scenario in step 201 here is only an example. In actual application, it should be set in combination with the specific application scenario and is not limited here.
[0067] 202. Generate a correspondence between the first application and the first storage space;
[0068] After receiving a request to create a storage space, the Memarts store generates a correspondence between the first application and the first storage space based on the request. The capacity of the first storage space is greater than or equal to the first capacity, and the first storage space includes the storage resources of the first server. Furthermore, the first storage space includes the storage resources of N servers, and the storage system includes the storage resources of at least N+1 servers, where N is an integer greater than or equal to 1.
[0069] Specifically, after receiving a request to create a storage space, the memarts store selects a corresponding storage space for the first application based on the first capacity carried in the request, until the capacity of the first storage space is greater than or equal to the first capacity. For example, after receiving a request to create a storage space, the master in the memarts store forwards the request to the memarts pool, which creates a first storage space in the storage system for storing shuffle data corresponding to the first application and generates a corresponding relationship between the first storage space and the first application. The first storage space includes the storage resources of the first server.
[0070] For example, in the process of creating the first storage space, first obtain the list of allocatable storage resources of the storage system. The list of allocatable storage resources includes all the allocatable storage resources in the storage system. The list of allocatable storage resources includes the storage resources of the first server. The first capacity is less than the storage resource capacity of the first server. The memarts pool can select the storage resources of the first server as the first storage space and generate a corresponding relationship between the first storage space and the first application. If the first capacity is greater than the storage resource capacity of the first server, the memarts pool selects the storage resources of the second server as the storage resources of the first storage space while selecting the storage resources of the first server as the first storage space. Make the capacity of the first storage space greater than or equal to the first capacity, that is, the sum of the capacity of the storage resources of the first server and the capacity of the storage resources of the second server is greater than or equal to the first capacity.
[0071] It can be understood that the method of selecting the storage resources of the first server as the first storage space in the process of creating the first storage space is only an example. In actual applications, storage resources in the list of allocable storage resources can be selected as the first storage space according to pre-set rules. There is no restriction here.
[0072] In an embodiment of the present application, a list of allocatable storage resources of a storage system is obtained, and storage resources of a first server are selected as first storage space based on the list of allocatable storage resources. The list of allocatable storage resources includes all the allocatable storage resources of the storage system, the first server is included in the storage system, and the storage resources of the first server are the storage resources in the list of allocatable storage resources. By obtaining the list of allocatable storage resources of the storage system, allocating storage resources according to a certain rule based on the distribution of storage resources shown in the list, or randomly allocating storage resources to intermediate data generated by the first application, more possibilities are provided for the rational use of storage resources.
[0073] Furthermore, in order to more efficiently manage storage resources in the storage system, the memarts pool can also create virtual storage based on multiple servers in the storage system, and use the virtual storage to manage the storage resources of the servers in the storage system.
[0074] The local disks of multiple servers are combined into multiple diskpools, or virtual storage, through a memarts pool. Several servers form one or more diskpools, providing plog semantic services. This allows the outside world to create, append, read, close, and destroy any plog. Furthermore, each plog has a fixed capacity and at least one replica, located on a different server from the plog. The plog resource pool and diskpool, comprised of the local disks of all servers within the system, form the storage system.
[0075] Since each plog has at least one replica, a first storage space composed of multiple plogs also has a replica second storage space.
[0076] For example, please refer to FIG3 , which is a schematic diagram of a distribution of diskpools provided in an embodiment of the present application.
[0077] As shown in FIG3 , a diskpool divided by the memarts pool can include the storage space that can be provided by the local disks of server 1 and server 2.
[0078] Because the first capacity may be greater than the allocatable plog resource capacity of any diskpool in the storage system, multiple sub-storage spaces located in multiple diskpools can be selected to form the first storage space. Specifically, a greedy algorithm can be used to select the first sub-storage space. The memarts pool queries the DFS system's list of allocatable storage resources, which includes the allocatable plog resources of each diskpool, indicating the distribution of available storage capacity in the storage system. The multiple diskpools are sorted from largest to smallest based on their remaining allocatable storage capacity. The first sub-storage space consisting of the allocatable plog resources from the diskpool with the most allocatable resources is then selected from the sorted list and allocated to the first application. This means that the first sub-storage space is included in the first storage space. If the capacity of the first storage space is less than the first capacity, the second sub-storage space consisting of the allocatable plog resources from the remaining diskpool with the most allocatable resources is then selected from the sorted list and allocated to the first application. This means that the first sub-storage space is included in the first storage space, and the second sub-storage space is included in the first storage space. This continues until the capacity of the first storage space is greater than or equal to the first capacity, completing the creation of the first storage space.
[0079] In an embodiment of the present application, the server with the most storage resources in the list of allocatable storage resources is allocated to the first storage space so that as few servers as possible can be used to provide storage services for the intermediate data of the first application. This reduces the number of storage devices occupied by the intermediate data of the first application, and avoids the situation where the normal operation of multiple applications is affected by a server failure.
[0080] For example, please refer to FIG4 , which is a schematic diagram of a distribution of the first storage space provided in an embodiment of the present application.
[0081] As shown in Figure 4, when the storage system includes diskpool1, diskpool2, and diskpool3, the first storage space can include some or all of the plog resources in diskpool1 and diskpool2. Under this storage resource allocation rule, if any server occupying the first storage space experiences a hyper-redundancy failure, only the applications corresponding to the intermediate data stored in diskpool1 and diskpool2 will be affected.
[0082] Optionally, after generating the correspondence between the allocated first storage space and the first application, the memarts pool marks the plog resource corresponding to the first storage space as a used plog resource.
[0083] It is understandable that the description of the method of creating the first storage space when generating the correspondence between the first application and the first storage space is only an example. In actual applications, allocable plog resources can also be randomly selected for the first storage space, and there is no limitation here.
[0084] 203. Acquire first data generated by the first application;
[0085] After generating a correspondence between the first application and the first storage space, the Memart pool obtains first data generated by the first application, where the first data is intermediate data generated by the first application.
[0086] Specifically, the first application generates first data carrying an identifier (ID) of the first application. The first data is intermediate data generated by the first application when performing RSS service, that is, shuffle data. The Memarts store obtains the first data generated by the first application and forwards it to the master of the Memarts store.
[0087] It can be understood that the specific application scenario for obtaining the first data generated by the first application here is only an example. In actual applications, the specific application scenario can be adjusted according to actual conditions and is not limited here.
[0088] 204. Write the first data into the first storage space according to the correspondence between the first application and the first storage space;
[0089] After acquiring the first data, Memarts store writes the first data into the first storage space according to the corresponding relationship between the first application and the first storage space.
[0090] Specifically, after obtaining the first data generated by the first application, the memarts pool in the memarts store determines the association between the first data and the first application based on the ID of the first application carried by the first data, and then writes the first data into the first storage space based on the correspondence between the first application and the first storage space generated by the memart pool.
[0091] Exemplarily, the first data can be randomly written into the components of the first storage space: the first sub-storage space and the second sub-storage space; or, using a load balancing method, the first data can be evenly written into the first sub-storage space and the second sub-storage space; in addition, the first data can be written into the first sub-storage space in sequence, and when the first sub-storage space is fully occupied, the remaining first data can be written into the second sub-storage space.
[0092] Optionally, the memarts pool writes the first data written into the first storage space into the second storage space according to a mapping relationship between the first storage space and the second storage space.
[0093] It should be noted that the method of writing the first data into the first storage space here is only an example. In actual application, it should be set in combination with the requirements corresponding to the specific application scenario, and is not limited here.
[0094] 205. Obtain a first application end-of-run signal sent when the first application ends its run;
[0095] When the first application finishes running, Memarts store obtains a first application running end signal sent by the first application.
[0096] Specifically, when the first application ends running, the first application will send a first application running end signal to the memarts store, and the memart store will forward the first application running end signal to the memarts pool in the memarts store.
[0097] 206. Delete the correspondence between the first application and the first storage space and the first data stored in the first storage space.
[0098] After receiving the first application end-of-run signal, the Memarts store forwards the first application end-of-run signal to the Memarts pool in the Memarts store. After receiving the first application end-of-run signal, the Memarts pool deletes the correspondence between the first application and the first storage space, and destroys the first data stored in the first storage space.
[0099] Optionally, the memory pool deletes the first data in the second storage space according to a mapping relationship between the first storage space and the second storage space.
[0100] Furthermore, the memarts pool marks the plog contained in the first storage space as an allocatable resource.
[0101] It is understandable that the specific operation of memarts store deleting the correspondence between the first application and the first storage space and the first data stored in the first storage space is only an example. In actual applications, it can be implemented in combination with other RSS technologies and is not limited here.
[0102] In the embodiment of the present application, when the first application ends running, a signal sent by the first node that the first application has ended running is obtained, and the correspondence between the first application and the first storage space and the first data stored in the first storage space is deleted. After the first application ends running, the storage resources allocated for the intermediate data of the first application are released in a timely manner. This improves the utilization efficiency of storage resources in the storage system.
[0103] In an embodiment of the present application, by obtaining a storage space creation request sent after the first application is created, generating a correspondence between the first application and the first storage space, the obtained first data is written into the first storage space according to the correspondence between the first application and the first storage space, wherein the first data is intermediate data generated by the first application, the first storage space includes the storage resources of N servers, the N servers are included in the storage system, and the storage system includes the storage resources of at least N+1 servers. When the first application ends its operation, after obtaining the first application end operation signal sent by the first application, the correspondence between the first application and the first storage space and the first data stored in the first storage space are deleted to release the first storage space occupied by the first application. By dividing the storage space for the application, it is ensured that when the first application has a super-redundant fault, the application whose intermediate data is stored in other virtual storage spaces can still operate normally, thereby reducing the scope of impact on the application whose intermediate data is stored in the storage system when the first server fails.
[0104] Based on the method described in FIG. 2 , to improve storage efficiency, when allocating the first storage space for the first application, the sub-storage spaces within the first storage space can be categorized according to the function of the data to be stored, with data within the first data used for specific functions being stored in specific sub-storage spaces. For a specific implementation, please refer to FIG. 5 , which is another schematic flow chart of the data storage method provided in an embodiment of the present application.
[0105] 501. Obtain a storage space creation request sent by a first application after creation;
[0106] After the first application is created on the first node, it sends a storage space creation request to the master of the memarts store. The request carries first information indicating that the capacity of the first storage space required by the first application is the first capacity. The first node can be any server communicatively connected to the storage system. Specifically, the first node can be any server in the storage system or any server outside the storage system communicatively connected to the storage system, without limitation.
[0107] Exemplarily, the first information includes a classification rule for the intermediate data. The classification rule for the intermediate data may be that the first type of intermediate data generated by the first application requires a first sub-capacity of storage space, and the second type of intermediate data generated by the first application requires a second sub-capacity of storage space.
[0108] It is understandable that the description of the classification rules for intermediate data here is only an example, and there may be many different interpretations in actual applications, which are not limited here.
[0109] If the capacity of each category of intermediate data is too large, the intermediate data reading and writing tasks of each category will take too long to execute, be too concurrent, and consume too many resources. Therefore, when configuring the classification rules of intermediate data, technical personnel will fully consider the capacity of the category and control the capacity of the category within a certain range. For example, the capacity of each category is set to 128MB.
[0110] Specifically, according to the classification rules of the intermediate data and the capacity of each classification being 128 MB, the first capacity can be calculated using the following first formula:
[0111] First capacity = number of categories * 128MB.
[0112] Exemplarily, in a MapReduce system, after a first application is created on a first node, the first node sends a storage space creation request to the memarts pool of the memarts store in the MapReduce cluster. The storage space creation request carries the identity of the first application and the classification rule of intermediate data. The first capacity is calculated according to the classification rule of the intermediate data using a first formula. The first capacity is the shuffle data storage capacity of the first application configured by the user through the interactive interface during the first application creation phase. The classification rule of intermediate data is a rule for dividing the storage location of shuffle data according to its type.
[0113] It is understandable that the description of the application scenario of step 501 and the capacity description of each category are only examples. In actual application, they should be set in combination with specific application scenarios and are not limited here.
[0114] 502. Generate a correspondence between the first type of intermediate data and the first sub-storage space and a correspondence between the second type of intermediate data and the first storage space;
[0115] After receiving a request to create a storage space, the memarts store selects the storage resources of the first server as the first sub-storage space and the storage resources of the second server as the second sub-storage space based on the request to create a storage space. The memarts pool also generates a correspondence between the first type of intermediate data and the first sub-storage space, and between the second type of intermediate data and the second sub-storage space. The first sub-storage space is the storage space for the first type of intermediate data, and the second sub-storage space is the storage space for the second type of intermediate data. The capacity of the first sub-storage space is greater than or equal to the first sub-capacity, the capacity of the second sub-storage space is greater than or equal to the second sub-capacity, and the first sub-storage space and the second sub-storage space are included in the first storage space.
[0116] In order to manage storage resources in the storage system more flexibly, the memarts pool can also create virtual storage based on multiple servers in the storage system, and use the virtual storage to manage the storage resources of the servers in the storage system.
[0117] The local disks of multiple servers are combined into multiple diskpools, or virtual storage, through a memarts pool. Several servers form one or more diskpools, providing plog semantic services. This allows the outside world to create, append, read, close, and destroy any plog. Furthermore, each plog has a fixed capacity and at least one replica, located on a different server from the plog. The plog resource pool and diskpool, comprised of the local disks of all servers within the system, form the storage system.
[0118] Specifically, the first sub-storage space is included in the first virtual storage, which includes storage resources in the first server. The second sub-storage space is included in the second virtual storage, which includes storage resources in the second server. Please refer to Figure 6, which is a schematic diagram of the distribution of the first storage space provided in an embodiment of the present application.
[0119] As shown in Figure 6, the storage resources in the first server and the storage resources in the third server constitute the first virtual storage. The memarts pool can access the first sub-storage space set in the first virtual storage to read and write data, and then access the storage resources of the first server and / or the third server through the first virtual storage. The storage resources in the second server constitute the second virtual storage, so that the memarts pool can access the second sub-storage space set in the second virtual storage to read and write data, and then access the storage resources in the second server through the second virtual storage.
[0120] It can be understood that, here only the example of memarts pool accessing the first sub-storage space set in the first virtual storage, and the first sub-storage space only occupies the storage resources in the first server; memarts pool accesses the second sub-storage space set in the second virtual storage, and the second self-storage space occupies the storage resources in the second server is used for illustration. In actual applications, according to actual needs, the second sub-storage space can also be set in the first virtual storage, and there is no restriction here.
[0121] Exemplarily, after receiving a request to create a storage space, the master in the memarts store transmits the request to create a storage space to the memarts pool, and the memarts pool creates a first sub-storage space for storing the first type of shuffle data in the shuffle data corresponding to the first application and a second sub-storage space for storing the second type of shuffle data in the storage system, and generates a correspondence between the first sub-storage space and the first type of intermediate data and a correspondence between the second sub-storage space and the second type of intermediate data. The first storage space consists of the first sub-storage space and the second sub-storage space.
[0122] Optionally, after generating the correspondence between the first sub-storage space and the first type of intermediate data and the correspondence between the second sub-storage space and the second type of intermediate data, the memarts pool marks the plog resource corresponding to the first storage space as a used plog resource.
[0123] Optionally, because each plog has at least one replica, each plog in the first storage space has a corresponding backup plog. These backup plogs form the second storage space. When data is written to each plog, the backup plog also writes the same data. Therefore, the second storage space composed of the backup plogs also writes the first data when the first data is written to the first storage space.
[0124] In the embodiment of the present application, since there is a mapping relationship between the first storage space and the second storage space, after obtaining the first data sent by the first node, the first data is written to the second storage space according to the corresponding relationship between the first application and the first storage space and the mapping relationship between the first storage space and the second storage space. When there is a mapping relationship between the first storage space and the second storage space, after obtaining the first data, the first data is written to the second storage space according to the corresponding relationship between the first data and the first storage space and the mapping relationship between the first storage space and the second storage space as a backup of the first data in the first storage space, thereby improving the security of data storage in the storage system.
[0125] It can be understood that the description of the method of creating the first storage space when generating the correspondence between the first sub-storage space and the first type of intermediate data and the correspondence between the second sub-storage space and the second type of intermediate data is only an example. In actual application, it should be set in combination with the specific application scenario and is not restricted here.
[0126] 503. Acquire first data generated by the first application;
[0127] The operation of step 503 is similar to that of step 203 in FIG. 2 , and will not be described again here. Please refer to the introduction of step 203 .
[0128] 504. Write the first data into the first storage space according to the correspondence between the first application and the first storage space and the classification rule of the intermediate data;
[0129] After Memarts store obtains the first data, Memarts pool classifies the first data according to the classification rules of the intermediate data to obtain first data of the first type and first data of the second type, and writes the first data of the first type into the first sub-storage space and the first data of the second type into the second sub-storage space according to the correspondence between the first application and the first storage space, wherein the first data is the intermediate data generated by the first application.
[0130] It should be noted that the method of writing the first data into the first storage space here is only an example. In actual application, it should be set in combination with the requirements corresponding to the specific application scenario, and is not limited here.
[0131] 505. Obtain a first application end-of-run signal sent when the first application ends its run;
[0132] The operation of step 505 is similar to that of step 205 in FIG. 2 , and will not be described again here. Please refer to the introduction of step 205 .
[0133] 506. Delete the correspondence between the first sub-storage space and the first type of intermediate data, the correspondence between the second sub-storage space and the second type of intermediate data, and the first data in the first storage space.
[0134] After receiving the first application end-of-run signal, the Memarts store forwards the first application end-of-run signal to the Memarts pool in the Memarts store. After receiving the first application end-of-run signal, the Memarts pool deletes the correspondence between the first sub-storage space and the first type of intermediate data and the correspondence between the second sub-storage space and the second type of intermediate data, and destroys all first data stored in the first storage space.
[0135] Furthermore, the memarts pool marks the plog contained in the first storage space as an allocatable resource.
[0136] It can be understood that the specific operations of memarts store deleting the correspondence between the first sub-storage space and the first type of intermediate data, the correspondence between the second sub-storage space and the second type of intermediate data, and the first data in the first storage space are only examples. In actual applications, it can be implemented in combination with other RSS technologies and is not limited here.
[0137] In an embodiment of the present application, after obtaining a storage space creation request sent by a first application, a correspondence between the first type of intermediate data of the first application and the first sub-storage space and a correspondence between the second type of intermediate data of the first application and the second sub-storage space are generated according to the classification rules of the intermediate data carried in the storage space creation request. After obtaining the first data, the first data is classified, and the first data of the first type is written into the first sub-storage space; the first data of the second type is written into the second sub-storage space. And after obtaining a first application end operation signal sent by the first application when the first application ends, after obtaining the first application end operation signal, the correspondence between the first sub-storage space and the first type of intermediate data, the correspondence between the second sub-storage space and the second type of intermediate data, and the first data in the first storage space are deleted. Among them, the first storage space includes a first sub-storage space and a second sub-storage space.
[0138] The above solution proposed in this application uses a DFS system as an example. When the storage system is a Linux local file system, the minimum granularity for resource allocation in the first storage space is the server's hard disk, not the PLOG. When generating a correspondence between the first storage space and the first application, the Memarts pool also generates a correspondence between the first application and a specified file directory, thus binding the first application to the hard disk.
[0139] In the embodiment of the present application, by setting the storage system as a Linux local file system, the difficulty of generating the correspondence between the first storage space and the first application is reduced, thereby improving the implementation efficiency of the solution.
[0140] The above introduces the data storage method provided in the embodiment of the present application. The following introduces the data storage device provided in the embodiment of the present application in conjunction with the accompanying drawings. Please refer to Figure 7, which is a structural schematic diagram of the data storage device provided in the embodiment of the present application.
[0141] The data storage devices include:
[0142] An acquiring unit 701 is configured to acquire a storage space creation request sent by a first node after a first application is created, where the first node is a server connected to a storage system in a communicative manner.
[0143] A generating unit 702 is configured to generate a correspondence between a first application and a first storage space, where the first storage space includes storage resources of at least N servers, and the storage system includes at least N+1 servers, where N is a positive integer greater than 1;
[0144] The acquiring unit 701 is further configured to acquire first data sent by the first node, where the first data is intermediate data generated when the first application is running;
[0145] The reading and writing unit 703 is configured to write the first data into the first storage space according to the correspondence between the first application and the first storage space.
[0146] Optionally, the acquiring unit 701 is further configured to acquire a first application execution termination signal sent by the first node when the first application terminates execution;
[0147] The device further includes a deleting unit 704 configured to delete the correspondence between the first application and the first storage space and the first data stored in the first storage space.
[0148] Optionally, the acquiring unit 701 is further configured to acquire a list of allocatable storage resources in the storage system, where the list of allocatable storage resources includes allocatable storage resources in the storage system;
[0149] The device further includes a selection unit 705 for selecting storage resources of a first server as a first storage space, the first server being included in the storage system, and the storage resources of the first server being storage resources in the list of allocable storage resources.
[0150] Optionally, the first server is a server with the most allocatable storage resources in the list of allocatable storage resources.
[0151] Optionally, the storage space creation request includes first information, where the first information indicates that the storage space capacity required by the first application is a first capacity, and the capacity of the first storage space is greater than or equal to the first capacity.
[0152] Optionally, the first information includes a classification rule for the intermediate data, the classification rule for the intermediate data including: a storage space capacity required for first-type intermediate data of the first application is a first sub-capacity, a storage space capacity required for second-type intermediate data of the first application is a second sub-capacity, the first capacity is a sum of the first sub-capacity and the second sub-capacity, and the first storage space includes a first sub-storage space and a second sub-storage space;
[0153] The selection unit 705 is specifically configured to:
[0154] Selecting a storage resource of the first server as a first sub-storage space, where the capacity of the first sub-storage space is greater than or equal to the first sub-capacity;
[0155] The storage resources of the second server are selected as the second sub-storage space, and the capacity of the second sub-storage space is greater than or equal to the second sub-capacity.
[0156] Optionally, the correspondence between the first application and the first storage space includes a correspondence between the first type of intermediate data and the first sub-storage and a correspondence between the second type of intermediate data and the second sub-storage.
[0157] Optionally, there is a mapping relationship between the first storage space and the second storage space;
[0158] The reading and writing unit 703 is further configured to write the first data into the second storage space according to the corresponding relationship between the first application and the first storage space and the mapping relationship between the first storage space and the second storage space.
[0159] In addition, an embodiment of the present application further provides a data processing device. Please refer to FIG8 , which is another structural diagram of the data storage device provided in an embodiment of the present application.
[0160] Data storage device 800 includes a bus 802, a processor 804, a memory 806, and a communication interface 808. Processor 804, memory 806, and communication interface 808 communicate with each other via bus 802. Data storage device 800 may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in data storage device 800.
[0161] Bus 802 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG8 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 802 may include a path for transmitting information between various components of data storage device 800 (e.g., memory 806, processor 804, and communication interface 808).
[0162] The processor 804 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0163] The memory 806 may include volatile memory, such as random access memory (RAM). The processor 804 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0164] Memory 806 stores executable program code. Processor 804 executes the executable program code to implement the functions of the aforementioned acquisition unit 701, generation unit 702, read / write unit 703, deletion unit 704, and selection unit 705, respectively, thereby implementing any of the data storage methods. In other words, memory 806 stores instructions for executing any of the data storage methods.
[0165] Alternatively, the memory 806 stores executable code, and the processor 804 executes the executable code to respectively implement the functions of the aforementioned access point, thereby implementing any of the data storage methods. That is, the memory 806 stores instructions for executing any of the data storage methods.
[0166] The communication interface 808 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 800 and other devices or a communication network.
[0167] Please refer to FIG. 9 , which is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application.
[0168] The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0169] As shown in Figure 9, the computing device cluster includes at least one data storage device 800. The memory 806 in one or more data storage devices 800 in the computing device cluster may store the same instructions for executing any one of the data storage methods.
[0170] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster may also store partial instructions for executing any of the data storage methods. In other words, the combination of one or more data storage devices 800 can jointly execute instructions for executing any of the data storage methods.
[0171] It should be noted that the memory 806 in different data storage devices 800 in the computing device cluster can store different instructions, each used to execute a portion of the functions of the cloud management platform. In other words, the instructions stored in the memory 806 in different data storage devices 800 can implement the functions of one or more of the acquisition unit 701, generation unit 702, read / write unit 703, deletion unit 704, and selection unit 705.
[0172] In some possible implementations, one or more data storage devices in a computing device cluster may be connected via a network, which may be a wide area network or a local area network.
[0173] Please refer to FIG. 10 , which is another structural diagram of a computing device cluster provided in an embodiment of the present application.
[0174] As shown in Figure 10 , two data storage devices 800A and 800B are connected via a network. Specifically, the connection to the network is achieved through communication interfaces within each computing device. In this possible implementation, the memory 806 within the data storage device 800A stores instructions for executing the functions of the generation unit 702, the read / write unit 703, and the deletion unit 704. Simultaneously, the memory 806 within the data storage device 800B stores instructions for executing the functions of the acquisition unit 701 and the selection unit 705.
[0175] It should be understood that the function of the data storage device 800A shown in Figure 10 can also be completed by multiple data storage devices 800. Similarly, the function of the data storage device 800B can also be completed by multiple data storage devices 800.
[0176] The present application also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similar to the connection method of the computing device cluster described in Figures 9 and 10. However, the memory 806 in one or more data storage devices 800 in this computing device cluster can store the same instructions for executing any of the data storage methods.
[0177] In some possible implementations, the memory 806 of one or more data storage devices 800 in the computing device cluster may also store partial instructions for executing any of the data storage methods. In other words, the combination of one or more data storage devices 800 can jointly execute instructions for executing any of the data storage methods.
[0178] It should be noted that the memories 806 in different data storage devices 800 in the computing device cluster may store different instructions for executing partial functions of the data storage method.
[0179] An embodiment of the present application also provides a computer-readable storage medium, including computer-readable instructions. When the computer-readable instructions are executed on a computer, the computer executes any one of the implementation methods shown in the aforementioned method embodiments.
[0180] An embodiment of the present application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the computer executes any one of the implementation methods shown in the aforementioned method embodiments.
[0181] The present application also provides a chip or chip system, which may include a processor. The chip may also include a memory (or storage module) and / or a transceiver (or communication module), or the chip is coupled to a memory (or storage module) and / or a transceiver (or communication module), wherein the transceiver (or communication module) can be used to support the chip for wired and / or wireless communication, and the memory (or storage module) can be used to store a program or a set of instructions, and the processor calls the program or the set of instructions to implement the above-mentioned method embodiment, the operation performed by the terminal or network device in any possible implementation of the method embodiment. The chip system may include the above chip, and may also include the above chip and other discrete devices, such as memory (or storage module) and / or transceiver (or communication module).
[0182] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0183] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0184] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0185] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0186] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A method for data storage, characterized in that: include: Obtaining a storage space creation request sent by a first node after the first application is created, where the first node is a server connected to the storage system in a communicable manner; Generate a correspondence between the first application and a first storage space, the first storage space includes storage resources of at least N servers, the storage system includes at least N+1 servers, and N is a positive integer greater than 1; Acquire first data sent by the first node, where the first data is intermediate data generated when the first application is running; The first data is written into the first storage space according to the correspondence between the first application and the first storage space.
2. The method according to claim 1, characterized in that The method further comprises: Acquire a first application execution end signal sent by the first node when the first application finishes execution; The correspondence between the first application and the first storage space and the first data stored in the first storage space are deleted.
3. The method according to claim 1 or 2, characterized in that: Before generating the correspondence relationship between the first application and the first storage space, the method further includes: Acquire a list of allocatable storage resources of the storage system, wherein the list of allocatable storage resources includes allocatable storage resources in the storage system; The storage resources of a first server are selected as the first storage space, the first server is included in the storage system, and the storage resources of the first server are storage resources in the list of allocatable storage resources.
4. The method according to claim 3, characterized in that The first server is a server with the most allocatable storage resources in the list of allocatable storage resources.
5. The method according to claims 1 to 4, characterized in that The request to create a storage space includes first information, where the first information indicates that the storage space capacity required by the first application is a first capacity, and the capacity of the first storage space is greater than or equal to the first capacity.
6. The method according to claim 5, characterized in that The first information includes a classification rule for intermediate data, the classification rule for intermediate data includes that a storage space capacity required for a first type of intermediate data of the first application is a first sub-capacity, a storage space capacity required for a second type of intermediate data of the first application is a second sub-capacity, the first capacity is a sum of the first sub-capacity and the second sub-capacity, and the first storage space includes a first sub-storage space and a second sub-storage space; The selecting the storage resource of the first server as the first storage space includes: Selecting a storage resource of a first server as the first sub-storage space, wherein the capacity of the first sub-storage space is greater than or equal to the first sub-capacity; A storage resource of a second server is selected as the second sub-storage space, and a capacity of the second sub-storage space is greater than or equal to the second sub-capacity.
7. The method according to claim 6, characterized in that The correspondence between the first application and the first storage space includes a correspondence between the first type of intermediate data and the first sub-storage and a correspondence between the second type of intermediate data and the second sub-storage.
8. The method according to any one of claims 1 to 7, characterized in that: There is a mapping relationship between the first storage space and the second storage space; After obtaining the first data sent by the first node, the method further includes: The first data is written into the second storage space according to a corresponding relationship between the first application and the first storage space and a mapping relationship between the first storage space and the second storage space.
9. A data storage device, characterized in that: include: an acquisition unit, configured to acquire a storage space creation request sent by a first node after the first application is created, wherein the first node is a server connected to the storage system in a communicable manner; A generating unit, configured to generate a correspondence between the first application and a first storage space, wherein the first storage space includes storage resources of at least N servers, and the storage system includes at least N+1 servers, where N is a positive integer greater than 1; The acquisition unit is further configured to acquire first data sent by the first node, wherein the first data is generated when the first application is running. intermediate data generated; A reading and writing unit is used to write the first data into the first storage space according to the corresponding relationship between the first application and the first storage space.
10. The device according to claim 9, characterized in that The acquisition unit is further configured to acquire a first application execution end signal sent by the first node when the first application finishes execution; The device further includes a deleting unit configured to delete the correspondence between the first application and the first storage space and the first data stored in the first storage space.
11. The device according to claim 9 or 10, characterized in that The acquisition unit is further configured to acquire a list of allocatable storage resources in the storage system, wherein the list of allocatable storage resources includes allocatable storage resources in the storage system; The device further includes a selection unit configured to select storage resources of a first server as the first storage space, the first server being included in the storage system, and the storage resources of the first server being storage resources in the list of allocatable storage resources.
12. The device according to claim 11, characterized in that The first server is a server with the most allocatable storage resources in the list of allocatable storage resources.
13. The device according to claims 9 to 12, characterized in that The request to create a storage space includes first information, where the first information indicates that the storage space capacity required by the first application is a first capacity, and the capacity of the first storage space is greater than or equal to the first capacity.
14. The device according to claim 13, characterized in that The first information includes a classification rule for intermediate data, the classification rule for intermediate data includes that a storage space capacity required for a first type of intermediate data of the first application is a first sub-capacity, a storage space capacity required for a second type of intermediate data of the first application is a second sub-capacity, the first capacity is a sum of the first sub-capacity and the second sub-capacity, and the first storage space includes a first sub-storage space and a second sub-storage space; The selection unit is specifically used for: Selecting a storage resource of a first server as the first sub-storage space, wherein the capacity of the first sub-storage space is greater than or equal to the first sub-capacity; A storage resource of a second server is selected as the second sub-storage space, and a capacity of the second sub-storage space is greater than or equal to the second sub-capacity.
15. The device according to claim 14, characterized in that The correspondence between the first application and the first storage space includes a correspondence between the first type of intermediate data and the first sub-storage and a correspondence between the second type of intermediate data and the second sub-storage.
16. The device according to any one of claims 9 to 15, characterized in that There is a mapping relationship between the first storage space and the second storage space; The read-write unit is further configured to write the first data into the second storage space according to a corresponding relationship between the first application and the first storage space and a mapping relationship between the first storage space and the second storage space.
17. A data storage device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store instructions, and the processor is used to execute the instructions. When the processor executes the instructions, the method according to any one of claims 1 to 8 is executed.
18. A computer-readable storage medium, characterized in that: The invention comprises a program which, when being run on a computer, causes the computer to execute the method according to any one of claims 1 to 8.
19. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Distributive storage method, device and system
CN102255962A
Distributed big data parallel computing method based on Hadoop MapReduce
CN110187970A
Data storage method
CN111258978A
File system cloning method and apparatus
US20220350779A1
