WO2023029610A1 - Data access method and device, and storage medium - Google Patents

Data access method and device, and storage medium Download PDF

Info

Publication number
WO2023029610A1
WO2023029610A1 PCT/CN2022/095010 CN2022095010W WO2023029610A1 WO 2023029610 A1 WO2023029610 A1 WO 2023029610A1 CN 2022095010 W CN2022095010 W CN 2022095010W WO 2023029610 A1 WO2023029610 A1 WO 2023029610A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
cache
data
task
directory
Prior art date
Application number
PCT/CN2022/095010
Other languages
French (fr)
Chinese (zh)
Inventor
李秀桥
孙宏伟
丁肇辉
高帅
江喆
陈强
Original Assignee
超聚变数字技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 超聚变数字技术有限公司 filed Critical 超聚变数字技术有限公司
Publication of WO2023029610A1 publication Critical patent/WO2023029610A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0811Multiuser, multiprocessor or multiprocessing cache systems with multilevel cache hierarchies
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • G06F12/0871Allocation or management of cache space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers

Definitions

  • the present application relates to the technical field of data processing, in particular to a data access method, device and storage medium.
  • a large-scale cluster system is usually used to provide a shared application execution environment for multiple users.
  • the cluster system usually includes a management node and multiple computing nodes. Wherein, for any application to be run, the management node may assign a corresponding computing node to the application, and then the computing node runs the application. In this way, the user cannot control the resource usage of the computing node by the application, thus causing the application performance to fail to meet user requirements.
  • the present application provides a data access method, device, and storage medium, which can control application resource usage according to user requirements, so that application performance meets user requirements. Described technical scheme is as follows:
  • a data access method includes: receiving a cache configuration request for a first application submitted by a user, the cache configuration request includes cache policy and mapping directory information, and the cache policy is used to indicate
  • the mapping directory information is the information of the first directory where the application data of the first application stored in the storage system is located; according to the caching policy, scheduling caching for the first application resource; according to the mapping directory information, prefetch the application data of the first application into the cache resource of the first application; during the running of the first application, access the cache resource according to the cache policy Cache resources of the first application.
  • the cache resource is scheduled for the first application according to the cache policy submitted by the user for the first application, and the data is prefetched into the cache resource of the first application according to the mapping directory information submitted by the user. Subsequently, during the running of the first application, the cache resource of the first application is accessed according to the cache policy. It can be seen that the data access method provided by the present application can perceive the user's needs, and then control the resource usage of the application according to the user's needs, thereby improving the application performance.
  • the implementation process of scheduling cache resources for the first application according to the cache policy includes: determining each of the multiple tasks of the first application according to the cache policy
  • the resource requirement information includes the size of the cache space required by each task and the type of the included storage medium; according to the resource requirement information of each task, the cache space is allocated for each task.
  • the first application can be divided into multiple tasks.
  • the user can specify the resource requirement information of each task of the first application to control the cluster system to allocate cache for the corresponding task according to the resource requirement information of each task. space.
  • the resource requirement information of different tasks may be the same or different.
  • the mapping directory information includes a directory path of the first directory, and according to the mapping directory information, the application data of the first application is prefetched to the first application
  • the implementation process in the cache resource includes: determining the directory identifier of the subdirectory corresponding to each task in the plurality of tasks of the first application; according to the directory path of the first directory and the directory of the subdirectory corresponding to each task Identifying, obtaining from the storage system the data in the subdirectory corresponding to each task stored in the first directory; storing the data in the subdirectory corresponding to each task in the cache resource of the first application .
  • the data of the first application is prefetched into the cache resource allocated for the first application through the mapping directory information specified by the user. In this way, the user does not need to perform explicit data copying, which reduces the complexity of the user's use.
  • the implementing process of accessing the cache resource of the first application according to the cache policy includes: when the cache policy includes a hierarchical cache policy, according to the hierarchical cache policy, The different types of task data of each task of the first application are cached in the storage medium of the corresponding type in the cache resource of the first application; when the cache policy includes a data consistency policy, when accessing any cache When accessing task data in the space, lock operation is performed on the accessed task data.
  • data can be cached and accessed in the cache resource of the first application according to the data cache and access policy in the cache policy specified by the user, for example, data can be cached according to the hierarchical cache policy, so as to improve data access performance and save Resource consumption of cache space.
  • the data is accessed according to the data consistency policy to ensure the accuracy of the data during the data access process.
  • users can flexibly customize other policies to achieve flexible settings of data caching and access methods.
  • the access before accessing the cache resource of the first application according to the cache policy, the access further includes: obtaining an input/output IO request; if the data accessed by the IO request is the mapping directory data in the first directory indicated by the information, then perform the step of accessing the cache resource of the first application according to the cache policy.
  • mapping directory information by setting the mapping directory information, the access to the first directory indicated by the mapping directory information can be directly intercepted, and then the data access can be realized by accessing the cache resource allocated for the first application, which improves the access efficiency, and The user is not aware of the whole process.
  • the method further includes: acquiring the bandwidth requirements of the data to be migrated to the storage system in the cache resources of each of the multiple applications, the multiple applications including the first application; according to the bandwidth requirement, allocate IO bandwidth for the data to be migrated in the cache resource of the first application; according to the IO bandwidth, store the data to be migrated in the cache resource of the first application to the in the storage system.
  • each computing node when each computing node detects that the amount of data in the cache resources allocated by itself for the application reaches the second threshold, it may apply to the management node for allocating the bandwidth requirements of the data to be migrated for the application it is running.
  • the management node can allocate the IO bandwidth for migrating the data to be migrated to the application running on each computing node, so as to control the data volume of each computing node migrating data to the storage system, thereby avoiding The application data access volume of different computing nodes exceeds the available bandwidth of the storage system, resulting in I/O bandwidth competition.
  • This enables applications in the global view to access the storage system in an orderly manner, thereby reducing application performance problems caused by IO competition.
  • the cluster system can automatically complete the data copy without the user's own operation to complete the data copy, which reduces the complexity of the user's operation.
  • a data access method includes: a management node receives a cache configuration request of a first application submitted by a user, the cache configuration request includes a cache policy and mapping directory information, and the cache policy is used for Indicating the caching requirements of the first application, the mapping directory information is the information of the first directory where the application data of the first application stored in the storage system is located; the management node calculates from the target according to the caching policy A cache resource is scheduled for the first application in the node; the management node controls the target computing node to prefetch the application data of the first application into the cache resource of the first application according to the mapping directory information , and through the cache policy, control the target computing node to access the cache resources of the first application during the running process of the first application.
  • the management node schedules cache resources for the first application according to the cache policy submitted by the user for the first application, and controls the computing node to prefetch data into the cache resources of the first application according to the mapping directory information submitted by the user. Subsequently, during the running of the first application, the control computing node accesses the cache resource of the first application according to the cache policy. It can be seen that, the embodiment of the present application can sense the user's demand, and then control the resource usage of the application according to the user's demand, thereby improving the application performance.
  • the management node schedules cache resources for the first application from the target computing node according to the cache policy, including: the management node obtains the first application from the cache policy.
  • the resource requirement information of each task among the multiple tasks of an application, the resource requirement information includes the size of the buffer space required by each task and the type of the storage medium included; the management node allocates according to the resource requirement information A target computing node that executes each task of the first application; the management node sends the caching policy to the target computing node to instruct the target computing node to, according to the resource requirement information in the caching policy, from itself Allocate cache space for the corresponding tasks in the cache space.
  • the management node can control the resource usage of the computing node by the first application according to the cache policy specified by the user, so as to realize the user's control of the resource usage of the computing node, so that the application performance of the first application can be Better meet the needs of users.
  • the mapping directory information includes a directory path of the first directory
  • the management node controls the target computing node to store the application data of the first application according to the mapping directory information
  • the implementation process of prefetching to the cache resource of the first application may be: the management node sends the directory path of the first directory to the target computing node, so as to instruct the target computing node to
  • the directory path of the directory is to prefetch the data under the subdirectory of each task stored under the first directory from the storage system, and store the obtained data into the cache resource of the first application.
  • the management node controls the computing node to prefetch the data of the first application into the cache resources allocated for the first application through the mapping directory information specified by the user. In this way, the user does not need to perform explicit data copying, reducing the user complexity.
  • the method further includes: the management node receiving the bandwidth requirements of the data to be migrated to the storage system in the cache resources of each application sent by the multiple computing nodes, and the multiple computing nodes
  • the node includes the target computing node; according to the bandwidth requirement, allocate IO bandwidth for the data to be migrated in the cache resource of the first application; send the IO bandwidth allocated for the first application to the target computing node, Instructing the target computing node to store the data to be migrated in the cache resource of the first application in the storage system according to the IO bandwidth allocated for the first application.
  • the management node can allocate the IO bandwidth for migrating the data to be migrated to the application running on each computing node according to the collected bandwidth requirements of each computing node, so as to control the process of migrating data from each computing node to the storage system.
  • the amount of data so as to prevent the application data access volume of different computing nodes from exceeding the available bandwidth of the storage system, resulting in I/O bandwidth competition, and realize orderly access to the storage system by applications in the global view, thereby reducing application performance caused by IO competition question.
  • a data access method includes: a computing node receives a caching policy and mapping directory information of a first application specified by a user, the caching policy is used to indicate a caching requirement of the first application,
  • the mapping directory information is the information of the first directory where the application data of the first application stored in the storage system is located; according to the cache policy, allocate cache resources for the first application, and according to the mapping directory information, Prefetch the application data of the first application into the cache resource of the first application; and access the cache resource of the first application according to the cache policy during the running of the first application.
  • the computing node can allocate corresponding cache resources for the first application according to the caching policy of the first application specified by the user, so that the resource usage of the computing node by the first application meets the user's requirements, and then the first application's Application performance can meet user needs.
  • data access can be directly performed in the cache resources allocated by the computing node for the first application, reducing the access to the storage system, thereby reducing the communication between computing nodes. compete.
  • the computing node can prefetch the application data of the first application under the first directory in the storage system into the first cache space according to the mapping directory information, without manual data copying by the user. Reduced operational complexity.
  • the computing node when allocating cache resources for the first application according to the cache policy, obtains each of the multiple tasks of the first application from the cache policy
  • the resource requirement information of the task includes the size of the cache space required by each task and the type of storage medium included;
  • a cache space is allocated to a first task, where the first task is any one of the multiple tasks running on the computing node.
  • the implementation process of prefetching the application data of the first application into the cache resource of the first application according to the mapping directory information includes: determining that the first task The directory identifier of the corresponding subdirectory; according to the directory path of the first directory and the directory identifier of the subdirectory corresponding to the first task, obtain the first task corresponding to the first task stored in the first directory from the storage system the data under the subdirectory; storing the data under the subdirectory corresponding to the first task in the cache space of the first task.
  • the implementation process of storing the data in the subdirectory corresponding to the first task in the cache space of the first task includes: according to the According to the data type of the data in the subdirectory corresponding to the first task, different data are stored in different types of storage media.
  • data is cached according to a hierarchical cache policy, so that different types of data can be stored in appropriate storage media, thereby improving data access performance and saving resource consumption of cache space.
  • the implementation process of accessing the cache resources of the first application may include: obtaining an IO request, if the The data accessed by the IO request is the data under the first directory indicated by the mapping directory information, and the cache resource of the first application is accessed according to the IO request and the cache policy.
  • mapping directory information by setting the mapping directory information, the access to the first directory indicated by the mapping directory information can be directly intercepted, and then the data access can be realized by accessing the cache resource allocated for the first application, which improves the access efficiency, and The user is not aware of the whole process.
  • the cache policy includes a data consistency policy
  • the computing node accesses data in the cache resource of the first application, lock the accessed data Operation, in order to ensure the accuracy of the data in the data access process.
  • the computing node when the computing node detects that the amount of data in the cache resource allocated by itself for the first application reaches a reference threshold, it sends the bandwidth requirement of the first application to the management node, so The bandwidth requirement is used to indicate the bandwidth required for migrating the data to be migrated in the cache resource of the first application on the computing node to the storage system; According to the allocated IO bandwidth of the data to be migrated, the data to be migrated in the cache resource of the first application is migrated to the storage system.
  • the computing node can request the management node to allocate IO bandwidth for the first application by sending the bandwidth requirement of the first application to the management node. Since the management node can collect the bandwidth requirements of each computing node at the same time, according to the management node When the allocated IO bandwidth is used to migrate data, each computing node can generate I/O bandwidth competition, realizing orderly access to the storage system by applications in the global view, thereby reducing application performance problems caused by IO competition.
  • a data access device in a fourth aspect, has the function of implementing the behavior of the data access method in the first aspect above.
  • the data access device includes at least one module, and the at least one module is used to implement the data access method provided in the first aspect above.
  • a data access device has the function of realizing the behavior of the data access method in the second aspect above, and the data access device includes at least one module, and the at least one module is used to realize the above first The data access method provided by the second aspect.
  • a data access device has the function of realizing the behavior of the data access method in the above third aspect, and the data access device includes at least one module, and the at least one module is used to realize the above-mentioned first Data access methods provided by three aspects.
  • a cluster system in a seventh aspect, includes a management node and a computing node, the management node and the computing node both include a processor and a memory, and the memory is used to store and support the execution of the cluster system
  • the processor is configured to execute programs stored in the memory.
  • the eighth aspect provides a management node, the structure of the management node includes a processor and a memory, and the memory is used to store a program that supports the management node to execute the data access method provided in the second aspect above, and The data involved in implementing the data access method provided by the second aspect above is stored.
  • the processor is configured to execute programs stored in the memory.
  • a ninth aspect provides a computing node, the structure of the computing node includes a processor and a memory, and the memory is used to store a program that supports the computing node to execute the data access method provided in the third aspect above, and The data involved in implementing the data access method provided by the above third aspect is stored.
  • the processor is configured to execute programs stored in the memory.
  • a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the above-mentioned first aspect or the second aspect or the third aspect.
  • a computer program product containing instructions which, when run on a computer, causes the computer to execute the data access method described in the first aspect or the second aspect or the third aspect.
  • FIG. 1 is a system architecture diagram of a data center provided in an embodiment of the present application
  • Fig. 2 is a method flowchart of a computer device provided by an embodiment of the present application
  • FIG. 3 is a flow chart of a data access method provided by an embodiment of the present application.
  • Fig. 4 is a schematic structural diagram of a data access device provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of another data access device provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of another data access device provided by an embodiment of the present application.
  • the data access method provided by the present application can be applied to a data center, and the data center can provide a shared application execution environment for multiple users.
  • the applications running in the data center may be data-intensive applications such as high-performance computing applications and big data applications.
  • the data center includes a cluster system 10 and a storage system 11 , and a communication connection is established between the cluster system 10 and the storage system 11 .
  • the cluster system 10 is used to provide an execution environment for multiple applications
  • the storage system 11 is used to store application data of the multiple applications.
  • the cluster system 10 may include a management node 101 and a plurality of computing nodes 102, and the management node 101 and each computing node 102 may communicate through a wired network or a wireless network, and each computing node 102 is also Communication can be performed via a wired network or a wireless network.
  • the management node 101 is used to assign a computing node 102 for executing the application to the application according to the caching policy specified by the user, and combine the caching policy and the mapping directory information specified by the user sent to the computing node 102.
  • the computing node 102 After receiving the cache policy and mapping directory information specified by the user from the management node 101, the computing node 102 allocates cache resources for the application from its own cache resources according to the cache policy, and according to the mapping directory information, the storage system The data of the application stored in step 11 is prefetched into the cache resource of the application. After that, run the application, and access the cache resources of the application according to the cache policy during the running of the application.
  • the cache resource of the computing node 102 itself refers to a storage medium included in the computing node 102 .
  • the cache resource of the computing node 102 itself may include its own dynamic random access memory (dynamic random access memory, DRAM), large-capacity storage class memory (storage class memory, SCM), solid-state hard disk (solid storage disk, SSD) ) and other types of storage media, which are not limited in this embodiment of the present application.
  • DRAM dynamic random access memory
  • SCM storage class memory
  • SSD solid-state hard disk
  • the number of computing nodes 102 that the management node 102 assigns to the application to execute the application can be multiple, so that each computing node 102 can be used to run one or more tasks of the application.
  • the management node 101 can schedule cache resources in the computing nodes 102 for various applications to be run by different users according to user requirements, thereby controlling the corresponding computing nodes 102 to run corresponding applications.
  • the computing node 102 may send the cache resource of the application to be migrated to the storage system to the management node 101 11 to request the management node 101 to allocate IO bandwidth for the application data to be migrated.
  • the management node 101 After receiving the bandwidth requirements of each application sent by one or more computing nodes 102, the management node 101 can allocate IO bandwidth for the data to be migrated of each application according to the bandwidth requirement, and deliver the allocated IO bandwidth to the corresponding computing nodes. Node 102.
  • the computing node 102 may send the application data to be migrated to the storage system 11 for storage according to the IO bandwidth.
  • the storage system 11 includes multiple storage nodes 111 . Wherein, wired or wireless communication may be performed between each storage node 111 and each computing node 102 .
  • Each storage node 111 is used to receive the IO request of the computing node 102, wherein, when the IO request is a read request sent by the computing node 102 according to the mapping directory information, the storage node 111 obtains application data according to the read request and returns it to the computing node 102 , so that the computing node 102 caches the data of the application in the cache resource allocated for the application.
  • the storage node 111 may persistently store the data to be migrated according to the write request.
  • the storage node 111 may include a control unit, a network card, and multiple storage devices.
  • the control unit is used for communicating with the computing node 102 through the network card, and accessing multiple storage devices according to the IO request of the computing node 102 .
  • the plurality of storage devices may include large-capacity storage class memory (storage class memory, SCM), solid storage disk (solid storage disk, SSD) and other types of storage devices, which is not limited in this embodiment of the present application.
  • the data center may also provide users with a login node for submitting cache policies and mapping directory information.
  • the user submits the cache policy and mapping directory information of the application to be run to the management node 101 through the login node, so that the management node 101 schedules resources for the application according to the application cache policy and mapping directory information.
  • Each of the above-mentioned management node 101 , computing node 102 , storage node 111 and login node may be a separate computer device.
  • the login node may be a terminal device, such as a laptop computer, a desktop computer, a tablet computer, a smart phone, and the like.
  • the management node 101 and the computing node 102 may be terminal devices or servers.
  • the storage node 111 may be a server.
  • Fig. 2 is a schematic structural diagram of a computer device provided by an embodiment of the present application. Both the management node and the computing node in the system architecture shown in FIG. 1 can be realized by the computer device.
  • the computer device may include one or more processors 201 , a communication bus 202 , a main memory 203 and one or more communication interfaces 204 .
  • the processor 201 may be a general-purpose central processing unit (central processing unit, CPU), a network processor (network processor, NP), a microprocessor, or may be one or more integrated circuits for realizing the scheme of the present application, such as , application-specific integrated circuit (ASIC), programmable logic device (programmable logic device, PLD) or a combination thereof.
  • the aforementioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL) or any combination thereof.
  • the communication bus 202 is used to transfer information between the aforementioned components.
  • the communication bus 202 can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
  • the main memory 203 can be a read-only main memory (read-only memory, ROM), or a random access memory (random access memory, RAM), or can be used to carry or store desired data in the form of instructions or data structures. program code and any other medium that can be accessed by a computer, but is not limited thereto. Wherein, when the main memory 203 is RAM, the main memory may be Dynamic Random Access Memory (Dynamic Random Access Memory, DRAM), or SCM, etc.
  • the main memory 203 may exist independently, and is connected to the processor 201 through the communication bus 202 .
  • the main memory 203 can also be integrated with the processor 201 .
  • the Communication interface 204 utilizes any transceiver-like device for communicating with other devices or a communication network.
  • the communication interface 204 includes a wired communication interface, and may also include a wireless communication interface.
  • the wired communication interface may be an Ethernet interface, for example.
  • the Ethernet interface can be an optical interface, an electrical interface or a combination thereof.
  • the wireless communication interface may be a wireless local area network (wireless local area networks, WLAN) interface, a cellular network communication interface or a combination thereof.
  • the computer device may further include other storage media 205, for example, the other storage media 205 may include a mechanical hard disk, a solid state hard disk, and the like.
  • a computer device may include multiple processors, such as processor 201 and processor 206 as shown in FIG. 2 . Each of these processors can be a single-core processor or a multi-core processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data such as computer program instructions.
  • the computer device may further include an output device 207 and an input device 208 .
  • Output device 207 is in communication with processor 201 and can display information in a variety of ways.
  • the output device 207 may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, a cathode ray tube (cathode ray tube, CRT) display device, or a projector (projector), etc.
  • the input device 208 communicates with the processor 201 and can receive user input in various ways.
  • the input device 208 may be a mouse, a keyboard, a touch screen device, or a sensory device, among others.
  • the main memory 203 is used to store a kernel, program codes for executing the solution of the present application, and other instructions and data, and the processor 201 can execute the program codes stored in the main memory 203 .
  • the program code may include one or more software modules, and the computer device may implement the data access method provided in the embodiment of FIG. 3 below through the program code in the processor 201 and the main memory 203 .
  • the user can flexibly customize the cache policy for the application, and the cluster system can schedule cache resources for the application according to the cache policy submitted by the user, that is, the cluster system can sense the user's needs, and then according to the user's demand To control the resource usage of the application, so as to achieve the effect of improving application performance.
  • the cluster system can prefetch data into the cache resource of the application according to the mapping directory information submitted by the user, so as to improve the data access speed and reduce the complexity of the user's use.
  • the management node in the cluster system can allocate IO bandwidth for applications running on the computing nodes by collecting the bandwidth requirements of each computing node, reducing application performance problems caused by IO competition.
  • Fig. 3 is a flow chart of a data access method provided by an embodiment of the present application. This method can be applied to the cluster system in the data center shown in Figure 1, referring to Figure 3, the method includes the following steps:
  • Step 301 The management node receives a cache configuration request for the first application submitted by the user.
  • the cache configuration request includes a cache policy and mapping directory information.
  • the cache policy is used to indicate the cache requirements of the first application, and the mapping directory information is stored in the storage system. Information about the first directory where the application data of the first application is located.
  • the user inputs the caching policy and mapping directory information for the first application on the login node.
  • the login node generates a cache configuration request for the first application according to the cache policy and mapping directory information input by the user, and sends the cache configuration request to the management node.
  • the cache configuration request carries the cache policy and mapping directory information
  • the first application refers to the application to be run by the user.
  • the management node receives the cache configuration request of the first application sent by the login node.
  • a command line tool is deployed on the login node, and the user may input the caching policy and mapping directory information of the first application in the command line interface of the command line tool displayed on the login node.
  • the login node acquires the cache policy and mapping directory information of the first application input by the user in the command line interface.
  • a service configuration client may also be deployed on the login node, and the user may input the cache policy and mapping directory information of the first application in the interface of the service configuration client displayed on the login node.
  • the login node can obtain the cache policy and mapping directory information of the first application through the service configuration client, and then generate a cache configuration request of the first application.
  • the caching policy of the first application may include resource requirement information and data caching and access policies of the first application.
  • the first application may be divided into multiple tasks to be executed by multiple computing nodes.
  • the resource requirement information of the first application specified by the user may include resource requirement information of each task of the first application.
  • the resource requirement information of each task of the first application may be the same or different.
  • the resource requirement information may include computing resource requirement information and cache resource requirement information.
  • the computing resource requirement information is used to indicate the computing resources required by each task of the first application, for example, the number of cores and main frequency of the processor required to run each task of the first application.
  • the cache resource requirement information includes the size of the cache space required by each task of the first application. In addition, it may also include the type of storage medium included in the cache space required by each task of the first application.
  • the first application The cache space required by each task may include two different storage media, DRAM and SCM.
  • the cache resource requirement information may also include a topology structure of the cache space required by each task of the first application, that is, a topology structure of storage media at various levels constituting the cache space on corresponding computing nodes.
  • the resource requirement information of the first application may also be directly used to indicate the resource requirement of the first application, that is, the resource requirement information is not the above-mentioned resource requirement information at the task granularity level, but resource requirements at the application granularity level demand information.
  • the data cache and access policy may be used to indicate the cache mode and access policy for the application data of the first application.
  • the data cache and access policy may include a hierarchical cache policy for instructing to cache different types of application data of the first application in different types of storage media.
  • the data cache and access policy may include a data consistency policy, which is used to indicate that when accessing any data in the cache resource of the first application, a lock operation is performed on the accessed data to ensure data consistency .
  • the data caching and access policy may also include a security level policy, which is used to indicate the access rights of the data in the cache resources of the application.
  • mapping directory information refers to information of the first directory where the application data of the first application stored in the storage system is located.
  • the mapped directory information may be a directory path of the first directory in the storage system.
  • the mapping directory information may also be other information that can be used to indicate the storage location of the application data of the first application in the storage system, which is not limited in this embodiment of the present application.
  • Step 302 The management node allocates a target computing node for executing the first application according to the caching policy.
  • the management node After receiving the cache configuration request of the first application, the management node allocates a target computing node for executing the first application from multiple computing nodes according to the resource requirement information included in the cache policy in the cache configuration request.
  • the management node may acquire the resource requirement information of each of the multiple tasks of the first application from the cache strategy, and allocate A target computing node for executing each task of the first application.
  • the resource requirement information of each task may include computing resource requirement information and cache resource requirement information of each task.
  • the management node can collect and update the usage of computing resources and cache resources of each computing node in real time, based on the computing resource demand information of each task and the latest update of the usage of computing resources of each computing node. Determine a candidate computing node that can meet the computing resource requirements required by the task running of the first application among the computing nodes.
  • the cache resource requirement information of each task and the usage of the cache resource of each candidate computing node updated last time further determine the computing node that can meet the cache resource requirement of the task of the first application from the candidate computing nodes, and set The finally determined computing node is used as the target computing node.
  • the management node can determine the remaining computing resources on each computing node according to the resources occupied by the applications running on each computing node last updated, and then determine from multiple computing nodes that the remaining computing resources meet the tasks of the first application Candidate computing nodes for computing resource requirements. Afterwards, according to the size of the remaining cache space of each candidate computing node updated last time and the type of the storage medium forming the remaining cache space, determine from the candidate computing nodes that the remaining cache space is greater than the size of the cache space required by the task of the first application, And the remaining cache space includes the computing nodes of the storage medium required by the task of the first application, so as to obtain the target computing node.
  • the management node may also determine candidate computing nodes from multiple computing nodes according to the cache resource requirement information of each task, and then determine from the candidate computing nodes according to the computing resource requirement information of each task of the first application.
  • the target computing node will not be described again in this embodiment of the present application.
  • the management node can determine the computing node running each task of the first application.
  • the computing nodes running each task can be different, so there will be multiple target computing nodes.
  • the computing nodes running each task may also be the same target computing node, so there will be one target computing node.
  • some tasks can be executed by one target computing node, and some tasks can be executed by another target computing node, so there will be multiple target computing nodes.
  • the management node may directly assign a target computing node to the first application according to the resource requirement information of the first application.
  • the implementation may be Referring to the implementation manner of allocating target computing nodes for each task in the foregoing, details are not described in this embodiment of the present application.
  • the management node can also determine the resource requirement information of each of the multiple tasks of the first application according to the resource requirement information of the first application and the task division principle of the first application, and calculate The node method assigns a target compute node for each task.
  • Step 303 the management node sends the cache policy and mapping directory information to the target computing node.
  • the management node can deliver the caching policy and mapping directory information of each task of the first application to the target computing node, so as to control the target computing node to serve the first application according to the caching policy.
  • Each task of an application allocates cache resources, and accesses the cache resources of the first application according to the mapping directory information and the cache policy.
  • the management node may deliver the cache policy and mapping directory information to each target computing node.
  • the management node can use the data cache and access policy contained in the cache policy and the resource requirement information of each task as the corresponding task cache policy, and then deliver the mapping directory information and the cache policy of each task to the target computing node corresponding to the task, wherein the target computing node corresponding to the task runs the target computing node of the task.
  • the management node can also deliver the identifier of the task to be run to each target computing node, so as to indicate that the target computing node is to run the first Which task to apply.
  • the identifier of the task can uniquely identify the task.
  • each target computing node After each target computing node receives the cache policy and mapping directory information sent by the management node, it can run the first application through the following steps 304 to 306 .
  • Step 304 The target computing node allocates cache resources for the first application according to the cache policy.
  • the target computing node After receiving the cache policy and mapping directory information issued by the management node, the target computing node first allocates cache resources for the first application according to the cache policy.
  • the target computing node may obtain cache resource requirement information from the received cache policy, and then allocate cache resource for the task of the first application to be executed by itself according to the cache resource requirement information.
  • a target computing node is used as an example for description. For convenience of description, this target computing node is referred to as a first target computing node.
  • the first target computing node obtains the cache resource requirement information of the first task from the received cache policy, and then according to the cache resource requirement information of the first task information, and allocate a cache space that meets the requirements of the cache resource for the first task in its own cache resource.
  • the first target computing node may allocate the cache resources corresponding to the cache resource according to the cache resource requirement information.
  • the cache space of the same size indicated by the cache resource requirement information is used as the cache space of the first application.
  • the allocated cache space of the first application may be the cache of the first task of the first application running on the first target computing node.
  • the space, that is, for storing task data of the first task may also be a cache space for other tasks of the first application running on other target computing nodes, that is, for storing task data of other tasks.
  • Each target computing node allocates cache space for each task of the first application according to the cache policy issued by the management node, so that the cache space of each task of the first application located on each target computing node constitutes the cache resource of the first application .
  • the target computing node may allocate cache space for the first application from its own cache resources according to the cache resource requirement information. In this way, the cache resource of the first application will be located on one computing node.
  • Step 305 The target computing node prefetches the application data of the first application into the cache resource of the first application according to the mapping directory information.
  • the target computing node may obtain the application data of the first application from the storage system according to the mapping directory information, and then cache the application data in the cache resource of the first application.
  • the first target computing node is still taken as an example for illustration.
  • the first target computing node may determine the directory identifier of the subdirectory corresponding to the first task, and obtain the first task stored in the first directory from the storage system according to the directory path of the first directory and the directory identifier of the subdirectory corresponding to the first task. The data under the corresponding subdirectory, and then store the acquired data under the subdirectory corresponding to the first task in the cache space allocated for the first task.
  • the first target computing node may obtain the directory identifier of the subdirectory corresponding to the first task from preset task identifiers and directory identifiers of subdirectories according to the task identifier of the first task.
  • the first target computing node may also generate the directory identifier of the subdirectory corresponding to the first task by using a preset rule according to the task identifier of the first task. For example, the task number of the first task is 1, and the default rule for generating the directory identifier of the subdirectory corresponding to the task is processor+task number, then according to the preset rule, the directory identifier of the subdirectory corresponding to the first task can be obtained as processor 1 .
  • the first target computing node can obtain the data under the subdirectory with the same directory identifier as the subdirectory corresponding to the first task from the first directory stored in the storage system according to the directory path of the first directory, that is, the first The task data of the task, and then, store the task data of the first task in the cache space of the first task.
  • the first The target computing node may also store different data in different types of storage media according to the data type of the task data of the first task.
  • the hotspot data whose access frequency is higher than the first threshold is stored in a memory with higher performance (also referred to as a storage medium), and the data with a lower access frequency is stored in a memory with a relatively lower performance.
  • weak storage media For example, metadata and other data other than metadata may be stored in different types of storage media.
  • the first threshold may be set according to business requirements, may be set according to task data processing efficiency, may also be an experience value, or may be set according to system processing capability.
  • each task of the first application executed by the above-mentioned first target computing node.
  • each The data under the subdirectory corresponding to the task to be executed is prefetched into the cache space corresponding to the corresponding task.
  • the first target computing node may obtain the data under the first directory indicated by the mapping directory information from the storage system, and then perform a hash operation on the directory path of the obtained data to obtain a hash value corresponding to the data.
  • a target computing node whose node ID matches the hash value is determined from among the plurality of target computing nodes. If the node identifies the target computing node matching the hash value as itself, then store the data in the cache space allocated by itself for the first application.
  • the first target computing node may send the data to the second target computing node, and the second target computing node After receiving the data, the target computing node stores the data in the cache space allocated by itself for the first application.
  • the target computing node can directly obtain the mapping directory information from the storage system The data under the indicated first directory is stored in the cache space allocated for the first application.
  • the target computing node may also use a multi-copy mechanism to prefetch task data of each task of the first application, or use other implementation manners to prefetch data of the first application, which is not limited in this embodiment of the present application.
  • the data prefetched from the first directory of the storage system may be all data in the first directory, or may be part of the data in the first directory.
  • what is prefetched may be all data of the task, or part of the data of the task, which is not limited in this embodiment of the present application.
  • more important data may be prefetched according to the access frequency of the data or other information that can indicate the importance of the data.
  • Step 306 During the running of the first application, the target computing node accesses the cache resource of the first application according to the cache policy.
  • the target computing node After allocating cache resources for the first application through steps 304 and 305, and prefetching the application data of the first application into the cache resources of the first application, the target computing node starts the running script of the first application to start running the first application. application.
  • the first target computing node is still taken as an example for illustration.
  • the first target computing node starts the running script of the first application, and executes the first task of the first application assigned to itself.
  • the first target computing node may need to read the application data of the first application, or write the data generated during the execution of the task into the cache resource of the first application. Based on this, the first target computing node may generate an IO request according to an operation to be performed, where the IO request may be a read request or a write request. Moreover, the IO request may include a directory path of a directory where the accessed target data is located.
  • the first target computing node After obtaining the IO request, the first target computing node can first compare the directory path of the accessed target data with the mapping directory information, and if the directory path of the accessed target data contains the mapping directory information, it can be determined that the The target data to be accessed is the data under the first directory. In this case, since the data in the first directory is prefetched into the cache resource of the first application in step 305, the first target computing node can directly access the cache resource of the first application.
  • each target computing node is the data prefetched by the method described in the first possible situation in step 305, after determining that the data to be accessed by the IO request is the data under the first directory, the first target computing node The cache resource of the first application is accessed according to the IO request.
  • the first target computing node can first search for the target data from the cache space of the first task, and if the target data is hit in the cache space of the first task, then the target data. If the target data fails to hit in the cache space of the first task, the IO request is sent to other target computing nodes. After receiving the IO request, other target computing nodes search for the target data from the cache space of the task assigned by themselves for the first application, and if the target data is hit, return the target data to the first target computing node, if not If the target data is hit, a notification message is returned to the first target computing node to notify the first target computing node that data acquisition fails.
  • the first target computing node may acquire the target data from the storage system.
  • the first target computing node may write the target data into the cache space of the first task.
  • the IO request may be sent to other target computing nodes.
  • other target computing nodes may also send the IO request to the first target computing node.
  • the first target computing node may also receive IO requests sent by other target computing nodes, and access the cache space of the first task according to the IO requests.
  • computing nodes can send IO requests to access each other's cache space through remote direct memory access (RDMA) technology.
  • RDMA remote direct memory access
  • the first target computing node may hash the directory path of the target data to be accessed by the IO request operation to obtain the hash value corresponding to the target data, determine the target computing node whose node ID matches the hash value corresponding to the target data, and if the determined target computing node is itself, then the first target computing node accesses itself The buffer space allocated for the first application, so as to realize reading or writing of target data.
  • the first target computing node sends an IO request to the determined target computing node, and the determined target computing node assigns the first application by accessing itself cache space to read or write target data.
  • the corresponding target computing node can also obtain the target data from the storage system.
  • the target computing node can access itself according to the IO request as In the cache space allocated by the first application.
  • the access method refer to the aforementioned implementation method, which will not be repeated in this embodiment of the present application.
  • the data cache and access policy in the cache policy also includes a data consistency policy
  • the target computing node when a certain target computing node modifies, deletes, or writes in the cache resource of the first application according to an IO request, the target computing node can also perform a lock operation on the target data, so as to prevent other target computing nodes from accessing the target data and ensure data consistency.
  • Step 307 The multiple computing nodes send to the management node the bandwidth requirements of the data to be migrated to the storage system in the cache resources of the running applications.
  • the multiple computing nodes include the target computing node, and the multiple applications include the first application.
  • the computing node when it detects that the amount of data cached in the cache space allocated by itself for a certain application reaches the second threshold, it may send the bandwidth requirement of the application to the management node.
  • the management node can receive the bandwidth requirements of each application sent by each computing node in real time.
  • the bandwidth requirement is used to indicate the bandwidth required for migrating the data to be migrated in the cache resource of the corresponding application on the corresponding computing node to the storage system.
  • the bandwidth requirement may include the amount of data to be migrated in the cache resource of the corresponding application on the computing node.
  • other information such as an application identifier may also be included, which is not limited in this embodiment of the present application.
  • the second threshold may be preset according to the size of the cache space allocated for the application on the computing node, for example, the second threshold may be a preset ratio of the total capacity of the cache space allocated for the application, for example, It may be 80% of the cache space allocated for the application, or other values, which are not limited in this embodiment of the present application.
  • the multiple computing nodes include the target computing node, that is, when the target computing node detects that the amount of data cached in the buffer space allocated by itself for the first application reaches the second threshold, it can send the first The bandwidth requirements of the application.
  • the bandwidth requirement of the first application is used to indicate the bandwidth required to migrate the data to be migrated in the cache space of the first application on the target computing node to the storage system.
  • Step 308 The management node allocates IO bandwidth for the data to be migrated in the cache resource of the first application according to the bandwidth requirement.
  • the management node After receiving the bandwidth requirements of each application sent by multiple computing nodes including the target computing node, the management node can use the bandwidth required by the data to be migrated for the corresponding application indicated by the bandwidth requirements of each application and the current To allocate the corresponding IO bandwidth for the data to be migrated of each application.
  • the management node may calculate the ratio of the bandwidth required by each application, and then allocate the IO bandwidth for each application according to the ratio and the current remaining bandwidth of the storage system. Among them, if the current remaining bandwidth of the storage system is not greater than the total bandwidth required by each application, the IO bandwidth allocated to each application will be smaller than the required bandwidth; if the current remaining bandwidth of the storage system is greater than the total bandwidth required by each application , the IO bandwidth allocated to each application may be equal to the required bandwidth.
  • the management node may also adopt other principles to allocate the IO bandwidth to the data to be migrated of each application, which is not limited in this embodiment of the present application.
  • the IO bandwidth allocated for each application's data to be migrated can indicate the maximum amount of data that is allowed to be migrated by each application per unit time. For example, when the IO bandwidth allocated for the data to be migrated of the first application is 30MB/s, it means that the target computing node is allowed to migrate at most 30MB of cached data of the first application to the storage system per second.
  • the management node can allocate the IO bandwidth for the data to be migrated in the cache resource of the first application through the above method.
  • Step 309 the management node sends the IO bandwidth allocated for the first application to the target computing node.
  • the management node after the management node allocates the IO bandwidth for the data to be migrated in the cache resources of each application, it can send the IO bandwidth allocated for the corresponding application to the corresponding computing node.
  • the management node may send the IO bandwidth allocated for the data to be migrated in the cache resource of the first application to the target computing node.
  • Step 310 The target computing node stores the data to be migrated in the cache resource of the first application into the storage system according to the IO bandwidth allocated for the first application.
  • the IO bandwidth allocated for the first application is used to indicate the data volume of cached data of the first application that allows the target computing node to migrate this time. Based on this, according to the IO bandwidth allocated by the management node for the first application, the target computing node obtains data whose quantity is not greater than the IO bandwidth from the cache space allocated for the first application as the data to be migrated, and then, according to the mapping specified by the user
  • the directory information migrates the data to be migrated to the storage system for persistent storage.
  • the operation of migrating data to the storage system according to the mapping directory information is a reverse operation of prefetching data from the storage system according to the mapping directory information.
  • the target computing node After the target computing node starts running the first application, whenever it detects that the amount of data in the cache space allocated by itself for the first application reaches the second threshold, it can apply for IO bandwidth from the management node through the above steps 307-310, so that Migrate the data in the cache space of the first application to the storage system according to the IO bandwidth, until the first application finishes running and all the data in the cache space of the first application is migrated to the storage system, the target computing node can release The cache space allocated for the first application.
  • cache resources are scheduled for the first application according to the cache policy for the first application submitted by the user, and data is prefetched into the cache resource of the first application according to the mapping directory information submitted by the user. Subsequently, during the running of the first application, the cache resource of the first application is accessed according to the cache policy. It can be seen that, the embodiment of the present application can sense the user's demand, and then control the resource usage of the application according to the user's demand, thereby improving the application performance.
  • the data of the first application stored in the storage system can be prefetched into the cache resource allocated for the first application according to the mapping directory information specified by the user, so that the subsequent running of the first application During the process, if the data to be accessed is the data under the directory indicated by the mapping directory information, the cache resource allocated for the first application can be directly accessed to improve the data access speed. Moreover, the data in the storage system is prefetched by specifying the mapping directory information by the user, which reduces the complexity of the user's use.
  • data can be cached and accessed in the cache resource of the first application according to the data cache and access policy in the cache policy specified by the user, for example, data can be cached according to a hierarchical cache policy, thereby improving Data access performance, save resource consumption of cache space.
  • the data is accessed according to the data consistency policy to ensure the accuracy of the data during the data access process.
  • users can flexibly customize other policies to achieve flexible settings of data caching and access methods.
  • each computing node when each computing node detects that the amount of data in the cache resources allocated by itself for the application reaches the second threshold, it can apply to the management node for allocating the bandwidth requirements of the data to be migrated for the application it is running. . According to the collected bandwidth requirements of each computing node, the management node can allocate the IO bandwidth for migrating the data to be migrated to the application running on each computing node, so as to control the data volume of each computing node migrating data to the storage system, thereby avoiding The application data access volume of different computing nodes exceeds the available bandwidth of the storage system, resulting in I/O bandwidth competition.
  • the cluster system can automatically complete the data copy without the user's own operation to complete the data copy, which reduces the complexity of the user's operation.
  • the steps related to the management node can be independently implemented as a data access method on the management node side
  • the steps related to the computing node side can be independently implemented as a data access method on the computing node side.
  • the embodiment of the present application provides a data access device 400, which can be applied in a cluster system, and the device 400 includes:
  • a receiving module 401 configured to execute step 301 in the above embodiment
  • the access module 404 is configured to execute step 306 in the above embodiment.
  • the data access device 400 in this embodiment of the present invention can be implemented by a central processing unit (central processing unit, CPU), or by an application-specific integrated circuit (ASIC), or programmable Logic device (programmable logic device, PLD) realizes, and above-mentioned PLD can be complex program logic device (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic) , GAL) or any combination thereof.
  • the data access method shown in FIG. 3 can also be realized by software
  • the data access device 400 and its modules can also be software modules.
  • the scheduling module 402 is mainly used for:
  • resource requirement information for each of the multiple tasks of the first application according to the cache strategy, where the resource requirement information includes the size of the cache space required by each task and the type of storage medium included;
  • cache space is allocated for each task.
  • mapping directory information includes the directory path of the first directory
  • prefetching module 403 is mainly used for:
  • the data under the subdirectory corresponding to each task stored in the first directory is obtained from the storage system;
  • the data under the subdirectory corresponding to each task is stored in the cache resource of the first application.
  • the access module 404 is mainly used for:
  • the caching strategy includes a hierarchical caching strategy
  • different types of task data of each task of the first application are cached in a storage medium of a corresponding type in the caching resource of the first application
  • the cache policy includes a data consistency policy
  • a lock operation is performed on the accessed task data.
  • the device 400 is also used for:
  • the data accessed by the IO request is the data under the first directory indicated by the mapping directory information, perform the step of accessing the cache resource of the first application according to the cache policy.
  • the device 400 is also used for:
  • the data to be migrated in the cache resource of the first application is stored in the storage system.
  • the data access device 400 can correspond to the implementation of the method described in the embodiment of the present invention, and the above-mentioned and other operations and/or functions of the various units in the data access device 400 are respectively in order to realize Fig. 3
  • the corresponding processes executed by corresponding nodes in each method in will not be repeated here.
  • cache resources are scheduled for the first application according to the cache policy submitted by the user for the first application, and data is prefetched to the cache resources of the first application according to the mapping directory information submitted by the user middle. Subsequently, during the running of the first application, the cache resource of the first application is accessed according to the cache policy. It can be seen that, the embodiment of the present application can sense the user's demand, and then control the resource usage of the application according to the user's demand, thereby improving the application performance.
  • the embodiment of the present application provides a data access device 500, which can be applied to a management node, and the device 500 includes:
  • a receiving module 501 configured to execute step 301 in the above embodiment
  • the scheduling module 502 is configured to execute the operation of sending the caching policy to the target computing node in step 302 and step 303 in the above embodiment, so as to control the target computing node to execute steps 304 to 306 .
  • the device 500 of the embodiment of the present invention can be implemented by a central processing unit (central processing unit, CPU), or by an application-specific integrated circuit (ASIC), or a programmable logic device (programmable logic device, PLD) implementation
  • the above-mentioned PLD can be a complex program logic device (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic, GAL ) or any combination thereof.
  • the device 500 and its modules can also be software modules.
  • the scheduling module 502 is mainly used for:
  • the cache policy is sent to the target computing node to instruct the target computing node to allocate cache space for the corresponding task from its own cache space according to the resource requirement information in the cache policy.
  • mapping directory information includes the directory path of the first directory
  • scheduling module 502 is mainly used for:
  • the device 500 is also used for:
  • the device 500 according to the embodiment of the present application of the present invention may correspond to the implementation of the method described in the embodiment of the present application, and the above-mentioned and other operations and/or functions of each unit in the device 500 are for realizing each method in FIG. 3
  • the corresponding processes executed by the corresponding nodes in will not be repeated here.
  • the management node schedules cache resources for the first application according to the cache policy submitted by the user for the first application, and controls the computing node to prefetch data to the first application according to the mapping directory information submitted by the user.
  • the cache resource of an application In the cache resource of an application.
  • the control computing node accesses the cache resource of the first application according to the cache policy. It can be seen that, the embodiment of the present application can sense the user's demand, and then control the resource usage of the application according to the user's demand, thereby improving the application performance.
  • the present application also provides a data access device 600.
  • the data access device 600 can be applied to computing nodes, and the data access device 600 includes:
  • the receiving module 601 is configured to receive the caching strategy and mapping directory information of the first application specified by the user, the caching strategy is used to indicate the caching requirements of the first application, and the mapping directory information is where the application data of the first application stored in the storage system is located. the information of the first directory;
  • the access module 604 is configured to execute step 306 in the foregoing embodiment.
  • the data access device 600 in this embodiment of the present invention can be implemented by a central processing unit (central processing unit, CPU), or by an application-specific integrated circuit (ASIC), or programmable Logic device (programmable logic device, PLD) realizes, and above-mentioned PLD can be complex program logic device (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic) , GAL) or any combination thereof.
  • the data access method shown in FIG. 3 can also be realized by software
  • the data access device 600 and its modules can also be software modules.
  • the allocation module 602 is mainly used for:
  • a cache space is allocated in its own cache resource for the first task run by itself, where the first task is any one of multiple tasks running on the computing node.
  • the prefetching module 603 is mainly used for:
  • the data under the subdirectory corresponding to the first task stored in the first directory is obtained from the storage system;
  • the data under the subdirectory corresponding to the first task is stored in the cache space of the first task.
  • the prefetch module is further configured to: store different data in different types of storage media according to the data type of the data in the subdirectory corresponding to the first task.
  • the access module 604 is mainly used for:
  • the cache resource of the first application is accessed according to the IO request and the cache policy.
  • the access module is mainly used for:
  • the apparatus 600 is further configured to: when detecting that the amount of data in the cache resource allocated by itself for the first application reaches a reference threshold, send the bandwidth requirement of the first application to the management node, and the bandwidth requirement is used to indicate that the computing The bandwidth required for migrating the data to be migrated in the cache resource of the first application on the node to the storage system; receiving the IO bandwidth allocated by the management node for the data to be migrated in the cache resource of the first application, according to the allocated IO bandwidth, the Data to be migrated in cache resources of an application is migrated to a storage system.
  • the device 600 according to the embodiment of the present application of the present invention may correspond to the implementation of the method described in the embodiment of the present application, and the above-mentioned and other operations and/or functions of each unit in the device 600 are for realizing each method in FIG. 3
  • the corresponding processes executed by the corresponding nodes in will not be repeated here.
  • the computing node can allocate corresponding cache resources for the first application according to the caching policy of the first application specified by the user, so that the resource usage of the computing node by the first application meets the user's requirements, and then the first application The application performance of the application can meet user needs.
  • data access can be directly performed in the cache resources allocated by the computing node for the first application, reducing the access to the storage system, thereby reducing the communication between computing nodes. compete.
  • the computing node can prefetch the application data of the first application under the first directory in the storage system into the first cache space according to the mapping directory information, without manual data copying by the user. Reduced operational complexity.
  • the present application also provides a data access system, the system includes a management node and a computing node, wherein the connection mode between the management node and the computing node can refer to the connection mode between the management node and the computing node in the system shown in Figure 1 , the structure of the management node and the computing node may refer to the structure of the computer device shown in FIG. 2 .
  • the management node is used to realize the function of the management node in the data access method shown in Figure 3
  • the computing node is used to realize the function of the computing node in the data access method shown in Figure 3. Examples will not be repeated here.
  • the data access device provided in the above-mentioned embodiment when the data access device provided in the above-mentioned embodiment reads and writes data, it only uses the division of the above-mentioned functional modules as an example. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs. , which divides the internal structure of the device into different functional modules to complete all or part of the functions described above.
  • the data access device and the data access method embodiments provided by the above embodiments belong to the same idea, and the specific implementation process thereof is detailed in the method embodiments, and will not be repeated here.
  • all or part may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server or data center via wired (eg coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (eg infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (for example: floppy disk, hard disk, magnetic tape), an optical medium (for example: Digital Versatile Disc (Digital Versatile Disc, DVD)), or a semiconductor medium (for example: Solid State Disk (Solid State Disk, SSD) )wait.
  • a magnetic medium for example: floppy disk, hard disk, magnetic tape
  • an optical medium for example: Digital Versatile Disc (Digital Versatile Disc, DVD)
  • a semiconductor medium for example: Solid State Disk (Solid State Disk, SSD)
  • the program can be stored in a computer-readable storage medium.
  • the above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A data access method, comprising: scheduling a cache resource for a first application according to a cache policy submitted by a user for the first application; pre-fetching data into the cache resource for the first application according to mapping directory information submitted by the user; and subsequently, during running of the first application, accessing the cache resource for the first application according to the cache policy. Thus, a requirement of a user is sensed, and resource usage of the application is controlled according to the requirement of the user, thereby improving the application performance.

Description

数据访问方法、装置及存储介质Data access method, device and storage medium
本申请要求于2021年08月31日提交中国专利局、申请号为202111010014.8、申请名称为“数据访问方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111010014.8 and the application name "data access method, device and storage medium" submitted to the China Patent Office on August 31, 2021, the entire contents of which are incorporated by reference in this application middle.
技术领域technical field
本申请涉及数据处理技术领域,特别涉及一种数据访问方法、装置及存储介质。The present application relates to the technical field of data processing, in particular to a data access method, device and storage medium.
背景技术Background technique
在数据中心,通常采用大型的集群系统为多个用户提供共享的应用执行环境。在该集群系统中通常包括管理节点和多个计算节点。其中,对于所要运行的任一应用,管理节点可以为该应用分配对应的计算节点,之后,由该计算节点运行该应用。这样,用户无法控制应用对计算节点的资源的使用情况,从而导致应用性能无法满足用户需求。In the data center, a large-scale cluster system is usually used to provide a shared application execution environment for multiple users. The cluster system usually includes a management node and multiple computing nodes. Wherein, for any application to be run, the management node may assign a corresponding computing node to the application, and then the computing node runs the application. In this way, the user cannot control the resource usage of the computing node by the application, thus causing the application performance to fail to meet user requirements.
发明内容Contents of the invention
本申请提供了一种数据访问方法、装置及存储介质,可以根据用户的需求来控制应用的资源使用情况,以使应用性能满足用户需求。所述技术方案如下:The present application provides a data access method, device, and storage medium, which can control application resource usage according to user requirements, so that application performance meets user requirements. Described technical scheme is as follows:
第一方面,提供了一种数据访问方法,所述方法包括:接收用户提交的针对第一应用的缓存配置请求,所述缓存配置请求包括缓存策略和映射目录信息,所述缓存策略用于指示所述第一应用的缓存需求,所述映射目录信息为存储系统中存储的所述第一应用的应用数据所在的第一目录的信息;根据所述缓存策略,为所述第一应用调度缓存资源;根据所述映射目录信息,将所述第一应用的应用数据预取至所述第一应用的缓存资源中;在运行所述第一应用的过程中,根据所述缓存策略,访问所述第一应用的缓存资源。In a first aspect, a data access method is provided, the method includes: receiving a cache configuration request for a first application submitted by a user, the cache configuration request includes cache policy and mapping directory information, and the cache policy is used to indicate For the caching requirements of the first application, the mapping directory information is the information of the first directory where the application data of the first application stored in the storage system is located; according to the caching policy, scheduling caching for the first application resource; according to the mapping directory information, prefetch the application data of the first application into the cache resource of the first application; during the running of the first application, access the cache resource according to the cache policy Cache resources of the first application.
由上述描述可知,根据用户提交的针对第一应用的缓存策略为第一应用调度缓存资源,并根据用户提交的映射目录信息将数据预取至第一应用的缓存资源中。后续,在第一应用运行的过程中,根据该缓存策略来访问第一应用的缓存资源。由此可见,本申请提供的数据访问方法可以感知用户的需求,进而根据用户的需求来控制应用的资源使用情况,从而提升应用性能。It can be known from the above description that the cache resource is scheduled for the first application according to the cache policy submitted by the user for the first application, and the data is prefetched into the cache resource of the first application according to the mapping directory information submitted by the user. Subsequently, during the running of the first application, the cache resource of the first application is accessed according to the cache policy. It can be seen that the data access method provided by the present application can perceive the user's needs, and then control the resource usage of the application according to the user's needs, thereby improving the application performance.
在一种可能的实现方式中,所述根据所述缓存策略,为所述第一应用调度缓存资源的实现过程包括:根据所述缓存策略确定所述第一应用的多个任务中每个任务的资源需求信息,所述资源需求信息包括每个任务所需的缓存空间的大小和包括的存储介质的类型;根据每个任务的资源需求信息,为每个任务分配缓存空间。In a possible implementation manner, the implementation process of scheduling cache resources for the first application according to the cache policy includes: determining each of the multiple tasks of the first application according to the cache policy The resource requirement information includes the size of the cache space required by each task and the type of the included storage medium; according to the resource requirement information of each task, the cache space is allocated for each task.
在本申请中,第一应用可以被划分为多个任务,这样,用户可以指定第一应用的每个任务的资源需求信息,以控制集群系统根据每个任务的资源需求信息为相应任务分配缓存空间。其中,不同任务的资源需求信息可以相同也可以不同。In this application, the first application can be divided into multiple tasks. In this way, the user can specify the resource requirement information of each task of the first application to control the cluster system to allocate cache for the corresponding task according to the resource requirement information of each task. space. Wherein, the resource requirement information of different tasks may be the same or different.
在一种可能的实现方式中,所述映射目录信息包括所述第一目录的目录路径,所述根据 所述映射目录信息,将所述第一应用的应用数据预取至所述第一应用的缓存资源中的实现过程包括:确定所述第一应用的多个任务中每个任务对应的子目录的目录标识;根据所述第一目录的目录路径和每个任务对应的子目录的目录标识,从所述存储系统中获取所述第一目录下存储的每个任务对应的子目录下的数据;将每个任务对应的子目录下的数据存储至所述第一应用的缓存资源中。In a possible implementation manner, the mapping directory information includes a directory path of the first directory, and according to the mapping directory information, the application data of the first application is prefetched to the first application The implementation process in the cache resource includes: determining the directory identifier of the subdirectory corresponding to each task in the plurality of tasks of the first application; according to the directory path of the first directory and the directory of the subdirectory corresponding to each task Identifying, obtaining from the storage system the data in the subdirectory corresponding to each task stored in the first directory; storing the data in the subdirectory corresponding to each task in the cache resource of the first application .
通过用户指定的映射目录信息将第一应用的数据预取至为第一应用分配的缓存资源中,这样,无需用户自行进行显式的数据拷贝,降低了用户使用复杂度。The data of the first application is prefetched into the cache resource allocated for the first application through the mapping directory information specified by the user. In this way, the user does not need to perform explicit data copying, which reduces the complexity of the user's use.
在一种可能的实现方式中,所述根据所述缓存策略,访问所述第一应用的缓存资源的实现过程包括:当所述缓存策略包括分级缓存策略时,根据所述分级缓存策略,将所述第一应用的每个任务的不同类型的任务数据缓存至所述第一应用的缓存资源中对应类型的存储介质中;当所述缓存策略包括数据一致性策略时,在访问任一缓存空间中的任务数据时,对所访问的任务数据执行加锁操作。In a possible implementation manner, the implementing process of accessing the cache resource of the first application according to the cache policy includes: when the cache policy includes a hierarchical cache policy, according to the hierarchical cache policy, The different types of task data of each task of the first application are cached in the storage medium of the corresponding type in the cache resource of the first application; when the cache policy includes a data consistency policy, when accessing any cache When accessing task data in the space, lock operation is performed on the accessed task data.
在本申请中,可以根据用户指定的缓存策略中的数据缓存和访问策略在第一应用的缓存资源中缓存并访问数据,例如,根据分级缓存策略缓存数据,以此来提高数据访问性能,节省缓存空间的资源消耗。根据数据一致性策略来访问数据,以此保证数据访问过程中数据的准确性。除此之外,用户还可以灵活的定制其他策略,以此来实现数据缓存和访问方式的灵活设置。In this application, data can be cached and accessed in the cache resource of the first application according to the data cache and access policy in the cache policy specified by the user, for example, data can be cached according to the hierarchical cache policy, so as to improve data access performance and save Resource consumption of cache space. The data is accessed according to the data consistency policy to ensure the accuracy of the data during the data access process. In addition, users can flexibly customize other policies to achieve flexible settings of data caching and access methods.
在一种可能的实现方式中,所述根据所述缓存策略,访问所述第一应用的缓存资源之前还包括:获取输入输出IO请求;如果所述IO请求所访问的数据为所述映射目录信息所指示的所述第一目录下的数据,则执行所述根据所述缓存策略,访问所述第一应用的缓存资源的步骤。In a possible implementation manner, before accessing the cache resource of the first application according to the cache policy, the access further includes: obtaining an input/output IO request; if the data accessed by the IO request is the mapping directory data in the first directory indicated by the information, then perform the step of accessing the cache resource of the first application according to the cache policy.
在本申请中,通过设置映射目录信息,可以将针对映射目录信息所指示的第一目录的访问直接截获,进而通过访问为第一应用分配的缓存资源来实现数据访问,提高了访问效率,并且整个过程用户无感知。In this application, by setting the mapping directory information, the access to the first directory indicated by the mapping directory information can be directly intercepted, and then the data access can be realized by accessing the cache resource allocated for the first application, which improves the access efficiency, and The user is not aware of the whole process.
在一种可能的实现方式中,所述方法还包括:获取多个应用中每个应用的缓存资源中待迁移至所述存储系统的数据的带宽需求,所述多个应用包括所述第一应用;根据所述带宽需求,为所述第一应用的缓存资源中的待迁移数据分配IO带宽;根据所述IO带宽,将所述第一应用的缓存资源中的待迁移数据存储至所述存储系统中。In a possible implementation manner, the method further includes: acquiring the bandwidth requirements of the data to be migrated to the storage system in the cache resources of each of the multiple applications, the multiple applications including the first application; according to the bandwidth requirement, allocate IO bandwidth for the data to be migrated in the cache resource of the first application; according to the IO bandwidth, store the data to be migrated in the cache resource of the first application to the in the storage system.
在本申请中,各个计算节点在检测到自身为应用分配的缓存资源中的数据量达到第二阈值时,可以向管理节点申请分配自身所运行的应用的待迁移数据的带宽需求。管理节点可以根据收集的各个计算节点的带宽需求,为各个计算节点所运行的应用分配用于迁移待迁移数据的IO带宽,以此来控制各个计算节点向存储系统迁移数据的数据量,从而避免不同计算节点的应用数据访问量超过存储系统的可用带宽进而产生I/O带宽竞争,实现了全局视图中各应用有序访问存储系统,从而减少了因IO竞争导致的应用性能问题。并且,本申请实施例中根据用户指定的映射目录信息,集群系统可以自动完成数据拷贝,无需用户自行操作来完成数据拷贝,降低了用户的操作复杂度。In this application, when each computing node detects that the amount of data in the cache resources allocated by itself for the application reaches the second threshold, it may apply to the management node for allocating the bandwidth requirements of the data to be migrated for the application it is running. According to the collected bandwidth requirements of each computing node, the management node can allocate the IO bandwidth for migrating the data to be migrated to the application running on each computing node, so as to control the data volume of each computing node migrating data to the storage system, thereby avoiding The application data access volume of different computing nodes exceeds the available bandwidth of the storage system, resulting in I/O bandwidth competition. This enables applications in the global view to access the storage system in an orderly manner, thereby reducing application performance problems caused by IO competition. Moreover, in the embodiment of the present application, according to the mapping directory information specified by the user, the cluster system can automatically complete the data copy without the user's own operation to complete the data copy, which reduces the complexity of the user's operation.
第二方面,提供了一种数据访问方法,所述方法包括:管理节点接收用户提交的第一应用的缓存配置请求,所述缓存配置请求包括缓存策略和映射目录信息,所述缓存策略用于指示所述第一应用的缓存需求,所述映射目录信息为存储系统中存储的所述第一应用的应用数 据所在的第一目录的信息;所述管理节点根据所述缓存策略,从目标计算节点中为所述第一应用调度缓存资源;所述管理节点根据所述映射目录信息,控制所述目标计算节点将所述第一应用的应用数据预取至所述第一应用的缓存资源中,并通过所述缓存策略,控制所述目标计算节点在所述第一应用的运行过程中,访问所述第一应用的缓存资源。In a second aspect, a data access method is provided, the method includes: a management node receives a cache configuration request of a first application submitted by a user, the cache configuration request includes a cache policy and mapping directory information, and the cache policy is used for Indicating the caching requirements of the first application, the mapping directory information is the information of the first directory where the application data of the first application stored in the storage system is located; the management node calculates from the target according to the caching policy A cache resource is scheduled for the first application in the node; the management node controls the target computing node to prefetch the application data of the first application into the cache resource of the first application according to the mapping directory information , and through the cache policy, control the target computing node to access the cache resources of the first application during the running process of the first application.
在本申请中,管理节点根据用户提交的针对第一应用的缓存策略为第一应用调度缓存资源,并根据用户提交的映射目录信息控制计算节点将数据预取至第一应用的缓存资源中。后续,在第一应用运行的过程中,控制计算节点根据该缓存策略来访问第一应用的缓存资源。由此可见,本申请实施例可以感知用户的需求,进而根据用户的需求来控制应用的资源使用情况,从而提升应用性能。In this application, the management node schedules cache resources for the first application according to the cache policy submitted by the user for the first application, and controls the computing node to prefetch data into the cache resources of the first application according to the mapping directory information submitted by the user. Subsequently, during the running of the first application, the control computing node accesses the cache resource of the first application according to the cache policy. It can be seen that, the embodiment of the present application can sense the user's demand, and then control the resource usage of the application according to the user's demand, thereby improving the application performance.
在一种可能的实现方式中,所述管理节点根据所述缓存策略,从目标计算节点中为所述第一应用调度缓存资源,包括:所述管理节点从所述缓存策略中获取所述第一应用的多个任务中每个任务的资源需求信息,所述资源需求信息包括每个任务所需的缓存空间的大小和包括的存储介质的类型;所述管理节点根据所述资源需求信息分配执行所述第一应用的各个任务的目标计算节点;所述管理节点向所述目标计算节点发送所述缓存策略,以指示所述目标计算节点根据所述缓存策略中的资源需求信息,从自身的缓存空间中为相应任务分配缓存空间。In a possible implementation manner, the management node schedules cache resources for the first application from the target computing node according to the cache policy, including: the management node obtains the first application from the cache policy. The resource requirement information of each task among the multiple tasks of an application, the resource requirement information includes the size of the buffer space required by each task and the type of the storage medium included; the management node allocates according to the resource requirement information A target computing node that executes each task of the first application; the management node sends the caching policy to the target computing node to instruct the target computing node to, according to the resource requirement information in the caching policy, from itself Allocate cache space for the corresponding tasks in the cache space.
在本申请中,管理节点可以根据用户指定的缓存策略来控制第一应用对计算节点的资源使用情况,以此实现用户对计算节点的资源使用情况的控制,从而使得第一应用的应用性能能够更好的满足用户的需求。In this application, the management node can control the resource usage of the computing node by the first application according to the cache policy specified by the user, so as to realize the user's control of the resource usage of the computing node, so that the application performance of the first application can be Better meet the needs of users.
在一种可能的实现方式中,所述映射目录信息包括所述第一目录的目录路径,所述管理节点根据所述映射目录信息,控制所述目标计算节点将所述第一应用的应用数据预取至所述第一应用的缓存资源中的实现过程可以为:所述管理节点向所述目标计算节点发送所述第一目录的目录路径,以指示所述目标计算节点根据所述第一目录的目录路径,从所述存储系统中预取所述第一目录下存储的各个任务的子目录下的数据,并将获取的数据存储至所述第一应用的缓存资源中。In a possible implementation manner, the mapping directory information includes a directory path of the first directory, and the management node controls the target computing node to store the application data of the first application according to the mapping directory information The implementation process of prefetching to the cache resource of the first application may be: the management node sends the directory path of the first directory to the target computing node, so as to instruct the target computing node to The directory path of the directory is to prefetch the data under the subdirectory of each task stored under the first directory from the storage system, and store the obtained data into the cache resource of the first application.
在本申请中,管理节点通过用户指定的映射目录信息控制计算节点将第一应用的数据预取至为第一应用分配的缓存资源中,这样,无需用户自行进行显式的数据拷贝,降低了用户使用复杂度。In this application, the management node controls the computing node to prefetch the data of the first application into the cache resources allocated for the first application through the mapping directory information specified by the user. In this way, the user does not need to perform explicit data copying, reducing the user complexity.
在一种可能的实现方式中,所述方法还包括:所述管理节点接收多个计算节点发送的各个应用的缓存资源中待迁移至所述存储系统的数据的带宽需求,所述多个计算节点包括所述目标计算节点;根据所述带宽需求,为所述第一应用的缓存资源中的待迁移数据分配IO带宽;向所述目标计算节点发送为所述第一应用分配的IO带宽,以指示所述目标计算节点根据为所述第一应用分配的IO带宽,将所述第一应用的缓存资源中的待迁移数据存储至所述存储系统中。In a possible implementation manner, the method further includes: the management node receiving the bandwidth requirements of the data to be migrated to the storage system in the cache resources of each application sent by the multiple computing nodes, and the multiple computing nodes The node includes the target computing node; according to the bandwidth requirement, allocate IO bandwidth for the data to be migrated in the cache resource of the first application; send the IO bandwidth allocated for the first application to the target computing node, Instructing the target computing node to store the data to be migrated in the cache resource of the first application in the storage system according to the IO bandwidth allocated for the first application.
在本申请中,管理节点可以根据收集的各个计算节点的带宽需求,为各个计算节点所运行的应用分配用于迁移待迁移数据的IO带宽,以此来控制各个计算节点向存储系统迁移数据的数据量,从而避免不同计算节点的应用数据访问量超过存储系统的可用带宽进而产生I/O带宽竞争,实现了全局视图中各应用有序访问存储系统,从而减少了因IO竞争导致的应用性能问题。In this application, the management node can allocate the IO bandwidth for migrating the data to be migrated to the application running on each computing node according to the collected bandwidth requirements of each computing node, so as to control the process of migrating data from each computing node to the storage system. The amount of data, so as to prevent the application data access volume of different computing nodes from exceeding the available bandwidth of the storage system, resulting in I/O bandwidth competition, and realize orderly access to the storage system by applications in the global view, thereby reducing application performance caused by IO competition question.
第三方面,提供了一种数据访问方法,所述方法包括:计算节点接收用户指定的第一应用的缓存策略和映射目录信息,所述缓存策略用于指示所述第一应用的缓存需求,所述映射目录信息为存储系统中存储的所述第一应用的应用数据所在的第一目录的信息;根据所述缓存策略,为所述第一应用分配缓存资源,根据所述映射目录信息,将所述第一应用的应用数据预取至所述第一应用的缓存资源中;在运行所述第一应用的过程中,根据所述缓存策略,访问所述第一应用的缓存资源。In a third aspect, a data access method is provided, the method includes: a computing node receives a caching policy and mapping directory information of a first application specified by a user, the caching policy is used to indicate a caching requirement of the first application, The mapping directory information is the information of the first directory where the application data of the first application stored in the storage system is located; according to the cache policy, allocate cache resources for the first application, and according to the mapping directory information, Prefetch the application data of the first application into the cache resource of the first application; and access the cache resource of the first application according to the cache policy during the running of the first application.
在本申请中,计算节点能够根据用户指定的第一应用的缓存策略为第一应用分配对应的缓存资源,从而使得第一应用对计算节点的资源使用情况符合用户要求,进而使得第一应用的应用性能能够满足用户需求。在此基础上,在运行第一应用的过程中,可以直接在该计算节点为该第一应用分配的缓存资源中进行数据访问,减少了对存储系统的访问,从而减少了计算节点之间的竞争。并且,在为第一应用分配缓存资源之后,计算节点可以根据映射目录信息将存储系统中第一目录下的第一应用的应用数据预取至第一缓存空间中,无需用户进行人工数据拷贝,降低了操作复杂度。In this application, the computing node can allocate corresponding cache resources for the first application according to the caching policy of the first application specified by the user, so that the resource usage of the computing node by the first application meets the user's requirements, and then the first application's Application performance can meet user needs. On this basis, in the process of running the first application, data access can be directly performed in the cache resources allocated by the computing node for the first application, reducing the access to the storage system, thereby reducing the communication between computing nodes. compete. Moreover, after allocating cache resources for the first application, the computing node can prefetch the application data of the first application under the first directory in the storage system into the first cache space according to the mapping directory information, without manual data copying by the user. Reduced operational complexity.
在一种可能的实现方式中,在根据所述缓存策略,为所述第一应用分配缓存资源时,所述计算节点从所述缓存策略中获取所述第一应用的多个任务中每个任务的资源需求信息,所述资源需求信息包括每个任务所需的缓存空间的大小和包括的存储介质的类型;根据每个任务的资源需求信息,在自身的缓存资源中为自身所运行的第一任务分配缓存空间,所述第一任务为在所述计算节点上运行的所述多个任务中的任一个任务。In a possible implementation manner, when allocating cache resources for the first application according to the cache policy, the computing node obtains each of the multiple tasks of the first application from the cache policy The resource requirement information of the task, the resource requirement information includes the size of the cache space required by each task and the type of storage medium included; A cache space is allocated to a first task, where the first task is any one of the multiple tasks running on the computing node.
在一种可能的实现方式中,所述根据所述映射目录信息,将所述第一应用的应用数据预取至所述第一应用的缓存资源中的实现过程包括:确定所述第一任务对应的子目录的目录标识;根据所述第一目录的目录路径和所述第一任务对应的子目录的目录标识,从存储系统中获取所述第一目录下存储的所述第一任务对应的子目录下的数据;将所述第一任务对应的子目录下的数据存储至所述第一任务的缓存空间中。In a possible implementation manner, the implementation process of prefetching the application data of the first application into the cache resource of the first application according to the mapping directory information includes: determining that the first task The directory identifier of the corresponding subdirectory; according to the directory path of the first directory and the directory identifier of the subdirectory corresponding to the first task, obtain the first task corresponding to the first task stored in the first directory from the storage system the data under the subdirectory; storing the data under the subdirectory corresponding to the first task in the cache space of the first task.
在一种可能的实现方式中,如果所述缓存策略包括分级缓存策略,则将所述第一任务对应的子目录下的数据存储至所述第一任务的缓存空间的实现过程包括:根据所述第一任务对应的子目录下的数据的数据类型,将不同的数据存储至不同类型的存储介质中。In a possible implementation manner, if the cache policy includes a hierarchical cache policy, the implementation process of storing the data in the subdirectory corresponding to the first task in the cache space of the first task includes: according to the According to the data type of the data in the subdirectory corresponding to the first task, different data are stored in different types of storage media.
在本申请中,根据分级缓存策略缓存数据,能够使得不同类型的数据存储在合适的存储介质中,从而提高数据访问性能,节省缓存空间的资源消耗。In this application, data is cached according to a hierarchical cache policy, so that different types of data can be stored in appropriate storage media, thereby improving data access performance and saving resource consumption of cache space.
在一种可能的实现方式中,所述在运行所述第一应用的过程中,根据所述缓存策略,访问所述第一应用的缓存资源的实现过程可以包括:获取IO请求,如果所述IO请求所访问的数据为所述映射目录信息所指示的所述第一目录下的数据,则根据所述IO请求和所述缓存策略,访问所述第一应用的缓存资源。In a possible implementation manner, in the process of running the first application, according to the cache policy, the implementation process of accessing the cache resources of the first application may include: obtaining an IO request, if the The data accessed by the IO request is the data under the first directory indicated by the mapping directory information, and the cache resource of the first application is accessed according to the IO request and the cache policy.
在本申请中,通过设置映射目录信息,可以将针对映射目录信息所指示的第一目录的访问直接截获,进而通过访问为第一应用分配的缓存资源来实现数据访问,提高了访问效率,并且整个过程用户无感知。In this application, by setting the mapping directory information, the access to the first directory indicated by the mapping directory information can be directly intercepted, and then the data access can be realized by accessing the cache resource allocated for the first application, which improves the access efficiency, and The user is not aware of the whole process.
在一种可能的实现方式中,如果所述缓存策略包括数据一致性策略,则当所述计算节点对所述第一应用的缓存资源中的数据进行访问时,对所访问的数据执行加锁操作,以此来保证数据访问过程中数据的准确性。In a possible implementation manner, if the cache policy includes a data consistency policy, when the computing node accesses data in the cache resource of the first application, lock the accessed data Operation, in order to ensure the accuracy of the data in the data access process.
在一种可能的实现方式中,当所述计算节点检测到自身为所述第一应用分配的缓存资源 中的数据量达到参考阈值时,向管理节点发送所述第一应用的带宽需求,所述带宽需求用于指示将所述计算节点上所述第一应用的缓存资源中的待迁移数据迁移至存储系统所需的带宽;接收所述管理节点为所述第一应用的缓存资源中的待迁移数据分配的IO带宽,根据分配的IO带宽,将所述第一应用的缓存资源中的待迁移数据迁移至存储系统。In a possible implementation manner, when the computing node detects that the amount of data in the cache resource allocated by itself for the first application reaches a reference threshold, it sends the bandwidth requirement of the first application to the management node, so The bandwidth requirement is used to indicate the bandwidth required for migrating the data to be migrated in the cache resource of the first application on the computing node to the storage system; According to the allocated IO bandwidth of the data to be migrated, the data to be migrated in the cache resource of the first application is migrated to the storage system.
在本申请中,计算节点可以通过向管理节点发送第一应用的带宽需求来请求管理节点为第一应用分配IO带宽,由于管理节点能够同时收集到各个计算节点的带宽需求,因此,根据管理节点分配的IO带宽来迁移数据时能够各个计算节点产生I/O带宽竞争,实现了全局视图中各应用有序访问存储系统,从而减少了因IO竞争导致的应用性能问题。In this application, the computing node can request the management node to allocate IO bandwidth for the first application by sending the bandwidth requirement of the first application to the management node. Since the management node can collect the bandwidth requirements of each computing node at the same time, according to the management node When the allocated IO bandwidth is used to migrate data, each computing node can generate I/O bandwidth competition, realizing orderly access to the storage system by applications in the global view, thereby reducing application performance problems caused by IO competition.
第四方面,提供了一种数据访问装置,所述数据访问装置具有实现上述第一方面中数据访问方法行为的功能。所述数据访问装置包括至少一个模块,该至少一个模块用于实现上述第一方面所提供的数据访问方法。In a fourth aspect, a data access device is provided, and the data access device has the function of implementing the behavior of the data access method in the first aspect above. The data access device includes at least one module, and the at least one module is used to implement the data access method provided in the first aspect above.
第五方面,提供了一种数据访问装置,所述数据访问装置具有实现上述第二方面中数据访问方法行为的功能,所述数据访问装置包括至少一个模块,该至少一个模块用于实现上述第二方面所提供的数据访问方法。In the fifth aspect, a data access device is provided, the data access device has the function of realizing the behavior of the data access method in the second aspect above, and the data access device includes at least one module, and the at least one module is used to realize the above first The data access method provided by the second aspect.
第六方面,提供了一种数据访问装置,所述数据访问装置具有实现上述第三方面中数据访问方法行为的功能,所述数据访问装置包括至少一个模块,该至少一个模块用于实现上述第三方面所提供的数据访问方法。In the sixth aspect, a data access device is provided, the data access device has the function of realizing the behavior of the data access method in the above third aspect, and the data access device includes at least one module, and the at least one module is used to realize the above-mentioned first Data access methods provided by three aspects.
第七方面,提供了一种集群系统,所述集群系统包括管理节点和计算节点,所述管理节点和所述计算节点均包括处理器和存储器,所述存储器用于存储支持所述集群系统执行上述第一方面所提供的数据访问方法的程序,以及存储用于实现上述第一方面所提供的数据访问方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。In a seventh aspect, a cluster system is provided, the cluster system includes a management node and a computing node, the management node and the computing node both include a processor and a memory, and the memory is used to store and support the execution of the cluster system The program of the data access method provided by the first aspect above, and storing the data involved in implementing the data access method provided by the first aspect above. The processor is configured to execute programs stored in the memory.
第八方面,提供了一种管理节点,所述管理节点的结构中包括处理器和存储器,所述存储器用于存储支持所述管理节点执行上述第二方面所提供的数据访问方法的程序,以及存储用于实现上述第二方面所提供的数据访问方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。The eighth aspect provides a management node, the structure of the management node includes a processor and a memory, and the memory is used to store a program that supports the management node to execute the data access method provided in the second aspect above, and The data involved in implementing the data access method provided by the second aspect above is stored. The processor is configured to execute programs stored in the memory.
第九方面,提供了一种计算节点,所述计算节点的结构中包括处理器和存储器,所述存储器用于存储支持所述计算节点执行上述第三方面所提供的数据访问方法的程序,以及存储用于实现上述第三方面所提供的数据访问方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。A ninth aspect provides a computing node, the structure of the computing node includes a processor and a memory, and the memory is used to store a program that supports the computing node to execute the data access method provided in the third aspect above, and The data involved in implementing the data access method provided by the above third aspect is stored. The processor is configured to execute programs stored in the memory.
第十方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面或第二方面或第三方面所述的数据访问方法。In a tenth aspect, a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the above-mentioned first aspect or the second aspect or the third aspect. The data access methods described above.
第十一方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面或第二方面或第三方面所述的数据访问方法。In an eleventh aspect, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to execute the data access method described in the first aspect or the second aspect or the third aspect.
附图说明Description of drawings
图1是本申请实施例提供的一种数据中心的系统架构图;FIG. 1 is a system architecture diagram of a data center provided in an embodiment of the present application;
图2是本申请实施例提供的一种计算机设备的方法流程图;Fig. 2 is a method flowchart of a computer device provided by an embodiment of the present application;
图3是本申请实施例提供的一种数据访问方法的流程图;FIG. 3 is a flow chart of a data access method provided by an embodiment of the present application;
图4是本申请实施例提供的一种数据访问装置的结构示意图;Fig. 4 is a schematic structural diagram of a data access device provided by an embodiment of the present application;
图5是本申请实施例提供的另一种数据访问装置的结构示意图;FIG. 5 is a schematic structural diagram of another data access device provided by an embodiment of the present application;
图6是本申请实施例提供的又一种数据访问装置的结构示意图。FIG. 6 is a schematic structural diagram of another data access device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了便于理解,首先对本申请实施例涉及的系统架构予以介绍。For ease of understanding, the system architecture involved in the embodiment of the present application is firstly introduced.
本申请提供的数据访问方法可以应用于数据中心,该数据中心可以为多个用户提供共享的应用执行环境。其中,该数据中心中运行的应用可以为诸如高性能计算应用、大数据应用等数据密集型应用。The data access method provided by the present application can be applied to a data center, and the data center can provide a shared application execution environment for multiple users. Wherein, the applications running in the data center may be data-intensive applications such as high-performance computing applications and big data applications.
示例性地,参见图1,该数据中心包括集群系统10和存储系统11,且该集群系统10和存储系统11建立有通信连接。其中,集群系统10用于为多个应用的提供执行环境,存储系统11用于存储该多个应用的应用数据。For example, referring to FIG. 1 , the data center includes a cluster system 10 and a storage system 11 , and a communication connection is established between the cluster system 10 and the storage system 11 . Wherein, the cluster system 10 is used to provide an execution environment for multiple applications, and the storage system 11 is used to store application data of the multiple applications.
参见图1,该集群系统10可以包括管理节点101和多个计算节点102,且该管理节点101和每个计算节点102可以通过有线网络或者无线网络进行通信,并且,各个计算节点102之间也可以通过有线网络或者无线网络进行通信。在本申请实施例中,该管理节点101用于根据用户指定的某个应用的缓存策略,为该应用分配用于执行该应用的计算节点102,并将该缓存策略和用户指定的映射目录信息下发至该计算节点102。Referring to FIG. 1, the cluster system 10 may include a management node 101 and a plurality of computing nodes 102, and the management node 101 and each computing node 102 may communicate through a wired network or a wireless network, and each computing node 102 is also Communication can be performed via a wired network or a wireless network. In the embodiment of the present application, the management node 101 is used to assign a computing node 102 for executing the application to the application according to the caching policy specified by the user, and combine the caching policy and the mapping directory information specified by the user sent to the computing node 102.
计算节点102在接收到管理节点101下发的用户指定的缓存策略和映射目录信息之后,根据该缓存策略从自身的缓存资源中为该应用分配缓存资源,并根据该映射目录信息,将存储系统11中存储的应用的数据预取至该应用的缓存资源中。之后,运行该应用,并在该应用的运行过程中,根据该缓存策略访问该应用的缓存资源。其中,计算节点102自身的缓存资源是指该计算节点102包括的存储介质。示例性地,该计算节点102自身的缓存资源可以包括自身的动态随机访问内存(dynamic random access memory,DRAM)、大容量存储级内存(storage class memory,SCM)、固态硬盘(solid storage disk,SSD)等类型的存储介质,本申请实施例对此不做限定。After receiving the cache policy and mapping directory information specified by the user from the management node 101, the computing node 102 allocates cache resources for the application from its own cache resources according to the cache policy, and according to the mapping directory information, the storage system The data of the application stored in step 11 is prefetched into the cache resource of the application. After that, run the application, and access the cache resources of the application according to the cache policy during the running of the application. Wherein, the cache resource of the computing node 102 itself refers to a storage medium included in the computing node 102 . Exemplarily, the cache resource of the computing node 102 itself may include its own dynamic random access memory (dynamic random access memory, DRAM), large-capacity storage class memory (storage class memory, SCM), solid-state hard disk (solid storage disk, SSD) ) and other types of storage media, which are not limited in this embodiment of the present application.
需要说明的是,管理节点102为该应用分配的执行该应用的计算节点102的数量可以为多个,这样,每个计算节点102可以用于运行该应用的一个或多个任务。It should be noted that the number of computing nodes 102 that the management node 102 assigns to the application to execute the application can be multiple, so that each computing node 102 can be used to run one or more tasks of the application.
通过上述方法,管理节点101可以根据用户需求为不同用户所要运行的各个应用调度计算节点102中缓存资源,从而控制相应的计算节点102运行对应的应用。Through the above method, the management node 101 can schedule cache resources in the computing nodes 102 for various applications to be run by different users according to user requirements, thereby controlling the corresponding computing nodes 102 to run corresponding applications.
在计算节点102运行应用的过程中,当检测到某个应用的缓存资源中缓存的数据量达到第二阈值之后,计算节点102可以向管理节点101发送该应用的缓存资源中待迁移至存储系统11中的数据的带宽需求,以请求管理节点101为该应用的待迁移数据分配IO带宽。When the computing node 102 is running an application, after detecting that the amount of cached data in the cache resource of a certain application reaches the second threshold, the computing node 102 may send the cache resource of the application to be migrated to the storage system to the management node 101 11 to request the management node 101 to allocate IO bandwidth for the application data to be migrated.
管理节点101在接收到一个或多个计算节点102发送的各个应用的带宽需求之后,可以根据该带宽需求为各个应用的待迁移数据分配IO带宽,并将分配的IO带宽下发至对应的计算节点102。相应地,计算节点102在接收到管理节点101为应用的待迁移数据分配的IO带宽之后,可以根据该IO带宽将应用的待迁移数据发送至存储系统11进行存储。After receiving the bandwidth requirements of each application sent by one or more computing nodes 102, the management node 101 can allocate IO bandwidth for the data to be migrated of each application according to the bandwidth requirement, and deliver the allocated IO bandwidth to the corresponding computing nodes. Node 102. Correspondingly, after receiving the IO bandwidth allocated by the management node 101 for the application data to be migrated, the computing node 102 may send the application data to be migrated to the storage system 11 for storage according to the IO bandwidth.
其中,存储系统11包括多个存储节点111。其中,各个存储节点111与各个计算节点102之间可以进行有线或者无线通信。各个存储节点111用于接收计算节点102的IO请求,其中,当该IO请求为计算节点102根据映射目录信息发送的读请求时,存储节点111根据该读请求 获取应用的数据返回至计算节点102,以便计算节点102将应用的数据缓存至为应用分配的缓存资源中。当该IO请求为携带有应用的待迁移数据的写请求时,存储节点111可以根据该写请求对待迁移数据进行持久化存储。Wherein, the storage system 11 includes multiple storage nodes 111 . Wherein, wired or wireless communication may be performed between each storage node 111 and each computing node 102 . Each storage node 111 is used to receive the IO request of the computing node 102, wherein, when the IO request is a read request sent by the computing node 102 according to the mapping directory information, the storage node 111 obtains application data according to the read request and returns it to the computing node 102 , so that the computing node 102 caches the data of the application in the cache resource allocated for the application. When the IO request is a write request carrying application data to be migrated, the storage node 111 may persistently store the data to be migrated according to the write request.
需要说明的是,在一种可能实现方式中,存储节点111可以包括控制单元、网卡和多个存储设备。其中,控制单元用于通过网卡与计算节点102进行通信,并根据计算节点102的IO请求访问多个存储设备。其中,多个存储设备可以包括大容量存储级内存(storage class memory,SCM)、固态硬盘(solid storage disk,SSD)等类型的存储设备,本申请实施例对此不做限定。It should be noted that, in a possible implementation manner, the storage node 111 may include a control unit, a network card, and multiple storage devices. Wherein, the control unit is used for communicating with the computing node 102 through the network card, and accessing multiple storage devices according to the IO request of the computing node 102 . Wherein, the plurality of storage devices may include large-capacity storage class memory (storage class memory, SCM), solid storage disk (solid storage disk, SSD) and other types of storage devices, which is not limited in this embodiment of the present application.
可选地,在本申请实施例中,该数据中心还可以为用户提供用于提交缓存策略和映射目录信息的登录节点。用户通过该登录节点将所要运行的应用的缓存策略和映射目录信息提交至管理节点101,以便管理节点101根据该应用的缓存策略和映射目录信息为该应用调度资源。Optionally, in this embodiment of the application, the data center may also provide users with a login node for submitting cache policies and mapping directory information. The user submits the cache policy and mapping directory information of the application to be run to the management node 101 through the login node, so that the management node 101 schedules resources for the application according to the application cache policy and mapping directory information.
上述的管理节点101、计算节点102、存储节点111和登录节点中的每个节点可以为一台单独的计算机设备。其中,登录节点可以为终端设备,例如笔记本电脑、台式电脑、平板电脑、智能手机等。管理节点101和计算节点102可以为终端设备,也可以为服务器。存储节点111可以为服务器。Each of the above-mentioned management node 101 , computing node 102 , storage node 111 and login node may be a separate computer device. Wherein, the login node may be a terminal device, such as a laptop computer, a desktop computer, a tablet computer, a smart phone, and the like. The management node 101 and the computing node 102 may be terminal devices or servers. The storage node 111 may be a server.
图2是本申请实施例提供的一种计算机设备的结构示意图。图1所示的系统架构中的管理节点、计算节点均可以通过该计算机设备来实现。参见图2,该计算机设备可以包括一个或多个处理器201、通信总线202、主存储器203以及一个或多个通信接口204。Fig. 2 is a schematic structural diagram of a computer device provided by an embodiment of the present application. Both the management node and the computing node in the system architecture shown in FIG. 1 can be realized by the computer device. Referring to FIG. 2 , the computer device may include one or more processors 201 , a communication bus 202 , a main memory 203 and one or more communication interfaces 204 .
处理器201可以是一个通用中央处理器(central processing unit,CPU)、网络处理器(network processor,NP)、微处理器、或者可以是一个或多个用于实现本申请方案的集成电路,例如,专用集成电路(application-specific integrated circuit,ASIC)、可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD)、现场可编程逻辑门阵列(field-programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合。The processor 201 may be a general-purpose central processing unit (central processing unit, CPU), a network processor (network processor, NP), a microprocessor, or may be one or more integrated circuits for realizing the scheme of the present application, such as , application-specific integrated circuit (ASIC), programmable logic device (programmable logic device, PLD) or a combination thereof. The aforementioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL) or any combination thereof.
通信总线202用于在上述组件之间传送信息。通信总线202可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus 202 is used to transfer information between the aforementioned components. The communication bus 202 can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
主存储器203可以是只读主存储器(read-only memory,ROM),也可以是随机存取存储器(random access memory,RAM),或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。其中,当主存储器203为RAM时,该主存储器可以为动态随机存取存储器(Dynamic Random Access Memory,DRAM),或者SCM等。主存储器203可以是独立存在,并通过通信总线202与处理器201相连接。主存储器203也可以和处理器201集成在一起。The main memory 203 can be a read-only main memory (read-only memory, ROM), or a random access memory (random access memory, RAM), or can be used to carry or store desired data in the form of instructions or data structures. program code and any other medium that can be accessed by a computer, but is not limited thereto. Wherein, when the main memory 203 is RAM, the main memory may be Dynamic Random Access Memory (Dynamic Random Access Memory, DRAM), or SCM, etc. The main memory 203 may exist independently, and is connected to the processor 201 through the communication bus 202 . The main memory 203 can also be integrated with the processor 201 .
通信接口204使用任何收发器一类的装置,用于与其它设备或通信网络通信。通信接口204包括有线通信接口,还可以包括无线通信接口。其中,有线通信接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线通信接口可以为无线局域网(wireless local area networks,WLAN)接口,蜂窝网络通信接口或其组合等。 Communication interface 204 utilizes any transceiver-like device for communicating with other devices or a communication network. The communication interface 204 includes a wired communication interface, and may also include a wireless communication interface. Wherein, the wired communication interface may be an Ethernet interface, for example. The Ethernet interface can be an optical interface, an electrical interface or a combination thereof. The wireless communication interface may be a wireless local area network (wireless local area networks, WLAN) interface, a cellular network communication interface or a combination thereof.
在一些实施例中,计算机设备还可以包括其他存储介质205,例如,其他存储介质205 可以包括机械硬盘、固态硬盘等。In some embodiments, the computer device may further include other storage media 205, for example, the other storage media 205 may include a mechanical hard disk, a solid state hard disk, and the like.
在一些实施例中,计算机设备可以包括多个处理器,如图2中所示的处理器201和处理器206。这些处理器中的每一个可以是一个单核处理器,也可以是一个多核处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。In some embodiments, a computer device may include multiple processors, such as processor 201 and processor 206 as shown in FIG. 2 . Each of these processors can be a single-core processor or a multi-core processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data such as computer program instructions.
在具体实现中,作为一种实施例,计算机设备还可以包括输出设备207和输入设备208。输出设备207和处理器201通信,可以以多种方式来显示信息。例如,输出设备207可以是液晶显示器(liquid crystal display,LCD)、发光二级管(light emitting diode,LED)显示设备、阴极射线管(cathode ray tube,CRT)显示设备或投影仪(projector)等。输入设备208和处理器201通信,可以以多种方式接收用户的输入。例如,输入设备208可以是鼠标、键盘、触摸屏设备或传感设备等。In a specific implementation, as an embodiment, the computer device may further include an output device 207 and an input device 208 . Output device 207 is in communication with processor 201 and can display information in a variety of ways. For example, the output device 207 may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, a cathode ray tube (cathode ray tube, CRT) display device, or a projector (projector), etc. . The input device 208 communicates with the processor 201 and can receive user input in various ways. For example, the input device 208 may be a mouse, a keyboard, a touch screen device, or a sensory device, among others.
在一些实施例中,主存储器203用于存储内核(kernel)、执行本申请方案的程序代码以及其他指令和数据,处理器201可以执行主存储器203中存储的程序代码。该程序代码中可以包括一个或多个软件模块,该计算机设备可以通过处理器201以及主存储器203中的程序代码,来实现下文图3实施例提供的数据访问方法。In some embodiments, the main memory 203 is used to store a kernel, program codes for executing the solution of the present application, and other instructions and data, and the processor 201 can execute the program codes stored in the main memory 203 . The program code may include one or more software modules, and the computer device may implement the data access method provided in the embodiment of FIG. 3 below through the program code in the processor 201 and the main memory 203 .
在本申请提供的数据访问方法中,用户能够针对应用灵活定制缓存策略,集群系统能够根据用户提交的缓存策略为应用调度缓存资源,也即,集群系统能够感知用户的需求,进而根据用户的需求来控制应用的资源使用情况,从而达到提升应用性能的效果。并且,集群系统可以根据用户提交的映射目录信息将数据预取至应用的缓存资源中,以此提升数据访问速度,降低了用户的使用复杂度。另外,集群系统中的管理节点能够通过收集各个计算节点的带宽需求来为计算节点上运行的应用分配IO带宽,减少了因IO竞争导致的应用性能问题。下面将结合附图对本申请实施方式作进一步地详细描述。In the data access method provided by this application, the user can flexibly customize the cache policy for the application, and the cluster system can schedule cache resources for the application according to the cache policy submitted by the user, that is, the cluster system can sense the user's needs, and then according to the user's demand To control the resource usage of the application, so as to achieve the effect of improving application performance. In addition, the cluster system can prefetch data into the cache resource of the application according to the mapping directory information submitted by the user, so as to improve the data access speed and reduce the complexity of the user's use. In addition, the management node in the cluster system can allocate IO bandwidth for applications running on the computing nodes by collecting the bandwidth requirements of each computing node, reducing application performance problems caused by IO competition. The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
图3是本申请实施例提供的一种数据访问方法的流程图。该方法可以应用于图1所示的数据中心中的集群系统中,参见图3,该方法包括以下步骤:Fig. 3 is a flow chart of a data access method provided by an embodiment of the present application. This method can be applied to the cluster system in the data center shown in Figure 1, referring to Figure 3, the method includes the following steps:
步骤301:管理节点接收用户提交的针对第一应用的缓存配置请求,该缓存配置请求包括缓存策略和映射目录信息,缓存策略用于指示第一应用的缓存需求,映射目录信息为存储系统中存储的第一应用的应用数据所在的第一目录的信息。Step 301: The management node receives a cache configuration request for the first application submitted by the user. The cache configuration request includes a cache policy and mapping directory information. The cache policy is used to indicate the cache requirements of the first application, and the mapping directory information is stored in the storage system. Information about the first directory where the application data of the first application is located.
在本申请实施例中,用户在登录节点上输入针对第一应用的缓存策略和映射目录信息。登录节点根据用户输入的缓存策略和映射目录信息,生成第一应用的缓存配置请求,并向管理节点发送该缓存配置请求。其中,该缓存配置请求携带该缓存策略和映射目录信息,第一应用是指用户所要运行的应用。相应地,管理节点接收登录节点发送的第一应用的缓存配置请求。In the embodiment of the present application, the user inputs the caching policy and mapping directory information for the first application on the login node. The login node generates a cache configuration request for the first application according to the cache policy and mapping directory information input by the user, and sends the cache configuration request to the management node. Wherein, the cache configuration request carries the cache policy and mapping directory information, and the first application refers to the application to be run by the user. Correspondingly, the management node receives the cache configuration request of the first application sent by the login node.
示例性地,登录节点上部署有命令行工具,用户可以在登录节点显示的命令行工具的命令行界面中输入第一应用的缓存策略和映射目录信息。登录节点获取用户在命令行界面中输入的第一应用的缓存策略和映射目录信息。Exemplarily, a command line tool is deployed on the login node, and the user may input the caching policy and mapping directory information of the first application in the command line interface of the command line tool displayed on the login node. The login node acquires the cache policy and mapping directory information of the first application input by the user in the command line interface.
可选地,登录节点上也可以部署有业务配置客户端,用户可以在登录节点显示的业务配置客户端的界面中输入第一应用的缓存策略和映射目录信息。相应的,登录节点可以通过该业务配置客户端获取第一应用的缓存策略和映射目录信息,进而生成第一应用的缓存配置请求。Optionally, a service configuration client may also be deployed on the login node, and the user may input the cache policy and mapping directory information of the first application in the interface of the service configuration client displayed on the login node. Correspondingly, the login node can obtain the cache policy and mapping directory information of the first application through the service configuration client, and then generate a cache configuration request of the first application.
需要说明的是,第一应用的缓存策略可以包括第一应用的资源需求信息和数据缓存和访 问策略。It should be noted that the caching policy of the first application may include resource requirement information and data caching and access policies of the first application.
在本申请实施例中,第一应用可以被划分为多个任务由多个计算节点来执行。在这种情况下,用户指定的第一应用的资源需求信息可以包括第一应用的各个任务的资源需求信息。并且,第一应用的各个任务的资源需求信息可以相同,也可以不同。其中,资源需求信息可以包括计算资源需求信息和缓存资源需求信息。该计算资源需求信息用于指示第一应用的各个任务所需的计算资源,例如,运行第一应用的各个任务所需的处理器的核数、主频等。缓存资源需求信息包括第一应用的各个任务所需的缓存空间的大小,除此之外,还可以包括第一应用的各个任务所需的缓存空间包括的存储介质的类型,例如,第一应用的各个任务所需的缓存空间可以包括DRAM、SCM两种不同的存储介质。可选地,缓存资源需求信息还可以包括第一应用的各个任务所需的缓存空间的拓扑结构,也即,组成该缓存空间的各级存储介质在相应计算节点上的拓扑结构。In the embodiment of the present application, the first application may be divided into multiple tasks to be executed by multiple computing nodes. In this case, the resource requirement information of the first application specified by the user may include resource requirement information of each task of the first application. Moreover, the resource requirement information of each task of the first application may be the same or different. Wherein, the resource requirement information may include computing resource requirement information and cache resource requirement information. The computing resource requirement information is used to indicate the computing resources required by each task of the first application, for example, the number of cores and main frequency of the processor required to run each task of the first application. The cache resource requirement information includes the size of the cache space required by each task of the first application. In addition, it may also include the type of storage medium included in the cache space required by each task of the first application. For example, the first application The cache space required by each task may include two different storage media, DRAM and SCM. Optionally, the cache resource requirement information may also include a topology structure of the cache space required by each task of the first application, that is, a topology structure of storage media at various levels constituting the cache space on corresponding computing nodes.
可选地,第一应用的资源需求信息也可以直接用于指示的第一应用的资源需求,也即,该资源需求信息非上述的任务粒度级别的资源需求信息,而是应用粒度级别的资源需求信息。Optionally, the resource requirement information of the first application may also be directly used to indicate the resource requirement of the first application, that is, the resource requirement information is not the above-mentioned resource requirement information at the task granularity level, but resource requirements at the application granularity level demand information.
数据缓存和访问策略可以用于指示对第一应用的应用数据的缓存方式和访问策略。例如,该数据缓存和访问策略可以包括分级缓存策略,用于指示将第一应用的不同类型的应用数据缓存至不同类型的存储介质中。再例如,该数据缓存和访问策略可以包括数据一致性策略,用于指示在访问第一应用的缓存资源中的任一数据时,对所访问的数据执行加锁操作,以保证数据的一致性。再例如,该数据缓存和访问策略还可以包括安全级别策略,用于指示应用的缓存资源中的数据的访问权限。上述仅是本申请实施例给出的数据缓存和访问策略中可能包括的一些策略,除此之外,该数据缓存和访问策略中还可以包括其他由用户灵活定制的策略,以更好的满足用户需求,提高应用性能。The data cache and access policy may be used to indicate the cache mode and access policy for the application data of the first application. For example, the data cache and access policy may include a hierarchical cache policy for instructing to cache different types of application data of the first application in different types of storage media. For another example, the data cache and access policy may include a data consistency policy, which is used to indicate that when accessing any data in the cache resource of the first application, a lock operation is performed on the accessed data to ensure data consistency . For another example, the data caching and access policy may also include a security level policy, which is used to indicate the access rights of the data in the cache resources of the application. The above are only some strategies that may be included in the data cache and access strategies given in the embodiment of this application. In addition, the data cache and access strategies may also include other strategies flexibly customized by users to better meet User needs, improve application performance.
另外,映射目录信息是指存储系统中存储的第一应用的应用数据所在的第一目录的信息。示例性地,该映射目录信息可以为存储系统中第一目录的目录路径。或者,该映射目录信息也可以为其他能够用于指示存储系统中第一应用的应用数据的存储位置的信息,本申请实施例对此不做限定。In addition, the mapping directory information refers to information of the first directory where the application data of the first application stored in the storage system is located. Exemplarily, the mapped directory information may be a directory path of the first directory in the storage system. Alternatively, the mapping directory information may also be other information that can be used to indicate the storage location of the application data of the first application in the storage system, which is not limited in this embodiment of the present application.
步骤302:管理节点根据该缓存策略,分配执行第一应用的目标计算节点。Step 302: The management node allocates a target computing node for executing the first application according to the caching policy.
管理节点在接收到第一应用的缓存配置请求之后,根据该缓存配置请求中的缓存策略包括的资源需求信息,从多个计算节点中分配执行第一应用的目标计算节点。After receiving the cache configuration request of the first application, the management node allocates a target computing node for executing the first application from multiple computing nodes according to the resource requirement information included in the cache policy in the cache configuration request.
示例性地,如果缓存策略中包括的是任务粒度级别的资源需求信息,则管理节点可以从缓存策略中获取第一应用的多个任务中每个任务的资源需求信息,根据该资源需求信息分配执行第一应用的各个任务的目标计算节点。Exemplarily, if the cache policy includes resource requirement information at the task granularity level, the management node may acquire the resource requirement information of each of the multiple tasks of the first application from the cache strategy, and allocate A target computing node for executing each task of the first application.
由步骤301中的介绍可知,每个任务的资源需求信息可以包括每个任务的计算资源需求信息和缓存资源需求信息。基于此,管理节点可以实时收集并更新各个计算节点的计算资源和缓存资源的使用情况,进行根据每个任务的计算资源需求信息和最近一次更新的各个计算节点的计算资源的使用情况,从多个计算节点中确定能够满足第一应用的任务运行所需的计算资源需求的候选计算节点。之后,根据每个任务的缓存资源需求信息和最近一次更新的各个候选计算节点的缓存资源的使用情况,从候选计算节点中进一步确定能够满足第一应用的任务的缓存资源需求的计算节点,将最终确定出的计算节点作为目标计算节点。It can be seen from the introduction in step 301 that the resource requirement information of each task may include computing resource requirement information and cache resource requirement information of each task. Based on this, the management node can collect and update the usage of computing resources and cache resources of each computing node in real time, based on the computing resource demand information of each task and the latest update of the usage of computing resources of each computing node. Determine a candidate computing node that can meet the computing resource requirements required by the task running of the first application among the computing nodes. Afterwards, according to the cache resource requirement information of each task and the usage of the cache resource of each candidate computing node updated last time, further determine the computing node that can meet the cache resource requirement of the task of the first application from the candidate computing nodes, and set The finally determined computing node is used as the target computing node.
例如,管理节点可以根据最近一次更新的各个计算节点上运行的应用所占用的资源,确 定各个计算节点上剩余的计算资源,进而从多个计算节点中确定剩余的计算资源满足第一应用的任务的计算资源需求的候选计算节点。之后,根据最近一次更新的各个候选计算节点的剩余缓存空间的大小以及组成剩余缓存空间的存储介质的类型,从候选计算节点中确定剩余缓存空间大于第一应用的任务所需的缓存空间大小、且剩余缓存空间包含有第一应用的任务所需的存储介质的计算节点,以得到目标计算节点。For example, the management node can determine the remaining computing resources on each computing node according to the resources occupied by the applications running on each computing node last updated, and then determine from multiple computing nodes that the remaining computing resources meet the tasks of the first application Candidate computing nodes for computing resource requirements. Afterwards, according to the size of the remaining cache space of each candidate computing node updated last time and the type of the storage medium forming the remaining cache space, determine from the candidate computing nodes that the remaining cache space is greater than the size of the cache space required by the task of the first application, And the remaining cache space includes the computing nodes of the storage medium required by the task of the first application, so as to obtain the target computing node.
可选地,管理节点也可以向根据各个任务的缓存资源需求信息从多个计算节点中确定出候选计算节点,然后再根据第一应用的各个任务的计算资源需求信息从候选计算节点中确定出目标计算节点,本申请实施例在此不再赘述。Optionally, the management node may also determine candidate computing nodes from multiple computing nodes according to the cache resource requirement information of each task, and then determine from the candidate computing nodes according to the computing resource requirement information of each task of the first application. The target computing node will not be described again in this embodiment of the present application.
值得注意的是,通过上述方法,管理节点可以确定出运行第一应用的每个任务的计算节点。其中,运行每个任务的计算节点可以不同,这样,目标计算节点将有多个。可选地,运行每个任务的计算节点也有可能为同一个目标计算节点,这样,目标计算节点将为一个。或者,部分任务可以通过一个目标计算节点来执行,部分任务可以通过另一个目标计算节点来执行,这样,目标计算节点也将有多个。It should be noted that, through the above method, the management node can determine the computing node running each task of the first application. Wherein, the computing nodes running each task can be different, so there will be multiple target computing nodes. Optionally, the computing nodes running each task may also be the same target computing node, so there will be one target computing node. Or, some tasks can be executed by one target computing node, and some tasks can be executed by another target computing node, so there will be multiple target computing nodes.
在另一种实现方式中,如果缓存策略包括的是应用粒度级别的资源需求信息,则管理节点可以直接根据该第一应用的资源需求信息,为该第一应用分配目标计算节点,实现方式可以参考前文中为每个任务分配目标计算节点的实现方式,本申请实施例在此不再赘述。In another implementation, if the caching policy includes resource requirement information at the application granularity level, the management node may directly assign a target computing node to the first application according to the resource requirement information of the first application. The implementation may be Referring to the implementation manner of allocating target computing nodes for each task in the foregoing, details are not described in this embodiment of the present application.
可选地,管理节点也可以根据第一应用的资源需求信息以及第一应用的任务划分原则,确定第一应用的多个任务中每个任务的资源需求信息,通过前文中介绍的分配目标计算节点的方法为每个任务分配目标计算节点。Optionally, the management node can also determine the resource requirement information of each of the multiple tasks of the first application according to the resource requirement information of the first application and the task division principle of the first application, and calculate The node method assigns a target compute node for each task.
步骤303:管理节点向目标计算节点发送该缓存策略和映射目录信息。Step 303: the management node sends the cache policy and mapping directory information to the target computing node.
在确定出执行第一应用的各个任务的目标计算节点之后,管理节点可以向目标计算节点下发第一应用的各个任务的缓存策略和映射目录信息,以控制目标计算节点根据该缓存策略为第一应用的各个任务分配缓存资源,并根据该映射目录信息和缓存策略来访问第一应用的缓存资源。After determining the target computing node that executes each task of the first application, the management node can deliver the caching policy and mapping directory information of each task of the first application to the target computing node, so as to control the target computing node to serve the first application according to the caching policy. Each task of an application allocates cache resources, and accesses the cache resources of the first application according to the mapping directory information and the cache policy.
可选地,当目标计算节点有多个,且各个任务的缓存策略相同时,管理节点可以向每个目标计算节点下发该缓存策略和映射目录信息。当目标计算节点有多个,且缓存策略中包含的各个任务的资源需求信息不相同时,则管理节点可以将缓存策略中包含的数据缓存和访问策略以及每个任务的资源需求信息作为相应任务的缓存策略,然后将映射目录信息和每个任务的缓存策略下发至任务对应的目标计算节点,其中,任务对应的目标计算节点运行该任务的目标计算节点。Optionally, when there are multiple target computing nodes and each task has the same cache policy, the management node may deliver the cache policy and mapping directory information to each target computing node. When there are multiple target computing nodes and the resource requirement information of each task contained in the cache policy is different, the management node can use the data cache and access policy contained in the cache policy and the resource requirement information of each task as the corresponding task cache policy, and then deliver the mapping directory information and the cache policy of each task to the target computing node corresponding to the task, wherein the target computing node corresponding to the task runs the target computing node of the task.
可选地,管理节点在向目标计算节点下发缓存策略和映射目录信息的同时,还可以向每个目标计算节点下发所要运行的任务的标识,以指示目标计算节点所要运行的是第一应用的哪个任务。其中,任务的标识能够唯一标识任务。Optionally, while delivering the cache policy and mapping directory information to the target computing nodes, the management node can also deliver the identifier of the task to be run to each target computing node, so as to indicate that the target computing node is to run the first Which task to apply. Wherein, the identifier of the task can uniquely identify the task.
当各个目标计算节点接收到管理节点发送的缓存策略和映射目录信息之后,即可以通过下述步骤304至306来运行第一应用。After each target computing node receives the cache policy and mapping directory information sent by the management node, it can run the first application through the following steps 304 to 306 .
步骤304:目标计算节点根据该缓存策略,为第一应用分配缓存资源。Step 304: The target computing node allocates cache resources for the first application according to the cache policy.
目标计算节点在接收到管理节点下发的缓存策略和映射目录信息之后,首先根据该缓存策略,为第一应用分配缓存资源。After receiving the cache policy and mapping directory information issued by the management node, the target computing node first allocates cache resources for the first application according to the cache policy.
其中,目标计算节点可以从接收到的缓存策略中获取缓存资源需求信息,进而根据该缓 存资源需求信息为自身所要执行的第一应用的任务分配缓存资源。接下来,以一个目标计算节点为例来进行说明,为了方便说明,将该目标计算节点称为第一目标计算节点。Wherein, the target computing node may obtain cache resource requirement information from the received cache policy, and then allocate cache resource for the task of the first application to be executed by itself according to the cache resource requirement information. Next, a target computing node is used as an example for description. For convenience of description, this target computing node is referred to as a first target computing node.
示例性地,例如,第一目标计算节点上运行有第一任务,则第一目标计算节点从接收到的缓存策略中获取第一任务的缓存资源需求信息,进而根据第一任务的缓存资源需求信息,在自身的缓存资源中为第一任务分配满足该缓存资源需求的缓存空间。Exemplarily, for example, if there is a first task running on the first target computing node, the first target computing node obtains the cache resource requirement information of the first task from the received cache policy, and then according to the cache resource requirement information of the first task information, and allocate a cache space that meets the requirements of the cache resource for the first task in its own cache resource.
可选地,当各个任务的缓存资源需求信息相同且一个目标计算节点上运行第一应用的一个任务时,该第一目标计算节点可以根据该缓存资源需求信息从自身的缓存资源中分配与该缓存资源需求信息所指示的大小相同的缓存空间作为第一应用的缓存空间,此时,分配的第一应用的缓存空间可能是第一目标计算节点上运行的第一应用的第一任务的缓存空间,也即,用于存储第一任务的任务数据,也可能为其他目标计算节点上运行的第一应用的其他任务的缓存空间,也即,用于存储其他任务的任务数据。Optionally, when the cache resource requirement information of each task is the same and a task of the first application is run on a target computing node, the first target computing node may allocate the cache resources corresponding to the cache resource according to the cache resource requirement information. The cache space of the same size indicated by the cache resource requirement information is used as the cache space of the first application. At this time, the allocated cache space of the first application may be the cache of the first task of the first application running on the first target computing node. The space, that is, for storing task data of the first task, may also be a cache space for other tasks of the first application running on other target computing nodes, that is, for storing task data of other tasks.
各个目标计算节点根据管理节点下发的缓存策略为第一应用的各个任务分配缓存空间,这样,位于各个目标计算节点上的第一应用的各个任务的缓存空间即组成了第一应用的缓存资源。Each target computing node allocates cache space for each task of the first application according to the cache policy issued by the management node, so that the cache space of each task of the first application located on each target computing node constitutes the cache resource of the first application .
可选地,如果缓存策略中的资源需求信息是应用粒度级别的资源需求信息,且管理节点直接将该第一应用的资源需求信息下发至了目标计算节点,则目标计算节点将有一个,在这种情况下,该目标计算节点在接收到第一应用的缓存资源需求信息之后,可以根据该缓存资源需求信息从自身的缓存资源中为第一应用分配缓存空间。这样,第一应用的缓存资源将位于一个计算节点上。Optionally, if the resource requirement information in the cache policy is resource requirement information at the application granularity level, and the management node directly delivers the resource requirement information of the first application to the target computing node, then the target computing node will have one, In this case, after receiving the cache resource requirement information of the first application, the target computing node may allocate cache space for the first application from its own cache resources according to the cache resource requirement information. In this way, the cache resource of the first application will be located on one computing node.
步骤305:目标计算节点根据映射目录信息,将第一应用的应用数据预取至第一应用的缓存资源中。Step 305: The target computing node prefetches the application data of the first application into the cache resource of the first application according to the mapping directory information.
在为第一应用分配对应的缓存资源之后,目标计算节点可以根据映射目录信息,从存储系统中获取第一应用的应用数据,进而将该应用数据缓存至第一应用的缓存资源中。接下来仍以第一目标计算节点为例进行说明。After allocating the corresponding cache resource for the first application, the target computing node may obtain the application data of the first application from the storage system according to the mapping directory information, and then cache the application data in the cache resource of the first application. Next, the first target computing node is still taken as an example for illustration.
在第一种可能的情况中,如果第一目标计算节点为自身所执行的第一应用的第一任务分配了缓存空间,且映射目录信息为存储系统中第一目录的目录路径,则第一目标计算节点可以确定第一任务对应的子目录的目录标识,根据该第一目录的目录路径和第一任务对应的子目录的目录标识,从存储系统中获取第一目录下存储的第一任务对应的子目录下的数据,进而将获取到的第一任务对应的子目录下的数据存储至为第一任务分配的缓存空间中。In the first possible situation, if the first target computing node allocates cache space for the first task of the first application executed by itself, and the mapping directory information is the directory path of the first directory in the storage system, then the first The target computing node may determine the directory identifier of the subdirectory corresponding to the first task, and obtain the first task stored in the first directory from the storage system according to the directory path of the first directory and the directory identifier of the subdirectory corresponding to the first task. The data under the corresponding subdirectory, and then store the acquired data under the subdirectory corresponding to the first task in the cache space allocated for the first task.
其中,第一目标计算节点可以根据第一任务的任务标识,从预设的任务标识与子目录的目录标识中获取第一任务对应的子目录的目录标识。或者,第一目标计算节点也可以根据第一任务的任务标识,采用预设的规则生成第一任务对应的子目录的目录标识。例如,第一任务的任务编号为1,生成任务对应的子目录的目录标识的预设规则为processor+任务编号,则根据该预设规则可以得到第一任务对应的子目录的目录标识为processor 1。Wherein, the first target computing node may obtain the directory identifier of the subdirectory corresponding to the first task from preset task identifiers and directory identifiers of subdirectories according to the task identifier of the first task. Alternatively, the first target computing node may also generate the directory identifier of the subdirectory corresponding to the first task by using a preset rule according to the task identifier of the first task. For example, the task number of the first task is 1, and the default rule for generating the directory identifier of the subdirectory corresponding to the task is processor+task number, then according to the preset rule, the directory identifier of the subdirectory corresponding to the first task can be obtained as processor 1 .
之后,第一目标计算节点可以按照第一目录的目录路径,从存储系统存储的第一目录下获取与第一任务对应的子目录的目录标识相同的子目录下的数据,也即,第一任务的任务数据,之后,将该第一任务的任务数据存储至第一任务的缓存空间中。Afterwards, the first target computing node can obtain the data under the subdirectory with the same directory identifier as the subdirectory corresponding to the first task from the first directory stored in the storage system according to the directory path of the first directory, that is, the first The task data of the task, and then, store the task data of the first task in the cache space of the first task.
需要说明的是,在将第一任务的任务数据存储至第一任务的缓存空间时,如果缓存策略中还包括数据缓存和访问策略,且数据缓存和访问策略中包含分级缓存策略时,第一目标计 算节点还可以根据第一任务的任务数据的数据类型,将不同的数据存储至不同类型的存储介质中。It should be noted that when storing the task data of the first task in the cache space of the first task, if the cache policy also includes a data cache and access policy, and the data cache and access policy includes a hierarchical cache policy, the first The target computing node may also store different data in different types of storage media according to the data type of the task data of the first task.
例如,将第一任务的任务数据中访问频次高于第一阈值的热点数据存储至性能较高的存储器(也可以称为存储介质)中,而将访问频次比较低的数据存储至性能相对较弱的存储介质中。例如,可以将元数据和除元数据之外的其他数据存储至不同类型的存储介质中。其中,第一阈值可以根据业务需求设置,可以根据任务数据的处理效率设定,也可以为经验值,还可以是根据系统处理能力进行设置。For example, among the task data of the first task, the hotspot data whose access frequency is higher than the first threshold is stored in a memory with higher performance (also referred to as a storage medium), and the data with a lower access frequency is stored in a memory with a relatively lower performance. weak storage media. For example, metadata and other data other than metadata may be stored in different types of storage media. Wherein, the first threshold may be set according to business requirements, may be set according to task data processing efficiency, may also be an experience value, or may be set according to system processing capability.
另外,上述第一目标计算节点所执行的第一应用的任务可能为一个,也可能为多个,当第一目标计算节点执行第一应用的多个任务时,则可以参考上述方式将每个要执行的任务对应的子目录下的数据预取至相应任务对应的缓存空间中。In addition, there may be one or multiple tasks of the first application executed by the above-mentioned first target computing node. When the first target computing node executes multiple tasks of the first application, each The data under the subdirectory corresponding to the task to be executed is prefetched into the cache space corresponding to the corresponding task.
在第二种可能的情况中,如果各个任务的缓存资源需求信息相同,各个目标计算节点从自身的缓存资源中分配了与该缓存资源需求信息所指示的空间大小相同的缓存空间,则第一目标计算节点可以从存储系统中获取映射目录信息所指示的第一目录下的数据,之后,对获取到的数据的目录路径执行哈希运算,得到数据对应的哈希值。从多个目标计算节点中确定节点标识与该哈希值相匹配的目标计算节点。如果节点标识与该哈希值相匹配的目标计算节点为自身,则将该数据存储至自身为第一应用分配的缓存空间中。如果节点标识与该哈希值相匹配的目标计算节点为其他目标计算节点,例如,为第二目标计算节点,则第一目标计算节点可以将该数据发送至与第二目标计算节点,第二目标计算节点在接收到该数据之后,将该数据存储至自身为第一应用分配的缓存空间中。In the second possible situation, if the cache resource requirement information of each task is the same, and each target computing node allocates the same cache space from its own cache resource as the space indicated by the cache resource requirement information, then the first The target computing node may obtain the data under the first directory indicated by the mapping directory information from the storage system, and then perform a hash operation on the directory path of the obtained data to obtain a hash value corresponding to the data. A target computing node whose node ID matches the hash value is determined from among the plurality of target computing nodes. If the node identifies the target computing node matching the hash value as itself, then store the data in the cache space allocated by itself for the first application. If the node identifies that the target computing node matching the hash value is another target computing node, for example, the second target computing node, the first target computing node may send the data to the second target computing node, and the second target computing node After receiving the data, the target computing node stores the data in the cache space allocated by itself for the first application.
其中,在将数据存储至为第一应用分配的缓存空间中时,同样可以参考前述介绍的方法,按照数据缓存和访问策略中包含的分级缓存策略,将该数据存储至对应类型的存储介质中。Wherein, when storing the data in the cache space allocated for the first application, you can also refer to the method described above, and store the data in the corresponding type of storage medium according to the hierarchical cache policy included in the data cache and access policy .
在第三种可能的情况中,如果目标计算节点根据应用粒度级别的第一应用的缓存资源信息为第一应用分配了缓存空间,则该目标计算节点可以直接从存储系统中获取该映射目录信息所指示的第一目录下的数据,并将该数据存储至为第一应用分配的缓存空间中。In the third possible situation, if the target computing node allocates cache space for the first application according to the cache resource information of the first application at the application granularity level, the target computing node can directly obtain the mapping directory information from the storage system The data under the indicated first directory is stored in the cache space allocated for the first application.
上述是本申请实施例给出的几种预取第一应用的应用数据的可能实现方式。可选地,目标计算节点还可以采用多副本机制预取第一应用的各个任务的任务数据,或者,采用其他实现方式来预取第一应用的数据,本申请实施例对此不做限定。The foregoing are several possible implementation manners of prefetching application data of the first application given in the embodiments of the present application. Optionally, the target computing node may also use a multi-copy mechanism to prefetch task data of each task of the first application, or use other implementation manners to prefetch data of the first application, which is not limited in this embodiment of the present application.
另外,值得注意的是,上述从存储系统的第一目录中预取到的数据可以是第一目录中的全部数据,也可以是第一目录中的部分数据。对于各个任务而言,预取到的可能是任务的全部数据,也可能是任务的部分数据,本申请实施例对此也不做限定。其中,当预取的是部分数据时,可以根据数据的访问频次或者是其他能够指示数据重要程度的信息来预取较为重要的数据。In addition, it should be noted that the data prefetched from the first directory of the storage system may be all data in the first directory, or may be part of the data in the first directory. For each task, what is prefetched may be all data of the task, or part of the data of the task, which is not limited in this embodiment of the present application. Wherein, when prefetching is partial data, more important data may be prefetched according to the access frequency of the data or other information that can indicate the importance of the data.
步骤306:目标计算节点在运行第一应用的过程中,根据缓存策略,访问第一应用的缓存资源。Step 306: During the running of the first application, the target computing node accesses the cache resource of the first application according to the cache policy.
通过步骤304和步骤305为第一应用分配缓存资源,并将第一应用的应用数据预取至第一应用的缓存资源中之后,目标计算节点启动第一应用的运行脚本,从而开始运行第一应用。After allocating cache resources for the first application through steps 304 and 305, and prefetching the application data of the first application into the cache resources of the first application, the target computing node starts the running script of the first application to start running the first application. application.
其中,仍以第一目标计算节点为例来进行说明。第一目标计算节点启动第一应用的运行脚本,执行自身分配到的第一应用的第一任务。Wherein, the first target computing node is still taken as an example for illustration. The first target computing node starts the running script of the first application, and executes the first task of the first application assigned to itself.
在执行第一任务的过程中,第一目标计算节点可能需要读取第一应用的应用数据,或者 是将执行任务过程中产生的数据写入至第一应用的缓存资源中。基于此,第一目标计算节点可以根据所要执行的操作生成IO请求,其中,该IO请求可能为读请求,也可能为写请求。并且,该IO请求可以包括所访问的目标数据所在目录的目录路径。During the execution of the first task, the first target computing node may need to read the application data of the first application, or write the data generated during the execution of the task into the cache resource of the first application. Based on this, the first target computing node may generate an IO request according to an operation to be performed, where the IO request may be a read request or a write request. Moreover, the IO request may include a directory path of a directory where the accessed target data is located.
在得到IO请求之后,第一目标计算节点首先可以将所访问的目标数据的目录路径与映射目录信息进行比较,如果所访问的目标数据的目录路径包含有该映射目录信息,则可以确定当前所要访问的目标数据为第一目录下的数据。在这种情况下,由于在步骤305中预取了第一目录下的数据至第一应用的缓存资源中,所以,第一目标计算节点可以直接访问第一应用的缓存资源。After obtaining the IO request, the first target computing node can first compare the directory path of the accessed target data with the mapping directory information, and if the directory path of the accessed target data contains the mapping directory information, it can be determined that the The target data to be accessed is the data under the first directory. In this case, since the data in the first directory is prefetched into the cache resource of the first application in step 305, the first target computing node can directly access the cache resource of the first application.
其中,如果各个目标计算节点是通过步骤305中第一种可能的情况中介绍的方法预取的数据,则在确定IO请求所要访问的数据为第一目录下的数据之后,第一目标计算节点根据该IO请求访问第一应用的缓存资源。Wherein, if each target computing node is the data prefetched by the method described in the first possible situation in step 305, after determining that the data to be accessed by the IO request is the data under the first directory, the first target computing node The cache resource of the first application is accessed according to the IO request.
需要说明的是,如果IO请求为读请求,则第一目标计算节点首先可以从第一任务的缓存空间中查找目标数据,如果在第一任务的缓存空间中命中该目标数据,则获取该目标数据。如果未能在第一任务的缓存空间中命中该目标数据,则将该IO请求发送至其他目标计算节点。其他目标计算节点在接收到该IO请求之后,从自身为第一应用分配的任务的缓存空间中查找目标数据,如果命中该目标数据,则将目标数据返回至第一目标计算节点,如果未能命中该目标数据,则向第一目标计算节点返回通知消息以通知第一目标计算节点获取数据失败。如果其他各个目标计算节点均未能命中该目标数据,则第一目标计算节点可以从存储系统中获取该目标数据。可选地,如果IO请求为写请求,则第一目标计算节点可以将该目标数据写入至第一任务的缓存空间中。It should be noted that, if the IO request is a read request, the first target computing node can first search for the target data from the cache space of the first task, and if the target data is hit in the cache space of the first task, then the target data. If the target data fails to hit in the cache space of the first task, the IO request is sent to other target computing nodes. After receiving the IO request, other target computing nodes search for the target data from the cache space of the task assigned by themselves for the first application, and if the target data is hit, return the target data to the first target computing node, if not If the target data is hit, a notification message is returned to the first target computing node to notify the first target computing node that data acquisition fails. If all other target computing nodes fail to hit the target data, the first target computing node may acquire the target data from the storage system. Optionally, if the IO request is a write request, the first target computing node may write the target data into the cache space of the first task.
由上述介绍可知,当第一目标计算节点根据该IO请求未能在第一任务的缓存空间中命中目标数据时,可以将该IO请求发送至其他目标计算节点。同理,其他目标计算节点在生成IO请求之后,如果未能在自身为第一应用分配的缓存空间中命中所要访问的数据,也可以向第一目标计算节点发送IO请求。在这种情况下,第一目标计算节点也可以接收其他目标计算节点发送的IO请求,并根据该IO请求对第一任务的缓存空间进行访问。可选地,计算节点之间可以通过远程内存直接访问(remote direct memory access,RDMA)技术来发送IO请求以访问对方的缓存空间。It can be known from the above introduction that when the first target computing node fails to hit the target data in the cache space of the first task according to the IO request, the IO request may be sent to other target computing nodes. Similarly, after other target computing nodes generate the IO request, if they fail to hit the data to be accessed in the cache space allocated for the first application, they may also send the IO request to the first target computing node. In this case, the first target computing node may also receive IO requests sent by other target computing nodes, and access the cache space of the first task according to the IO requests. Optionally, computing nodes can send IO requests to access each other's cache space through remote direct memory access (RDMA) technology.
可选地,如果各个目标计算节点是通过步骤305中第二种可能的情况中介绍的方法预取的数据,则第一目标计算节点可以对IO请求所要访问的目标数据的目录路径进行哈希运算,以得到该目标数据对应的哈希值,确定节点标识与该目标数据对应的哈希值相匹配的目标计算节点,如果确定出的目标计算节点为自身,则第一目标计算节点访问自身为第一应用分配的缓存空间,以实现目标数据的读取或写入。Optionally, if each target computing node prefetches data through the method described in the second possible situation in step 305, the first target computing node may hash the directory path of the target data to be accessed by the IO request operation to obtain the hash value corresponding to the target data, determine the target computing node whose node ID matches the hash value corresponding to the target data, and if the determined target computing node is itself, then the first target computing node accesses itself The buffer space allocated for the first application, so as to realize reading or writing of target data.
可选地,如果确定出的目标计算节点为其他目标计算节点,则第一目标计算节点将IO请求发送至确定出的目标计算节点,由确定出的目标计算节点通过访问自身为第一应用分配的缓存空间来实现目标数据的读取或写入。Optionally, if the determined target computing node is another target computing node, the first target computing node sends an IO request to the determined target computing node, and the determined target computing node assigns the first application by accessing itself cache space to read or write target data.
其中,对于在第一应用的缓存空间中未能命中目标数据的情况,相应的目标计算节点同样可以从存储系统中获取该目标数据。Wherein, for the situation that the target data is not hit in the cache space of the first application, the corresponding target computing node can also obtain the target data from the storage system.
可选地,如果目标计算节点是通过步骤305中第三种可能的情况中介绍的方法预取的数据,则由于目标计算节点为一个,所以,该目标计算节点可以根据该IO请求访问自身为第一 应用分配的缓存空间中。其中,访问方式参考前述实现方式,本申请实施例在此不再赘述。Optionally, if the target computing node is the data prefetched by the method described in the third possible situation in step 305, since there is only one target computing node, the target computing node can access itself according to the IO request as In the cache space allocated by the first application. For the access method, refer to the aforementioned implementation method, which will not be repeated in this embodiment of the present application.
可选地,如果缓存策略中的数据缓存和访问策略还包括数据一致性策略,则在本步骤中,当某个目标计算节点根据IO请求在第一应用的缓存资源中修改、删除或写入目标数据时,该目标计算节点还可以对该目标数据执行加锁操作,以此来避免其他目标计算节点访问该目标数据,保证数据的一致性。Optionally, if the data cache and access policy in the cache policy also includes a data consistency policy, then in this step, when a certain target computing node modifies, deletes, or writes in the cache resource of the first application according to an IO request When receiving target data, the target computing node can also perform a lock operation on the target data, so as to prevent other target computing nodes from accessing the target data and ensure data consistency.
步骤307:多个计算节点向管理节点发送自身运行的应用的缓存资源中待迁移至存储系统的数据的带宽需求,多个计算节点包括目标计算节点,多个应用包括第一应用。Step 307: The multiple computing nodes send to the management node the bandwidth requirements of the data to be migrated to the storage system in the cache resources of the running applications. The multiple computing nodes include the target computing node, and the multiple applications include the first application.
在本申请实施例中,当计算节点检测到自身为某个应用分配的缓存空间中缓存的数据量达到第二阈值时,即可以向管理节点发送该应用的带宽需求。相应地,管理节点可以实时接收各个计算节点发送的各个应用的带宽需求。其中,该带宽需求用于指示将相应计算节点上相应应用的缓存资源中的待迁移数据迁移至存储系统所需的带宽。示例性地,该带宽需求可以包括计算节点上相应应用的缓存资源中的待迁移数据的数据量。可选地,还可以包括应用标识等其他信息,本申请实施例对此不做限定。另外,第二阈值可以根据该计算节点上为该应用分配的缓存空间的大小来预先设定,例如,该第二阈值可以是为该应用分配的缓存空间的总容量的预设比例,例如,可以是为该应用分配的缓存空间的80%,或者是其他数值,本申请实施例对此不做限定。In the embodiment of the present application, when the computing node detects that the amount of data cached in the cache space allocated by itself for a certain application reaches the second threshold, it may send the bandwidth requirement of the application to the management node. Correspondingly, the management node can receive the bandwidth requirements of each application sent by each computing node in real time. Wherein, the bandwidth requirement is used to indicate the bandwidth required for migrating the data to be migrated in the cache resource of the corresponding application on the corresponding computing node to the storage system. Exemplarily, the bandwidth requirement may include the amount of data to be migrated in the cache resource of the corresponding application on the computing node. Optionally, other information such as an application identifier may also be included, which is not limited in this embodiment of the present application. In addition, the second threshold may be preset according to the size of the cache space allocated for the application on the computing node, for example, the second threshold may be a preset ratio of the total capacity of the cache space allocated for the application, for example, It may be 80% of the cache space allocated for the application, or other values, which are not limited in this embodiment of the present application.
其中,该多个计算节点中包括目标计算节点,也即,当目标计算节点检测到自身为第一应用分配的缓存空间中缓存的数据量达到第二阈值时,即可以向管理节点发送第一应用的带宽需求。此时,该第一应用的带宽需求用于指示将目标计算节点上第一应用的缓存空间中的待迁移数据迁移至存储系统所需的带宽。Wherein, the multiple computing nodes include the target computing node, that is, when the target computing node detects that the amount of data cached in the buffer space allocated by itself for the first application reaches the second threshold, it can send the first The bandwidth requirements of the application. At this time, the bandwidth requirement of the first application is used to indicate the bandwidth required to migrate the data to be migrated in the cache space of the first application on the target computing node to the storage system.
步骤308:管理节点根据该带宽需求,为第一应用的缓存资源中的待迁移数据分配IO带宽。Step 308: The management node allocates IO bandwidth for the data to be migrated in the cache resource of the first application according to the bandwidth requirement.
管理节点在接收到包括目标计算节点在内的多个计算节点发送的各个应用的带宽需求之后,可以根据每个应用的带宽需求所指示的相应应用的待迁移数据所需的带宽以及存储系统当前的剩余带宽,为各个应用的待迁移数据分配对应的IO带宽。After receiving the bandwidth requirements of each application sent by multiple computing nodes including the target computing node, the management node can use the bandwidth required by the data to be migrated for the corresponding application indicated by the bandwidth requirements of each application and the current To allocate the corresponding IO bandwidth for the data to be migrated of each application.
示例性地,管理节点可以计算各个应用所需的带宽的比例,之后,根据该比例和存储系统当前的剩余带宽,为各个应用分配的IO带宽。其中,如果存储系统当前的剩余带宽不大于各个应用所需的总带宽,则为各个应用分配的IO带宽将小于其所需的带宽,如果存储系统当前的剩余带宽大于各个应用所需的总带宽,则为各个应用分配的IO带宽可以等于其所需的带宽。Exemplarily, the management node may calculate the ratio of the bandwidth required by each application, and then allocate the IO bandwidth for each application according to the ratio and the current remaining bandwidth of the storage system. Among them, if the current remaining bandwidth of the storage system is not greater than the total bandwidth required by each application, the IO bandwidth allocated to each application will be smaller than the required bandwidth; if the current remaining bandwidth of the storage system is greater than the total bandwidth required by each application , the IO bandwidth allocated to each application may be equal to the required bandwidth.
管理节点也可以采用其他原则来对各个应用的待迁移数据分配IO带宽,本申请实施例对此不做限定。The management node may also adopt other principles to allocate the IO bandwidth to the data to be migrated of each application, which is not limited in this embodiment of the present application.
另外,为各个应用的待迁移数据分配的IO带宽能够指示出单位时间内允许各个应用所迁移的数据的最大数据量。例如,当为第一应用的待迁移数据分配的IO带宽为30MB/s时,则表示允许目标计算节点在每秒钟最多向存储系统迁移30MB的第一应用的缓存数据。In addition, the IO bandwidth allocated for each application's data to be migrated can indicate the maximum amount of data that is allowed to be migrated by each application per unit time. For example, when the IO bandwidth allocated for the data to be migrated of the first application is 30MB/s, it means that the target computing node is allowed to migrate at most 30MB of cached data of the first application to the storage system per second.
由于多个应用中包括第一应用,所以管理节点通过上述方法可以为第一应用的缓存资源中的待迁移数据分配IO带宽。Since the first application is included in the multiple applications, the management node can allocate the IO bandwidth for the data to be migrated in the cache resource of the first application through the above method.
步骤309:管理节点向目标计算节点发送为第一应用分配的IO带宽。Step 309: the management node sends the IO bandwidth allocated for the first application to the target computing node.
其中,管理节点为各个应用的缓存资源中的待迁移数据分配IO带宽之后,可以向对应的 计算节点发送为相应应用分配的IO带宽。Among them, after the management node allocates the IO bandwidth for the data to be migrated in the cache resources of each application, it can send the IO bandwidth allocated for the corresponding application to the corresponding computing node.
例如,管理节点可以向目标计算节点发送为第一应用的缓存资源中的待迁移数据分配的IO带宽。For example, the management node may send the IO bandwidth allocated for the data to be migrated in the cache resource of the first application to the target computing node.
步骤310:目标计算节点根据为第一应用分配的IO带宽将第一应用的缓存资源中的待迁移数据存储至存储系统中。Step 310: The target computing node stores the data to be migrated in the cache resource of the first application into the storage system according to the IO bandwidth allocated for the first application.
其中,为第一应用分配的IO带宽用于指示允许目标计算节点此次迁移的第一应用的缓存数据的数据量。基于此,目标计算节点根据管理节点为第一应用分配的IO带宽,从自身为第一应用分配的缓存空间中获取数量不大于该IO带宽的数据作为待迁移数据,之后,根据用户指定的映射目录信息将待迁移数据迁移至存储系统进行持久化存储。其中,根据映射目录信息将数据迁移至存储系统的操作为根据映射目录信息从存储系统中预取数据的逆向操作,具体实现方式可以参考前文介绍,本申请实施例在此不再赘述。Wherein, the IO bandwidth allocated for the first application is used to indicate the data volume of cached data of the first application that allows the target computing node to migrate this time. Based on this, according to the IO bandwidth allocated by the management node for the first application, the target computing node obtains data whose quantity is not greater than the IO bandwidth from the cache space allocated for the first application as the data to be migrated, and then, according to the mapping specified by the user The directory information migrates the data to be migrated to the storage system for persistent storage. Wherein, the operation of migrating data to the storage system according to the mapping directory information is a reverse operation of prefetching data from the storage system according to the mapping directory information. The specific implementation method can refer to the above introduction, and the embodiment of the present application will not repeat it here.
在目标计算节点开始运行第一应用之后,每当检测到自身为第一应用分配的缓存空间中的数据量达到第二阈值时,均可以通过上述步骤307-310向管理节点申请IO带宽,以便根据该IO带宽将第一应用的缓存空间中的数据迁移至存储系统中,直至第一应用结束运行且将第一应用的缓存空间中的数据全部迁移至存储系统中为止,目标计算节点可以释放为该第一应用分配的缓存空间。After the target computing node starts running the first application, whenever it detects that the amount of data in the cache space allocated by itself for the first application reaches the second threshold, it can apply for IO bandwidth from the management node through the above steps 307-310, so that Migrate the data in the cache space of the first application to the storage system according to the IO bandwidth, until the first application finishes running and all the data in the cache space of the first application is migrated to the storage system, the target computing node can release The cache space allocated for the first application.
在本申请实施例中,根据用户提交的针对第一应用的缓存策略为第一应用调度缓存资源,并根据用户提交的映射目录信息将数据预取至第一应用的缓存资源中。后续,在第一应用运行的过程中,根据该缓存策略来访问第一应用的缓存资源。由此可见,本申请实施例可以感知用户的需求,进而根据用户的需求来控制应用的资源使用情况,从而提升应用性能。In this embodiment of the present application, cache resources are scheduled for the first application according to the cache policy for the first application submitted by the user, and data is prefetched into the cache resource of the first application according to the mapping directory information submitted by the user. Subsequently, during the running of the first application, the cache resource of the first application is accessed according to the cache policy. It can be seen that, the embodiment of the present application can sense the user's demand, and then control the resource usage of the application according to the user's demand, thereby improving the application performance.
其次,在本申请实施例中,可以根据用户指定的映射目录信息将存储系统中存储的第一应用的数据预取至为第一应用分配的缓存资源中,这样,后续在运行第一应用的过程中,如果所要访问的数据为该映射目录信息所指示的目录下的数据,则可以直接访问为第一应用分配的缓存资源,提升数据访问速度。并且,通过用户指定映射目录信息来预取存储系统中的数据,降低了用户的使用复杂度。Secondly, in the embodiment of the present application, the data of the first application stored in the storage system can be prefetched into the cache resource allocated for the first application according to the mapping directory information specified by the user, so that the subsequent running of the first application During the process, if the data to be accessed is the data under the directory indicated by the mapping directory information, the cache resource allocated for the first application can be directly accessed to improve the data access speed. Moreover, the data in the storage system is prefetched by specifying the mapping directory information by the user, which reduces the complexity of the user's use.
第三,在本申请实施例中,可以根据用户指定的缓存策略中的数据缓存和访问策略在第一应用的缓存资源中缓存并访问数据,例如,根据分级缓存策略缓存数据,以此来提高数据访问性能,节省缓存空间的资源消耗。根据数据一致性策略来访问数据,以此保证数据访问过程中数据的准确性。除此之外,用户还可以灵活的定制其他策略,以此来实现数据缓存和访问方式的灵活设置。Third, in the embodiment of the present application, data can be cached and accessed in the cache resource of the first application according to the data cache and access policy in the cache policy specified by the user, for example, data can be cached according to a hierarchical cache policy, thereby improving Data access performance, save resource consumption of cache space. The data is accessed according to the data consistency policy to ensure the accuracy of the data during the data access process. In addition, users can flexibly customize other policies to achieve flexible settings of data caching and access methods.
最后,在本申请实施例中,各个计算节点在检测到自身为应用分配的缓存资源中的数据量达到第二阈值时,可以向管理节点申请分配自身所运行的应用的待迁移数据的带宽需求。管理节点可以根据收集的各个计算节点的带宽需求,为各个计算节点所运行的应用分配用于迁移待迁移数据的IO带宽,以此来控制各个计算节点向存储系统迁移数据的数据量,从而避免不同计算节点的应用数据访问量超过存储系统的可用带宽进而产生I/O带宽竞争,实现了全局视图中各应用有序访问存储系统,从而减少了因IO竞争导致的应用性能问题。并且,本申请实施例中根据用户指定的映射目录信息,集群系统可以自动完成数据拷贝,无需用户自行操作来完成数据拷贝,降低了用户的操作复杂度。Finally, in the embodiment of this application, when each computing node detects that the amount of data in the cache resources allocated by itself for the application reaches the second threshold, it can apply to the management node for allocating the bandwidth requirements of the data to be migrated for the application it is running. . According to the collected bandwidth requirements of each computing node, the management node can allocate the IO bandwidth for migrating the data to be migrated to the application running on each computing node, so as to control the data volume of each computing node migrating data to the storage system, thereby avoiding The application data access volume of different computing nodes exceeds the available bandwidth of the storage system, resulting in I/O bandwidth competition. This enables applications in the global view to access the storage system in an orderly manner, thereby reducing application performance problems caused by IO competition. Moreover, in the embodiment of the present application, according to the mapping directory information specified by the user, the cluster system can automatically complete the data copy without the user's own operation to complete the data copy, which reduces the complexity of the user's operation.
需要说明的是,上述实施例中有关管理节点的步骤可以单独实现成为管理节点侧的数据 访问方法,有关计算节点侧的步骤可以单独实现成为计算节点侧的数据访问方法。It should be noted that in the above embodiments, the steps related to the management node can be independently implemented as a data access method on the management node side, and the steps related to the computing node side can be independently implemented as a data access method on the computing node side.
上文中结合图1至图3详细描述了根据本申请实施例所提供的数据访问的方法,下面将结合图4至图6描述根据本申请实施例所提供的数据访问装置。The data access method provided according to the embodiment of the present application is described in detail above with reference to FIG. 1 to FIG. 3 , and the data access device provided according to the embodiment of the present application will be described below in conjunction with FIG. 4 to FIG. 6 .
参见图4,本申请实施例提供了一种数据访问装置400,该装置可以应用于集群系统中,该装置400包括:Referring to Fig. 4, the embodiment of the present application provides a data access device 400, which can be applied in a cluster system, and the device 400 includes:
接收模块401,用于执行上述实施例中的步骤301;A receiving module 401, configured to execute step 301 in the above embodiment;
调度模块402,用于执行上述实施例中的步骤302-304;A scheduling module 402, configured to execute steps 302-304 in the above embodiments;
预取模块403,用于执行上述实施例中的步骤305;A prefetch module 403, configured to execute step 305 in the above embodiment;
访问模块404,用于执行上述实施例中的步骤306。The access module 404 is configured to execute step 306 in the above embodiment.
应理解的是,本发明本申请实施例的数据访问装置400可以通过中央处理器(central processing unit,CPU)实现,也可以通过专用集成电路(application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。也可以通过软件实现图3所示的数据访问方法时,数据访问装置400及其各个模块也可以为软件模块。It should be understood that the data access device 400 in this embodiment of the present invention can be implemented by a central processing unit (central processing unit, CPU), or by an application-specific integrated circuit (ASIC), or programmable Logic device (programmable logic device, PLD) realizes, and above-mentioned PLD can be complex program logic device (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic) , GAL) or any combination thereof. When the data access method shown in FIG. 3 can also be realized by software, the data access device 400 and its modules can also be software modules.
可选地,调度模块402主要用于:Optionally, the scheduling module 402 is mainly used for:
根据缓存策略确定第一应用的多个任务中每个任务的资源需求信息,资源需求信息包括每个任务所需的缓存空间的大小和包括的存储介质的类型;Determine resource requirement information for each of the multiple tasks of the first application according to the cache strategy, where the resource requirement information includes the size of the cache space required by each task and the type of storage medium included;
根据每个任务的资源需求信息,为每个任务分配缓存空间。According to the resource requirement information of each task, cache space is allocated for each task.
可选地,映射目录信息包括第一目录的目录路径,预取模块403主要用于:Optionally, the mapping directory information includes the directory path of the first directory, and the prefetching module 403 is mainly used for:
确定第一应用的多个任务中每个任务对应的子目录的目录标识;Determine the directory identifier of the subdirectory corresponding to each task in the multiple tasks of the first application;
根据第一目录的目录路径和每个任务对应的子目录的目录标识,从存储系统中获取第一目录下存储的每个任务对应的子目录下的数据;According to the directory path of the first directory and the directory identifier of the subdirectory corresponding to each task, the data under the subdirectory corresponding to each task stored in the first directory is obtained from the storage system;
将每个任务对应的子目录下的数据存储至第一应用的缓存资源中。The data under the subdirectory corresponding to each task is stored in the cache resource of the first application.
可选地,访问模块404主要用于:Optionally, the access module 404 is mainly used for:
当缓存策略包括分级缓存策略时,根据分级缓存策略,将第一应用的每个任务的不同类型的任务数据缓存至第一应用的缓存资源中对应类型的存储介质中;When the caching strategy includes a hierarchical caching strategy, according to the hierarchical caching strategy, different types of task data of each task of the first application are cached in a storage medium of a corresponding type in the caching resource of the first application;
当缓存策略包括数据一致性策略时,在访问任一缓存空间中的任务数据时,对所访问的任务数据执行加锁操作。When the cache policy includes a data consistency policy, when accessing task data in any cache space, a lock operation is performed on the accessed task data.
可选地,该装置400还用于:Optionally, the device 400 is also used for:
获取输入输出IO请求;Obtain input and output IO requests;
如果IO请求所访问的数据为映射目录信息所指示的第一目录下的数据,则执行根据缓存策略,访问第一应用的缓存资源的步骤。If the data accessed by the IO request is the data under the first directory indicated by the mapping directory information, perform the step of accessing the cache resource of the first application according to the cache policy.
可选地,该装置400还用于:Optionally, the device 400 is also used for:
获取多个应用中每个应用的缓存资源中待迁移至存储系统的数据的带宽需求,多个应用包括第一应用;Obtain the bandwidth requirement of the data to be migrated to the storage system in the cache resources of each of the multiple applications, where the multiple applications include the first application;
根据带宽需求,为第一应用的缓存资源中的待迁移数据分配IO带宽;Allocating IO bandwidth for the data to be migrated in the cache resource of the first application according to the bandwidth requirement;
根据IO带宽,将第一应用的缓存资源中的待迁移数据存储至存储系统中。According to the IO bandwidth, the data to be migrated in the cache resource of the first application is stored in the storage system.
根据本发明本申请实施例的数据访问装置400可对应于执行本发明本申请实施例中描述的方法,并且数据访问装置400中的各个单元的上述和其它操作和/或功能分别为了实现图3中的各个方法中对应节点所执行的相应流程,为了简洁,在此不再赘述。The data access device 400 according to the embodiment of the present application of the present invention can correspond to the implementation of the method described in the embodiment of the present invention, and the above-mentioned and other operations and/or functions of the various units in the data access device 400 are respectively in order to realize Fig. 3 For the sake of brevity, the corresponding processes executed by corresponding nodes in each method in , will not be repeated here.
综上所述,在本申请实施例中,根据用户提交的针对第一应用的缓存策略为第一应用调度缓存资源,并根据用户提交的映射目录信息将数据预取至第一应用的缓存资源中。后续,在第一应用运行的过程中,根据该缓存策略来访问第一应用的缓存资源。由此可见,本申请实施例可以感知用户的需求,进而根据用户的需求来控制应用的资源使用情况,从而提升应用性能。To sum up, in the embodiment of this application, cache resources are scheduled for the first application according to the cache policy submitted by the user for the first application, and data is prefetched to the cache resources of the first application according to the mapping directory information submitted by the user middle. Subsequently, during the running of the first application, the cache resource of the first application is accessed according to the cache policy. It can be seen that, the embodiment of the present application can sense the user's demand, and then control the resource usage of the application according to the user's demand, thereby improving the application performance.
参见图5,本申请实施例提供了一种数据访问的装置500,该装置500可以应用于管理节点中,该装置500包括:Referring to Fig. 5, the embodiment of the present application provides a data access device 500, which can be applied to a management node, and the device 500 includes:
接收模块501,用于执行上述实施例中的步骤301;A receiving module 501, configured to execute step 301 in the above embodiment;
调度模块502,用于执行上述实施例中的步骤302和步骤303中向目标计算节点发送缓存策略的操作,以控制目标计算节点执行步骤304至步骤306。The scheduling module 502 is configured to execute the operation of sending the caching policy to the target computing node in step 302 and step 303 in the above embodiment, so as to control the target computing node to execute steps 304 to 306 .
应理解的是,本发明本申请实施例的装置500可以通过中央处理器(central processing unit,CPU)实现,也可以通过专用集成电路(application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。也可以通过软件实现图3所示的数据访问方法时,装置500及其各个模块也可以为软件模块。It should be understood that the device 500 of the embodiment of the present invention can be implemented by a central processing unit (central processing unit, CPU), or by an application-specific integrated circuit (ASIC), or a programmable logic device (programmable logic device, PLD) implementation, the above-mentioned PLD can be a complex program logic device (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic, GAL ) or any combination thereof. When the data access method shown in FIG. 3 can also be realized by software, the device 500 and its modules can also be software modules.
可选地,调度模块502主要用于:Optionally, the scheduling module 502 is mainly used for:
从缓存策略中获取第一应用的多个任务中每个任务的资源需求信息,资源需求信息包括每个任务所需的缓存空间的大小和包括的存储介质的类型;Acquiring resource requirement information of each of the multiple tasks of the first application from the cache policy, where the resource requirement information includes the size of the cache space required by each task and the type of storage medium included;
根据资源需求信息分配执行第一应用的各个任务的目标计算节点;Allocating target computing nodes for executing each task of the first application according to the resource requirement information;
向目标计算节点发送缓存策略,以指示目标计算节点根据缓存策略中的资源需求信息,从自身的缓存空间中为相应任务分配缓存空间。The cache policy is sent to the target computing node to instruct the target computing node to allocate cache space for the corresponding task from its own cache space according to the resource requirement information in the cache policy.
可选地,映射目录信息包括第一目录的目录路径,调度模块502主要用于:Optionally, the mapping directory information includes the directory path of the first directory, and the scheduling module 502 is mainly used for:
向目标计算节点发送第一目录的目录路径,以指示目标计算节点根据第一目录的目录路径,从存储系统中预取第一目录下存储的各个任务的子目录下的数据,并将获取的数据存储至第一应用的缓存资源中。Send the directory path of the first directory to the target computing node to instruct the target computing node to prefetch the data under the subdirectories of each task stored in the first directory from the storage system according to the directory path of the first directory, and transfer the acquired The data is stored in the cache resource of the first application.
可选地,该装置500还用于:Optionally, the device 500 is also used for:
接收多个计算节点发送的各个应用的缓存资源中待迁移至存储系统的数据的带宽需求,多个计算节点包括目标计算节点;Receive the bandwidth requirements of the data to be migrated to the storage system in the cache resources of each application sent by multiple computing nodes, the multiple computing nodes including the target computing node;
根据带宽需求,为第一应用的缓存资源中的待迁移数据分配IO带宽;Allocating IO bandwidth for the data to be migrated in the cache resource of the first application according to the bandwidth requirement;
向目标计算节点发送为第一应用分配的IO带宽,以指示目标计算节点根据为第一应用分配的IO带宽,将第一应用的缓存资源中的待迁移数据存储至存储系统中。Sending the IO bandwidth allocated for the first application to the target computing node, so as to instruct the target computing node to store the data to be migrated in the cache resource of the first application in the storage system according to the IO bandwidth allocated for the first application.
根据本发明本申请实施例的装置500可对应于执行本发明本申请实施例中描述的方法,并且装置500中的各个单元的上述和其它操作和/或功能分别为了实现图3中的各个方法中对应节点所执行的相应流程,为了简洁,在此不再赘述。The device 500 according to the embodiment of the present application of the present invention may correspond to the implementation of the method described in the embodiment of the present application, and the above-mentioned and other operations and/or functions of each unit in the device 500 are for realizing each method in FIG. 3 For the sake of brevity, the corresponding processes executed by the corresponding nodes in , will not be repeated here.
综上所述,在本申请实施例中,管理节点根据用户提交的针对第一应用的缓存策略为第一应用调度缓存资源,并根据用户提交的映射目录信息控制计算节点将数据预取至第一应用的缓存资源中。后续,在第一应用运行的过程中,控制计算节点根据该缓存策略来访问第一应用的缓存资源。由此可见,本申请实施例可以感知用户的需求,进而根据用户的需求来控制应用的资源使用情况,从而提升应用性能。To sum up, in this embodiment of the application, the management node schedules cache resources for the first application according to the cache policy submitted by the user for the first application, and controls the computing node to prefetch data to the first application according to the mapping directory information submitted by the user. In the cache resource of an application. Subsequently, during the running of the first application, the control computing node accesses the cache resource of the first application according to the cache policy. It can be seen that, the embodiment of the present application can sense the user's demand, and then control the resource usage of the application according to the user's demand, thereby improving the application performance.
参见图6,本申请还提供了一种数据访问装置600,如图6所示,该数据访问装置600可以应用于计算节点中,该数据访问装置600包括:Referring to FIG. 6, the present application also provides a data access device 600. As shown in FIG. 6, the data access device 600 can be applied to computing nodes, and the data access device 600 includes:
接收模块601,用于接收用户指定的第一应用的缓存策略和映射目录信息,缓存策略用于指示第一应用的缓存需求,映射目录信息为存储系统中存储的第一应用的应用数据所在的第一目录的信息;The receiving module 601 is configured to receive the caching strategy and mapping directory information of the first application specified by the user, the caching strategy is used to indicate the caching requirements of the first application, and the mapping directory information is where the application data of the first application stored in the storage system is located. the information of the first directory;
分配模块602,用于执行前述实施例中的步骤304;An allocation module 602, configured to execute step 304 in the foregoing embodiment;
预取模块603,用于执行前述实施例中的步骤305;A prefetch module 603, configured to execute step 305 in the foregoing embodiment;
访问模块604,用于执行前述实施例中的步骤306。The access module 604 is configured to execute step 306 in the foregoing embodiment.
应理解的是,本发明本申请实施例的数据访问装置600可以通过中央处理器(central processing unit,CPU)实现,也可以通过专用集成电路(application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。也可以通过软件实现图3所示的数据访问方法时,数据访问装置600及其各个模块也可以为软件模块。It should be understood that the data access device 600 in this embodiment of the present invention can be implemented by a central processing unit (central processing unit, CPU), or by an application-specific integrated circuit (ASIC), or programmable Logic device (programmable logic device, PLD) realizes, and above-mentioned PLD can be complex program logic device (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic) , GAL) or any combination thereof. When the data access method shown in FIG. 3 can also be realized by software, the data access device 600 and its modules can also be software modules.
可选地,分配模块602主要用于:Optionally, the allocation module 602 is mainly used for:
从缓存策略中获取第一应用的多个任务中每个任务的资源需求信息,资源需求信息包括每个任务所需的缓存空间的大小和包括的存储介质的类型;Acquiring resource requirement information of each of the multiple tasks of the first application from the cache policy, where the resource requirement information includes the size of the cache space required by each task and the type of storage medium included;
根据每个任务的资源需求信息,在自身的缓存资源中为自身所运行的第一任务分配缓存空间,第一任务为在计算节点上运行的多个任务中的任一个任务。According to the resource requirement information of each task, a cache space is allocated in its own cache resource for the first task run by itself, where the first task is any one of multiple tasks running on the computing node.
可选地,预取模块603主要用于:Optionally, the prefetching module 603 is mainly used for:
确定第一任务对应的子目录的目录标识;Determine the directory identifier of the subdirectory corresponding to the first task;
根据第一目录的目录路径和第一任务对应的子目录的目录标识,从存储系统中获取第一目录下存储的第一任务对应的子目录下的数据;According to the directory path of the first directory and the directory identifier of the subdirectory corresponding to the first task, the data under the subdirectory corresponding to the first task stored in the first directory is obtained from the storage system;
将第一任务对应的子目录下的数据存储至第一任务的缓存空间中。The data under the subdirectory corresponding to the first task is stored in the cache space of the first task.
可选地,如果缓存策略包括分级缓存策略,则预取模块还用于:根据第一任务对应的子目录下的数据的数据类型,将不同的数据存储至不同类型的存储介质中。Optionally, if the caching strategy includes a hierarchical caching strategy, the prefetch module is further configured to: store different data in different types of storage media according to the data type of the data in the subdirectory corresponding to the first task.
可选地,访问模块604主要用于:Optionally, the access module 604 is mainly used for:
获取IO请求;Get IO request;
如果IO请求所访问的数据为映射目录信息所指示的第一目录下的数据,则根据IO请求和缓存策略,访问第一应用的缓存资源。If the data accessed by the IO request is the data under the first directory indicated by the mapping directory information, the cache resource of the first application is accessed according to the IO request and the cache policy.
可选地,如果缓存策略包括数据一致性策略,则访问模块主要用于:Optionally, if the cache policy includes a data consistency policy, the access module is mainly used for:
当对第一应用的缓存资源中的数据进行访问时,对所访问的数据执行加锁操作。When accessing data in the cache resource of the first application, a locking operation is performed on the accessed data.
可选地,该装置600还用于:当检测到自身为第一应用分配的缓存资源中的数据量达到 参考阈值时,向管理节点发送第一应用的带宽需求,带宽需求用于指示将计算节点上第一应用的缓存资源中的待迁移数据迁移至存储系统所需的带宽;接收管理节点为第一应用的缓存资源中的待迁移数据分配的IO带宽,根据分配的IO带宽,将第一应用的缓存资源中的待迁移数据迁移至存储系统。Optionally, the apparatus 600 is further configured to: when detecting that the amount of data in the cache resource allocated by itself for the first application reaches a reference threshold, send the bandwidth requirement of the first application to the management node, and the bandwidth requirement is used to indicate that the computing The bandwidth required for migrating the data to be migrated in the cache resource of the first application on the node to the storage system; receiving the IO bandwidth allocated by the management node for the data to be migrated in the cache resource of the first application, according to the allocated IO bandwidth, the Data to be migrated in cache resources of an application is migrated to a storage system.
根据本发明本申请实施例的装置600可对应于执行本发明本申请实施例中描述的方法,并且装置600中的各个单元的上述和其它操作和/或功能分别为了实现图3中的各个方法中对应节点所执行的相应流程,为了简洁,在此不再赘述。The device 600 according to the embodiment of the present application of the present invention may correspond to the implementation of the method described in the embodiment of the present application, and the above-mentioned and other operations and/or functions of each unit in the device 600 are for realizing each method in FIG. 3 For the sake of brevity, the corresponding processes executed by the corresponding nodes in , will not be repeated here.
在本申请实施例中,计算节点能够根据用户指定的第一应用的缓存策略为第一应用分配对应的缓存资源,从而使得第一应用对计算节点的资源使用情况符合用户要求,进而使得第一应用的应用性能能够满足用户需求。在此基础上,在运行第一应用的过程中,可以直接在该计算节点为该第一应用分配的缓存资源中进行数据访问,减少了对存储系统的访问,从而减少了计算节点之间的竞争。并且,在为第一应用分配缓存资源之后,计算节点可以根据映射目录信息将存储系统中第一目录下的第一应用的应用数据预取至第一缓存空间中,无需用户进行人工数据拷贝,降低了操作复杂度。In this embodiment of the application, the computing node can allocate corresponding cache resources for the first application according to the caching policy of the first application specified by the user, so that the resource usage of the computing node by the first application meets the user's requirements, and then the first application The application performance of the application can meet user needs. On this basis, in the process of running the first application, data access can be directly performed in the cache resources allocated by the computing node for the first application, reducing the access to the storage system, thereby reducing the communication between computing nodes. compete. Moreover, after allocating cache resources for the first application, the computing node can prefetch the application data of the first application under the first directory in the storage system into the first cache space according to the mapping directory information, without manual data copying by the user. Reduced operational complexity.
本申请还提供一种数据访问系统,该系统包括管理节点和计算节点,其中,管理节点和计算节点之间的连接方式可以参考图1所示的系统中管理节点和计算节点之间的连接方式,管理节点和计算节点的结构可以参考图2所示的计算机设备的结构。在该数据访问系统中,管理节点用于实现图3所示的数据访问方法中的管理节点的功能,计算节点用于实现图3所示的数据访问方法中的计算节点的功能,本申请实施例在此不再赘述。The present application also provides a data access system, the system includes a management node and a computing node, wherein the connection mode between the management node and the computing node can refer to the connection mode between the management node and the computing node in the system shown in Figure 1 , the structure of the management node and the computing node may refer to the structure of the computer device shown in FIG. 2 . In this data access system, the management node is used to realize the function of the management node in the data access method shown in Figure 3, and the computing node is used to realize the function of the computing node in the data access method shown in Figure 3. Examples will not be repeated here.
需要说明的是:上述实施例提供的数据访问装置在进行数据读写时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的数据访问装置与数据访问方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the data access device provided in the above-mentioned embodiment reads and writes data, it only uses the division of the above-mentioned functional modules as an example. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs. , which divides the internal structure of the device into different functional modules to complete all or part of the functions described above. In addition, the data access device and the data access method embodiments provided by the above embodiments belong to the same idea, and the specific implementation process thereof is detailed in the method embodiments, and will not be repeated here.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如:同轴电缆、光纤、数据用户线(Digital Subscriber Line,DSL))或无线(例如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如:软盘、硬盘、磁带)、光介质(例如:数字通用光盘(Digital Versatile Disc,DVD))、或者半导体介质(例如:固态硬盘(Solid State Disk,SSD))等。In the above embodiments, all or part may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server or data center via wired (eg coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (eg infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example: floppy disk, hard disk, magnetic tape), an optical medium (for example: Digital Versatile Disc (Digital Versatile Disc, DVD)), or a semiconductor medium (for example: Solid State Disk (Solid State Disk, SSD) )wait.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.
以上所述并不用以限制本申请实施例,凡在本申请实施例的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请实施例的保护范围之内。The above description is not intended to limit the embodiments of the present application, and any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be included within the scope of protection of the embodiments of the present application.

Claims (13)

  1. 一种数据访问方法,其特征在于,所述方法包括:A data access method, characterized in that the method comprises:
    接收用户提交的针对第一应用的缓存配置请求,所述缓存配置请求包括缓存策略和映射目录信息,所述缓存策略用于指示所述第一应用的缓存需求,所述映射目录信息为存储系统中存储的所述第一应用的应用数据所在的第一目录的信息;Receive a cache configuration request for the first application submitted by the user, the cache configuration request includes a cache policy and mapping directory information, the cache policy is used to indicate the cache requirements of the first application, and the mapping directory information is a storage system information about the first directory where the application data of the first application is stored;
    根据所述缓存策略,为所述第一应用调度缓存资源;Scheduling cache resources for the first application according to the cache policy;
    根据所述映射目录信息,将所述第一应用的应用数据预取至所述第一应用的缓存资源中;Prefetching application data of the first application into cache resources of the first application according to the mapping directory information;
    在运行所述第一应用的过程中,根据所述缓存策略,访问所述第一应用的缓存资源。During the running of the first application, according to the cache policy, the cache resources of the first application are accessed.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述缓存策略,为所述第一应用调度缓存资源,包括:The method according to claim 1, wherein the scheduling cache resources for the first application according to the cache policy comprises:
    根据所述缓存策略确定所述第一应用的多个任务中每个任务的资源需求信息,所述资源需求信息包括每个任务所需的缓存空间的大小和包括的存储介质的类型;determining resource requirement information of each of the multiple tasks of the first application according to the cache policy, where the resource requirement information includes the size of the cache space required by each task and the type of storage medium included;
    根据每个任务的资源需求信息,为每个任务分配缓存空间。According to the resource requirement information of each task, cache space is allocated for each task.
  3. 根据权利要求1所述的方法,其特征在于,所述映射目录信息包括所述第一目录的目录路径,所述根据所述映射目录信息,将所述第一应用的应用数据预取至所述第一应用的缓存资源中,包括:The method according to claim 1, wherein the mapping directory information includes a directory path of the first directory, and according to the mapping directory information, prefetching the application data of the first application to the The cache resources of the first application include:
    确定所述第一应用的多个任务中每个任务对应的子目录的目录标识;determining a directory identifier of a subdirectory corresponding to each of the multiple tasks of the first application;
    根据所述第一目录的目录路径和每个任务对应的子目录的目录标识,从所述存储系统中获取所述第一目录下存储的每个任务对应的子目录下的数据;According to the directory path of the first directory and the directory identifier of the subdirectory corresponding to each task, obtain the data under the subdirectory corresponding to each task stored in the first directory from the storage system;
    将每个任务对应的子目录下的数据存储至所述第一应用的缓存资源中。The data under the subdirectory corresponding to each task is stored in the cache resource of the first application.
  4. 根据权利要求2或3所述的方法,其特征在于,所述根据所述缓存策略,访问所述第一应用的缓存资源,包括:The method according to claim 2 or 3, wherein the accessing the cache resource of the first application according to the cache policy comprises:
    当所述缓存策略包括分级缓存策略时,根据所述分级缓存策略,将所述第一应用的每个任务的不同类型的任务数据缓存至所述第一应用的缓存资源中对应类型的存储介质中;When the caching policy includes a hierarchical caching policy, according to the hierarchical caching policy, cache different types of task data of each task of the first application to a storage medium of a corresponding type in the caching resource of the first application middle;
    当所述缓存策略包括数据一致性策略时,在访问任一缓存空间中的数据时,对所访问的任务数据执行加锁操作。When the cache policy includes a data consistency policy, when data in any cache space is accessed, a lock operation is performed on the accessed task data.
  5. 根据权利要求1-4任一所述的方法,其特征在于,所述根据所述缓存策略,访问所述第一应用的缓存资源之前,还包括:The method according to any one of claims 1-4, wherein before accessing the cache resources of the first application according to the cache policy, further comprising:
    获取输入输出IO请求;Obtain input and output IO requests;
    如果所述IO请求所访问的数据为所述映射目录信息所指示的所述第一目录下的数据,则执行所述根据所述缓存策略,访问所述第一应用的缓存资源的步骤。If the data accessed by the IO request is the data under the first directory indicated by the mapping directory information, the step of accessing the cache resource of the first application according to the cache policy is performed.
  6. 根据权利要求1-5任一所述的方法,所述方法还包括:The method according to any one of claims 1-5, further comprising:
    获取多个应用中每个应用的缓存资源中待迁移至所述存储系统的数据的带宽需求,所述多个应用包括所述第一应用;Acquiring bandwidth requirements of data to be migrated to the storage system in cache resources of each of multiple applications, where the multiple applications include the first application;
    根据所述带宽需求,为所述第一应用的缓存资源中的待迁移数据分配IO带宽;Allocating IO bandwidth for the data to be migrated in the cache resource of the first application according to the bandwidth requirement;
    根据所述IO带宽,将所述第一应用的缓存资源中的待迁移数据存储至所述存储系统中。According to the IO bandwidth, the data to be migrated in the cache resource of the first application is stored in the storage system.
  7. 一种数据访问装置,其特征在于,所述装置包括:A data access device, characterized in that the device comprises:
    接收模块,用于接收用户提交的针对第一应用的缓存配置请求,所述缓存配置请求包括 缓存策略和映射目录信息,所述缓存策略用于指示所述第一应用的缓存需求,所述映射目录信息为存储系统中存储的所述第一应用的应用数据所在的第一目录的信息;The receiving module is configured to receive a cache configuration request for the first application submitted by the user, the cache configuration request includes cache policy and mapping directory information, the cache policy is used to indicate the cache requirements of the first application, and the mapping The directory information is the information of the first directory where the application data of the first application stored in the storage system is located;
    调度模块,用于根据所述缓存策略,为所述第一应用调度缓存资源;A scheduling module, configured to schedule cache resources for the first application according to the cache policy;
    预取模块,用于根据所述映射目录信息,将所述第一应用的应用数据预取至所述第一应用的缓存资源中;A prefetching module, configured to prefetch the application data of the first application into the cache resource of the first application according to the mapping directory information;
    访问模块,用于在运行所述第一应用的过程中,根据所述缓存策略,访问所述第一应用的缓存资源。An access module, configured to access cache resources of the first application according to the cache policy during running of the first application.
  8. 根据权利要求7所述的装置,其特征在于,所述调度模块主要用于:The device according to claim 7, wherein the scheduling module is mainly used for:
    根据所述缓存策略确定所述第一应用的多个任务中每个任务的资源需求信息,所述资源需求信息包括每个任务所需的缓存空间的大小和包括的存储介质的类型;determining resource requirement information of each of the multiple tasks of the first application according to the cache policy, where the resource requirement information includes the size of the cache space required by each task and the type of storage medium included;
    根据每个任务的资源需求信息,为每个任务分配缓存空间。According to the resource requirement information of each task, cache space is allocated for each task.
  9. 根据权利要求7所述的装置,其特征在于,所述映射目录信息包括所述第一目录的目录路径,所述预取模块主要用于:The device according to claim 7, wherein the mapping directory information includes a directory path of the first directory, and the prefetching module is mainly used for:
    确定所述第一应用的多个任务中每个任务对应的子目录的目录标识;determining a directory identifier of a subdirectory corresponding to each of the multiple tasks of the first application;
    根据所述第一目录的目录路径和每个任务对应的子目录的目录标识,从所述存储系统中获取所述第一目录下存储的每个任务对应的子目录下的数据;According to the directory path of the first directory and the directory identifier of the subdirectory corresponding to each task, obtain the data under the subdirectory corresponding to each task stored in the first directory from the storage system;
    将每个任务对应的子目录下的数据存储至所述第一应用的缓存资源中。The data under the subdirectory corresponding to each task is stored in the cache resource of the first application.
  10. 根据权利要求8或9所述的装置,其特征在于,所述访问模块主要用于:The device according to claim 8 or 9, wherein the access module is mainly used for:
    当所述缓存策略包括分级缓存策略时,根据所述分级缓存策略,将所述第一应用的每个任务的不同类型的任务数据缓存至所述第一应用的缓存资源中对应类型的存储介质中;When the caching policy includes a hierarchical caching policy, according to the hierarchical caching policy, cache different types of task data of each task of the first application to a storage medium of a corresponding type in the caching resource of the first application middle;
    当所述缓存策略包括数据一致性策略时,在访问任一缓存空间中的任务数据时,对所访问的任务数据执行加锁操作。When the cache policy includes a data consistency policy, when accessing task data in any cache space, a locking operation is performed on the accessed task data.
  11. 根据权利要求7-10任一所述的装置,其特征在于,所述装置还用于:The device according to any one of claims 7-10, wherein the device is also used for:
    获取输入输出IO请求;Obtain input and output IO requests;
    如果所述IO请求所访问的数据为所述映射目录信息所指示的所述第一目录下的数据,则执行所述根据所述缓存策略,访问所述第一应用的缓存资源的步骤。If the data accessed by the IO request is the data under the first directory indicated by the mapping directory information, the step of accessing the cache resource of the first application according to the cache policy is performed.
  12. 根据权利要求7-11任一所述的装置,所述装置还用于:The device according to any one of claims 7-11, said device is also used for:
    获取多个应用中每个应用的缓存资源中待迁移至所述存储系统的数据的带宽需求,所述多个应用包括所述第一应用;Acquiring bandwidth requirements of data to be migrated to the storage system in cache resources of each of multiple applications, where the multiple applications include the first application;
    根据所述带宽需求,为所述第一应用的缓存资源中的待迁移数据分配IO带宽;Allocating IO bandwidth for the data to be migrated in the cache resource of the first application according to the bandwidth requirement;
    根据所述IO带宽,将所述第一应用的缓存资源中的待迁移数据存储至所述存储系统中。According to the IO bandwidth, the data to be migrated in the cache resource of the first application is stored in the storage system.
  13. 一种计算机可读存储介质,其特征在于,所述存储介质存储有指令,当所述指令在计算机上执行时,使得所述计算机执行上述权利要求1-6任一项所述的数据访问方法。A computer-readable storage medium, characterized in that the storage medium stores instructions, and when the instructions are executed on a computer, the computer is made to execute the data access method described in any one of claims 1-6 .
PCT/CN2022/095010 2021-08-31 2022-05-25 Data access method and device, and storage medium WO2023029610A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111010014.8A CN115729438A (en) 2021-08-31 2021-08-31 Data access method, device and storage medium
CN202111010014.8 2021-08-31

Publications (1)

Publication Number Publication Date
WO2023029610A1 true WO2023029610A1 (en) 2023-03-09

Family

ID=85291204

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/095010 WO2023029610A1 (en) 2021-08-31 2022-05-25 Data access method and device, and storage medium

Country Status (2)

Country Link
CN (1) CN115729438A (en)
WO (1) WO2023029610A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118034613A (en) * 2024-04-11 2024-05-14 深圳市铨兴科技有限公司 Intelligent scheduling method, system and memory for storage space data
CN118426705A (en) * 2024-07-03 2024-08-02 深圳星云智联科技有限公司 Access scheduling method, computer equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6185659B1 (en) * 1999-03-23 2001-02-06 Storage Technology Corporation Adapting resource use to improve performance in a caching memory system
US20180324108A1 (en) * 2017-05-03 2018-11-08 International Business Machines Corporation QUALITY OF SERVICE (QoS) STORED PROCEDURES
US20210096996A1 (en) * 2019-10-01 2021-04-01 Microsoft Technology Licensing, Llc Cache and i/o management for analytics over disaggregated stores
CN113127380A (en) * 2019-12-31 2021-07-16 华为技术有限公司 Method for deploying instances, instance management node, computing node and computing equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6185659B1 (en) * 1999-03-23 2001-02-06 Storage Technology Corporation Adapting resource use to improve performance in a caching memory system
US20180324108A1 (en) * 2017-05-03 2018-11-08 International Business Machines Corporation QUALITY OF SERVICE (QoS) STORED PROCEDURES
US20210096996A1 (en) * 2019-10-01 2021-04-01 Microsoft Technology Licensing, Llc Cache and i/o management for analytics over disaggregated stores
CN113127380A (en) * 2019-12-31 2021-07-16 华为技术有限公司 Method for deploying instances, instance management node, computing node and computing equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118034613A (en) * 2024-04-11 2024-05-14 深圳市铨兴科技有限公司 Intelligent scheduling method, system and memory for storage space data
CN118034613B (en) * 2024-04-11 2024-06-11 深圳市铨兴科技有限公司 Intelligent scheduling method, system and memory for storage space data
CN118426705A (en) * 2024-07-03 2024-08-02 深圳星云智联科技有限公司 Access scheduling method, computer equipment and medium

Also Published As

Publication number Publication date
CN115729438A (en) 2023-03-03

Similar Documents

Publication Publication Date Title
US11086725B2 (en) Orchestration of heterogeneous multi-role applications
US10579364B2 (en) Upgrading bundled applications in a distributed computing system
US10303646B2 (en) Memory sharing for working data using RDMA
US11175832B2 (en) Thread groups for pluggable database connection consolidation in NUMA environment
US11099937B2 (en) Implementing clone snapshots in a distributed storage system
US20190213085A1 (en) Implementing Fault Domain And Latency Requirements In A Virtualized Distributed Storage System
WO2023029610A1 (en) Data access method and device, and storage medium
WO2019237791A1 (en) Virtualized cache implementation method and physical machine
US10241550B2 (en) Affinity aware parallel zeroing of memory in non-uniform memory access (NUMA) servers
JP2019057155A (en) Memory system and control method
US10235047B2 (en) Memory management method, apparatus, and system
CN114860163B (en) Storage system, memory management method and management node
US10091126B2 (en) Cloud system, control method thereof, management server and control method thereof
CN110196681B (en) Disk data write-in control method and device for business write operation and electronic equipment
JP2019057151A (en) Memory system and control method
US12038879B2 (en) Read and write access to data replicas stored in multiple data centers
WO2021258881A1 (en) Data management method and system for application, and computer device
US20210149703A1 (en) Numa-aware resource allocation and placement of database containers
CN108667744A (en) Flow control methods and device
CN109582649A (en) A kind of metadata storing method, device, equipment and readable storage medium storing program for executing
CN112214162A (en) Storage device and control method
WO2021120843A1 (en) Cloud host memory allocation method, cloud host, device, and storage medium
EP4239462A1 (en) Systems and methods for heterogeneous storage systems
US20220318042A1 (en) Distributed memory block device storage
US11748203B2 (en) Multi-role application orchestration in a distributed storage system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22862752

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22862752

Country of ref document: EP

Kind code of ref document: A1